xref: /rk3399_rockchip-uboot/include/dm/pinctrl.h (revision c5acf4a2b3c6fd49aa0bc02db50f4b625b2e2991)
1d90a5a30SMasahiro Yamada /*
2d90a5a30SMasahiro Yamada  * Copyright (C) 2015  Masahiro Yamada <yamada.masahiro@socionext.com>
3d90a5a30SMasahiro Yamada  *
4d90a5a30SMasahiro Yamada  * SPDX-License-Identifier:	GPL-2.0+
5d90a5a30SMasahiro Yamada  */
6d90a5a30SMasahiro Yamada 
7d90a5a30SMasahiro Yamada #ifndef __PINCTRL_H
8d90a5a30SMasahiro Yamada #define __PINCTRL_H
9d90a5a30SMasahiro Yamada 
10d90a5a30SMasahiro Yamada /**
11d90a5a30SMasahiro Yamada  * struct pinconf_param - pin config parameters
12d90a5a30SMasahiro Yamada  *
13d90a5a30SMasahiro Yamada  * @property: property name in DT nodes
14d90a5a30SMasahiro Yamada  * @param: ID for this config parameter
15d90a5a30SMasahiro Yamada  * @default_value: default value for this config parameter used in case
16d90a5a30SMasahiro Yamada  *	no value is specified in DT nodes
17d90a5a30SMasahiro Yamada  */
18d90a5a30SMasahiro Yamada struct pinconf_param {
19d90a5a30SMasahiro Yamada 	const char * const property;
20d90a5a30SMasahiro Yamada 	unsigned int param;
21d90a5a30SMasahiro Yamada 	u32 default_value;
22d90a5a30SMasahiro Yamada };
23d90a5a30SMasahiro Yamada 
24d90a5a30SMasahiro Yamada /**
25d90a5a30SMasahiro Yamada  * struct pinctrl_ops - pin control operations, to be implemented by
26d90a5a30SMasahiro Yamada  * pin controller drivers.
27d90a5a30SMasahiro Yamada  *
28d90a5a30SMasahiro Yamada  * The @set_state is the only mandatory operation.  You can implement your
29d90a5a30SMasahiro Yamada  * pinctrl driver with its own @set_state.  In this case, the other callbacks
30d90a5a30SMasahiro Yamada  * are not required.  Otherwise, generic pinctrl framework is also available;
31d90a5a30SMasahiro Yamada  * use pinctrl_generic_set_state for @set_state, and implement other operations
32d90a5a30SMasahiro Yamada  * depending on your necessity.
33d90a5a30SMasahiro Yamada  *
34d90a5a30SMasahiro Yamada  * @get_pins_count: return number of selectable named pins available
35d90a5a30SMasahiro Yamada  *	in this driver.  (necessary to parse "pins" property in DTS)
36d90a5a30SMasahiro Yamada  * @get_pin_name: return the pin name of the pin selector,
37d90a5a30SMasahiro Yamada  *	called by the core to figure out which pin it shall do
38d90a5a30SMasahiro Yamada  *	operations to.  (necessary to parse "pins" property in DTS)
39d90a5a30SMasahiro Yamada  * @get_groups_count: return number of selectable named groups available
40d90a5a30SMasahiro Yamada  *	in this driver.  (necessary to parse "groups" property in DTS)
41d90a5a30SMasahiro Yamada  * @get_group_name: return the group name of the group selector,
42d90a5a30SMasahiro Yamada  *	called by the core to figure out which pin group it shall do
43d90a5a30SMasahiro Yamada  *	operations to.  (necessary to parse "groups" property in DTS)
44d90a5a30SMasahiro Yamada  * @get_functions_count: return number of selectable named functions available
45d90a5a30SMasahiro Yamada  *	in this driver.  (necessary for pin-muxing)
46d90a5a30SMasahiro Yamada  * @get_function_name: return the function name of the muxing selector,
47d90a5a30SMasahiro Yamada  *	called by the core to figure out which mux setting it shall map a
48d90a5a30SMasahiro Yamada  *	certain device to.  (necessary for pin-muxing)
49d90a5a30SMasahiro Yamada  * @pinmux_set: enable a certain muxing function with a certain pin.
50d90a5a30SMasahiro Yamada  *	The @func_selector selects a certain function whereas @pin_selector
51d90a5a30SMasahiro Yamada  *	selects a certain pin to be used. On simple controllers one of them
52d90a5a30SMasahiro Yamada  *	may be ignored.  (necessary for pin-muxing against a single pin)
53d90a5a30SMasahiro Yamada  * @pinmux_group_set: enable a certain muxing function with a certain pin
54d90a5a30SMasahiro Yamada  *	group.  The @func_selector selects a certain function whereas
55d90a5a30SMasahiro Yamada  *	@group_selector selects a certain set of pins to be used. On simple
56d90a5a30SMasahiro Yamada  *	controllers one of them may be ignored.
57d90a5a30SMasahiro Yamada  *	(necessary for pin-muxing against a pin group)
58d90a5a30SMasahiro Yamada  * @pinconf_num_params: number of driver-specific parameters to be parsed
59d90a5a30SMasahiro Yamada  *	from device trees  (necessary for pin-configuration)
60d90a5a30SMasahiro Yamada  * @pinconf_params: list of driver_specific parameters to be parsed from
61d90a5a30SMasahiro Yamada  *	device trees  (necessary for pin-configuration)
62d90a5a30SMasahiro Yamada  * @pinconf_set: configure an individual pin with a given parameter.
63d90a5a30SMasahiro Yamada  *	(necessary for pin-configuration against a single pin)
64d90a5a30SMasahiro Yamada  * @pinconf_group_set: configure all pins in a group with a given parameter.
65d90a5a30SMasahiro Yamada  *	(necessary for pin-configuration against a pin group)
66d90a5a30SMasahiro Yamada  * @set_state: do pinctrl operations specified by @config, a pseudo device
67d90a5a30SMasahiro Yamada  *	pointing a config node. (necessary for pinctrl_full)
68d90a5a30SMasahiro Yamada  * @set_state_simple: do needed pinctrl operations for a peripherl @periph.
69d90a5a30SMasahiro Yamada  *	(necessary for pinctrl_simple)
70d90a5a30SMasahiro Yamada  */
71d90a5a30SMasahiro Yamada struct pinctrl_ops {
72d90a5a30SMasahiro Yamada 	int (*get_pins_count)(struct udevice *dev);
73d90a5a30SMasahiro Yamada 	const char *(*get_pin_name)(struct udevice *dev, unsigned selector);
74d90a5a30SMasahiro Yamada 	int (*get_groups_count)(struct udevice *dev);
75d90a5a30SMasahiro Yamada 	const char *(*get_group_name)(struct udevice *dev, unsigned selector);
76d90a5a30SMasahiro Yamada 	int (*get_functions_count)(struct udevice *dev);
77d90a5a30SMasahiro Yamada 	const char *(*get_function_name)(struct udevice *dev,
78d90a5a30SMasahiro Yamada 					 unsigned selector);
79d90a5a30SMasahiro Yamada 	int (*pinmux_set)(struct udevice *dev, unsigned pin_selector,
80d90a5a30SMasahiro Yamada 			  unsigned func_selector);
81d90a5a30SMasahiro Yamada 	int (*pinmux_group_set)(struct udevice *dev, unsigned group_selector,
82d90a5a30SMasahiro Yamada 				unsigned func_selector);
83d90a5a30SMasahiro Yamada 	unsigned int pinconf_num_params;
84d90a5a30SMasahiro Yamada 	const struct pinconf_param *pinconf_params;
85d90a5a30SMasahiro Yamada 	int (*pinconf_set)(struct udevice *dev, unsigned pin_selector,
86d90a5a30SMasahiro Yamada 			   unsigned param, unsigned argument);
87d90a5a30SMasahiro Yamada 	int (*pinconf_group_set)(struct udevice *dev, unsigned group_selector,
88d90a5a30SMasahiro Yamada 				 unsigned param, unsigned argument);
89d90a5a30SMasahiro Yamada 	int (*set_state)(struct udevice *dev, struct udevice *config);
90*c5acf4a2SSimon Glass 
91*c5acf4a2SSimon Glass 	/* for pinctrl-simple */
92d90a5a30SMasahiro Yamada 	int (*set_state_simple)(struct udevice *dev, struct udevice *periph);
93*c5acf4a2SSimon Glass 	/**
94*c5acf4a2SSimon Glass 	 * request() - Request a particular pinctrl function
95*c5acf4a2SSimon Glass 	 *
96*c5acf4a2SSimon Glass 	 * This activates the selected function.
97*c5acf4a2SSimon Glass 	 *
98*c5acf4a2SSimon Glass 	 * @dev:	Device to adjust (UCLASS_PINCTRL)
99*c5acf4a2SSimon Glass 	 * @func:	Function number (driver-specific)
100*c5acf4a2SSimon Glass 	 * @return 0 if OK, -ve on error
101*c5acf4a2SSimon Glass 	 */
102*c5acf4a2SSimon Glass 	int (*request)(struct udevice *dev, int func, int flags);
103*c5acf4a2SSimon Glass 
104*c5acf4a2SSimon Glass 	/**
105*c5acf4a2SSimon Glass 	* get_periph_id() - get the peripheral ID for a device
106*c5acf4a2SSimon Glass 	*
107*c5acf4a2SSimon Glass 	* This generally looks at the peripheral's device tree node to work
108*c5acf4a2SSimon Glass 	* out the peripheral ID. The return value is normally interpreted as
109*c5acf4a2SSimon Glass 	* enum periph_id. so long as this is defined by the platform (which it
110*c5acf4a2SSimon Glass 	* should be).
111*c5acf4a2SSimon Glass 	*
112*c5acf4a2SSimon Glass 	* @dev:		Pinctrl device to use for decoding
113*c5acf4a2SSimon Glass 	* @periph:	Device to check
114*c5acf4a2SSimon Glass 	* @return peripheral ID of @periph, or -ENOENT on error
115*c5acf4a2SSimon Glass 	*/
116*c5acf4a2SSimon Glass 	int (*get_periph_id)(struct udevice *dev, struct udevice *periph);
117d90a5a30SMasahiro Yamada };
118d90a5a30SMasahiro Yamada 
119d90a5a30SMasahiro Yamada #define pinctrl_get_ops(dev)	((struct pinctrl_ops *)(dev)->driver->ops)
120d90a5a30SMasahiro Yamada 
121d90a5a30SMasahiro Yamada /**
122d90a5a30SMasahiro Yamada  * Generic pin configuration paramters
123d90a5a30SMasahiro Yamada  *
124d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_DISABLE: disable any pin bias on the pin, a
125d90a5a30SMasahiro Yamada  *	transition from say pull-up to pull-down implies that you disable
126d90a5a30SMasahiro Yamada  *	pull-up in the process, this setting disables all biasing.
127d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_HIGH_IMPEDANCE: the pin will be set to a high impedance
128d90a5a30SMasahiro Yamada  *	mode, also know as "third-state" (tristate) or "high-Z" or "floating".
129d90a5a30SMasahiro Yamada  *	On output pins this effectively disconnects the pin, which is useful
130d90a5a30SMasahiro Yamada  *	if for example some other pin is going to drive the signal connected
131d90a5a30SMasahiro Yamada  *	to it for a while. Pins used for input are usually always high
132d90a5a30SMasahiro Yamada  *	impedance.
133d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
134d90a5a30SMasahiro Yamada  *	weakly drives the last value on a tristate bus, also known as a "bus
135d90a5a30SMasahiro Yamada  *	holder", "bus keeper" or "repeater". This allows another device on the
136d90a5a30SMasahiro Yamada  *	bus to change the value by driving the bus high or low and switching to
137d90a5a30SMasahiro Yamada  *	tristate. The argument is ignored.
138d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
139d90a5a30SMasahiro Yamada  *	impedance to VDD). If the argument is != 0 pull-up is enabled,
140d90a5a30SMasahiro Yamada  *	if it is 0, pull-up is total, i.e. the pin is connected to VDD.
141d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
142d90a5a30SMasahiro Yamada  *	impedance to GROUND). If the argument is != 0 pull-down is enabled,
143d90a5a30SMasahiro Yamada  *	if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
144d90a5a30SMasahiro Yamada  * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
145d90a5a30SMasahiro Yamada  *	on embedded knowledge of the controller hardware, like current mux
146d90a5a30SMasahiro Yamada  *	function. The pull direction and possibly strength too will normally
147d90a5a30SMasahiro Yamada  *	be decided completely inside the hardware block and not be readable
148d90a5a30SMasahiro Yamada  *	from the kernel side.
149d90a5a30SMasahiro Yamada  *	If the argument is != 0 pull up/down is enabled, if it is 0, the
150d90a5a30SMasahiro Yamada  *	configuration is ignored. The proper way to disable it is to use
151d90a5a30SMasahiro Yamada  *	@PIN_CONFIG_BIAS_DISABLE.
152d90a5a30SMasahiro Yamada  * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
153d90a5a30SMasahiro Yamada  *	low, this is the most typical case and is typically achieved with two
154d90a5a30SMasahiro Yamada  *	active transistors on the output. Setting this config will enable
155d90a5a30SMasahiro Yamada  *	push-pull mode, the argument is ignored.
156d90a5a30SMasahiro Yamada  * @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open
157d90a5a30SMasahiro Yamada  *	collector) which means it is usually wired with other output ports
158d90a5a30SMasahiro Yamada  *	which are then pulled up with an external resistor. Setting this
159d90a5a30SMasahiro Yamada  *	config will enable open drain mode, the argument is ignored.
160d90a5a30SMasahiro Yamada  * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
161d90a5a30SMasahiro Yamada  *	(open emitter). Setting this config will enable open source mode, the
162d90a5a30SMasahiro Yamada  *	argument is ignored.
163d90a5a30SMasahiro Yamada  * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
164d90a5a30SMasahiro Yamada  *	passed as argument. The argument is in mA.
165d90a5a30SMasahiro Yamada  * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input.  Note that this does not
166d90a5a30SMasahiro Yamada  *	affect the pin's ability to drive output.  1 enables input, 0 disables
167d90a5a30SMasahiro Yamada  *	input.
168d90a5a30SMasahiro Yamada  * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
169d90a5a30SMasahiro Yamada  *      If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
170d90a5a30SMasahiro Yamada  *      schmitt-trigger mode is disabled.
171d90a5a30SMasahiro Yamada  * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
172d90a5a30SMasahiro Yamada  *	schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
173d90a5a30SMasahiro Yamada  *	the threshold value is given on a custom format as argument when
174d90a5a30SMasahiro Yamada  *	setting pins to this mode.
175d90a5a30SMasahiro Yamada  * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
176d90a5a30SMasahiro Yamada  *	which means it will wait for signals to settle when reading inputs. The
177d90a5a30SMasahiro Yamada  *	argument gives the debounce time in usecs. Setting the
178d90a5a30SMasahiro Yamada  *	argument to zero turns debouncing off.
179d90a5a30SMasahiro Yamada  * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
180d90a5a30SMasahiro Yamada  *	supplies, the argument to this parameter (on a custom format) tells
181d90a5a30SMasahiro Yamada  *	the driver which alternative power source to use.
182d90a5a30SMasahiro Yamada  * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
183d90a5a30SMasahiro Yamada  *	this parameter (on a custom format) tells the driver which alternative
184d90a5a30SMasahiro Yamada  *	slew rate to use.
185d90a5a30SMasahiro Yamada  * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
186d90a5a30SMasahiro Yamada  *	operation, if several modes of operation are supported these can be
187d90a5a30SMasahiro Yamada  *	passed in the argument on a custom form, else just use argument 1
188d90a5a30SMasahiro Yamada  *	to indicate low power mode, argument 0 turns low power mode off.
189d90a5a30SMasahiro Yamada  * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument
190d90a5a30SMasahiro Yamada  *	1 to indicate high level, argument 0 to indicate low level. (Please
191d90a5a30SMasahiro Yamada  *	see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a
192d90a5a30SMasahiro Yamada  *	discussion around this parameter.)
193d90a5a30SMasahiro Yamada  * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
194d90a5a30SMasahiro Yamada  *	you need to pass in custom configurations to the pin controller, use
195d90a5a30SMasahiro Yamada  *	PIN_CONFIG_END+1 as the base offset.
196d90a5a30SMasahiro Yamada  */
197d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_DISABLE			0
198d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_HIGH_IMPEDANCE		1
199d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_BUS_HOLD		2
200d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_PULL_UP			3
201d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_PULL_DOWN		4
202d90a5a30SMasahiro Yamada #define PIN_CONFIG_BIAS_PULL_PIN_DEFAULT	5
203d90a5a30SMasahiro Yamada #define PIN_CONFIG_DRIVE_PUSH_PULL		6
204d90a5a30SMasahiro Yamada #define PIN_CONFIG_DRIVE_OPEN_DRAIN		7
205d90a5a30SMasahiro Yamada #define PIN_CONFIG_DRIVE_OPEN_SOURCE		8
206d90a5a30SMasahiro Yamada #define PIN_CONFIG_DRIVE_STRENGTH		9
207d90a5a30SMasahiro Yamada #define PIN_CONFIG_INPUT_ENABLE			10
208d90a5a30SMasahiro Yamada #define PIN_CONFIG_INPUT_SCHMITT_ENABLE		11
209d90a5a30SMasahiro Yamada #define PIN_CONFIG_INPUT_SCHMITT		12
210d90a5a30SMasahiro Yamada #define PIN_CONFIG_INPUT_DEBOUNCE		13
211d90a5a30SMasahiro Yamada #define PIN_CONFIG_POWER_SOURCE			14
212d90a5a30SMasahiro Yamada #define PIN_CONFIG_SLEW_RATE			15
213d90a5a30SMasahiro Yamada #define PIN_CONFIG_LOW_POWER_MODE		16
214d90a5a30SMasahiro Yamada #define PIN_CONFIG_OUTPUT			17
215d90a5a30SMasahiro Yamada #define PIN_CONFIG_END				0x7FFF
216d90a5a30SMasahiro Yamada 
217d90a5a30SMasahiro Yamada #if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
218d90a5a30SMasahiro Yamada /**
219d90a5a30SMasahiro Yamada  * pinctrl_generic_set_state() - generic set_state operation
220d90a5a30SMasahiro Yamada  * Parse the DT node of @config and its children and handle generic properties
221d90a5a30SMasahiro Yamada  * such as "pins", "groups", "functions", and pin configuration parameters.
222d90a5a30SMasahiro Yamada  *
223d90a5a30SMasahiro Yamada  * @pctldev: pinctrl device
224d90a5a30SMasahiro Yamada  * @config: config device (pseudo device), pointing a config node in DTS
225d90a5a30SMasahiro Yamada  * @return: 0 on success, or negative error code on failure
226d90a5a30SMasahiro Yamada  */
227d90a5a30SMasahiro Yamada int pinctrl_generic_set_state(struct udevice *pctldev, struct udevice *config);
228d90a5a30SMasahiro Yamada #else
229d90a5a30SMasahiro Yamada static inline int pinctrl_generic_set_state(struct udevice *pctldev,
230d90a5a30SMasahiro Yamada 					    struct udevice *config)
231d90a5a30SMasahiro Yamada {
232d90a5a30SMasahiro Yamada 	return -EINVAL;
233d90a5a30SMasahiro Yamada }
234d90a5a30SMasahiro Yamada #endif
235d90a5a30SMasahiro Yamada 
236d90a5a30SMasahiro Yamada #if CONFIG_IS_ENABLED(PINCTRL)
237d90a5a30SMasahiro Yamada /**
238d90a5a30SMasahiro Yamada  * pinctrl_select_state() - set a device to a given state
239d90a5a30SMasahiro Yamada  *
240d90a5a30SMasahiro Yamada  * @dev: peripheral device
241d90a5a30SMasahiro Yamada  * @statename: state name, like "default"
242d90a5a30SMasahiro Yamada  * @return: 0 on success, or negative error code on failure
243d90a5a30SMasahiro Yamada  */
244d90a5a30SMasahiro Yamada int pinctrl_select_state(struct udevice *dev, const char *statename);
245d90a5a30SMasahiro Yamada #else
246d90a5a30SMasahiro Yamada static inline int pinctrl_select_state(struct udevice *dev,
247d90a5a30SMasahiro Yamada 				       const char *statename)
248d90a5a30SMasahiro Yamada {
249d90a5a30SMasahiro Yamada 	return -EINVAL;
250d90a5a30SMasahiro Yamada }
251d90a5a30SMasahiro Yamada #endif
252d90a5a30SMasahiro Yamada 
253*c5acf4a2SSimon Glass /**
254*c5acf4a2SSimon Glass  * pinctrl_request() - Request a particular pinctrl function
255*c5acf4a2SSimon Glass  *
256*c5acf4a2SSimon Glass  * @dev:	Device to check (UCLASS_PINCTRL)
257*c5acf4a2SSimon Glass  * @func:	Function number (driver-specific)
258*c5acf4a2SSimon Glass  * @flags:	Flags (driver-specific)
259*c5acf4a2SSimon Glass  * @return 0 if OK, -ve on error
260*c5acf4a2SSimon Glass  */
261*c5acf4a2SSimon Glass int pinctrl_request(struct udevice *dev, int func, int flags);
262*c5acf4a2SSimon Glass 
263*c5acf4a2SSimon Glass /**
264*c5acf4a2SSimon Glass  * pinctrl_request_noflags() - Request a particular pinctrl function
265*c5acf4a2SSimon Glass  *
266*c5acf4a2SSimon Glass  * This is similar to pinctrl_request() but uses 0 for @flags.
267*c5acf4a2SSimon Glass  *
268*c5acf4a2SSimon Glass  * @dev:	Device to check (UCLASS_PINCTRL)
269*c5acf4a2SSimon Glass  * @func:	Function number (driver-specific)
270*c5acf4a2SSimon Glass  * @return 0 if OK, -ve on error
271*c5acf4a2SSimon Glass  */
272*c5acf4a2SSimon Glass int pinctrl_request_noflags(struct udevice *dev, int func);
273*c5acf4a2SSimon Glass 
274*c5acf4a2SSimon Glass /**
275*c5acf4a2SSimon Glass  * pinctrl_get_periph_id() - get the peripheral ID for a device
276*c5acf4a2SSimon Glass  *
277*c5acf4a2SSimon Glass  * This generally looks at the peripheral's device tree node to work out the
278*c5acf4a2SSimon Glass  * peripheral ID. The return value is normally interpreted as enum periph_id.
279*c5acf4a2SSimon Glass  * so long as this is defined by the platform (which it should be).
280*c5acf4a2SSimon Glass  *
281*c5acf4a2SSimon Glass  * @dev:	Pinctrl device to use for decoding
282*c5acf4a2SSimon Glass  * @periph:	Device to check
283*c5acf4a2SSimon Glass  * @return peripheral ID of @periph, or -ENOENT on error
284*c5acf4a2SSimon Glass  */
285*c5acf4a2SSimon Glass int pinctrl_get_periph_id(struct udevice *dev, struct udevice *periph);
286*c5acf4a2SSimon Glass 
287d90a5a30SMasahiro Yamada #endif /* __PINCTRL_H */
288