Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
0002 /*
0003  * This header provides constants for Renesas RZ/V2M pinctrl bindings.
0004  *
0005  * Copyright (C) 2022 Renesas Electronics Corp.
0006  *
0007  */
0008 
0009 #ifndef __DT_BINDINGS_RZV2M_PINCTRL_H
0010 #define __DT_BINDINGS_RZV2M_PINCTRL_H
0011 
0012 #define RZV2M_PINS_PER_PORT 16
0013 
0014 /*
0015  * Create the pin index from its bank and position numbers and store in
0016  * the upper 16 bits the alternate function identifier
0017  */
0018 #define RZV2M_PORT_PINMUX(b, p, f)  ((b) * RZV2M_PINS_PER_PORT + (p) | ((f) << 16))
0019 
0020 /* Convert a port and pin label to its global pin index */
0021 #define RZV2M_GPIO(port, pin)   ((port) * RZV2M_PINS_PER_PORT + (pin))
0022 
0023 #endif /* __DT_BINDINGS_RZV2M_PINCTRL_H */