#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/pinctrl/consumer.h>
#include <dt-bindings/pinctrl/mt65xx.h>
#include "pinctrl-paris.h"
#define PINCTRL_PINCTRL_DEV …
#define MTK_PIN_CONFIG_TDSEL …
#define MTK_PIN_CONFIG_RDSEL …
#define MTK_PIN_CONFIG_PU_ADV …
#define MTK_PIN_CONFIG_PD_ADV …
#define MTK_PIN_CONFIG_DRV_ADV …
static const struct pinconf_generic_params mtk_custom_bindings[] = …;
#ifdef CONFIG_DEBUG_FS
static const struct pin_config_item mtk_conf_items[] = …;
#endif
static const char * const mtk_gpio_functions[] = …;
static const int mtk_drv_adv_uA[] = …;
static int mtk_drv_adv_to_uA(int val)
{ … }
static int mtk_drv_uA_to_adv(int val)
{ … }
static int mtk_pinmux_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int pin)
{ … }
static int mtk_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int pin, bool input)
{ … }
static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
unsigned int pin, unsigned long *config)
{ … }
static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
enum pin_config_param param, u32 arg)
{ … }
static struct mtk_pinctrl_group *
mtk_pctrl_find_group_by_pin(struct mtk_pinctrl *hw, u32 pin)
{ … }
static const struct mtk_func_desc *
mtk_pctrl_find_function_by_pin(struct mtk_pinctrl *hw, u32 pin_num, u32 fnum)
{ … }
static bool mtk_pctrl_is_function_valid(struct mtk_pinctrl *hw, u32 pin_num,
u32 fnum)
{ … }
static int mtk_pctrl_dt_node_to_map_func(struct mtk_pinctrl *pctl,
u32 pin, u32 fnum,
struct mtk_pinctrl_group *grp,
struct pinctrl_map **map,
unsigned *reserved_maps,
unsigned *num_maps)
{ … }
static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
struct device_node *node,
struct pinctrl_map **map,
unsigned *reserved_maps,
unsigned *num_maps)
{ … }
static int mtk_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map,
unsigned *num_maps)
{ … }
static int mtk_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *mtk_pctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned group)
{ … }
static int mtk_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned group, const unsigned **pins,
unsigned *num_pins)
{ … }
static int mtk_hw_get_value_wrap(struct mtk_pinctrl *hw, unsigned int gpio, int field)
{ … }
#define mtk_pctrl_get_pinmux(hw, gpio) …
#define mtk_pctrl_get_direction(hw, gpio) …
#define mtk_pctrl_get_out(hw, gpio) …
#define mtk_pctrl_get_in(hw, gpio) …
#define mtk_pctrl_get_smt(hw, gpio) …
#define mtk_pctrl_get_ies(hw, gpio) …
#define mtk_pctrl_get_driving(hw, gpio) …
ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
unsigned int gpio, char *buf, unsigned int buf_len)
{ … }
EXPORT_SYMBOL_GPL(…);
#define PIN_DBG_BUF_SZ …
static void mtk_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
unsigned int gpio)
{ … }
static const struct pinctrl_ops mtk_pctlops = …;
static int mtk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)
{ … }
static const char *mtk_pmx_get_func_name(struct pinctrl_dev *pctldev,
unsigned selector)
{ … }
static int mtk_pmx_get_func_groups(struct pinctrl_dev *pctldev,
unsigned function,
const char * const **groups,
unsigned * const num_groups)
{ … }
static int mtk_pmx_set_mux(struct pinctrl_dev *pctldev,
unsigned function,
unsigned group)
{ … }
static const struct pinmux_ops mtk_pmxops = …;
static int mtk_pconf_group_get(struct pinctrl_dev *pctldev, unsigned group,
unsigned long *config)
{ … }
static int mtk_pconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
unsigned long *configs, unsigned num_configs)
{ … }
static const struct pinconf_ops mtk_confops = …;
static struct pinctrl_desc mtk_desc = …;
static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)
{ … }
static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
{ … }
static void mtk_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
{ … }
static int mtk_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio)
{ … }
static int mtk_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
int value)
{ … }
static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{ … }
static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
unsigned long config)
{ … }
static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
{ … }
static int mtk_pctrl_build_state(struct platform_device *pdev)
{ … }
int mtk_paris_pinctrl_probe(struct platform_device *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mtk_paris_pinctrl_suspend(struct device *device)
{ … }
static int mtk_paris_pinctrl_resume(struct device *device)
{ … }
EXPORT_GPL_DEV_SLEEP_PM_OPS(mtk_paris_pinctrl_pm_ops) = …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;