162306a36Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * This header provides constants for most GPIO bindings. 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Most GPIO bindings include a flags cell as part of the GPIO specifier. 662306a36Sopenharmony_ci * In most cases, the format of the flags cell uses the standard values 762306a36Sopenharmony_ci * defined in this header. 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _DT_BINDINGS_GPIO_GPIO_H 1162306a36Sopenharmony_ci#define _DT_BINDINGS_GPIO_GPIO_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci/* Bit 0 express polarity */ 1462306a36Sopenharmony_ci#define GPIO_ACTIVE_HIGH 0 1562306a36Sopenharmony_ci#define GPIO_ACTIVE_LOW 1 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* Bit 1 express single-endedness */ 1862306a36Sopenharmony_ci#define GPIO_PUSH_PULL 0 1962306a36Sopenharmony_ci#define GPIO_SINGLE_ENDED 2 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* Bit 2 express Open drain or open source */ 2262306a36Sopenharmony_ci#define GPIO_LINE_OPEN_SOURCE 0 2362306a36Sopenharmony_ci#define GPIO_LINE_OPEN_DRAIN 4 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci/* 2662306a36Sopenharmony_ci * Open Drain/Collector is the combination of single-ended open drain interface. 2762306a36Sopenharmony_ci * Open Source/Emitter is the combination of single-ended open source interface. 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN) 3062306a36Sopenharmony_ci#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE) 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci/* Bit 3 express GPIO suspend/resume and reset persistence */ 3362306a36Sopenharmony_ci#define GPIO_PERSISTENT 0 3462306a36Sopenharmony_ci#define GPIO_TRANSITORY 8 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* Bit 4 express pull up */ 3762306a36Sopenharmony_ci#define GPIO_PULL_UP 16 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci/* Bit 5 express pull down */ 4062306a36Sopenharmony_ci#define GPIO_PULL_DOWN 32 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci/* Bit 6 express pull disable */ 4362306a36Sopenharmony_ci#define GPIO_PULL_DISABLE 64 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#endif 46