Juergen Beisert | 0c36ec3 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 1 | #ifndef LINUX_SPI_MAX7301_H |
| 2 | #define LINUX_SPI_MAX7301_H |
| 3 | |
Wolfram Sang | e952805 | 2010-03-05 13:44:33 -0800 | [diff] [blame] | 4 | #include <linux/gpio.h> |
| 5 | |
| 6 | /* |
| 7 | * Some registers must be read back to modify. |
| 8 | * To save time we cache them here in memory |
| 9 | */ |
| 10 | struct max7301 { |
| 11 | struct mutex lock; |
| 12 | u8 port_config[8]; /* field 0 is unused */ |
| 13 | u32 out_level; /* cached output levels */ |
| 14 | struct gpio_chip chip; |
| 15 | struct device *dev; |
| 16 | int (*write)(struct device *dev, unsigned int reg, unsigned int val); |
| 17 | int (*read)(struct device *dev, unsigned int reg); |
| 18 | }; |
| 19 | |
Juergen Beisert | 0c36ec3 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 20 | struct max7301_platform_data { |
| 21 | /* number assigned to the first GPIO */ |
| 22 | unsigned base; |
| 23 | }; |
| 24 | |
Wolfram Sang | e952805 | 2010-03-05 13:44:33 -0800 | [diff] [blame] | 25 | extern int __max730x_remove(struct device *dev); |
| 26 | extern int __max730x_probe(struct max7301 *ts); |
Juergen Beisert | 0c36ec3 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 27 | #endif |