max7301.h 675 B

123456789101112131415161718192021222324252627
  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. struct gpio_chip chip;
  13. struct device *dev;
  14. int (*write)(struct device *dev, unsigned int reg, unsigned int val);
  15. int (*read)(struct device *dev, unsigned int reg);
  16. };
  17. struct max7301_platform_data {
  18. /* number assigned to the first GPIO */
  19. unsigned base;
  20. };
  21. extern int __max730x_remove(struct device *dev);
  22. extern int __max730x_probe(struct max7301 *ts);
  23. #endif