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