29 #include <linux/kernel.h>
31 #include <linux/types.h>
32 #include <linux/export.h>
45 static struct resource rb532_gpio_reg0_res[] = {
60 static inline void rb532_set_bit(
unsigned bitval,
69 val &= ~(!bitval <<
offset);
70 val |= (!!bitval <<
offset);
80 static inline int rb532_get_bit(
unsigned offset,
void __iomem *ioaddr)
82 return (
readl(ioaddr) & (1 << offset));
87 static int rb532_gpio_get(
struct gpio_chip *
chip,
unsigned offset)
98 static void rb532_gpio_set(
struct gpio_chip *
chip,
99 unsigned offset,
int value)
110 static int rb532_gpio_direction_input(
struct gpio_chip *
chip,
unsigned offset)
126 static int rb532_gpio_direction_output(
struct gpio_chip *
chip,
127 unsigned offset,
int value)
147 .direction_input = rb532_gpio_direction_input,
148 .direction_output = rb532_gpio_direction_output,
149 .get = rb532_gpio_get,
150 .set = rb532_gpio_set,
188 r = rb532_gpio_reg0_res;
191 if (!rb532_gpio_chip->
regbase) {