1193323Sed/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2193323Sed/* 3193323Sed * This header provides constants for Renesas RZ/V2M pinctrl bindings. 4193323Sed * 5193323Sed * Copyright (C) 2022 Renesas Electronics Corp. 6193323Sed * 7193323Sed */ 8193323Sed 9193323Sed#ifndef __DT_BINDINGS_RZV2M_PINCTRL_H 10193323Sed#define __DT_BINDINGS_RZV2M_PINCTRL_H 11193323Sed 12193323Sed#define RZV2M_PINS_PER_PORT 16 13193323Sed 14193323Sed/* 15193323Sed * Create the pin index from its bank and position numbers and store in 16193323Sed * the upper 16 bits the alternate function identifier 17218893Sdim */ 18193323Sed#define RZV2M_PORT_PINMUX(b, p, f) ((b) * RZV2M_PINS_PER_PORT + (p) | ((f) << 16)) 19193323Sed 20193323Sed/* Convert a port and pin label to its global pin index */ 21193323Sed#define RZV2M_GPIO(port, pin) ((port) * RZV2M_PINS_PER_PORT + (pin)) 22193323Sed 23193323Sed#endif /* __DT_BINDINGS_RZV2M_PINCTRL_H */ 24193323Sed