From c06e677aed0c86480b01faa894967daa8aa3568a Mon Sep 17 00:00:00 2001 From: David Brownell Date: Tue, 17 Jul 2007 04:04:03 -0700 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/hwmon/lm70.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/hwmon/lm70.c') 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) struct lm70 *p_lm70; int status; + /* signaling is SPI_MODE_0 on a 3-wire link (shared SI/SO) */ + if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !(spi->mode & SPI_3WIRE)) + return -EINVAL; + p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL); if (!p_lm70) return -ENOMEM; -- cgit