18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This header provides constants for most GPIO bindings. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Most GPIO bindings include a flags cell as part of the GPIO specifier. 68c2ecf20Sopenharmony_ci * In most cases, the format of the flags cell uses the standard values 78c2ecf20Sopenharmony_ci * defined in this header. 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef _DT_BINDINGS_GPIO_GPIO_H 118c2ecf20Sopenharmony_ci#define _DT_BINDINGS_GPIO_GPIO_H 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/* Bit 0 express polarity */ 148c2ecf20Sopenharmony_ci#define GPIO_ACTIVE_HIGH 0 158c2ecf20Sopenharmony_ci#define GPIO_ACTIVE_LOW 1 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* Bit 1 express single-endedness */ 188c2ecf20Sopenharmony_ci#define GPIO_PUSH_PULL 0 198c2ecf20Sopenharmony_ci#define GPIO_SINGLE_ENDED 2 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* Bit 2 express Open drain or open source */ 228c2ecf20Sopenharmony_ci#define GPIO_LINE_OPEN_SOURCE 0 238c2ecf20Sopenharmony_ci#define GPIO_LINE_OPEN_DRAIN 4 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* 268c2ecf20Sopenharmony_ci * Open Drain/Collector is the combination of single-ended open drain interface. 278c2ecf20Sopenharmony_ci * Open Source/Emitter is the combination of single-ended open source interface. 288c2ecf20Sopenharmony_ci */ 298c2ecf20Sopenharmony_ci#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN) 308c2ecf20Sopenharmony_ci#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE) 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* Bit 3 express GPIO suspend/resume and reset persistence */ 338c2ecf20Sopenharmony_ci#define GPIO_PERSISTENT 0 348c2ecf20Sopenharmony_ci#define GPIO_TRANSITORY 8 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/* Bit 4 express pull up */ 378c2ecf20Sopenharmony_ci#define GPIO_PULL_UP 16 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* Bit 5 express pull down */ 408c2ecf20Sopenharmony_ci#define GPIO_PULL_DOWN 32 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#endif 43