162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * This header provides constants specific to DM814X pinctrl bindings. 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef _DT_BINDINGS_PINCTRL_DM814X_H 762306a36Sopenharmony_ci#define _DT_BINDINGS_PINCTRL_DM814X_H 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <dt-bindings/pinctrl/omap.h> 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#undef INPUT_EN 1262306a36Sopenharmony_ci#undef PULL_UP 1362306a36Sopenharmony_ci#undef PULL_ENA 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/* 1662306a36Sopenharmony_ci * Note that dm814x silicon revision 2.1 and older require input enabled 1762306a36Sopenharmony_ci * (bit 18 set) for all 3.3V I/Os to avoid cumulative hardware damage. For 1862306a36Sopenharmony_ci * more info, see errata advisory 2.1.87. We leave bit 18 out of 1962306a36Sopenharmony_ci * function-mask in dm814x.h and rely on the bootloader for it. 2062306a36Sopenharmony_ci */ 2162306a36Sopenharmony_ci#define INPUT_EN (1 << 18) 2262306a36Sopenharmony_ci#define PULL_UP (1 << 17) 2362306a36Sopenharmony_ci#define PULL_DISABLE (1 << 16) 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci/* update macro depending on INPUT_EN and PULL_ENA */ 2662306a36Sopenharmony_ci#undef PIN_OUTPUT 2762306a36Sopenharmony_ci#undef PIN_OUTPUT_PULLUP 2862306a36Sopenharmony_ci#undef PIN_OUTPUT_PULLDOWN 2962306a36Sopenharmony_ci#undef PIN_INPUT 3062306a36Sopenharmony_ci#undef PIN_INPUT_PULLUP 3162306a36Sopenharmony_ci#undef PIN_INPUT_PULLDOWN 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#define PIN_OUTPUT (PULL_DISABLE) 3462306a36Sopenharmony_ci#define PIN_OUTPUT_PULLUP (PULL_UP) 3562306a36Sopenharmony_ci#define PIN_OUTPUT_PULLDOWN 0 3662306a36Sopenharmony_ci#define PIN_INPUT (INPUT_EN | PULL_DISABLE) 3762306a36Sopenharmony_ci#define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) 3862306a36Sopenharmony_ci#define PIN_INPUT_PULLDOWN (INPUT_EN) 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci/* undef non-existing modes */ 4162306a36Sopenharmony_ci#undef PIN_OFF_NONE 4262306a36Sopenharmony_ci#undef PIN_OFF_OUTPUT_HIGH 4362306a36Sopenharmony_ci#undef PIN_OFF_OUTPUT_LOW 4462306a36Sopenharmony_ci#undef PIN_OFF_INPUT_PULLUP 4562306a36Sopenharmony_ci#undef PIN_OFF_INPUT_PULLDOWN 4662306a36Sopenharmony_ci#undef PIN_OFF_WAKEUPENABLE 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#endif 4962306a36Sopenharmony_ci 50