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