18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This header provides constants specific to DM814X pinctrl bindings. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _DT_BINDINGS_PINCTRL_DM814X_H 78c2ecf20Sopenharmony_ci#define _DT_BINDINGS_PINCTRL_DM814X_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <dt-bindings/pinctrl/omap.h> 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#undef INPUT_EN 128c2ecf20Sopenharmony_ci#undef PULL_UP 138c2ecf20Sopenharmony_ci#undef PULL_ENA 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* 168c2ecf20Sopenharmony_ci * Note that dm814x silicon revision 2.1 and older require input enabled 178c2ecf20Sopenharmony_ci * (bit 18 set) for all 3.3V I/Os to avoid cumulative hardware damage. For 188c2ecf20Sopenharmony_ci * more info, see errata advisory 2.1.87. We leave bit 18 out of 198c2ecf20Sopenharmony_ci * function-mask in dm814x.h and rely on the bootloader for it. 208c2ecf20Sopenharmony_ci */ 218c2ecf20Sopenharmony_ci#define INPUT_EN (1 << 18) 228c2ecf20Sopenharmony_ci#define PULL_UP (1 << 17) 238c2ecf20Sopenharmony_ci#define PULL_DISABLE (1 << 16) 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* update macro depending on INPUT_EN and PULL_ENA */ 268c2ecf20Sopenharmony_ci#undef PIN_OUTPUT 278c2ecf20Sopenharmony_ci#undef PIN_OUTPUT_PULLUP 288c2ecf20Sopenharmony_ci#undef PIN_OUTPUT_PULLDOWN 298c2ecf20Sopenharmony_ci#undef PIN_INPUT 308c2ecf20Sopenharmony_ci#undef PIN_INPUT_PULLUP 318c2ecf20Sopenharmony_ci#undef PIN_INPUT_PULLDOWN 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define PIN_OUTPUT (PULL_DISABLE) 348c2ecf20Sopenharmony_ci#define PIN_OUTPUT_PULLUP (PULL_UP) 358c2ecf20Sopenharmony_ci#define PIN_OUTPUT_PULLDOWN 0 368c2ecf20Sopenharmony_ci#define PIN_INPUT (INPUT_EN | PULL_DISABLE) 378c2ecf20Sopenharmony_ci#define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) 388c2ecf20Sopenharmony_ci#define PIN_INPUT_PULLDOWN (INPUT_EN) 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* undef non-existing modes */ 418c2ecf20Sopenharmony_ci#undef PIN_OFF_NONE 428c2ecf20Sopenharmony_ci#undef PIN_OFF_OUTPUT_HIGH 438c2ecf20Sopenharmony_ci#undef PIN_OFF_OUTPUT_LOW 448c2ecf20Sopenharmony_ci#undef PIN_OFF_INPUT_PULLUP 458c2ecf20Sopenharmony_ci#undef PIN_OFF_INPUT_PULLDOWN 468c2ecf20Sopenharmony_ci#undef PIN_OFF_WAKEUPENABLE 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#endif 498c2ecf20Sopenharmony_ci 50