xref: /linux/scripts/dtc/include-prefixes/dt-bindings/pinctrl/r7s9210-pinctrl.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1*94693b7bSChris Brandt /* SPDX-License-Identifier: GPL-2.0 */
2*94693b7bSChris Brandt /*
3*94693b7bSChris Brandt  * Defines macros and constants for Renesas RZ/A2 pin controller pin
4*94693b7bSChris Brandt  * muxing functions.
5*94693b7bSChris Brandt  */
6*94693b7bSChris Brandt #ifndef __DT_BINDINGS_PINCTRL_RENESAS_RZA2_H
7*94693b7bSChris Brandt #define __DT_BINDINGS_PINCTRL_RENESAS_RZA2_H
8*94693b7bSChris Brandt 
9*94693b7bSChris Brandt #define RZA2_PINS_PER_PORT	8
10*94693b7bSChris Brandt 
11*94693b7bSChris Brandt /* Port names as labeled in the Hardware Manual */
12*94693b7bSChris Brandt #define PORT0 0
13*94693b7bSChris Brandt #define PORT1 1
14*94693b7bSChris Brandt #define PORT2 2
15*94693b7bSChris Brandt #define PORT3 3
16*94693b7bSChris Brandt #define PORT4 4
17*94693b7bSChris Brandt #define PORT5 5
18*94693b7bSChris Brandt #define PORT6 6
19*94693b7bSChris Brandt #define PORT7 7
20*94693b7bSChris Brandt #define PORT8 8
21*94693b7bSChris Brandt #define PORT9 9
22*94693b7bSChris Brandt #define PORTA 10
23*94693b7bSChris Brandt #define PORTB 11
24*94693b7bSChris Brandt #define PORTC 12
25*94693b7bSChris Brandt #define PORTD 13
26*94693b7bSChris Brandt #define PORTE 14
27*94693b7bSChris Brandt #define PORTF 15
28*94693b7bSChris Brandt #define PORTG 16
29*94693b7bSChris Brandt #define PORTH 17
30*94693b7bSChris Brandt /* No I */
31*94693b7bSChris Brandt #define PORTJ 18
32*94693b7bSChris Brandt #define PORTK 19
33*94693b7bSChris Brandt #define PORTL 20
34*94693b7bSChris Brandt #define PORTM 21	/* Pins PM_0/1 are labeled JP_0/1 in HW manual */
35*94693b7bSChris Brandt 
36*94693b7bSChris Brandt /*
37*94693b7bSChris Brandt  * Create the pin index from its bank and position numbers and store in
38*94693b7bSChris Brandt  * the upper 16 bits the alternate function identifier
39*94693b7bSChris Brandt  */
40*94693b7bSChris Brandt #define RZA2_PINMUX(b, p, f)	((b) * RZA2_PINS_PER_PORT + (p) | (f << 16))
41*94693b7bSChris Brandt 
42*94693b7bSChris Brandt /*
43*94693b7bSChris Brandt  * Convert a port and pin label to its global pin index
44*94693b7bSChris Brandt  */
45*94693b7bSChris Brandt #define RZA2_PIN(port, pin)	((port) * RZA2_PINS_PER_PORT + (pin))
46*94693b7bSChris Brandt 
47*94693b7bSChris Brandt #endif /* __DT_BINDINGS_PINCTRL_RENESAS_RZA2_H */
48