1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2e54686e4SMugunthan V N /* 3e54686e4SMugunthan V N * This header provides constants specific to AM43XX pinctrl bindings. 4e54686e4SMugunthan V N */ 5e54686e4SMugunthan V N 6e54686e4SMugunthan V N #ifndef _DT_BINDINGS_PINCTRL_AM43XX_H 7e54686e4SMugunthan V N #define _DT_BINDINGS_PINCTRL_AM43XX_H 8e54686e4SMugunthan V N 9e54686e4SMugunthan V N #define MUX_MODE0 0 10e54686e4SMugunthan V N #define MUX_MODE1 1 11e54686e4SMugunthan V N #define MUX_MODE2 2 12e54686e4SMugunthan V N #define MUX_MODE3 3 13e54686e4SMugunthan V N #define MUX_MODE4 4 14e54686e4SMugunthan V N #define MUX_MODE5 5 15e54686e4SMugunthan V N #define MUX_MODE6 6 16e54686e4SMugunthan V N #define MUX_MODE7 7 17dfc9d3f1SDarren Etheridge #define MUX_MODE8 8 1892814c4aSDave Gerlach #define MUX_MODE9 9 19e54686e4SMugunthan V N 20e54686e4SMugunthan V N #define PULL_DISABLE (1 << 16) 21e54686e4SMugunthan V N #define PULL_UP (1 << 17) 22e54686e4SMugunthan V N #define INPUT_EN (1 << 18) 2310b21855SDave Gerlach #define SLEWCTRL_SLOW (1 << 19) 2410b21855SDave Gerlach #define SLEWCTRL_FAST 0 25130c28daSAndrew F. Davis #define DS0_FORCE_OFF_MODE (1 << 24) 26130c28daSAndrew F. Davis #define DS0_INPUT (1 << 25) 27130c28daSAndrew F. Davis #define DS0_FORCE_OUT_HIGH (1 << 26) 28*01ce8803SDave Gerlach #define DS0_PULL_UP_DOWN_EN (0 << 27) 29*01ce8803SDave Gerlach #define DS0_PULL_UP_DOWN_DIS (1 << 27) 30130c28daSAndrew F. Davis #define DS0_PULL_UP_SEL (1 << 28) 31b6bbf598SEyal Reizer #define WAKEUP_ENABLE (1 << 29) 32e54686e4SMugunthan V N 33130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT (DS0_FORCE_OFF_MODE) 34130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_HIGH (DS0_FORCE_OFF_MODE | DS0_FORCE_OUT_HIGH) 35130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_PULLUP (DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL) 36130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_PULLDOWN (DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN) 37130c28daSAndrew F. Davis #define DS0_PIN_INPUT (DS0_FORCE_OFF_MODE | DS0_INPUT) 38130c28daSAndrew F. Davis #define DS0_PIN_INPUT_PULLUP (DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL) 39130c28daSAndrew F. Davis #define DS0_PIN_INPUT_PULLDOWN (DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN) 40130c28daSAndrew F. Davis 41e54686e4SMugunthan V N #define PIN_OUTPUT (PULL_DISABLE) 42e54686e4SMugunthan V N #define PIN_OUTPUT_PULLUP (PULL_UP) 43e54686e4SMugunthan V N #define PIN_OUTPUT_PULLDOWN 0 44e54686e4SMugunthan V N #define PIN_INPUT (INPUT_EN | PULL_DISABLE) 45e54686e4SMugunthan V N #define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) 46e54686e4SMugunthan V N #define PIN_INPUT_PULLDOWN (INPUT_EN) 47e54686e4SMugunthan V N 48fc63efdfSJavier Martinez Canillas /* 49fc63efdfSJavier Martinez Canillas * Macro to allow using the absolute physical address instead of the 50fc63efdfSJavier Martinez Canillas * padconf registers instead of the offset from padconf base. 51fc63efdfSJavier Martinez Canillas */ 52fc63efdfSJavier Martinez Canillas #define AM4372_IOPAD(pa, val) (((pa) & 0xffff) - 0x0800) (val) 53fc63efdfSJavier Martinez Canillas 54e54686e4SMugunthan V N #endif 55e54686e4SMugunthan V N 56