driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function
@ 2019-11-23 23:35 Rodrigo Carvalho
  2019-11-23 23:35 ` [PATCH v5 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240 Rodrigo Carvalho
  2019-11-25  7:55 ` [PATCH v5 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function Ardelean, Alexandru
  0 siblings, 2 replies; 7+ messages in thread
From: Rodrigo Carvalho @ 2019-11-23 23:35 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Stefan Popa,
	Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler,
	Greg Kroah-Hartman, alexandru.ardelean
  Cc: devel, devicetree, linux-iio, linux-kernel, Rodrigo Carvalho, kernel-usp

According to the datasheet, this driver supports only SPI mode 3,
so we should enforce it and call spi_setup() on probe function.

Signed-off-by: Rodrigo Ribeiro Carvalho <rodrigorsdc@gmail.com>
---
V5:
  - Add this patch to the patchset

 drivers/staging/iio/accel/adis16240.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c
index 82099db4bf0c..77b6b81767b9 100644
--- a/drivers/staging/iio/accel/adis16240.c
+++ b/drivers/staging/iio/accel/adis16240.c
@@ -400,6 +400,13 @@ static int adis16240_probe(struct spi_device *spi)
 	indio_dev->num_channels = ARRAY_SIZE(adis16240_channels);
 	indio_dev->modes = INDIO_DIRECT_MODE;
 
+	spi->mode = SPI_MODE_3;
+	ret = spi_setup(spi);
+	if (ret) {
+		dev_err(&spi->dev, "spi_setup failed!\n");
+		return ret;
+	}
+
 	ret = adis_init(st, indio_dev, spi, &adis16240_data);
 	if (ret)
 		return ret;
-- 
2.24.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-06 17:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 23:35 [PATCH v5 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function Rodrigo Carvalho
2019-11-23 23:35 ` [PATCH v5 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240 Rodrigo Carvalho
2019-12-05 15:21   ` Rob Herring
2019-12-06 17:10     ` Jonathan Cameron
2019-11-25  7:55 ` [PATCH v5 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function Ardelean, Alexandru
2019-12-01 11:42   ` Jonathan Cameron
2019-12-04  7:25     ` Ardelean, Alexandru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).