gpio.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * gpio.h -- GPIO driver for NXP PCF50633
  3. *
  4. * (C) 2006-2008 by Openmoko, Inc.
  5. * All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. */
  12. #ifndef __LINUX_MFD_PCF50633_GPIO_H
  13. #define __LINUX_MFD_PCF50633_GPIO_H
  14. #include <linux/mfd/pcf50633/core.h>
  15. #define PCF50633_GPIO1 1
  16. #define PCF50633_GPIO2 2
  17. #define PCF50633_GPIO3 3
  18. #define PCF50633_GPO 4
  19. #define PCF50633_REG_GPIO1CFG 0x14
  20. #define PCF50633_REG_GPIO2CFG 0x15
  21. #define PCF50633_REG_GPIO3CFG 0x16
  22. #define PCF50633_REG_GPOCFG 0x17
  23. #define PCF50633_GPOCFG_GPOSEL_MASK 0x07
  24. enum pcf50633_reg_gpocfg {
  25. PCF50633_GPOCFG_GPOSEL_0 = 0x00,
  26. PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01,
  27. PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02,
  28. PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03,
  29. PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04,
  30. PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05,
  31. PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06,
  32. PCF50633_GPOCFG_GPOSEL_1 = 0x07,
  33. PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08,
  34. };
  35. int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val);
  36. u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio);
  37. int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert);
  38. int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio);
  39. int pcf50633_gpio_power_supply_set(struct pcf50633 *,
  40. int gpio, int regulator, int on);
  41. #endif /* __LINUX_MFD_PCF50633_GPIO_H */