linux/arch/sh/include/asm/gpio.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0
   2 *
   3 *  include/asm-sh/gpio.h
   4 *
   5 * Generic GPIO API and pinmux table support for SuperH.
   6 *
   7 * Copyright (c) 2008 Magnus Damm
   8 */
   9#ifndef __ASM_SH_GPIO_H
  10#define __ASM_SH_GPIO_H
  11
  12#include <linux/kernel.h>
  13#include <linux/errno.h>
  14
  15#if defined(CONFIG_CPU_SH3)
  16#include <cpu/gpio.h>
  17#endif
  18
  19#define ARCH_NR_GPIOS 512
  20#include <asm-generic/gpio.h>
  21
  22#ifdef CONFIG_GPIOLIB
  23
  24static inline int gpio_get_value(unsigned gpio)
  25{
  26        return __gpio_get_value(gpio);
  27}
  28
  29static inline void gpio_set_value(unsigned gpio, int value)
  30{
  31        __gpio_set_value(gpio, value);
  32}
  33
  34static inline int gpio_cansleep(unsigned gpio)
  35{
  36        return __gpio_cansleep(gpio);
  37}
  38
  39static inline int gpio_to_irq(unsigned gpio)
  40{
  41        return __gpio_to_irq(gpio);
  42}
  43
  44static inline int irq_to_gpio(unsigned int irq)
  45{
  46        return -ENOSYS;
  47}
  48
  49#endif /* CONFIG_GPIOLIB */
  50
  51#endif /* __ASM_SH_GPIO_H */
  52