18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _ARCH_ARM_GPIO_H 38c2ecf20Sopenharmony_ci#define _ARCH_ARM_GPIO_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#if CONFIG_ARCH_NR_GPIO > 0 68c2ecf20Sopenharmony_ci#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO 78c2ecf20Sopenharmony_ci#endif 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ 108c2ecf20Sopenharmony_ci#include <asm-generic/gpio.h> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci/* The trivial gpiolib dispatchers */ 138c2ecf20Sopenharmony_ci#define gpio_get_value __gpio_get_value 148c2ecf20Sopenharmony_ci#define gpio_set_value __gpio_set_value 158c2ecf20Sopenharmony_ci#define gpio_cansleep __gpio_cansleep 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* 188c2ecf20Sopenharmony_ci * Provide a default gpio_to_irq() which should satisfy every case. 198c2ecf20Sopenharmony_ci * However, some platforms want to do this differently, so allow them 208c2ecf20Sopenharmony_ci * to override it. 218c2ecf20Sopenharmony_ci */ 228c2ecf20Sopenharmony_ci#ifndef gpio_to_irq 238c2ecf20Sopenharmony_ci#define gpio_to_irq __gpio_to_irq 248c2ecf20Sopenharmony_ci#endif 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#endif /* _ARCH_ARM_GPIO_H */ 27