15 #include <linux/kernel.h>
16 #include <linux/slab.h>
17 #include <linux/module.h>
45 static int wm8350_gpio_get(
struct gpio_chip *
chip,
unsigned offset)
55 if (ret & (1 << offset))
61 static void wm8350_gpio_set(
struct gpio_chip *chip,
unsigned offset,
int value)
64 struct wm8350 *wm8350 = wm8350_gpio->
wm8350;
72 static int wm8350_gpio_direction_out(
struct gpio_chip *chip,
73 unsigned offset,
int value)
76 struct wm8350 *wm8350 = wm8350_gpio->
wm8350;
85 wm8350_gpio_set(chip, offset, value);
90 static int wm8350_gpio_to_irq(
struct gpio_chip *chip,
unsigned offset)
93 struct wm8350 *wm8350 = wm8350_gpio->
wm8350;
101 static struct gpio_chip template_chip = {
104 .direction_input = wm8350_gpio_direction_in,
105 .get = wm8350_gpio_get,
106 .direction_output = wm8350_gpio_direction_out,
107 .set = wm8350_gpio_set,
108 .to_irq = wm8350_gpio_to_irq,
121 if (wm8350_gpio ==
NULL)
135 dev_err(&pdev->
dev,
"Could not register gpiochip, %d\n", ret);
139 platform_set_drvdata(pdev, wm8350_gpio);
152 .driver.name =
"wm8350-gpio",
154 .probe = wm8350_gpio_probe,
158 static int __init wm8350_gpio_init(
void)
164 static void __exit wm8350_gpio_exit(
void)