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