xref: /OK3568_Linux_fs/kernel/include/dt-bindings/pinctrl/dm814x.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * This header provides constants specific to DM814X pinctrl bindings.
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifndef _DT_BINDINGS_PINCTRL_DM814X_H
7*4882a593Smuzhiyun #define _DT_BINDINGS_PINCTRL_DM814X_H
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #include <dt-bindings/pinctrl/omap.h>
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #undef INPUT_EN
12*4882a593Smuzhiyun #undef PULL_UP
13*4882a593Smuzhiyun #undef PULL_ENA
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun /*
16*4882a593Smuzhiyun  * Note that dm814x silicon revision 2.1 and older require input enabled
17*4882a593Smuzhiyun  * (bit 18 set) for all 3.3V I/Os to avoid cumulative hardware damage. For
18*4882a593Smuzhiyun  * more info, see errata advisory 2.1.87. We leave bit 18 out of
19*4882a593Smuzhiyun  * function-mask in dm814x.h and rely on the bootloader for it.
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun #define INPUT_EN		(1 << 18)
22*4882a593Smuzhiyun #define PULL_UP			(1 << 17)
23*4882a593Smuzhiyun #define PULL_DISABLE		(1 << 16)
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun /* update macro depending on INPUT_EN and PULL_ENA */
26*4882a593Smuzhiyun #undef PIN_OUTPUT
27*4882a593Smuzhiyun #undef PIN_OUTPUT_PULLUP
28*4882a593Smuzhiyun #undef PIN_OUTPUT_PULLDOWN
29*4882a593Smuzhiyun #undef PIN_INPUT
30*4882a593Smuzhiyun #undef PIN_INPUT_PULLUP
31*4882a593Smuzhiyun #undef PIN_INPUT_PULLDOWN
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #define PIN_OUTPUT		(PULL_DISABLE)
34*4882a593Smuzhiyun #define PIN_OUTPUT_PULLUP	(PULL_UP)
35*4882a593Smuzhiyun #define PIN_OUTPUT_PULLDOWN	0
36*4882a593Smuzhiyun #define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
37*4882a593Smuzhiyun #define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
38*4882a593Smuzhiyun #define PIN_INPUT_PULLDOWN	(INPUT_EN)
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun /* undef non-existing modes */
41*4882a593Smuzhiyun #undef PIN_OFF_NONE
42*4882a593Smuzhiyun #undef PIN_OFF_OUTPUT_HIGH
43*4882a593Smuzhiyun #undef PIN_OFF_OUTPUT_LOW
44*4882a593Smuzhiyun #undef PIN_OFF_INPUT_PULLUP
45*4882a593Smuzhiyun #undef PIN_OFF_INPUT_PULLDOWN
46*4882a593Smuzhiyun #undef PIN_OFF_WAKEUPENABLE
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #endif
49*4882a593Smuzhiyun 
50