linux/drivers/pinctrl/sprd/pinctrl-sprd.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Spreadtrum pin controller driver
 * Copyright (C) 2017 Spreadtrum  - http://www.spreadtrum.com
 */

#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>

#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>

#include "../core.h"
#include "../pinmux.h"
#include "../pinconf.h"
#include "../pinctrl-utils.h"
#include "pinctrl-sprd.h"

#define PINCTRL_BIT_MASK(width)
#define PINCTRL_REG_OFFSET
#define PINCTRL_REG_MISC_OFFSET
#define PINCTRL_REG_LEN

#define PIN_FUNC_MASK
#define PIN_FUNC_SEL_1
#define PIN_FUNC_SEL_2
#define PIN_FUNC_SEL_3
#define PIN_FUNC_SEL_4

#define AP_SLEEP_MODE
#define PUBCP_SLEEP_MODE
#define TGLDSP_SLEEP_MODE
#define AGDSP_SLEEP_MODE
#define CM4_SLEEP_MODE
#define SLEEP_MODE_MASK
#define SLEEP_MODE_SHIFT

#define SLEEP_INPUT
#define SLEEP_INPUT_MASK
#define SLEEP_INPUT_SHIFT

#define SLEEP_OUTPUT
#define SLEEP_OUTPUT_MASK
#define SLEEP_OUTPUT_SHIFT

#define DRIVE_STRENGTH_MASK
#define DRIVE_STRENGTH_SHIFT

#define SLEEP_PULL_DOWN
#define SLEEP_PULL_DOWN_MASK
#define SLEEP_PULL_DOWN_SHIFT

#define PULL_DOWN
#define PULL_DOWN_MASK
#define PULL_DOWN_SHIFT

#define SLEEP_PULL_UP
#define SLEEP_PULL_UP_MASK
#define SLEEP_PULL_UP_SHIFT

#define PULL_UP_4_7K
#define PULL_UP_20K
#define PULL_UP_MASK
#define PULL_UP_SHIFT

#define INPUT_SCHMITT
#define INPUT_SCHMITT_MASK
#define INPUT_SCHMITT_SHIFT

enum pin_sleep_mode {};

enum pin_func_sel {};

/**
 * struct sprd_pin: represent one pin's description
 * @name: pin name
 * @number: pin number
 * @type: pin type, can be GLOBAL_CTRL_PIN/COMMON_PIN/MISC_PIN
 * @reg: pin register address
 * @bit_offset: bit offset in pin register
 * @bit_width: bit width in pin register
 */
struct sprd_pin {};

/**
 * struct sprd_pin_group: represent one group's description
 * @name: group name
 * @npins: pin numbers of this group
 * @pins: pointer to pins array
 */
struct sprd_pin_group {};

/**
 * struct sprd_pinctrl_soc_info: represent the SoC's pins description
 * @groups: pointer to groups of pins
 * @ngroups: group numbers of the whole SoC
 * @pins: pointer to pins description
 * @npins: pin numbers of the whole SoC
 * @grp_names: pointer to group names array
 */
struct sprd_pinctrl_soc_info {};

/**
 * struct sprd_pinctrl: represent the pin controller device
 * @dev: pointer to the device structure
 * @pctl: pointer to the pinctrl handle
 * @base: base address of the controller
 * @info: pointer to SoC's pins description information
 */
struct sprd_pinctrl {};

#define SPRD_PIN_CONFIG_CONTROL
#define SPRD_PIN_CONFIG_SLEEP_MODE

static int sprd_pinctrl_get_id_by_name(struct sprd_pinctrl *sprd_pctl,
				       const char *name)
{}

static struct sprd_pin *
sprd_pinctrl_get_pin_by_id(struct sprd_pinctrl *sprd_pctl, unsigned int id)
{}

static const struct sprd_pin_group *
sprd_pinctrl_find_group_by_name(struct sprd_pinctrl *sprd_pctl,
				const char *name)
{}

static int sprd_pctrl_group_count(struct pinctrl_dev *pctldev)
{}

static const char *sprd_pctrl_group_name(struct pinctrl_dev *pctldev,
					 unsigned int selector)
{}

static int sprd_pctrl_group_pins(struct pinctrl_dev *pctldev,
				 unsigned int selector,
				 const unsigned int **pins,
				 unsigned int *npins)
{}

static int sprd_dt_node_to_map(struct pinctrl_dev *pctldev,
			       struct device_node *np,
			       struct pinctrl_map **map,
			       unsigned int *num_maps)
{}

static void sprd_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
				unsigned int offset)
{}

static const struct pinctrl_ops sprd_pctrl_ops =;

static int sprd_pmx_get_function_count(struct pinctrl_dev *pctldev)
{}

static const char *sprd_pmx_get_function_name(struct pinctrl_dev *pctldev,
					      unsigned int selector)
{}

static int sprd_pmx_get_function_groups(struct pinctrl_dev *pctldev,
					unsigned int selector,
					const char * const **groups,
					unsigned int * const num_groups)
{}

static int sprd_pmx_set_mux(struct pinctrl_dev *pctldev,
			    unsigned int func_selector,
			    unsigned int group_selector)
{}

static const struct pinmux_ops sprd_pmx_ops =;

static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
			    unsigned long *config)
{}

static unsigned int sprd_pinconf_drive(unsigned int mA)
{}

static bool sprd_pinctrl_check_sleep_config(unsigned long *configs,
					    unsigned int num_configs)
{}

static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
			    unsigned long *configs, unsigned int num_configs)
{}

static int sprd_pinconf_group_get(struct pinctrl_dev *pctldev,
				  unsigned int selector, unsigned long *config)
{}

static int sprd_pinconf_group_set(struct pinctrl_dev *pctldev,
				  unsigned int selector,
				  unsigned long *configs,
				  unsigned int num_configs)
{}

static int sprd_pinconf_get_config(struct pinctrl_dev *pctldev,
				   unsigned int pin_id,
				   unsigned long *config)
{}

static void sprd_pinconf_dbg_show(struct pinctrl_dev *pctldev,
				  struct seq_file *s, unsigned int pin_id)
{}

static void sprd_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
					struct seq_file *s,
					unsigned int selector)
{}

static const struct pinconf_ops sprd_pinconf_ops =;

static const struct pinconf_generic_params sprd_dt_params[] =;

#ifdef CONFIG_DEBUG_FS
static const struct pin_config_item sprd_conf_items[] =;
#endif

static struct pinctrl_desc sprd_pinctrl_desc =;

static int sprd_pinctrl_parse_groups(struct device_node *np,
				     struct sprd_pinctrl *sprd_pctl,
				     struct sprd_pin_group *grp)
{}

static unsigned int sprd_pinctrl_get_groups(struct device_node *np)
{}

static int sprd_pinctrl_parse_dt(struct sprd_pinctrl *sprd_pctl)
{}

static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl,
				 struct sprd_pins_info *sprd_soc_pin_info,
				 int pins_cnt)
{}

int sprd_pinctrl_core_probe(struct platform_device *pdev,
			    struct sprd_pins_info *sprd_soc_pin_info,
			    int pins_cnt)
{}
EXPORT_SYMBOL_GPL();

void sprd_pinctrl_remove(struct platform_device *pdev)
{}
EXPORT_SYMBOL_GPL();

void sprd_pinctrl_shutdown(struct platform_device *pdev)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();