1
0
Fork 0

Second set of IIO fixes for the 4.6 cycle.

This lot are either dependent on patches from the merge window or just came
 in recently enough that they ended up in this tree.
 
 * core
   - The watermark for the buffers was given a value that meant that it was
     impossible to actually set the watermark to anything sensible.
 * at91_adc
   - Fix a build config dependency on HAS_IOMEM
 * bmc150
   - Fix wrong output on big endian systems
 * bmg160
   - Fix wrong output on big endian systems
   - Fix an issue in which the regmap return value was stored to the buffer
     rather than the value actually being read in a bulk read.
 * inv_mpu6050
   - Fix an indirect build config dependency on HAS_IOMEM
 * max30100
   - Fix an error in fifo check condition that leads to a double read of the
     final reading.
 * st_magn
   - Make sure ST_MAGN_TRIGGER_SET_STATE is always defined to avoid a build
     error for relatively obscure config combinations.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIbBAABCAAGBQJXAX2ZAAoJEFSFNJnE9BaIY1wP+I8fTMfiFIL3O3UJ/zLTCUs6
 KthkcFGEmzem6MgRdl6La1iVoES0tWYyLpceyD/kMekKYAkVju7HRuFaNJLvl1lf
 WlX7yBqy3Q/WVnuqlJpGBPgOcVx6BeCz0KlP5hLjcv3vJbf2Q7Y+TfRSLSk80fkk
 /VK06ObwhG3DkUe8YKDVmZ4Qyl1JZ6tjcB8DZYiLxoq4YigWzZcfYVQWEivn9knv
 E0rixfjSThHN5NNNOWSTGQaQKrbRQK2GkU0KVoG8BXBwjgkyqyK/LOquBCFOxmQ/
 Ma6ck4yDaSzZjPVaUqA4CGqjPqc+xYr17XcEmajIL1532yQEgDMTH+v7CcYZ1g09
 LlKs8dvdwkDnnJ2cE+tpu3HGTWapVFIAP1An2Or3NyIFmZXRaSItnXwUvJkzPhMS
 hjRfVtiokl5Uy+1sJKYzGPrfjHKzinXqxkiwYUouSYUu/ARujaDoCWOCiDYcoF7i
 SnTvPMmdnXyDJf671s7Dzc1G+u3CZyLvMBer6OU84LNQ5+uDqoineGvAg8K3mmQ/
 qYx8c/lgr05BSvZUuZajL3npe8Id5pii8ed+fStOJK6eXhDXY8o8nnLSNpjhNrQQ
 Hmmk4Lp0E+9S5ls8iF7ybaJTzD98X4v6XGMvdfNKmjojRRvm3dwVCrimUtjKL1dH
 NCfFGJ+fDogtMRTlLrs=
 =j/qV
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.6b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

Second set of IIO fixes for the 4.6 cycle.

This lot are either dependent on patches from the merge window or just came
in recently enough that they ended up in this tree.

* core
  - The watermark for the buffers was given a value that meant that it was
    impossible to actually set the watermark to anything sensible.
* at91_adc
  - Fix a build config dependency on HAS_IOMEM
* bmc150
  - Fix wrong output on big endian systems
* bmg160
  - Fix wrong output on big endian systems
  - Fix an issue in which the regmap return value was stored to the buffer
    rather than the value actually being read in a bulk read.
* inv_mpu6050
  - Fix an indirect build config dependency on HAS_IOMEM
* max30100
  - Fix an error in fifo check condition that leads to a double read of the
    final reading.
* st_magn
  - Make sure ST_MAGN_TRIGGER_SET_STATE is always defined to avoid a build
    error for relatively obscure config combinations.
hifive-unleashed-5.1
Greg Kroah-Hartman 2016-04-04 13:45:10 -07:00
commit 5a269ca9a6
7 changed files with 15 additions and 10 deletions

View File

@ -547,7 +547,7 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data,
{
int ret;
int axis = chan->scan_index;
unsigned int raw_val;
__le16 raw_val;
mutex_lock(&data->mutex);
ret = bmc150_accel_set_power_state(data, true);
@ -557,14 +557,14 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data,
}
ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_AXIS_TO_REG(axis),
&raw_val, 2);
&raw_val, sizeof(raw_val));
if (ret < 0) {
dev_err(data->dev, "Error reading axis %d\n", axis);
bmc150_accel_set_power_state(data, false);
mutex_unlock(&data->mutex);
return ret;
}
*val = sign_extend32(raw_val >> chan->scan_type.shift,
*val = sign_extend32(le16_to_cpu(raw_val) >> chan->scan_type.shift,
chan->scan_type.realbits - 1);
ret = bmc150_accel_set_power_state(data, false);
mutex_unlock(&data->mutex);
@ -988,6 +988,7 @@ static const struct iio_event_spec bmc150_accel_event = {
.realbits = (bits), \
.storagebits = 16, \
.shift = 16 - (bits), \
.endianness = IIO_LE, \
}, \
.event_spec = &bmc150_accel_event, \
.num_event_specs = 1 \

View File

@ -134,6 +134,7 @@ config AT91_ADC
config AT91_SAMA5D2_ADC
tristate "Atmel AT91 SAMA5D2 ADC"
depends on ARCH_AT91 || COMPILE_TEST
depends on HAS_IOMEM
help
Say yes here to build support for Atmel SAMA5D2 ADC which is
available on SAMA5D2 SoC family.

View File

@ -452,7 +452,7 @@ static int bmg160_get_temp(struct bmg160_data *data, int *val)
static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val)
{
int ret;
unsigned int raw_val;
__le16 raw_val;
mutex_lock(&data->mutex);
ret = bmg160_set_power_state(data, true);
@ -462,7 +462,7 @@ static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val)
}
ret = regmap_bulk_read(data->regmap, BMG160_AXIS_TO_REG(axis), &raw_val,
2);
sizeof(raw_val));
if (ret < 0) {
dev_err(data->dev, "Error reading axis %d\n", axis);
bmg160_set_power_state(data, false);
@ -470,7 +470,7 @@ static int bmg160_get_axis(struct bmg160_data *data, int axis, int *val)
return ret;
}
*val = sign_extend32(raw_val, 15);
*val = sign_extend32(le16_to_cpu(raw_val), 15);
ret = bmg160_set_power_state(data, false);
mutex_unlock(&data->mutex);
if (ret < 0)
@ -733,6 +733,7 @@ static const struct iio_event_spec bmg160_event = {
.sign = 's', \
.realbits = 16, \
.storagebits = 16, \
.endianness = IIO_LE, \
}, \
.event_spec = &bmg160_event, \
.num_event_specs = 1 \
@ -780,7 +781,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
mutex_unlock(&data->mutex);
goto err;
}
data->buffer[i++] = ret;
data->buffer[i++] = val;
}
mutex_unlock(&data->mutex);

View File

@ -238,12 +238,13 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)
mutex_lock(&data->lock);
while (cnt-- || (cnt = max30100_fifo_count(data) > 0)) {
while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
ret = max30100_read_measurement(data);
if (ret)
break;
iio_push_to_buffers(data->indio_dev, data->buffer);
cnt--;
}
mutex_unlock(&data->lock);

View File

@ -9,9 +9,8 @@ config INV_MPU6050_IIO
config INV_MPU6050_I2C
tristate "Invensense MPU6050 devices (I2C)"
depends on I2C
depends on I2C_MUX
select INV_MPU6050_IIO
select I2C_MUX
select REGMAP_I2C
help
This driver supports the Invensense MPU6050 devices.

View File

@ -653,6 +653,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
unsigned int modes;
memset(config, 0, sizeof(*config));
config->watermark = ~0;
/*
* If there is just one buffer and we are removing it there is nothing

View File

@ -44,6 +44,7 @@ static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
{
}
#define ST_MAGN_TRIGGER_SET_STATE NULL
#endif /* CONFIG_IIO_BUFFER */
#endif /* ST_MAGN_H */