diff options
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r-- | drivers/staging/iio/accel/Kconfig | 39 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16220_core.c | 17 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16240_core.c | 3 | ||||
-rw-r--r-- | drivers/staging/iio/accel/sca3000_ring.c | 2 |
4 files changed, 41 insertions, 20 deletions
diff --git a/drivers/staging/iio/accel/Kconfig b/drivers/staging/iio/accel/Kconfig index ad45dfbdf417..07b7ffa00ab5 100644 --- a/drivers/staging/iio/accel/Kconfig +++ b/drivers/staging/iio/accel/Kconfig @@ -9,53 +9,71 @@ config ADIS16201 select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16201 dual-axis + Say Y here to build support for Analog Devices adis16201 dual-axis digital inclinometer and accelerometer. + To compile this driver as a module, say M here: the module will + be called adis16201. + config ADIS16203 tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16203 Programmable + Say Y here to build support for Analog Devices adis16203 Programmable 360 Degrees Inclinometer. + To compile this driver as a module, say M here: the module will be + called adis16203. + config ADIS16204 tristate "Analog Devices ADIS16204 Programmable High-g Digital Impact Sensor and Recorder" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16204 Programmable + Say Y here to build support for Analog Devices adis16204 Programmable High-g Digital Impact Sensor and Recorder. + To compile this driver as a module, say M here: the module will be + called adis16204. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16209 dual-axis digital inclinometer + Say Y here to build support for Analog Devices adis16209 dual-axis digital inclinometer and accelerometer. + To compile this driver as a module, say M here: the module will be + called adis16209. + config ADIS16220 tristate "Analog Devices ADIS16220 Programmable Digital Vibration Sensor" depends on SPI select IIO_ADIS_LIB help - Say yes here to build support for Analog Devices adis16220 programmable + Say Y here to build support for Analog Devices adis16220 programmable digital vibration sensor. + To compile this driver as a module, say M here: the module will be + called adis16220. + config ADIS16240 tristate "Analog Devices ADIS16240 Programmable Impact Sensor and Recorder" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16240 programmable + Say Y here to build support for Analog Devices adis16240 programmable impact Sensor and recorder. + To compile this driver as a module, say M here: the module will be + called adis16240. + config LIS3L02DQ tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver" depends on SPI @@ -63,16 +81,21 @@ config LIS3L02DQ depends on !IIO_BUFFER || IIO_KFIFO_BUF depends on GPIOLIB help - Say yes here to build SPI support for the ST microelectronics + Say Y here to build SPI support for the ST microelectronics accelerometer. The driver supplies direct access via sysfs files and an event interface via a character device. + To compile this driver as a module, say M here: the module will be + called lis3l02dq. + config SCA3000 depends on IIO_BUFFER depends on SPI tristate "VTI SCA3000 series accelerometers" help - Say yes here to build support for the VTI SCA3000 series of SPI + Say Y here to build support for the VTI SCA3000 series of SPI accelerometers. These devices use a hardware ring buffer. + To compile this driver as a module, say M here: the module will be + called sca3000. endmenu diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index 6f38ca95f9bb..d478f5130a0f 100644 --- a/drivers/staging/iio/accel/adis16220_core.c +++ b/drivers/staging/iio/accel/adis16220_core.c @@ -70,7 +70,7 @@ static int adis16220_capture(struct iio_dev *indio_dev) if (ret) dev_err(&indio_dev->dev, "problem beginning capture"); - msleep(10); /* delay for capture to finish */ + usleep_range(10000, 11000); /* delay for capture to finish */ return ret; } @@ -323,15 +323,14 @@ static int adis16220_read_raw(struct iio_dev *indio_dev, sval = (s16)(sval << (16 - bits)) >> (16 - bits); *val = sval; return IIO_VAL_INT; - } else { - ret = adis_read_reg_16(&st->adis, addr->addr, &uval); - if (ret) - return ret; - bits = addr->bits; - uval &= (1 << bits) - 1; - *val = uval; - return IIO_VAL_INT; } + ret = adis_read_reg_16(&st->adis, addr->addr, &uval); + if (ret) + return ret; + bits = addr->bits; + uval &= (1 << bits) - 1; + *val = uval; + return IIO_VAL_INT; } static const struct iio_chan_spec adis16220_channels[] = { diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c index 205d6d0a2206..3f46086eab3a 100644 --- a/drivers/staging/iio/accel/adis16240_core.c +++ b/drivers/staging/iio/accel/adis16240_core.c @@ -99,9 +99,8 @@ static int adis16240_read_raw(struct iio_dev *indio_dev, *val = 4; *val2 = 880000; /* 4.88 mV */ return IIO_VAL_INT_PLUS_MICRO; - } else { - return -EINVAL; } + return -EINVAL; case IIO_TEMP: *val = 244; /* 0.244 C */ *val2 = 0; diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c index 33f0e9235be7..157827651bfa 100644 --- a/drivers/staging/iio/accel/sca3000_ring.c +++ b/drivers/staging/iio/accel/sca3000_ring.c @@ -117,7 +117,7 @@ static int sca3000_read_first_n_hw_rb(struct iio_buffer *r, goto error_ret; for (i = 0; i < num_read; i++) - *(((u16 *)rx) + i) = be16_to_cpup((u16 *)rx + i); + *(((u16 *)rx) + i) = be16_to_cpup((__be16 *)rx + i); if (copy_to_user(buf, rx, num_read)) ret = -EFAULT; |