14 #include <linux/kernel.h>
15 #include <linux/module.h>
16 #include <linux/errno.h>
21 #include <linux/slab.h>
29 static int tps65912_gpio_get(
struct gpio_chip *
gc,
unsigned offset)
42 static void tps65912_gpio_set(
struct gpio_chip *gc,
unsigned offset,
55 static int tps65912_gpio_output(
struct gpio_chip *gc,
unsigned offset,
61 tps65912_gpio_set(gc, offset, value);
67 static int tps65912_gpio_input(
struct gpio_chip *gc,
unsigned offset)
75 static struct gpio_chip template_chip = {
78 .direction_input = tps65912_gpio_input,
79 .direction_output = tps65912_gpio_output,
80 .get = tps65912_gpio_get,
81 .set = tps65912_gpio_set,
96 if (tps65912_gpio ==
NULL)
100 tps65912_gpio->
gpio_chip = template_chip;
107 dev_err(&pdev->
dev,
"Failed to register gpiochip, %d\n", ret);
111 platform_set_drvdata(pdev, tps65912_gpio);
125 .name =
"tps65912-gpio",
128 .probe = tps65912_gpio_probe,
132 static int __init tps65912_gpio_init(
void)
138 static void __exit tps65912_gpio_exit(
void)