18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * pin-controller/pin-mux/pin-config/gpio-driver for Samsung's SoC's.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2012 Samsung Electronics Co., Ltd.
68c2ecf20Sopenharmony_ci *		http://www.samsung.com
78c2ecf20Sopenharmony_ci * Copyright (c) 2012 Linaro Ltd
88c2ecf20Sopenharmony_ci *		http://www.linaro.org
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Author: Thomas Abraham <thomas.ab@samsung.com>
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#ifndef __PINCTRL_SAMSUNG_H
148c2ecf20Sopenharmony_ci#define __PINCTRL_SAMSUNG_H
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
178c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinmux.h>
188c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinconf.h>
198c2ecf20Sopenharmony_ci#include <linux/pinctrl/consumer.h>
208c2ecf20Sopenharmony_ci#include <linux/pinctrl/machine.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include <linux/gpio/driver.h>
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/**
258c2ecf20Sopenharmony_ci * enum pincfg_type - possible pin configuration types supported.
268c2ecf20Sopenharmony_ci * @PINCFG_TYPE_FUNC: Function configuration.
278c2ecf20Sopenharmony_ci * @PINCFG_TYPE_DAT: Pin value configuration.
288c2ecf20Sopenharmony_ci * @PINCFG_TYPE_PUD: Pull up/down configuration.
298c2ecf20Sopenharmony_ci * @PINCFG_TYPE_DRV: Drive strength configuration.
308c2ecf20Sopenharmony_ci * @PINCFG_TYPE_CON_PDN: Pin function in power down mode.
318c2ecf20Sopenharmony_ci * @PINCFG_TYPE_PUD_PDN: Pull up/down configuration in power down mode.
328c2ecf20Sopenharmony_ci */
338c2ecf20Sopenharmony_cienum pincfg_type {
348c2ecf20Sopenharmony_ci	PINCFG_TYPE_FUNC,
358c2ecf20Sopenharmony_ci	PINCFG_TYPE_DAT,
368c2ecf20Sopenharmony_ci	PINCFG_TYPE_PUD,
378c2ecf20Sopenharmony_ci	PINCFG_TYPE_DRV,
388c2ecf20Sopenharmony_ci	PINCFG_TYPE_CON_PDN,
398c2ecf20Sopenharmony_ci	PINCFG_TYPE_PUD_PDN,
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci	PINCFG_TYPE_NUM
428c2ecf20Sopenharmony_ci};
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/*
458c2ecf20Sopenharmony_ci * pin configuration (pull up/down and drive strength) type and its value are
468c2ecf20Sopenharmony_ci * packed together into a 16-bits. The upper 8-bits represent the configuration
478c2ecf20Sopenharmony_ci * type and the lower 8-bits hold the value of the configuration type.
488c2ecf20Sopenharmony_ci */
498c2ecf20Sopenharmony_ci#define PINCFG_TYPE_MASK		0xFF
508c2ecf20Sopenharmony_ci#define PINCFG_VALUE_SHIFT		8
518c2ecf20Sopenharmony_ci#define PINCFG_VALUE_MASK		(0xFF << PINCFG_VALUE_SHIFT)
528c2ecf20Sopenharmony_ci#define PINCFG_PACK(type, value)	(((value) << PINCFG_VALUE_SHIFT) | type)
538c2ecf20Sopenharmony_ci#define PINCFG_UNPACK_TYPE(cfg)		((cfg) & PINCFG_TYPE_MASK)
548c2ecf20Sopenharmony_ci#define PINCFG_UNPACK_VALUE(cfg)	(((cfg) & PINCFG_VALUE_MASK) >> \
558c2ecf20Sopenharmony_ci						PINCFG_VALUE_SHIFT)
568c2ecf20Sopenharmony_ci/**
578c2ecf20Sopenharmony_ci * enum eint_type - possible external interrupt types.
588c2ecf20Sopenharmony_ci * @EINT_TYPE_NONE: bank does not support external interrupts
598c2ecf20Sopenharmony_ci * @EINT_TYPE_GPIO: bank supportes external gpio interrupts
608c2ecf20Sopenharmony_ci * @EINT_TYPE_WKUP: bank supportes external wakeup interrupts
618c2ecf20Sopenharmony_ci * @EINT_TYPE_WKUP_MUX: bank supports multiplexed external wakeup interrupts
628c2ecf20Sopenharmony_ci *
638c2ecf20Sopenharmony_ci * Samsung GPIO controller groups all the available pins into banks. The pins
648c2ecf20Sopenharmony_ci * in a pin bank can support external gpio interrupts or external wakeup
658c2ecf20Sopenharmony_ci * interrupts or no interrupts at all. From a software perspective, the only
668c2ecf20Sopenharmony_ci * difference between external gpio and external wakeup interrupts is that
678c2ecf20Sopenharmony_ci * the wakeup interrupts can additionally wakeup the system if it is in
688c2ecf20Sopenharmony_ci * suspended state.
698c2ecf20Sopenharmony_ci */
708c2ecf20Sopenharmony_cienum eint_type {
718c2ecf20Sopenharmony_ci	EINT_TYPE_NONE,
728c2ecf20Sopenharmony_ci	EINT_TYPE_GPIO,
738c2ecf20Sopenharmony_ci	EINT_TYPE_WKUP,
748c2ecf20Sopenharmony_ci	EINT_TYPE_WKUP_MUX,
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* maximum length of a pin in pin descriptor (example: "gpa0-0") */
788c2ecf20Sopenharmony_ci#define PIN_NAME_LENGTH	10
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#define PIN_GROUP(n, p, f)				\
818c2ecf20Sopenharmony_ci	{						\
828c2ecf20Sopenharmony_ci		.name		= n,			\
838c2ecf20Sopenharmony_ci		.pins		= p,			\
848c2ecf20Sopenharmony_ci		.num_pins	= ARRAY_SIZE(p),	\
858c2ecf20Sopenharmony_ci		.func		= f			\
868c2ecf20Sopenharmony_ci	}
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define PMX_FUNC(n, g)					\
898c2ecf20Sopenharmony_ci	{						\
908c2ecf20Sopenharmony_ci		.name		= n,			\
918c2ecf20Sopenharmony_ci		.groups		= g,			\
928c2ecf20Sopenharmony_ci		.num_groups	= ARRAY_SIZE(g),	\
938c2ecf20Sopenharmony_ci	}
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_cistruct samsung_pinctrl_drv_data;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/**
988c2ecf20Sopenharmony_ci * struct samsung_pin_bank_type: pin bank type description
998c2ecf20Sopenharmony_ci * @fld_width: widths of configuration bitfields (0 if unavailable)
1008c2ecf20Sopenharmony_ci * @reg_offset: offsets of configuration registers (don't care of width is 0)
1018c2ecf20Sopenharmony_ci */
1028c2ecf20Sopenharmony_cistruct samsung_pin_bank_type {
1038c2ecf20Sopenharmony_ci	u8 fld_width[PINCFG_TYPE_NUM];
1048c2ecf20Sopenharmony_ci	u8 reg_offset[PINCFG_TYPE_NUM];
1058c2ecf20Sopenharmony_ci};
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/**
1088c2ecf20Sopenharmony_ci * struct samsung_pin_bank_data: represent a controller pin-bank (init data).
1098c2ecf20Sopenharmony_ci * @type: type of the bank (register offsets and bitfield widths)
1108c2ecf20Sopenharmony_ci * @pctl_offset: starting offset of the pin-bank registers.
1118c2ecf20Sopenharmony_ci * @pctl_res_idx: index of base address for pin-bank registers.
1128c2ecf20Sopenharmony_ci * @nr_pins: number of pins included in this bank.
1138c2ecf20Sopenharmony_ci * @eint_func: function to set in CON register to configure pin as EINT.
1148c2ecf20Sopenharmony_ci * @eint_type: type of the external interrupt supported by the bank.
1158c2ecf20Sopenharmony_ci * @eint_mask: bit mask of pins which support EINT function.
1168c2ecf20Sopenharmony_ci * @eint_offset: SoC-specific EINT register or interrupt offset of bank.
1178c2ecf20Sopenharmony_ci * @name: name to be prefixed for each pin in this pin bank.
1188c2ecf20Sopenharmony_ci */
1198c2ecf20Sopenharmony_cistruct samsung_pin_bank_data {
1208c2ecf20Sopenharmony_ci	const struct samsung_pin_bank_type *type;
1218c2ecf20Sopenharmony_ci	u32		pctl_offset;
1228c2ecf20Sopenharmony_ci	u8		pctl_res_idx;
1238c2ecf20Sopenharmony_ci	u8		nr_pins;
1248c2ecf20Sopenharmony_ci	u8		eint_func;
1258c2ecf20Sopenharmony_ci	enum eint_type	eint_type;
1268c2ecf20Sopenharmony_ci	u32		eint_mask;
1278c2ecf20Sopenharmony_ci	u32		eint_offset;
1288c2ecf20Sopenharmony_ci	const char	*name;
1298c2ecf20Sopenharmony_ci};
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/**
1328c2ecf20Sopenharmony_ci * struct samsung_pin_bank: represent a controller pin-bank.
1338c2ecf20Sopenharmony_ci * @type: type of the bank (register offsets and bitfield widths)
1348c2ecf20Sopenharmony_ci * @pctl_base: base address of the pin-bank registers
1358c2ecf20Sopenharmony_ci * @pctl_offset: starting offset of the pin-bank registers.
1368c2ecf20Sopenharmony_ci * @nr_pins: number of pins included in this bank.
1378c2ecf20Sopenharmony_ci * @eint_base: base address of the pin-bank EINT registers.
1388c2ecf20Sopenharmony_ci * @eint_func: function to set in CON register to configure pin as EINT.
1398c2ecf20Sopenharmony_ci * @eint_type: type of the external interrupt supported by the bank.
1408c2ecf20Sopenharmony_ci * @eint_mask: bit mask of pins which support EINT function.
1418c2ecf20Sopenharmony_ci * @eint_offset: SoC-specific EINT register or interrupt offset of bank.
1428c2ecf20Sopenharmony_ci * @name: name to be prefixed for each pin in this pin bank.
1438c2ecf20Sopenharmony_ci * @pin_base: starting pin number of the bank.
1448c2ecf20Sopenharmony_ci * @soc_priv: per-bank private data for SoC-specific code.
1458c2ecf20Sopenharmony_ci * @of_node: OF node of the bank.
1468c2ecf20Sopenharmony_ci * @drvdata: link to controller driver data
1478c2ecf20Sopenharmony_ci * @irq_domain: IRQ domain of the bank.
1488c2ecf20Sopenharmony_ci * @gpio_chip: GPIO chip of the bank.
1498c2ecf20Sopenharmony_ci * @grange: linux gpio pin range supported by this bank.
1508c2ecf20Sopenharmony_ci * @irq_chip: link to irq chip for external gpio and wakeup interrupts.
1518c2ecf20Sopenharmony_ci * @slock: spinlock protecting bank registers
1528c2ecf20Sopenharmony_ci * @pm_save: saved register values during suspend
1538c2ecf20Sopenharmony_ci */
1548c2ecf20Sopenharmony_cistruct samsung_pin_bank {
1558c2ecf20Sopenharmony_ci	const struct samsung_pin_bank_type *type;
1568c2ecf20Sopenharmony_ci	void __iomem	*pctl_base;
1578c2ecf20Sopenharmony_ci	u32		pctl_offset;
1588c2ecf20Sopenharmony_ci	u8		nr_pins;
1598c2ecf20Sopenharmony_ci	void __iomem	*eint_base;
1608c2ecf20Sopenharmony_ci	u8		eint_func;
1618c2ecf20Sopenharmony_ci	enum eint_type	eint_type;
1628c2ecf20Sopenharmony_ci	u32		eint_mask;
1638c2ecf20Sopenharmony_ci	u32		eint_offset;
1648c2ecf20Sopenharmony_ci	const char	*name;
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	u32		pin_base;
1678c2ecf20Sopenharmony_ci	void		*soc_priv;
1688c2ecf20Sopenharmony_ci	struct device_node *of_node;
1698c2ecf20Sopenharmony_ci	struct samsung_pinctrl_drv_data *drvdata;
1708c2ecf20Sopenharmony_ci	struct irq_domain *irq_domain;
1718c2ecf20Sopenharmony_ci	struct gpio_chip gpio_chip;
1728c2ecf20Sopenharmony_ci	struct pinctrl_gpio_range grange;
1738c2ecf20Sopenharmony_ci	struct exynos_irq_chip *irq_chip;
1748c2ecf20Sopenharmony_ci	spinlock_t slock;
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	u32 pm_save[PINCFG_TYPE_NUM + 1]; /* +1 to handle double CON registers*/
1778c2ecf20Sopenharmony_ci};
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci/**
1808c2ecf20Sopenharmony_ci * struct samsung_retention_data: runtime pin-bank retention control data.
1818c2ecf20Sopenharmony_ci * @regs: array of PMU registers to control pad retention.
1828c2ecf20Sopenharmony_ci * @nr_regs: number of registers in @regs array.
1838c2ecf20Sopenharmony_ci * @value: value to store to registers to turn off retention.
1848c2ecf20Sopenharmony_ci * @refcnt: atomic counter if retention control affects more than one bank.
1858c2ecf20Sopenharmony_ci * @priv: retention control code private data
1868c2ecf20Sopenharmony_ci * @enable: platform specific callback to enter retention mode.
1878c2ecf20Sopenharmony_ci * @disable: platform specific callback to exit retention mode.
1888c2ecf20Sopenharmony_ci **/
1898c2ecf20Sopenharmony_cistruct samsung_retention_ctrl {
1908c2ecf20Sopenharmony_ci	const u32	*regs;
1918c2ecf20Sopenharmony_ci	int		nr_regs;
1928c2ecf20Sopenharmony_ci	u32		value;
1938c2ecf20Sopenharmony_ci	atomic_t	*refcnt;
1948c2ecf20Sopenharmony_ci	void		*priv;
1958c2ecf20Sopenharmony_ci	void		(*enable)(struct samsung_pinctrl_drv_data *);
1968c2ecf20Sopenharmony_ci	void		(*disable)(struct samsung_pinctrl_drv_data *);
1978c2ecf20Sopenharmony_ci};
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci/**
2008c2ecf20Sopenharmony_ci * struct samsung_retention_data: represent a pin-bank retention control data.
2018c2ecf20Sopenharmony_ci * @regs: array of PMU registers to control pad retention.
2028c2ecf20Sopenharmony_ci * @nr_regs: number of registers in @regs array.
2038c2ecf20Sopenharmony_ci * @value: value to store to registers to turn off retention.
2048c2ecf20Sopenharmony_ci * @refcnt: atomic counter if retention control affects more than one bank.
2058c2ecf20Sopenharmony_ci * @init: platform specific callback to initialize retention control.
2068c2ecf20Sopenharmony_ci **/
2078c2ecf20Sopenharmony_cistruct samsung_retention_data {
2088c2ecf20Sopenharmony_ci	const u32	*regs;
2098c2ecf20Sopenharmony_ci	int		nr_regs;
2108c2ecf20Sopenharmony_ci	u32		value;
2118c2ecf20Sopenharmony_ci	atomic_t	*refcnt;
2128c2ecf20Sopenharmony_ci	struct samsung_retention_ctrl *(*init)(struct samsung_pinctrl_drv_data *,
2138c2ecf20Sopenharmony_ci					const struct samsung_retention_data *);
2148c2ecf20Sopenharmony_ci};
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci/**
2178c2ecf20Sopenharmony_ci * struct samsung_pin_ctrl: represent a pin controller.
2188c2ecf20Sopenharmony_ci * @pin_banks: list of pin banks included in this controller.
2198c2ecf20Sopenharmony_ci * @nr_banks: number of pin banks.
2208c2ecf20Sopenharmony_ci * @nr_ext_resources: number of the extra base address for pin banks.
2218c2ecf20Sopenharmony_ci * @retention_data: configuration data for retention control.
2228c2ecf20Sopenharmony_ci * @eint_gpio_init: platform specific callback to setup the external gpio
2238c2ecf20Sopenharmony_ci *	interrupts for the controller.
2248c2ecf20Sopenharmony_ci * @eint_wkup_init: platform specific callback to setup the external wakeup
2258c2ecf20Sopenharmony_ci *	interrupts for the controller.
2268c2ecf20Sopenharmony_ci * @suspend: platform specific suspend callback, executed during pin controller
2278c2ecf20Sopenharmony_ci *	device suspend, see samsung_pinctrl_suspend()
2288c2ecf20Sopenharmony_ci * @resume: platform specific resume callback, executed during pin controller
2298c2ecf20Sopenharmony_ci *	device suspend, see samsung_pinctrl_resume()
2308c2ecf20Sopenharmony_ci *
2318c2ecf20Sopenharmony_ci * External wakeup interrupts must define at least eint_wkup_init,
2328c2ecf20Sopenharmony_ci * retention_data and suspend in order for proper suspend/resume to work.
2338c2ecf20Sopenharmony_ci */
2348c2ecf20Sopenharmony_cistruct samsung_pin_ctrl {
2358c2ecf20Sopenharmony_ci	const struct samsung_pin_bank_data *pin_banks;
2368c2ecf20Sopenharmony_ci	unsigned int	nr_banks;
2378c2ecf20Sopenharmony_ci	unsigned int	nr_ext_resources;
2388c2ecf20Sopenharmony_ci	const struct samsung_retention_data *retention_data;
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci	int		(*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
2418c2ecf20Sopenharmony_ci	int		(*eint_wkup_init)(struct samsung_pinctrl_drv_data *);
2428c2ecf20Sopenharmony_ci	void		(*suspend)(struct samsung_pinctrl_drv_data *);
2438c2ecf20Sopenharmony_ci	void		(*resume)(struct samsung_pinctrl_drv_data *);
2448c2ecf20Sopenharmony_ci};
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/**
2478c2ecf20Sopenharmony_ci * struct samsung_pinctrl_drv_data: wrapper for holding driver data together.
2488c2ecf20Sopenharmony_ci * @node: global list node
2498c2ecf20Sopenharmony_ci * @virt_base: register base address of the controller; this will be equal
2508c2ecf20Sopenharmony_ci *             to each bank samsung_pin_bank->pctl_base and used on legacy
2518c2ecf20Sopenharmony_ci *             platforms (like S3C24XX or S3C64XX) which has to access the base
2528c2ecf20Sopenharmony_ci *             through samsung_pinctrl_drv_data, not samsung_pin_bank).
2538c2ecf20Sopenharmony_ci * @dev: device instance representing the controller.
2548c2ecf20Sopenharmony_ci * @irq: interrpt number used by the controller to notify gpio interrupts.
2558c2ecf20Sopenharmony_ci * @ctrl: pin controller instance managed by the driver.
2568c2ecf20Sopenharmony_ci * @pctl: pin controller descriptor registered with the pinctrl subsystem.
2578c2ecf20Sopenharmony_ci * @pctl_dev: cookie representing pinctrl device instance.
2588c2ecf20Sopenharmony_ci * @pin_groups: list of pin groups available to the driver.
2598c2ecf20Sopenharmony_ci * @nr_groups: number of such pin groups.
2608c2ecf20Sopenharmony_ci * @pmx_functions: list of pin functions available to the driver.
2618c2ecf20Sopenharmony_ci * @nr_function: number of such pin functions.
2628c2ecf20Sopenharmony_ci * @pin_base: starting system wide pin number.
2638c2ecf20Sopenharmony_ci * @nr_pins: number of pins supported by the controller.
2648c2ecf20Sopenharmony_ci * @retention_ctrl: retention control runtime data.
2658c2ecf20Sopenharmony_ci * @suspend: platform specific suspend callback, executed during pin controller
2668c2ecf20Sopenharmony_ci *	device suspend, see samsung_pinctrl_suspend()
2678c2ecf20Sopenharmony_ci * @resume: platform specific resume callback, executed during pin controller
2688c2ecf20Sopenharmony_ci *	device suspend, see samsung_pinctrl_resume()
2698c2ecf20Sopenharmony_ci */
2708c2ecf20Sopenharmony_cistruct samsung_pinctrl_drv_data {
2718c2ecf20Sopenharmony_ci	struct list_head		node;
2728c2ecf20Sopenharmony_ci	void __iomem			*virt_base;
2738c2ecf20Sopenharmony_ci	struct device			*dev;
2748c2ecf20Sopenharmony_ci	int				irq;
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci	struct pinctrl_desc		pctl;
2778c2ecf20Sopenharmony_ci	struct pinctrl_dev		*pctl_dev;
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci	const struct samsung_pin_group	*pin_groups;
2808c2ecf20Sopenharmony_ci	unsigned int			nr_groups;
2818c2ecf20Sopenharmony_ci	const struct samsung_pmx_func	*pmx_functions;
2828c2ecf20Sopenharmony_ci	unsigned int			nr_functions;
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci	struct samsung_pin_bank		*pin_banks;
2858c2ecf20Sopenharmony_ci	unsigned int			nr_banks;
2868c2ecf20Sopenharmony_ci	unsigned int			pin_base;
2878c2ecf20Sopenharmony_ci	unsigned int			nr_pins;
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci	struct samsung_retention_ctrl	*retention_ctrl;
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci	void (*suspend)(struct samsung_pinctrl_drv_data *);
2928c2ecf20Sopenharmony_ci	void (*resume)(struct samsung_pinctrl_drv_data *);
2938c2ecf20Sopenharmony_ci};
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci/**
2968c2ecf20Sopenharmony_ci * struct samsung_pinctrl_of_match_data: OF match device specific configuration data.
2978c2ecf20Sopenharmony_ci * @ctrl: array of pin controller data.
2988c2ecf20Sopenharmony_ci * @num_ctrl: size of array @ctrl.
2998c2ecf20Sopenharmony_ci */
3008c2ecf20Sopenharmony_cistruct samsung_pinctrl_of_match_data {
3018c2ecf20Sopenharmony_ci	const struct samsung_pin_ctrl	*ctrl;
3028c2ecf20Sopenharmony_ci	unsigned int			num_ctrl;
3038c2ecf20Sopenharmony_ci};
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci/**
3068c2ecf20Sopenharmony_ci * struct samsung_pin_group: represent group of pins of a pinmux function.
3078c2ecf20Sopenharmony_ci * @name: name of the pin group, used to lookup the group.
3088c2ecf20Sopenharmony_ci * @pins: the pins included in this group.
3098c2ecf20Sopenharmony_ci * @num_pins: number of pins included in this group.
3108c2ecf20Sopenharmony_ci * @func: the function number to be programmed when selected.
3118c2ecf20Sopenharmony_ci */
3128c2ecf20Sopenharmony_cistruct samsung_pin_group {
3138c2ecf20Sopenharmony_ci	const char		*name;
3148c2ecf20Sopenharmony_ci	const unsigned int	*pins;
3158c2ecf20Sopenharmony_ci	u8			num_pins;
3168c2ecf20Sopenharmony_ci	u8			func;
3178c2ecf20Sopenharmony_ci};
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci/**
3208c2ecf20Sopenharmony_ci * struct samsung_pmx_func: represent a pin function.
3218c2ecf20Sopenharmony_ci * @name: name of the pin function, used to lookup the function.
3228c2ecf20Sopenharmony_ci * @groups: one or more names of pin groups that provide this function.
3238c2ecf20Sopenharmony_ci * @num_groups: number of groups included in @groups.
3248c2ecf20Sopenharmony_ci */
3258c2ecf20Sopenharmony_cistruct samsung_pmx_func {
3268c2ecf20Sopenharmony_ci	const char		*name;
3278c2ecf20Sopenharmony_ci	const char		**groups;
3288c2ecf20Sopenharmony_ci	u8			num_groups;
3298c2ecf20Sopenharmony_ci	u32			val;
3308c2ecf20Sopenharmony_ci};
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci/* list of all exported SoC specific data */
3338c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos3250_of_data;
3348c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos4210_of_data;
3358c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos4x12_of_data;
3368c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos5250_of_data;
3378c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos5260_of_data;
3388c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos5410_of_data;
3398c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos5420_of_data;
3408c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos5433_of_data;
3418c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data exynos7_of_data;
3428c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s3c64xx_of_data;
3438c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s3c2412_of_data;
3448c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s3c2416_of_data;
3458c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s3c2440_of_data;
3468c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s3c2450_of_data;
3478c2ecf20Sopenharmony_ciextern const struct samsung_pinctrl_of_match_data s5pv210_of_data;
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci#endif /* __PINCTRL_SAMSUNG_H */
350