mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-17 02:08:38 +00:00
1bb257a9b3
This commit extends the flags that can be used in GPIO specifiers to indicate if a pull-up resistor or pull-down resistor should be enabled. It is the backport of linux commit ede033e1e863c ('dt-bindings: gpio: document the new pull-up/pull-down flags') from Thomas Petazzoni <thomas.petazzoni@bootlin.com> and integrated in v5.1-rc1 https://github.com/torvalds/linux/commit/ede033e1e863c Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* 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
|
|
|
|
/* Bit 0 express polarity */
|
|
#define GPIO_ACTIVE_HIGH 0
|
|
#define GPIO_ACTIVE_LOW 1
|
|
|
|
/* Bit 1 express single-endedness */
|
|
#define GPIO_PUSH_PULL 0
|
|
#define GPIO_SINGLE_ENDED 2
|
|
|
|
/* Bit 2 express Open drain or open source */
|
|
#define GPIO_LINE_OPEN_SOURCE 0
|
|
#define GPIO_LINE_OPEN_DRAIN 4
|
|
|
|
/*
|
|
* Open Drain/Collector is the combination of single-ended open drain interface.
|
|
* Open Source/Emitter is the combination of single-ended open source interface.
|
|
*/
|
|
#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN)
|
|
#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)
|
|
|
|
/* Bit 3 express GPIO suspend/resume and reset persistence */
|
|
#define GPIO_PERSISTENT 0
|
|
#define GPIO_TRANSITORY 8
|
|
|
|
/* Bit 4 express pull up */
|
|
#define GPIO_PULL_UP 16
|
|
|
|
/* Bit 5 express pull down */
|
|
#define GPIO_PULL_DOWN 32
|
|
|
|
#endif
|