#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mfd/tps65086.h>
static int tps65086_gpio_get_direction(struct gpio_chip *chip,
static int tps65086_gpio_direction_input(struct gpio_chip *chip,
static int tps65086_gpio_direction_output(struct gpio_chip *chip,
unsigned offset, int value)
struct tps65086_gpio *gpio = gpiochip_get_data(chip);
regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL,
BIT(4 + offset), value ? BIT(4 + offset) : 0);
static int tps65086_gpio_get(struct gpio_chip *chip, unsigned offset)
struct tps65086_gpio *gpio = gpiochip_get_data(chip);
ret = regmap_read(gpio->tps->regmap, TPS65086_GPOCTRL, &val);
return val & BIT(4 + offset);
static void tps65086_gpio_set(struct gpio_chip *chip, unsigned offset,
struct tps65086_gpio *gpio = gpiochip_get_data(chip);
regmap_update_bits(gpio->tps->regmap, TPS65086_GPOCTRL,