xref: /linux/include/dt-bindings/pinctrl/sppctl.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1*340407d2SWells Lu /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2*340407d2SWells Lu /*
3*340407d2SWells Lu  * Sunplus dt-bindings Pinctrl header file
4*340407d2SWells Lu  * Copyright (C) Sunplus Tech / Tibbo Tech.
5*340407d2SWells Lu  * Author: Dvorkin Dmitry <dvorkin@tibbo.com>
6*340407d2SWells Lu  */
7*340407d2SWells Lu 
8*340407d2SWells Lu #ifndef __DT_BINDINGS_PINCTRL_SPPCTL_H__
9*340407d2SWells Lu #define __DT_BINDINGS_PINCTRL_SPPCTL_H__
10*340407d2SWells Lu 
11*340407d2SWells Lu #define IOP_G_MASTE		(0x01 << 0)
12*340407d2SWells Lu #define IOP_G_FIRST		(0x01 << 1)
13*340407d2SWells Lu 
14*340407d2SWells Lu #define SPPCTL_PCTL_G_PMUX	(0x00        | IOP_G_MASTE)
15*340407d2SWells Lu #define SPPCTL_PCTL_G_GPIO	(IOP_G_FIRST | IOP_G_MASTE)
16*340407d2SWells Lu #define SPPCTL_PCTL_G_IOPP	(IOP_G_FIRST | 0x00)
17*340407d2SWells Lu 
18*340407d2SWells Lu #define SPPCTL_PCTL_L_OUT	(0x01 << 0)	/* Output LOW        */
19*340407d2SWells Lu #define SPPCTL_PCTL_L_OU1	(0x01 << 1)	/* Output HIGH       */
20*340407d2SWells Lu #define SPPCTL_PCTL_L_INV	(0x01 << 2)	/* Input Invert      */
21*340407d2SWells Lu #define SPPCTL_PCTL_L_ONV	(0x01 << 3)	/* Output Invert     */
22*340407d2SWells Lu #define SPPCTL_PCTL_L_ODR	(0x01 << 4)	/* Output Open Drain */
23*340407d2SWells Lu 
24*340407d2SWells Lu /*
25*340407d2SWells Lu  * pack into 32-bit value:
26*340407d2SWells Lu  * pin# (8bit), typ (8bit), function (8bit), flag (8bit)
27*340407d2SWells Lu  */
28*340407d2SWells Lu #define SPPCTL_IOPAD(pin, typ, fun, flg)	(((pin) << 24) | ((typ) << 16) | \
29*340407d2SWells Lu 						((fun) << 8) | (flg))
30*340407d2SWells Lu 
31*340407d2SWells Lu #endif
32