aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-03-05 16:44:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:48 -0500
commite952805d2d2e706aed182723e5ab3ec0b1f91de3 (patch)
tree5b4f9bfff6798f44fdea7c891ee911af2df5357b /include/linux/spi
parent5a98c04d78c896d52baef20ffc11f6d1ba6eb786 (diff)
gpio: add driver for MAX7300 I2C GPIO extender
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>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/max7301.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h
index 6dfd83f19b4b..34af0a3477bf 100644
--- a/include/linux/spi/max7301.h
+++ b/include/linux/spi/max7301.h
@@ -1,9 +1,27 @@
1#ifndef LINUX_SPI_MAX7301_H 1#ifndef LINUX_SPI_MAX7301_H
2#define LINUX_SPI_MAX7301_H 2#define LINUX_SPI_MAX7301_H
3 3
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 */
10struct 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
4struct max7301_platform_data { 20struct max7301_platform_data {
5 /* number assigned to the first GPIO */ 21 /* number assigned to the first GPIO */
6 unsigned base; 22 unsigned base;
7}; 23};
8 24
25extern int __max730x_remove(struct device *dev);
26extern int __max730x_probe(struct max7301 *ts);
9#endif 27#endif