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