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>
This commit is contained in:
Rodrigo Carvalho 2019-12-07 01:53:38 -03:00 committed by Jonathan Cameron
parent e4c5c4dfaa
commit 969fdd86ca

View File

@ -399,6 +399,13 @@ static int adis16240_probe(struct spi_device *spi)
indio_dev->num_channels = ARRAY_SIZE(adis16240_channels); indio_dev->num_channels = ARRAY_SIZE(adis16240_channels);
indio_dev->modes = INDIO_DIRECT_MODE; 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); ret = adis_init(st, indio_dev, spi, &adis16240_data);
if (ret) if (ret)
return ret; return ret;