#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "../pinctrl-utils.h"
#define NSP_CHIP_A_INT_STATUS …
#define NSP_CHIP_A_INT_MASK …
#define NSP_GPIO_DATA_IN …
#define NSP_GPIO_DATA_OUT …
#define NSP_GPIO_OUT_EN …
#define NSP_GPIO_INT_POLARITY …
#define NSP_GPIO_INT_MASK …
#define NSP_GPIO_EVENT …
#define NSP_GPIO_EVENT_INT_MASK …
#define NSP_GPIO_EVENT_INT_POLARITY …
#define NSP_CHIP_A_GPIO_INT_BIT …
#define NSP_GPIO_DRV_CTRL …
#define NSP_GPIO_HYSTERESIS_EN …
#define NSP_GPIO_SLEW_RATE_EN …
#define NSP_PULL_UP_EN …
#define NSP_PULL_DOWN_EN …
#define GPIO_DRV_STRENGTH_BITS …
struct nsp_gpio { … };
enum base_type { … };
static inline unsigned nsp_pin_to_gpio(unsigned pin)
{ … }
static inline void nsp_set_bit(struct nsp_gpio *chip, enum base_type address,
unsigned int reg, unsigned gpio, bool set)
{ … }
static inline bool nsp_get_bit(struct nsp_gpio *chip, enum base_type address,
unsigned int reg, unsigned gpio)
{ … }
static irqreturn_t nsp_gpio_irq_handler(int irq, void *data)
{ … }
static void nsp_gpio_irq_ack(struct irq_data *d)
{ … }
static void nsp_gpio_irq_set_mask(struct irq_data *d, bool unmask)
{ … }
static void nsp_gpio_irq_mask(struct irq_data *d)
{ … }
static void nsp_gpio_irq_unmask(struct irq_data *d)
{ … }
static int nsp_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{ … }
static const struct irq_chip nsp_gpio_irq_chip = …;
static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio)
{ … }
static int nsp_gpio_direction_output(struct gpio_chip *gc, unsigned gpio,
int val)
{ … }
static int nsp_gpio_get_direction(struct gpio_chip *gc, unsigned gpio)
{ … }
static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val)
{ … }
static int nsp_gpio_get(struct gpio_chip *gc, unsigned gpio)
{ … }
static int nsp_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *nsp_get_group_name(struct pinctrl_dev *pctldev,
unsigned selector)
{ … }
static const struct pinctrl_ops nsp_pctrl_ops = …;
static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u32 slew)
{ … }
static int nsp_gpio_set_pull(struct nsp_gpio *chip, unsigned gpio,
bool pull_up, bool pull_down)
{ … }
static void nsp_gpio_get_pull(struct nsp_gpio *chip, unsigned gpio,
bool *pull_up, bool *pull_down)
{ … }
static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio,
u32 strength)
{ … }
static int nsp_gpio_get_strength(struct nsp_gpio *chip, unsigned gpio,
u16 *strength)
{ … }
static int nsp_pin_config_group_get(struct pinctrl_dev *pctldev,
unsigned selector,
unsigned long *config)
{ … }
static int nsp_pin_config_group_set(struct pinctrl_dev *pctldev,
unsigned selector,
unsigned long *configs, unsigned num_configs)
{ … }
static int nsp_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long *config)
{ … }
static int nsp_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long *configs, unsigned num_configs)
{ … }
static const struct pinconf_ops nsp_pconf_ops = …;
static int nsp_gpio_register_pinconf(struct nsp_gpio *chip)
{ … }
static const struct of_device_id nsp_gpio_of_match[] = …;
static int nsp_gpio_probe(struct platform_device *pdev)
{ … }
static struct platform_driver nsp_gpio_driver = …;
static int __init nsp_gpio_init(void)
{ … }
arch_initcall_sync(nsp_gpio_init);