#include <linux/clk.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irqdomain.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include "../core.h"
#include "pinctrl-samsung.h"
#define SAMSUNG_PINCTRL_NUM_RESOURCES …
static struct pin_config { … } cfg_params[] = …;
static int samsung_get_group_count(struct pinctrl_dev *pctldev)
{ … }
static const char *samsung_get_group_name(struct pinctrl_dev *pctldev,
unsigned group)
{ … }
static int samsung_get_group_pins(struct pinctrl_dev *pctldev,
unsigned group,
const unsigned **pins,
unsigned *num_pins)
{ … }
static int reserve_map(struct device *dev, struct pinctrl_map **map,
unsigned *reserved_maps, unsigned *num_maps,
unsigned reserve)
{ … }
static int add_map_mux(struct pinctrl_map **map, unsigned *reserved_maps,
unsigned *num_maps, const char *group,
const char *function)
{ … }
static int add_map_configs(struct device *dev, struct pinctrl_map **map,
unsigned *reserved_maps, unsigned *num_maps,
const char *group, unsigned long *configs,
unsigned num_configs)
{ … }
static int add_config(struct device *dev, unsigned long **configs,
unsigned *num_configs, unsigned long config)
{ … }
static void samsung_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map,
unsigned num_maps)
{ … }
static int samsung_dt_subnode_to_map(struct samsung_pinctrl_drv_data *drvdata,
struct device *dev,
struct device_node *np,
struct pinctrl_map **map,
unsigned *reserved_maps,
unsigned *num_maps)
{ … }
static int samsung_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map,
unsigned *num_maps)
{ … }
#ifdef CONFIG_DEBUG_FS
static int samsung_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config);
static const char * const reg_names[] = …;
static void samsung_pin_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int pin)
{ … }
#endif
static const struct pinctrl_ops samsung_pctrl_ops = …;
static int samsung_get_functions_count(struct pinctrl_dev *pctldev)
{ … }
static const char *samsung_pinmux_get_fname(struct pinctrl_dev *pctldev,
unsigned selector)
{ … }
static int samsung_pinmux_get_groups(struct pinctrl_dev *pctldev,
unsigned selector, const char * const **groups,
unsigned * const num_groups)
{ … }
static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
unsigned pin, void __iomem **reg, u32 *offset,
struct samsung_pin_bank **bank)
{ … }
static int samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector,
unsigned group)
{ … }
static int samsung_pinmux_set_mux(struct pinctrl_dev *pctldev,
unsigned selector,
unsigned group)
{ … }
static const struct pinmux_ops samsung_pinmux_ops = …;
static int samsung_pinconf_rw(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config, bool set)
{ … }
static int samsung_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned num_configs)
{ … }
static int samsung_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config)
{ … }
static int samsung_pinconf_group_set(struct pinctrl_dev *pctldev,
unsigned group, unsigned long *configs,
unsigned num_configs)
{ … }
static int samsung_pinconf_group_get(struct pinctrl_dev *pctldev,
unsigned int group, unsigned long *config)
{ … }
static const struct pinconf_ops samsung_pinconf_ops = …;
static void samsung_gpio_set_value(struct gpio_chip *gc,
unsigned offset, int value)
{ … }
static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
{ … }
static int samsung_gpio_get(struct gpio_chip *gc, unsigned offset)
{ … }
static int samsung_gpio_set_direction(struct gpio_chip *gc,
unsigned offset, bool input)
{ … }
static int samsung_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
{ … }
static int samsung_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
int value)
{ … }
static int samsung_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
{ … }
static int samsung_add_pin_ranges(struct gpio_chip *gc)
{ … }
static struct samsung_pin_group *samsung_pinctrl_create_groups(
struct device *dev,
struct samsung_pinctrl_drv_data *drvdata,
unsigned int *cnt)
{ … }
static int samsung_pinctrl_create_function(struct device *dev,
struct samsung_pinctrl_drv_data *drvdata,
struct device_node *func_np,
struct samsung_pmx_func *func)
{ … }
static struct samsung_pmx_func *samsung_pinctrl_create_functions(
struct device *dev,
struct samsung_pinctrl_drv_data *drvdata,
unsigned int *cnt)
{ … }
static int samsung_pinctrl_parse_dt(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{ … }
static int samsung_pinctrl_register(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{ … }
static int samsung_pinctrl_unregister(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{ … }
static void samsung_pud_value_init(struct samsung_pinctrl_drv_data *drvdata)
{ … }
static void samsung_gpio_set_pud(struct gpio_chip *gc, unsigned int offset,
unsigned int value)
{ … }
static int samsung_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
unsigned long config)
{ … }
static const struct gpio_chip samsung_gpiolib_chip = …;
static int samsung_gpiolib_register(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{ … }
static const struct samsung_pin_ctrl *
samsung_pinctrl_get_soc_data_for_of_alias(struct platform_device *pdev)
{ … }
static void samsung_banks_node_put(struct samsung_pinctrl_drv_data *d)
{ … }
static void samsung_banks_node_get(struct device *dev, struct samsung_pinctrl_drv_data *d)
{ … }
static const struct samsung_pin_ctrl *
samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
struct platform_device *pdev)
{ … }
static int samsung_pinctrl_probe(struct platform_device *pdev)
{ … }
static int __maybe_unused samsung_pinctrl_suspend(struct device *dev)
{ … }
static int __maybe_unused samsung_pinctrl_resume(struct device *dev)
{ … }
static const struct of_device_id samsung_pinctrl_dt_match[] = …;
static const struct dev_pm_ops samsung_pinctrl_pm_ops = …;
static struct platform_driver samsung_pinctrl_driver = …;
static int __init samsung_pinctrl_drv_register(void)
{ … }
postcore_initcall(samsung_pinctrl_drv_register);