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