Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | ebace9f | 2018-05-26 18:56:17 -0600 | [diff] [blame] | 2 | |
Kyösti Mälkki | 50c9637 | 2014-10-18 07:51:03 +0300 | [diff] [blame] | 3 | #ifndef _CIMX_SB_GPIO_OEM_H_ |
| 4 | #define _CIMX_SB_GPIO_OEM_H_ |
| 5 | |
| 6 | #define SB_GPIO_REG02 2 |
| 7 | #define SB_GPIO_REG09 9 |
| 8 | #define SB_GPIO_REG10 10 |
| 9 | #define SB_GPIO_REG15 15 |
| 10 | #define SB_GPIO_REG17 17 |
| 11 | #define SB_GPIO_REG21 21 |
| 12 | #define SB_GPIO_REG25 25 |
| 13 | #define SB_GPIO_REG28 28 |
| 14 | |
| 15 | /* FCH GPIO access helpers */ |
Elyes Haouas | 616be8c | 2022-07-16 09:50:29 +0200 | [diff] [blame] | 16 | #define FCH_IOMUX(gpio_nr) (*(u8 *)((uintptr_t)ACPI_MMIO_BASE + IOMUX_BASE + (gpio_nr))) |
| 17 | #define FCH_PMIO(reg_nr) (*(u8 *)((uintptr_t)ACPI_MMIO_BASE + PMIO_BASE + (reg_nr))) |
| 18 | #define FCH_GPIO(gpio_nr) (*(volatile u8 *)((uintptr_t)ACPI_MMIO_BASE + GPIO_BASE + (gpio_nr))) |
Kyösti Mälkki | 50c9637 | 2014-10-18 07:51:03 +0300 | [diff] [blame] | 19 | |
| 20 | static inline u8 fch_gpio_state(unsigned int gpio_nr) |
| 21 | { |
| 22 | return FCH_GPIO(gpio_nr) >> 7; |
| 23 | } |
| 24 | |
| 25 | #endif |