linux/drivers/pinctrl/pinctrl-ocelot.c

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Microsemi SoCs pinctrl driver
 *
 * Author: <[email protected]>
 * License: Dual MIT/GPL
 * Copyright (c) 2017 Microsemi Corporation
 */

#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mfd/ocelot.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/slab.h>

#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>

#include "core.h"
#include "pinconf.h"
#include "pinmux.h"

#define ocelot_clrsetbits(addr, clear, set)

enum {};

/* GPIO standard registers */
#define OCELOT_GPIO_OUT_SET
#define OCELOT_GPIO_OUT_CLR
#define OCELOT_GPIO_OUT
#define OCELOT_GPIO_IN
#define OCELOT_GPIO_OE
#define OCELOT_GPIO_INTR
#define OCELOT_GPIO_INTR_ENA
#define OCELOT_GPIO_INTR_IDENT
#define OCELOT_GPIO_ALT0
#define OCELOT_GPIO_ALT1
#define OCELOT_GPIO_SD_MAP

#define OCELOT_FUNC_PER_PIN

enum {};

static const char *const ocelot_function_names[] =;

struct ocelot_pmx_func {};

struct ocelot_pin_caps {};

struct ocelot_pincfg_data {};

struct ocelot_pinctrl {};

struct ocelot_match_data {};

struct ocelot_irq_work {};

#define LUTON_P(p, f0, f1)

LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();
LUTON_P();

#define LUTON_PIN(n)

static const struct pinctrl_pin_desc luton_pins[] =;

#define SERVAL_P(p, f0, f1, f2)

SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();
SERVAL_P();

#define SERVAL_PIN(n)

static const struct pinctrl_pin_desc serval_pins[] =;

#define OCELOT_P(p, f0, f1, f2)

OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();
OCELOT_P();

#define OCELOT_PIN(n)

static const struct pinctrl_pin_desc ocelot_pins[] =;

#define JAGUAR2_P(p, f0, f1)

JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();
JAGUAR2_P();

#define JAGUAR2_PIN(n)

static const struct pinctrl_pin_desc jaguar2_pins[] =;

#define SERVALT_P(p, f0, f1, f2)

SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();
SERVALT_P();

#define SERVALT_PIN(n)

static const struct pinctrl_pin_desc servalt_pins[] =;

#define SPARX5_P(p, f0, f1, f2)

SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();
SPARX5_P();

#define SPARX5_PIN(n)

static const struct pinctrl_pin_desc sparx5_pins[] =;

#define LAN966X_P(p, f0, f1, f2, f3, f4, f5, f6, f7)

/* Pinmuxing table taken from data sheet */
/*        Pin   FUNC0    FUNC1     FUNC2      FUNC3     FUNC4     FUNC5      FUNC6    FUNC7 */
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();
LAN966X_P();

#define LAN966X_PIN(n)

static const struct pinctrl_pin_desc lan966x_pins[] =;

static int ocelot_get_functions_count(struct pinctrl_dev *pctldev)
{}

static const char *ocelot_get_function_name(struct pinctrl_dev *pctldev,
					    unsigned int function)
{}

static int ocelot_get_function_groups(struct pinctrl_dev *pctldev,
				      unsigned int function,
				      const char *const **groups,
				      unsigned *const num_groups)
{}

static int ocelot_pin_function_idx(struct ocelot_pinctrl *info,
				   unsigned int pin, unsigned int function)
{}

#define REG_ALT(msb, info, p)

static int ocelot_pinmux_set_mux(struct pinctrl_dev *pctldev,
				 unsigned int selector, unsigned int group)
{}

static int lan966x_pinmux_set_mux(struct pinctrl_dev *pctldev,
				  unsigned int selector, unsigned int group)
{}

#define REG(r, info, p)

static int ocelot_gpio_set_direction(struct pinctrl_dev *pctldev,
				     struct pinctrl_gpio_range *range,
				     unsigned int pin, bool input)
{}

static int ocelot_gpio_request_enable(struct pinctrl_dev *pctldev,
				      struct pinctrl_gpio_range *range,
				      unsigned int offset)
{}

static int lan966x_gpio_request_enable(struct pinctrl_dev *pctldev,
				       struct pinctrl_gpio_range *range,
				       unsigned int offset)
{}

static const struct pinmux_ops ocelot_pmx_ops =;

static const struct pinmux_ops lan966x_pmx_ops =;

static int ocelot_pctl_get_groups_count(struct pinctrl_dev *pctldev)
{}

static const char *ocelot_pctl_get_group_name(struct pinctrl_dev *pctldev,
					      unsigned int group)
{}

static int ocelot_pctl_get_group_pins(struct pinctrl_dev *pctldev,
				      unsigned int group,
				      const unsigned int **pins,
				      unsigned int *num_pins)
{}

static int ocelot_hw_get_value(struct ocelot_pinctrl *info,
			       unsigned int pin,
			       unsigned int reg,
			       int *val)
{}

static int ocelot_pincfg_clrsetbits(struct ocelot_pinctrl *info, u32 regaddr,
				    u32 clrbits, u32 setbits)
{}

static int ocelot_hw_set_value(struct ocelot_pinctrl *info,
			       unsigned int pin,
			       unsigned int reg,
			       int val)
{}

static int ocelot_pinconf_get(struct pinctrl_dev *pctldev,
			      unsigned int pin, unsigned long *config)
{}

static int ocelot_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
			      unsigned long *configs, unsigned int num_configs)
{}

static const struct pinconf_ops ocelot_confops =;

static const struct pinctrl_ops ocelot_pctl_ops =;

static struct ocelot_match_data luton_desc =;

static struct ocelot_match_data serval_desc =;

static struct ocelot_match_data ocelot_desc =;

static struct ocelot_match_data jaguar2_desc =;

static struct ocelot_match_data servalt_desc =;

static struct ocelot_match_data sparx5_desc =;

static struct ocelot_match_data lan966x_desc =;

static int ocelot_create_group_func_map(struct device *dev,
					struct ocelot_pinctrl *info)
{}

static int ocelot_pinctrl_register(struct platform_device *pdev,
				   struct ocelot_pinctrl *info)
{}

static int ocelot_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

static void ocelot_gpio_set(struct gpio_chip *chip, unsigned int offset,
			    int value)
{}

static int ocelot_gpio_get_direction(struct gpio_chip *chip,
				     unsigned int offset)
{}

static int ocelot_gpio_direction_output(struct gpio_chip *chip,
					unsigned int offset, int value)
{}

static const struct gpio_chip ocelot_gpiolib_chip =;

static void ocelot_irq_mask(struct irq_data *data)
{}

static void ocelot_irq_work(struct work_struct *work)
{}

static void ocelot_irq_unmask_level(struct irq_data *data)
{}

static void ocelot_irq_unmask(struct irq_data *data)
{}

static void ocelot_irq_ack(struct irq_data *data)
{}

static int ocelot_irq_set_type(struct irq_data *data, unsigned int type);

static struct irq_chip ocelot_level_irqchip =;

static struct irq_chip ocelot_irqchip =;

static int ocelot_irq_set_type(struct irq_data *data, unsigned int type)
{}

static void ocelot_irq_handler(struct irq_desc *desc)
{}

static int ocelot_gpiochip_register(struct platform_device *pdev,
				    struct ocelot_pinctrl *info)
{}

static const struct of_device_id ocelot_pinctrl_of_match[] =;
MODULE_DEVICE_TABLE(of, ocelot_pinctrl_of_match);

static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev,
						   const struct ocelot_pinctrl *info)
{}

static void ocelot_destroy_workqueue(void *data)
{}

static int ocelot_pinctrl_probe(struct platform_device *pdev)
{}

static struct platform_driver ocelot_pinctrl_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();