13 #include <linux/kernel.h>
14 #include <linux/module.h>
19 #define MSP71XX_DATA_OFFSET(gpio) (2 * (gpio))
20 #define MSP71XX_READ_OFFSET(gpio) (MSP71XX_DATA_OFFSET(gpio) + 1)
21 #define MSP71XX_CFG_OUT_OFFSET(gpio) (MSP71XX_DATA_OFFSET(gpio) + 16)
22 #define MSP71XX_CFG_IN_OFFSET(gpio) (MSP71XX_CFG_OUT_OFFSET(gpio) + 1)
24 #define MSP71XX_EXD_GPIO_BASE 0x0BC000000L
26 #define to_msp71xx_exd_gpio_chip(c) \
27 container_of(c, struct msp71xx_exd_gpio_chip, chip)
46 static int msp71xx_exd_gpio_get(
struct gpio_chip *
chip,
unsigned offset)
64 static void msp71xx_exd_gpio_set(
struct gpio_chip *
chip,
83 static int msp71xx_exd_direction_output(
struct gpio_chip *chip,
84 unsigned offset,
int value)
89 msp71xx_exd_gpio_set(chip, offset, value);
101 static int msp71xx_exd_direction_input(
struct gpio_chip *chip,
unsigned offset)
110 #define MSP71XX_EXD_GPIO_BANK(name, exd_reg, base_gpio, num_gpio) \
114 .direction_input = msp71xx_exd_direction_input, \
115 .direction_output = msp71xx_exd_direction_output, \
116 .get = msp71xx_exd_gpio_get, \
117 .set = msp71xx_exd_gpio_set, \
121 .reg = (void __iomem *)(MSP71XX_EXD_GPIO_BASE + exd_reg), \
144 for (i = 0; i <
ARRAY_SIZE(msp71xx_exd_gpio_banks); i++)