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