summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/accel
diff options
context:
space:
mode:
authorRodrigo Carvalho <rodrigorsdc@gmail.com>2019-12-07 01:53:38 -0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-12-15 12:18:49 +0000
commit969fdd86caa5be3e57d9e4b6ba4541ec5a54eae8 (patch)
tree1804577dac7c982510478797dc62f4d0aa353d2d /drivers/staging/iio/accel
parente4c5c4dfaa88e49f33e8c11b52c65c630c0b12a7 (diff)
downloadlinux-969fdd86caa5be3e57d9e4b6ba4541ec5a54eae8.tar.gz
linux-969fdd86caa5be3e57d9e4b6ba4541ec5a54eae8.tar.bz2
linux-969fdd86caa5be3e57d9e4b6ba4541ec5a54eae8.zip
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 on probe function. Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r--drivers/staging/iio/accel/adis16240.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c
index a480409090c0..794f063e6c86 100644
--- a/drivers/staging/iio/accel/adis16240.c
+++ b/drivers/staging/iio/accel/adis16240.c
@@ -399,6 +399,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;