Home | History | Annotate | Line # | Download | only in gpio
      1  1.1  jmcneill /*	$NetBSD: gpio.h,v 1.2 2024/10/31 07:07:45 skrll Exp $	*/
      2  1.1  jmcneill 
      3  1.2     skrll /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
      4  1.1  jmcneill /*
      5  1.1  jmcneill  * This header provides constants for most GPIO bindings.
      6  1.1  jmcneill  *
      7  1.1  jmcneill  * Most GPIO bindings include a flags cell as part of the GPIO specifier.
      8  1.1  jmcneill  * In most cases, the format of the flags cell uses the standard values
      9  1.1  jmcneill  * defined in this header.
     10  1.1  jmcneill  */
     11  1.1  jmcneill 
     12  1.1  jmcneill #ifndef _DT_BINDINGS_GPIO_GPIO_H
     13  1.1  jmcneill #define _DT_BINDINGS_GPIO_GPIO_H
     14  1.1  jmcneill 
     15  1.1  jmcneill /* Bit 0 express polarity */
     16  1.1  jmcneill #define GPIO_ACTIVE_HIGH 0
     17  1.1  jmcneill #define GPIO_ACTIVE_LOW 1
     18  1.1  jmcneill 
     19  1.1  jmcneill /* Bit 1 express single-endedness */
     20  1.1  jmcneill #define GPIO_PUSH_PULL 0
     21  1.1  jmcneill #define GPIO_SINGLE_ENDED 2
     22  1.1  jmcneill 
     23  1.2     skrll /* Bit 2 express Open drain or open source */
     24  1.2     skrll #define GPIO_LINE_OPEN_SOURCE 0
     25  1.2     skrll #define GPIO_LINE_OPEN_DRAIN 4
     26  1.2     skrll 
     27  1.1  jmcneill /*
     28  1.2     skrll  * Open Drain/Collector is the combination of single-ended open drain interface.
     29  1.2     skrll  * Open Source/Emitter is the combination of single-ended open source interface.
     30  1.1  jmcneill  */
     31  1.2     skrll #define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN)
     32  1.2     skrll #define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)
     33  1.2     skrll 
     34  1.2     skrll /* Bit 3 express GPIO suspend/resume and reset persistence */
     35  1.2     skrll #define GPIO_PERSISTENT 0
     36  1.2     skrll #define GPIO_TRANSITORY 8
     37  1.2     skrll 
     38  1.2     skrll /* Bit 4 express pull up */
     39  1.2     skrll #define GPIO_PULL_UP 16
     40  1.2     skrll 
     41  1.2     skrll /* Bit 5 express pull down */
     42  1.2     skrll #define GPIO_PULL_DOWN 32
     43  1.2     skrll 
     44  1.2     skrll /* Bit 6 express pull disable */
     45  1.2     skrll #define GPIO_PULL_DISABLE 64
     46  1.1  jmcneill 
     47  1.1  jmcneill #endif
     48