#include <linux/device.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/pinctrl/consumer.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include "core.h"
struct sh_pfc_gpio_data_reg { … };
struct sh_pfc_gpio_pin { … };
struct sh_pfc_chip { … };
static struct sh_pfc *gpio_to_pfc(struct gpio_chip *gc)
{ … }
static void gpio_get_data_reg(struct sh_pfc_chip *chip, unsigned int offset,
struct sh_pfc_gpio_data_reg **reg,
unsigned int *bit)
{ … }
static u32 gpio_read_data_reg(struct sh_pfc_chip *chip,
const struct pinmux_data_reg *dreg)
{ … }
static void gpio_write_data_reg(struct sh_pfc_chip *chip,
const struct pinmux_data_reg *dreg, u32 value)
{ … }
static void gpio_setup_data_reg(struct sh_pfc_chip *chip, unsigned idx)
{ … }
static int gpio_setup_data_regs(struct sh_pfc_chip *chip)
{ … }
static int gpio_pin_request(struct gpio_chip *gc, unsigned offset)
{ … }
static void gpio_pin_free(struct gpio_chip *gc, unsigned offset)
{ … }
static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
int value)
{ … }
static int gpio_pin_direction_input(struct gpio_chip *gc, unsigned offset)
{ … }
static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset,
int value)
{ … }
static int gpio_pin_get(struct gpio_chip *gc, unsigned offset)
{ … }
static void gpio_pin_set(struct gpio_chip *gc, unsigned offset, int value)
{ … }
static int gpio_pin_to_irq(struct gpio_chip *gc, unsigned offset)
{ … }
static int gpio_pin_setup(struct sh_pfc_chip *chip)
{ … }
#ifdef CONFIG_PINCTRL_SH_FUNC_GPIO
static int gpio_function_request(struct gpio_chip *gc, unsigned offset)
{ … }
static int gpio_function_setup(struct sh_pfc_chip *chip)
{ … }
#endif
static struct sh_pfc_chip *
sh_pfc_add_gpiochip(struct sh_pfc *pfc, int(*setup)(struct sh_pfc_chip *),
struct sh_pfc_window *mem)
{ … }
int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
{ … }