#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio/driver.h>
#include <linux/mfd/core.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/mfd/wm8350/core.h>
#include <linux/mfd/wm8350/gpio.h>
struct wm8350_gpio_data {
struct gpio_chip gpio_chip;
static int wm8350_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
struct wm8350_gpio_data *wm8350_gpio = gpiochip_get_data(chip);
struct wm8350 *wm8350 = wm8350_gpio->wm8350;
return wm8350_set_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O,
static int wm8350_gpio_get(struct gpio_chip *chip, unsigned offset)
struct wm8350_gpio_data *wm8350_gpio = gpiochip_get_data(chip);
struct wm8350 *wm8350 = wm8350_gpio->wm8350;
ret = wm8350_reg_read(wm8350, WM8350_GPIO_LEVEL);
static void wm8350_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
struct wm8350_gpio_data *wm8350_gpio = gpiochip_get_data(chip);
struct wm8350 *wm8350 = wm8350_gpio->wm8350;
wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
static int wm8350_gpio_direction_out(struct gpio_chip *chip,