blob: f61db5a6bfce23c4c51d5cb50d99d90fed789cd6 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Rothebace9f2018-05-26 18:56:17 -06002
Kyösti Mälkki50c96372014-10-18 07:51:03 +03003#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 Haouas616be8c2022-07-16 09:50:29 +020016#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älkki50c96372014-10-18 07:51:03 +030019
20static inline u8 fch_gpio_state(unsigned int gpio_nr)
21{
22 return FCH_GPIO(gpio_nr) >> 7;
23}
24
25#endif