From: Rodrigo Carvalho Date: Sat, 7 Dec 2019 04:53:38 +0000 (-0300) Subject: staging: iio: accel: adis16240: enforce SPI mode on probe function X-Git-Tag: v5.15~4624^2~128^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=969fdd86caa5be3e57d9e4b6ba4541ec5a54eae8;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c index a480409..794f063 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;