#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/mfd/stmfx.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/string_choices.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinmux.h>
#include "core.h"
#include "pinctrl-utils.h"
#define STMFX_REG_GPIO_STATE …
#define STMFX_REG_GPIO_DIR …
#define STMFX_REG_GPIO_TYPE …
#define STMFX_REG_GPIO_PUPD …
#define STMFX_REG_GPO_SET …
#define STMFX_REG_GPO_CLR …
#define STMFX_REG_IRQ_GPI_SRC …
#define STMFX_REG_IRQ_GPI_EVT …
#define STMFX_REG_IRQ_GPI_TYPE …
#define STMFX_REG_IRQ_GPI_PENDING …
#define STMFX_REG_IRQ_GPI_ACK …
#define NR_GPIO_REGS …
#define NR_GPIOS_PER_REG …
#define get_reg(offset) …
#define get_shift(offset) …
#define get_mask(offset) …
static const struct pinctrl_pin_desc stmfx_pins[] = …;
struct stmfx_pinctrl { … };
static int stmfx_gpio_get(struct gpio_chip *gc, unsigned int offset)
{ … }
static void stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
{ … }
static int stmfx_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
{ … }
static int stmfx_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
{ … }
static int stmfx_gpio_direction_output(struct gpio_chip *gc,
unsigned int offset, int value)
{ … }
static int stmfx_pinconf_get_pupd(struct stmfx_pinctrl *pctl,
unsigned int offset)
{ … }
static int stmfx_pinconf_set_pupd(struct stmfx_pinctrl *pctl,
unsigned int offset, u32 pupd)
{ … }
static int stmfx_pinconf_get_type(struct stmfx_pinctrl *pctl,
unsigned int offset)
{ … }
static int stmfx_pinconf_set_type(struct stmfx_pinctrl *pctl,
unsigned int offset, u32 type)
{ … }
static int stmfx_pinconf_get(struct pinctrl_dev *pctldev,
unsigned int pin, unsigned long *config)
{ … }
static int stmfx_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{ … }
static void stmfx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int offset)
{ … }
static const struct pinconf_ops stmfx_pinconf_ops = …;
static int stmfx_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *stmfx_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned int selector)
{ … }
static int stmfx_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int selector,
const unsigned int **pins,
unsigned int *num_pins)
{ … }
static const struct pinctrl_ops stmfx_pinctrl_ops = …;
static void stmfx_pinctrl_irq_mask(struct irq_data *data)
{ … }
static void stmfx_pinctrl_irq_unmask(struct irq_data *data)
{ … }
static int stmfx_pinctrl_irq_set_type(struct irq_data *data, unsigned int type)
{ … }
static void stmfx_pinctrl_irq_bus_lock(struct irq_data *data)
{ … }
static void stmfx_pinctrl_irq_bus_sync_unlock(struct irq_data *data)
{ … }
static int stmfx_gpio_irq_request_resources(struct irq_data *data)
{ … }
static void stmfx_gpio_irq_release_resources(struct irq_data *data)
{ … }
static void stmfx_pinctrl_irq_toggle_trigger(struct stmfx_pinctrl *pctl,
unsigned int offset)
{ … }
static irqreturn_t stmfx_pinctrl_irq_thread_fn(int irq, void *dev_id)
{ … }
static void stmfx_pinctrl_irq_print_chip(struct irq_data *d, struct seq_file *p)
{ … }
static const struct irq_chip stmfx_pinctrl_irq_chip = …;
static int stmfx_pinctrl_gpio_function_enable(struct stmfx_pinctrl *pctl)
{ … }
static int stmfx_pinctrl_probe(struct platform_device *pdev)
{ … }
static void stmfx_pinctrl_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int stmfx_pinctrl_backup_regs(struct stmfx_pinctrl *pctl)
{ … }
static int stmfx_pinctrl_restore_regs(struct stmfx_pinctrl *pctl)
{ … }
static int stmfx_pinctrl_suspend(struct device *dev)
{ … }
static int stmfx_pinctrl_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(stmfx_pinctrl_dev_pm_ops,
stmfx_pinctrl_suspend, stmfx_pinctrl_resume);
static const struct of_device_id stmfx_pinctrl_of_match[] = …;
MODULE_DEVICE_TABLE(of, stmfx_pinctrl_of_match);
static struct platform_driver stmfx_pinctrl_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;