15 #include <linux/kernel.h>
16 #include <linux/slab.h>
17 #include <linux/module.h>
45 static int arizona_gpio_get(
struct gpio_chip *
chip,
unsigned offset)
62 static int arizona_gpio_direction_out(
struct gpio_chip *chip,
63 unsigned offset,
int value)
65 struct arizona_gpio *arizona_gpio = to_arizona_gpio(chip);
66 struct arizona *arizona = arizona_gpio->
arizona;
75 static void arizona_gpio_set(
struct gpio_chip *chip,
unsigned offset,
int value)
77 struct arizona_gpio *arizona_gpio = to_arizona_gpio(chip);
78 struct arizona *arizona = arizona_gpio->
arizona;
87 static struct gpio_chip template_chip = {
90 .direction_input = arizona_gpio_direction_in,
91 .get = arizona_gpio_get,
92 .direction_output = arizona_gpio_direction_out,
93 .set = arizona_gpio_set,
101 struct arizona_gpio *arizona_gpio;
106 if (arizona_gpio ==
NULL)
113 switch (arizona->
type) {
119 dev_err(&pdev->
dev,
"Unknown chip variant %d\n",
131 dev_err(&pdev->
dev,
"Could not register gpiochip, %d\n",
136 platform_set_drvdata(pdev, arizona_gpio);
146 struct arizona_gpio *arizona_gpio = platform_get_drvdata(pdev);
152 .driver.name =
"arizona-gpio",
154 .probe = arizona_gpio_probe,