mcp23s08.h 919 B

12345678910111213141516171819202122232425262728293031
  1. /* FIXME driver should be able to handle IRQs... */
  2. struct mcp23s08_chip_info {
  3. bool is_present; /* true iff populated */
  4. u8 pullups; /* BIT(x) means enable pullup x */
  5. };
  6. struct mcp23s08_platform_data {
  7. /* Four slaves (numbered 0..3) can share one SPI chipselect, and
  8. * will provide 8..32 GPIOs using 1..4 gpio_chip instances.
  9. */
  10. struct mcp23s08_chip_info chip[4];
  11. /* "base" is the number of the first GPIO. Dynamic assignment is
  12. * not currently supported, and even if there are gaps in chip
  13. * addressing the GPIO numbers are sequential .. so for example
  14. * if only slaves 0 and 3 are present, their GPIOs range from
  15. * base to base+15.
  16. */
  17. unsigned base;
  18. void *context; /* param to setup/teardown */
  19. int (*setup)(struct spi_device *spi,
  20. int gpio, unsigned ngpio,
  21. void *context);
  22. int (*teardown)(struct spi_device *spi,
  23. int gpio, unsigned ngpio,
  24. void *context);
  25. };