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