#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/gpio/driver.h>
#include <linux/gpio/consumer.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include "pinctrl-mcp23s08.h"
#define MCP_IODIR …
#define MCP_IPOL …
#define MCP_GPINTEN …
#define MCP_DEFVAL …
#define MCP_INTCON …
#define MCP_IOCON …
#define IOCON_MIRROR …
#define IOCON_SEQOP …
#define IOCON_HAEN …
#define IOCON_ODR …
#define IOCON_INTPOL …
#define IOCON_INTCC …
#define MCP_GPPU …
#define MCP_INTF …
#define MCP_INTCAP …
#define MCP_GPIO …
#define MCP_OLAT …
static const struct reg_default mcp23x08_defaults[] = …;
static const struct regmap_range mcp23x08_volatile_range = …;
static const struct regmap_access_table mcp23x08_volatile_table = …;
static const struct regmap_range mcp23x08_precious_range = …;
static const struct regmap_access_table mcp23x08_precious_table = …;
const struct regmap_config mcp23x08_regmap = …;
EXPORT_SYMBOL_GPL(…);
static const struct reg_default mcp23x17_defaults[] = …;
static const struct regmap_range mcp23x17_volatile_range = …;
static const struct regmap_access_table mcp23x17_volatile_table = …;
static const struct regmap_range mcp23x17_precious_range = …;
static const struct regmap_access_table mcp23x17_precious_table = …;
const struct regmap_config mcp23x17_regmap = …;
EXPORT_SYMBOL_GPL(…);
static int mcp_read(struct mcp23s08 *mcp, unsigned int reg, unsigned int *val)
{ … }
static int mcp_write(struct mcp23s08 *mcp, unsigned int reg, unsigned int val)
{ … }
static int mcp_update_bits(struct mcp23s08 *mcp, unsigned int reg,
unsigned int mask, unsigned int val)
{ … }
static int mcp_set_bit(struct mcp23s08 *mcp, unsigned int reg,
unsigned int pin, bool enabled)
{ … }
static const struct pinctrl_pin_desc mcp23x08_pins[] = …;
static const struct pinctrl_pin_desc mcp23x17_pins[] = …;
static int mcp_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *mcp_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned int group)
{ … }
static int mcp_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int group,
const unsigned int **pins,
unsigned int *num_pins)
{ … }
static const struct pinctrl_ops mcp_pinctrl_ops = …;
static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config)
{ … }
static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{ … }
static const struct pinconf_ops mcp_pinconf_ops = …;
static int mcp23s08_direction_input(struct gpio_chip *chip, unsigned offset)
{ … }
static int mcp23s08_get(struct gpio_chip *chip, unsigned offset)
{ … }
static int mcp23s08_get_multiple(struct gpio_chip *chip,
unsigned long *mask, unsigned long *bits)
{ … }
static int __mcp23s08_set(struct mcp23s08 *mcp, unsigned mask, bool value)
{ … }
static void mcp23s08_set(struct gpio_chip *chip, unsigned offset, int value)
{ … }
static void mcp23s08_set_multiple(struct gpio_chip *chip,
unsigned long *mask, unsigned long *bits)
{ … }
static int
mcp23s08_direction_output(struct gpio_chip *chip, unsigned offset, int value)
{ … }
static irqreturn_t mcp23s08_irq(int irq, void *data)
{ … }
static void mcp23s08_irq_mask(struct irq_data *data)
{ … }
static void mcp23s08_irq_unmask(struct irq_data *data)
{ … }
static int mcp23s08_irq_set_type(struct irq_data *data, unsigned int type)
{ … }
static void mcp23s08_irq_bus_lock(struct irq_data *data)
{ … }
static void mcp23s08_irq_bus_unlock(struct irq_data *data)
{ … }
static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
{ … }
static void mcp23s08_irq_print_chip(struct irq_data *d, struct seq_file *p)
{ … }
static const struct irq_chip mcp23s08_irq_chip = …;
int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
unsigned int addr, unsigned int type, unsigned int base)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;