Line data Source code
1 0 : /* 2 : * Copyright (c) 2023 Enphase Energy 3 : * 4 : * SPDX-License-Identifier: Apache-2.0 5 : */ 6 : 7 : #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_TI_K3_PINCTRL_H_ 8 : #define ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_TI_K3_PINCTRL_H_ 9 : 10 0 : #define PULLUDEN_SHIFT 16 11 0 : #define PULLTYPESEL_SHIFT 17 12 0 : #define RXACTIVE_SHIFT 18 13 : 14 0 : #define PULL_DISABLE (1 << PULLUDEN_SHIFT) 15 0 : #define PULL_ENABLE (0 << PULLUDEN_SHIFT) 16 : 17 0 : #define PULL_UP ((1 << PULLTYPESEL_SHIFT) | PULL_ENABLE) 18 0 : #define PULL_DOWN ((0 << PULLTYPESEL_SHIFT) | PULL_ENABLE) 19 : 20 0 : #define INPUT_ENABLE (1 << RXACTIVE_SHIFT) 21 0 : #define INPUT_DISABLE (0 << RXACTIVE_SHIFT) 22 : 23 : /* Only the following macros are intended be used in DTS files */ 24 : 25 0 : #define PIN_OUTPUT (INPUT_DISABLE | PULL_DISABLE) 26 0 : #define PIN_OUTPUT_PULLUP (INPUT_DISABLE | PULL_UP) 27 0 : #define PIN_OUTPUT_PULLDOWN (INPUT_DISABLE | PULL_DOWN) 28 0 : #define PIN_INPUT (INPUT_ENABLE | PULL_DISABLE) 29 0 : #define PIN_INPUT_PULLUP (INPUT_ENABLE | PULL_UP) 30 0 : #define PIN_INPUT_PULLDOWN (INPUT_ENABLE | PULL_DOWN) 31 : 32 0 : #define MUX_MODE_0 0 33 0 : #define MUX_MODE_1 1 34 0 : #define MUX_MODE_2 2 35 0 : #define MUX_MODE_3 3 36 0 : #define MUX_MODE_4 4 37 0 : #define MUX_MODE_5 5 38 0 : #define MUX_MODE_6 6 39 0 : #define MUX_MODE_7 7 40 0 : #define MUX_MODE_8 8 41 0 : #define MUX_MODE_9 9 42 0 : #define MUX_MODE_10 10 43 0 : #define MUX_MODE_11 11 44 0 : #define MUX_MODE_12 12 45 0 : #define MUX_MODE_13 13 46 0 : #define MUX_MODE_14 14 47 : 48 0 : #define K3_PINMUX(offset, value, mux_mode) (((offset) & 0x1fff)) ((value) | (mux_mode)) 49 : 50 : #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_TI_K3_PINCTRL_H_ */