gpio-core.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* linux/arch/arm/plat-s3c/include/plat/gpio-core.h
  2. *
  3. * Copyright 2008 Simtec Electronics
  4. * http://armlinux.simtec.co.uk/
  5. * Ben Dooks <ben@simtec.co.uk>
  6. *
  7. * S3C Platform - GPIO core
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. /* Define the core gpiolib support functions that the s3c platforms may
  14. * need to extend or change depending on the hardware and the s3c chip
  15. * selected at build or found at run time.
  16. *
  17. * These definitions are not intended for driver inclusion, there is
  18. * nothing here that should not live outside the platform and core
  19. * specific code.
  20. */
  21. /**
  22. * struct s3c_gpio_chip - wrapper for specific implementation of gpio
  23. * @chip: The chip structure to be exported via gpiolib.
  24. * @base: The base pointer to the gpio configuration registers.
  25. *
  26. * This wrapper provides the necessary information for the Samsung
  27. * specific gpios being registered with gpiolib.
  28. */
  29. struct s3c_gpio_chip {
  30. struct gpio_chip chip;
  31. void __iomem *base;
  32. };
  33. static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc)
  34. {
  35. return container_of(gpc, struct s3c_gpio_chip, chip);
  36. }
  37. /** s3c_gpiolib_add() - add the s3c specific version of a gpio_chip.
  38. * @chip: The chip to register
  39. *
  40. * This is a wrapper to gpiochip_add() that takes our specific gpio chip
  41. * information and makes the necessary alterations for the platform and
  42. * notes the information for use with the configuration systems and any
  43. * other parts of the system.
  44. */
  45. extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip);