[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191123233510.4890-1-rodrigorsdc@gmail.com>
Date: Sat, 23 Nov 2019 20:35:09 -0300
From: Rodrigo Carvalho <rodrigorsdc@...il.com>
To: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Stefan Popa <stefan.popa@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
alexandru.ardelean@...log.com
Cc: linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
kernel-usp@...glegroups.com,
Rodrigo Carvalho <rodrigorsdc@...il.com>
Subject: [PATCH v5 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function
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@...il.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
Powered by blists - more mailing lists