diff options
author | Svyatoslav Ryhel <clamor95@gmail.com> | 2024-08-09 21:10:31 +0300 |
---|---|---|
committer | Svyatoslav Ryhel <clamor95@gmail.com> | 2024-10-13 17:20:26 +0300 |
commit | 2ff444d07d62174e24b7bf0c16cac6191cacaed2 (patch) | |
tree | d051832cf01fbd93faf7814827337fb45c38ecfb /include/spl_gpio.h | |
parent | d7c98f20307b8e50ffc8dc9aab305bb7fb6e76f2 (diff) |
drivers: tegra_gpio: add early SPL functions
In some cases access to GPIOs is needed so early that DM
is not ready even nearly. These functions are exactly for
this case.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Diffstat (limited to 'include/spl_gpio.h')
-rw-r--r-- | include/spl_gpio.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/spl_gpio.h b/include/spl_gpio.h index e39ac3f624b..b33261a6485 100644 --- a/include/spl_gpio.h +++ b/include/spl_gpio.h @@ -59,4 +59,23 @@ int spl_gpio_output(void *regs, uint gpio, int value); */ int spl_gpio_input(void *regs, uint gpio); +/** + * spl_gpio_get_value() - Get GPIO value + * + * @regs: Pointer to GPIO registers + * @gpio: GPIO to adjust (SoC-specific) + * Return: return GPIO value if OK, -ve on error + */ +int spl_gpio_get_value(void *regs, uint gpio); + +/** + * spl_gpio_set_value() - Set value on GPIO + * + * @regs: Pointer to GPIO registers + * @gpio: GPIO to adjust (SoC-specific) + * @value: 0 to set the output low, 1 to set it high + * Return: return 0 if OK, -ve on error + */ +int spl_gpio_set_value(void *regs, uint gpio, int value); + #endif /* __SPL_GPIO_H */ |