gpio-cfg-helpers.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright 2008 Openmoko, Inc.
  4. * Copyright 2008 Simtec Electronics
  5. * http://armlinux.simtec.co.uk/
  6. * Ben Dooks <ben@simtec.co.uk>
  7. *
  8. * Samsung Platform - GPIO pin configuration helper definitions
  9. */
  10. /* This is meant for core cpu support, machine or other driver files
  11. * should not be including this header.
  12. */
  13. #ifndef __PLAT_GPIO_CFG_HELPERS_H
  14. #define __PLAT_GPIO_CFG_HELPERS_H __FILE__
  15. /* As a note, all gpio configuration functions are entered exclusively, either
  16. * with the relevant lock held or the system prevented from doing anything else
  17. * by disabling interrupts.
  18. */
  19. static inline int samsung_gpio_do_setcfg(struct samsung_gpio_chip *chip,
  20. unsigned int off, unsigned int config)
  21. {
  22. return (chip->config->set_config)(chip, off, config);
  23. }
  24. static inline int samsung_gpio_do_setpull(struct samsung_gpio_chip *chip,
  25. unsigned int off, samsung_gpio_pull_t pull)
  26. {
  27. return (chip->config->set_pull)(chip, off, pull);
  28. }
  29. #endif /* __PLAT_GPIO_CFG_HELPERS_H */