xref: /freebsd/sys/contrib/device-tree/include/dt-bindings/pinctrl/pinctrl-cv18xx.h (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1*b2d2a78aSEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
2*b2d2a78aSEmmanuel Vadot /*
3*b2d2a78aSEmmanuel Vadot  * Copyright (C) 2023 Sophgo Ltd.
4*b2d2a78aSEmmanuel Vadot  *
5*b2d2a78aSEmmanuel Vadot  * Author: Inochi Amaoto <inochiama@outlook.com>
6*b2d2a78aSEmmanuel Vadot  */
7*b2d2a78aSEmmanuel Vadot 
8*b2d2a78aSEmmanuel Vadot #ifndef _DT_BINDINGS_PINCTRL_CV18XX_H
9*b2d2a78aSEmmanuel Vadot #define _DT_BINDINGS_PINCTRL_CV18XX_H
10*b2d2a78aSEmmanuel Vadot 
11*b2d2a78aSEmmanuel Vadot #define PIN_MUX_INVALD				0xff
12*b2d2a78aSEmmanuel Vadot 
13*b2d2a78aSEmmanuel Vadot #define PINMUX2(pin, mux, mux2)	\
14*b2d2a78aSEmmanuel Vadot 	(((pin) & 0xffff) | (((mux) & 0xff) << 16) | (((mux2) & 0xff) << 24))
15*b2d2a78aSEmmanuel Vadot 
16*b2d2a78aSEmmanuel Vadot #define PINMUX(pin, mux) \
17*b2d2a78aSEmmanuel Vadot 	PINMUX2(pin, mux, PIN_MUX_INVALD)
18*b2d2a78aSEmmanuel Vadot 
19*b2d2a78aSEmmanuel Vadot #endif /* _DT_BINDINGS_PINCTRL_CV18XX_H */
20