#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mfd/tps65912.h>
struct gpio_chip gpio_chip;
static int tps65912_gpio_get_direction(struct gpio_chip *gc,
struct tps65912_gpio *gpio = gpiochip_get_data(gc);
ret = regmap_read(gpio->tps->regmap, TPS65912_GPIO1 + offset, &val);
static int tps65912_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
struct tps65912_gpio *gpio = gpiochip_get_data(gc);
return regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset,
static int tps65912_gpio_direction_output(struct gpio_chip *gc,
unsigned offset, int value)
struct tps65912_gpio *gpio = gpiochip_get_data(gc);
regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset,
GPIO_SET_MASK, value ? GPIO_SET_MASK : 0);
return regmap_update_bits(gpio->tps->regmap, TPS65912_GPIO1 + offset,
GPIO_CFG_MASK, GPIO_CFG_MASK);
static int tps65912_gpio_get(struct gpio_chip *gc, unsigned offset)
struct tps65912_gpio *gpio = gpiochip_get_data(gc);