1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* MCP23S08 SPI/I2C GPIO driver */
4 #include <linux/gpio/driver.h>
6 #include <linux/mutex.h>
7 #include <linux/pinctrl/pinctrl.h>
8 #include <linux/types.h>
11 * MCP types supported by driver
13 #define MCP_TYPE_S08 1
14 #define MCP_TYPE_S17 2
15 #define MCP_TYPE_008 3
16 #define MCP_TYPE_017 4
17 #define MCP_TYPE_S18 5
18 #define MCP_TYPE_018 6
35 /* lock protects regmap access with bypass/cache flags */
38 struct gpio_chip chip
;
39 struct irq_chip irq_chip
;
41 struct regmap
*regmap
;
44 struct pinctrl_dev
*pctldev
;
45 struct pinctrl_desc pinctrl_desc
;
48 extern const struct regmap_config mcp23x08_regmap
;
49 extern const struct regmap_config mcp23x17_regmap
;
51 int mcp23s08_probe_one(struct mcp23s08
*mcp
, struct device
*dev
,
52 unsigned int addr
, unsigned int type
, unsigned int base
);