#include <dt-bindings/pinctrl/at91.h>
#include <linux/clk.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.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 "pinctrl-utils.h"
#define ATMEL_PIO_MSKR …
#define ATMEL_PIO_CFGR …
#define ATMEL_PIO_CFGR_FUNC_MASK …
#define ATMEL_PIO_DIR_MASK …
#define ATMEL_PIO_PUEN_MASK …
#define ATMEL_PIO_PDEN_MASK …
#define ATMEL_PIO_SR_MASK …
#define ATMEL_PIO_IFEN_MASK …
#define ATMEL_PIO_IFSCEN_MASK …
#define ATMEL_PIO_OPD_MASK …
#define ATMEL_PIO_SCHMITT_MASK …
#define ATMEL_PIO_DRVSTR_MASK …
#define ATMEL_PIO_DRVSTR_OFFSET …
#define ATMEL_PIO_CFGR_EVTSEL_MASK …
#define ATMEL_PIO_CFGR_EVTSEL_FALLING …
#define ATMEL_PIO_CFGR_EVTSEL_RISING …
#define ATMEL_PIO_CFGR_EVTSEL_BOTH …
#define ATMEL_PIO_CFGR_EVTSEL_LOW …
#define ATMEL_PIO_CFGR_EVTSEL_HIGH …
#define ATMEL_PIO_PDSR …
#define ATMEL_PIO_LOCKSR …
#define ATMEL_PIO_SODR …
#define ATMEL_PIO_CODR …
#define ATMEL_PIO_ODSR …
#define ATMEL_PIO_IER …
#define ATMEL_PIO_IDR …
#define ATMEL_PIO_IMR …
#define ATMEL_PIO_ISR …
#define ATMEL_PIO_IOFR …
#define ATMEL_PIO_NPINS_PER_BANK …
#define ATMEL_PIO_BANK(pin_id) …
#define ATMEL_PIO_LINE(pin_id) …
#define ATMEL_PIO_BANK_OFFSET …
#define ATMEL_GET_PIN_NO(pinfunc) …
#define ATMEL_GET_PIN_FUNC(pinfunc) …
#define ATMEL_GET_PIN_IOSET(pinfunc) …
#define ATMEL_PIN_CONFIG_DRIVE_STRENGTH …
struct atmel_pioctrl_data { … };
struct atmel_group { … };
struct atmel_pin { … };
struct atmel_pioctrl { … };
static const char * const atmel_functions[] = …;
static const struct pinconf_generic_params atmel_custom_bindings[] = …;
static unsigned int atmel_gpio_read(struct atmel_pioctrl *atmel_pioctrl,
unsigned int bank, unsigned int reg)
{ … }
static void atmel_gpio_write(struct atmel_pioctrl *atmel_pioctrl,
unsigned int bank, unsigned int reg,
unsigned int val)
{ … }
static void atmel_gpio_irq_ack(struct irq_data *d)
{ … }
static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{ … }
static void atmel_gpio_irq_mask(struct irq_data *d)
{ … }
static void atmel_gpio_irq_unmask(struct irq_data *d)
{ … }
static int atmel_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{ … }
static struct irq_chip atmel_gpio_irq_chip = …;
static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{ … }
static void atmel_gpio_irq_handler(struct irq_desc *desc)
{ … }
static int atmel_gpio_direction_input(struct gpio_chip *chip,
unsigned int offset)
{ … }
static int atmel_gpio_get(struct gpio_chip *chip, unsigned int offset)
{ … }
static int atmel_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
unsigned long *bits)
{ … }
static int atmel_gpio_direction_output(struct gpio_chip *chip,
unsigned int offset,
int value)
{ … }
static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
{ … }
static void atmel_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
unsigned long *bits)
{ … }
static struct gpio_chip atmel_gpio_chip = …;
static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev,
unsigned int pin_id)
{ … }
static void atmel_pin_config_write(struct pinctrl_dev *pctldev,
unsigned int pin_id, u32 conf)
{ … }
static int atmel_pctl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev,
unsigned int selector)
{ … }
static int atmel_pctl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int selector,
const unsigned int **pins,
unsigned int *num_pins)
{ … }
static struct atmel_group *
atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned int pin)
{ … }
static int atmel_pctl_xlate_pinfunc(struct pinctrl_dev *pctldev,
struct device_node *np,
u32 pinfunc, const char **grp_name,
const char **func_name)
{ … }
static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
struct device_node *np,
struct pinctrl_map **map,
unsigned int *reserved_maps,
unsigned int *num_maps)
{ … }
static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map,
unsigned int *num_maps)
{ … }
static const struct pinctrl_ops atmel_pctlops = …;
static int atmel_pmx_get_functions_count(struct pinctrl_dev *pctldev)
{ … }
static const char *atmel_pmx_get_function_name(struct pinctrl_dev *pctldev,
unsigned int selector)
{ … }
static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev,
unsigned int selector,
const char * const **groups,
unsigned * const num_groups)
{ … }
static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev,
unsigned int function,
unsigned int group)
{ … }
static const struct pinmux_ops atmel_pmxops = …;
static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
unsigned int group,
unsigned long *config)
{ … }
static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
unsigned int group,
unsigned long *configs,
unsigned int num_configs)
{ … }
static int atmel_conf_pin_config_set(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs,
unsigned num_configs)
{ … }
static int atmel_conf_pin_config_get(struct pinctrl_dev *pctldev,
unsigned pin,
unsigned long *configs)
{ … }
static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s,
unsigned int pin_id)
{ … }
static const struct pinconf_ops atmel_confops = …;
static struct pinctrl_desc atmel_pinctrl_desc = …;
static int __maybe_unused atmel_pctrl_suspend(struct device *dev)
{ … }
static int __maybe_unused atmel_pctrl_resume(struct device *dev)
{ … }
static const struct dev_pm_ops atmel_pctrl_pm_ops = …;
static const struct atmel_pioctrl_data atmel_sama5d2_pioctrl_data = …;
static const struct atmel_pioctrl_data microchip_sama7g5_pioctrl_data = …;
static const struct of_device_id atmel_pctrl_of_match[] = …;
static struct lock_class_key atmel_lock_key;
static struct lock_class_key atmel_request_key;
static int atmel_pinctrl_probe(struct platform_device *pdev)
{ … }
static struct platform_driver atmel_pinctrl_driver = …;
builtin_platform_driver(…) …;