pcal6416a.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* platform data for the PCAL6416A 16-bit I/O expander driver */
  2. #ifndef _PCAL6416A_H_
  3. #define _PCAL6416A_H_
  4. #define PCAL6416A_INPUT 0x00 /* Input port [RO] */
  5. #define PCAL6416A_DAT_OUT 0x02 /* GPIO DATA OUT [R/W] */
  6. #define PCAL6416A_POLARITY 0x04 /* Polarity Inversion port [R/W] */
  7. #define PCAL6416A_CONFIG 0x06 /* Configuration port [R/W] */
  8. #define PCAL6416A_DRIVE0 0x40 /* Output drive strength register Port0 [R/W] */
  9. #define PCAL6416A_DRIVE1 0x42 /* Output drive strength register Port1 [R/W] */
  10. #define PCAL6416A_INPUT_LATCH 0x44 /* Port0 Input latch register [R/W] */
  11. #define PCAL6416A_EN_PULLUPDOWN 0x46 /* Port0 Pull-up/Pull-down Enable [R/W] */
  12. #define PCAL6416A_SEL_PULLUPDOWN 0x48 /* Port0 Pull-up/Pull-down selection [R/W] */
  13. #define PCAL6416A_INT_MASK 0x4A /* Interrupt mask register [R/W] */
  14. #define PCAL6416A_INT_STATUS 0x4C /* Interrupt status register [RO] */
  15. #define PCAL6416A_OUTPUT_CONFIG 0x4F /* Output port configuration register [R/W] */
  16. #define NO_PULL 0x00
  17. #define PULL_DOWN 0x01
  18. #define PULL_UP 0x02
  19. /* EXPANDER GPIO Drive Strength */
  20. enum {
  21. GPIO_CFG_6_25MA,
  22. GPIO_CFG_12_5MA,
  23. GPIO_CFG_18_75MA,
  24. GPIO_CFG_25MA,
  25. };
  26. struct pcal6416a_platform_data {
  27. /* number of the first GPIO */
  28. unsigned gpio_base;
  29. int gpio_start;
  30. int ngpio;
  31. int irq_base;
  32. int reset_gpio;
  33. int irq_gpio;
  34. uint16_t support_init;
  35. uint16_t init_config;
  36. uint16_t init_data_out;
  37. uint16_t init_en_pull;
  38. uint16_t init_sel_pull;
  39. const char *supply_name;
  40. };
  41. #ifdef CONFIG_SEC_PM_DEBUG
  42. int expander_print_all(void);
  43. #endif
  44. #endif