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