aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-17 07:04:03 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:04 -0400
commitc06e677aed0c86480b01faa894967daa8aa3568a (patch)
tree804eaf65f578d25309d546592ada439d168d19b0 /drivers
parentdccd573bb02aa011a4a7146c02c409ac0bd722a0 (diff)
SPI: add 3wire mode flag
Add a new spi->mode bit: SPI_3WIRE, for chips where the SI and SO signals are shared (and which are thus only half duplex). Update the LM70 driver to require support for that hardware mode from the controller. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/lm70.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index 7eaae3834e15..275d392eca61 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -96,6 +96,10 @@ static int __devinit lm70_probe(struct spi_device *spi)
96 struct lm70 *p_lm70; 96 struct lm70 *p_lm70;
97 int status; 97 int status;
98 98
99 /* signaling is SPI_MODE_0 on a 3-wire link (shared SI/SO) */
100 if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !(spi->mode & SPI_3WIRE))
101 return -EINVAL;
102
99 p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL); 103 p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL);
100 if (!p_lm70) 104 if (!p_lm70)
101 return -ENOMEM; 105 return -ENOMEM;