2022-09-05 22:55:55 +08:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
|
2013-02-13 08:22:36 +08:00
|
|
|
/*
|
|
|
|
* This header provides constants for most GPIO bindings.
|
|
|
|
*
|
|
|
|
* Most GPIO bindings include a flags cell as part of the GPIO specifier.
|
|
|
|
* In most cases, the format of the flags cell uses the standard values
|
|
|
|
* defined in this header.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DT_BINDINGS_GPIO_GPIO_H
|
|
|
|
#define _DT_BINDINGS_GPIO_GPIO_H
|
|
|
|
|
2015-09-25 06:05:45 +08:00
|
|
|
/* Bit 0 express polarity */
|
2013-02-13 08:22:36 +08:00
|
|
|
#define GPIO_ACTIVE_HIGH 0
|
|
|
|
#define GPIO_ACTIVE_LOW 1
|
|
|
|
|
2015-09-25 06:05:45 +08:00
|
|
|
/* Bit 1 express single-endedness */
|
|
|
|
#define GPIO_PUSH_PULL 0
|
|
|
|
#define GPIO_SINGLE_ENDED 2
|
|
|
|
|
2017-04-06 21:35:52 +08:00
|
|
|
/* Bit 2 express Open drain or open source */
|
|
|
|
#define GPIO_LINE_OPEN_SOURCE 0
|
|
|
|
#define GPIO_LINE_OPEN_DRAIN 4
|
|
|
|
|
2015-09-25 06:05:45 +08:00
|
|
|
/*
|
2017-04-06 21:35:52 +08:00
|
|
|
* Open Drain/Collector is the combination of single-ended open drain interface.
|
|
|
|
* Open Source/Emitter is the combination of single-ended open source interface.
|
2015-09-25 06:05:45 +08:00
|
|
|
*/
|
2017-04-06 21:35:52 +08:00
|
|
|
#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN)
|
|
|
|
#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)
|
2015-09-25 06:05:45 +08:00
|
|
|
|
2017-11-30 11:55:24 +08:00
|
|
|
/* Bit 3 express GPIO suspend/resume and reset persistence */
|
|
|
|
#define GPIO_PERSISTENT 0
|
|
|
|
#define GPIO_TRANSITORY 8
|
2017-05-23 22:47:29 +08:00
|
|
|
|
2019-02-08 00:28:55 +08:00
|
|
|
/* Bit 4 express pull up */
|
|
|
|
#define GPIO_PULL_UP 16
|
|
|
|
|
|
|
|
/* Bit 5 express pull down */
|
|
|
|
#define GPIO_PULL_DOWN 32
|
|
|
|
|
2022-07-13 21:14:21 +08:00
|
|
|
/* Bit 6 express pull disable */
|
|
|
|
#define GPIO_PULL_DISABLE 64
|
|
|
|
|
2013-02-13 08:22:36 +08:00
|
|
|
#endif
|