#include <linux/bitfield.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.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>
#define AW9523_MAX_FUNCS …
#define AW9523_NUM_PORTS …
#define AW9523_PINS_PER_PORT …
#define AW9523_HW_RESET_US …
#define AW9523_HW_RESET_RECOVERY_US …
#define AW9523_PIN_TO_PORT(pin) …
#define AW9523_REG_IN_STATE(pin) …
#define AW9523_REG_OUT_STATE(pin) …
#define AW9523_REG_CONF_STATE(pin) …
#define AW9523_REG_INTR_DIS(pin) …
#define AW9523_REG_CHIPID …
#define AW9523_VAL_EXPECTED_CHIPID …
#define AW9523_REG_GCR …
#define AW9523_GCR_ISEL_MASK …
#define AW9523_GCR_GPOMD_MASK …
#define AW9523_REG_PORT_MODE(pin) …
#define AW9523_REG_SOFT_RESET …
#define AW9523_VAL_RESET …
struct aw9523_irq { … };
struct aw9523 { … };
static const struct pinctrl_pin_desc aw9523_pins[] = …;
static int aw9523_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *aw9523_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned int selector)
{ … }
static int aw9523_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int selector,
const unsigned int **pins,
unsigned int *num_pins)
{ … }
static const struct pinctrl_ops aw9523_pinctrl_ops = …;
static const char * const gpio_pwm_groups[] = …;
static const struct pinfunction aw9523_pmx[] = …;
static int aw9523_pmx_get_funcs_count(struct pinctrl_dev *pctl)
{ … }
static const char *aw9523_pmx_get_fname(struct pinctrl_dev *pctl,
unsigned int sel)
{ … }
static int aw9523_pmx_get_groups(struct pinctrl_dev *pctl, unsigned int sel,
const char * const **groups,
unsigned int * const ngroups)
{ … }
static int aw9523_pmx_set_mux(struct pinctrl_dev *pctl, unsigned int fsel,
unsigned int grp)
{ … }
static const struct pinmux_ops aw9523_pinmux_ops = …;
static int aw9523_pcfg_param_to_reg(enum pin_config_param pcp, int pin, u8 *r)
{ … }
static int aw9523_pconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config)
{ … }
static int aw9523_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{ … }
static const struct pinconf_ops aw9523_pinconf_ops = …;
static int aw9523_get_pin_direction(struct regmap *regmap, u8 pin, u8 n)
{ … }
static int aw9523_get_port_state(struct regmap *regmap, u8 pin, u8 regbit,
unsigned int *state)
{ … }
static int aw9523_gpio_irq_type(struct irq_data *d, unsigned int type)
{ … }
static void aw9523_irq_mask(struct irq_data *d)
{ … }
static void aw9523_irq_unmask(struct irq_data *d)
{ … }
static irqreturn_t aw9523_irq_thread_func(int irq, void *dev_id)
{ … }
static void aw9523_irq_bus_lock(struct irq_data *d)
{ … }
static void aw9523_irq_bus_sync_unlock(struct irq_data *d)
{ … }
static int aw9523_gpio_get_direction(struct gpio_chip *chip,
unsigned int offset)
{ … }
static int aw9523_gpio_get(struct gpio_chip *chip, unsigned int offset)
{ … }
static int _aw9523_gpio_get_multiple(struct aw9523 *awi, u8 regbit,
u8 *state, u8 mask)
{ … }
static int aw9523_gpio_get_multiple(struct gpio_chip *chip,
unsigned long *mask,
unsigned long *bits)
{ … }
static void aw9523_gpio_set_multiple(struct gpio_chip *chip,
unsigned long *mask,
unsigned long *bits)
{ … }
static void aw9523_gpio_set(struct gpio_chip *chip,
unsigned int offset, int value)
{ … }
static int aw9523_direction_input(struct gpio_chip *chip, unsigned int offset)
{ … }
static int aw9523_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{ … }
static int aw9523_drive_reset_gpio(struct aw9523 *awi)
{ … }
static int aw9523_hw_reset(struct aw9523 *awi)
{ … }
static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins)
{ … }
static const struct irq_chip aw9523_irq_chip = …;
static int aw9523_init_irq(struct aw9523 *awi, int irq)
{ … }
static bool aw9523_is_reg_hole(unsigned int reg)
{ … }
static bool aw9523_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool aw9523_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static bool aw9523_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static bool aw9523_precious_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config aw9523_regmap = …;
static int aw9523_hw_init(struct aw9523 *awi)
{ … }
static int aw9523_probe(struct i2c_client *client)
{ … }
static void aw9523_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id aw9523_i2c_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, aw9523_i2c_id_table);
static const struct of_device_id of_aw9523_i2c_match[] = …;
MODULE_DEVICE_TABLE(of, of_aw9523_i2c_match);
static struct i2c_driver aw9523_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;