omap_gpio.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2009 Wind River Systems, Inc.
  4. * Tom Rix <Tom.Rix@windriver.com>
  5. *
  6. * This work is derived from the linux 2.6.27 kernel source
  7. * To fetch, use the kernel repository
  8. * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
  9. * Use the v2.6.27 tag.
  10. *
  11. * Below is the original's header including its copyright
  12. *
  13. * linux/arch/arm/plat-omap/gpio.c
  14. *
  15. * Support functions for OMAP GPIO
  16. *
  17. * Copyright (C) 2003-2005 Nokia Corporation
  18. * Written by Juha Yrjölä <juha.yrjola@nokia.com>
  19. */
  20. #ifndef _GPIO_H
  21. #define _GPIO_H
  22. #include <asm/arch/cpu.h>
  23. #if CONFIG_IS_ENABLED(DM_GPIO)
  24. /* Information about a GPIO bank */
  25. struct omap_gpio_platdata {
  26. int bank_index;
  27. ulong base; /* address of registers in physical memory */
  28. const char *port_name;
  29. };
  30. #else
  31. struct gpio_bank {
  32. void *base;
  33. };
  34. extern const struct gpio_bank *const omap_gpio_bank;
  35. /**
  36. * Check if gpio is valid.
  37. *
  38. * @param gpio GPIO number
  39. * @return 1 if ok, 0 on error
  40. */
  41. int gpio_is_valid(int gpio);
  42. #endif
  43. #endif /* _GPIO_H_ */