max7301.h 900 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef LINUX_SPI_MAX7301_H
  2. #define LINUX_SPI_MAX7301_H
  3. #include <linux/gpio.h>
  4. /*
  5. * Some registers must be read back to modify.
  6. * To save time we cache them here in memory
  7. */
  8. struct max7301 {
  9. struct mutex lock;
  10. u8 port_config[8]; /* field 0 is unused */
  11. u32 out_level; /* cached output levels */
  12. u32 input_pullup_active;
  13. struct gpio_chip chip;
  14. struct device *dev;
  15. int (*write)(struct device *dev, unsigned int reg, unsigned int val);
  16. int (*read)(struct device *dev, unsigned int reg);
  17. };
  18. struct max7301_platform_data {
  19. /* number assigned to the first GPIO */
  20. unsigned base;
  21. /*
  22. * bitmask controlling the pullup configuration,
  23. *
  24. * _note_ the 4 lowest bits are unused, because the first 4
  25. * ports of the controller are not used, too.
  26. */
  27. u32 input_pullup_active;
  28. };
  29. extern int __max730x_remove(struct device *dev);
  30. extern int __max730x_probe(struct max7301 *ts);
  31. #endif