e952805d2d
Add the MAX7300-I2C variant of the MAX7301-SPI version. Both chips share the same core logic, so the generic part of the in-kernel SPI-driver is refactored into a generic part. The I2C and SPI specific funtions are then wrapped into seperate drivers picking up the generic part. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Juergen Beisert <j.beisert@pengutronix.de> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Jean Delvare <khali@linux-fr.org> Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28 lines
675 B
C
28 lines
675 B
C
#ifndef LINUX_SPI_MAX7301_H
|
|
#define LINUX_SPI_MAX7301_H
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
/*
|
|
* Some registers must be read back to modify.
|
|
* To save time we cache them here in memory
|
|
*/
|
|
struct max7301 {
|
|
struct mutex lock;
|
|
u8 port_config[8]; /* field 0 is unused */
|
|
u32 out_level; /* cached output levels */
|
|
struct gpio_chip chip;
|
|
struct device *dev;
|
|
int (*write)(struct device *dev, unsigned int reg, unsigned int val);
|
|
int (*read)(struct device *dev, unsigned int reg);
|
|
};
|
|
|
|
struct max7301_platform_data {
|
|
/* number assigned to the first GPIO */
|
|
unsigned base;
|
|
};
|
|
|
|
extern int __max730x_remove(struct device *dev);
|
|
extern int __max730x_probe(struct max7301 *ts);
|
|
#endif
|