Commit a34d5df8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-for-4.6a' of...

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

Jonathan writes:

First round of IIO fixes for the 4.6 cycle.

Again I've ended up with two early fix sets, depending on whether they are
dependent on elements of the merge window or simply came in after I had
patches with that dependency already, vs older fixes that were just too
late for the last cycle.  This first set is for the older ones.

- max1353
  * Add a missing adc to max1363_id - the driver has supported the
    max11644-11647 for a while, but as they weren't in the id table there
    was no way of actually initializing it.
  * Fix a wrong reference voltage for the above models.  Given you couldn't
    initialize the driver for these parts without patching, no one noticed
    that the reference voltage used in computing the scaling was wrong.
 - apds9960
   * The fifo last enelement was read twice (and hence pushed out twice) due
     to a small logic bug.
parents f55532a0 655048a0
...@@ -1386,7 +1386,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = { ...@@ -1386,7 +1386,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
}, },
[max11644] = { [max11644] = {
.bits = 12, .bits = 12,
.int_vref_mv = 2048, .int_vref_mv = 4096,
.mode_list = max11644_mode_list, .mode_list = max11644_mode_list,
.num_modes = ARRAY_SIZE(max11644_mode_list), .num_modes = ARRAY_SIZE(max11644_mode_list),
.default_mode = s0to1, .default_mode = s0to1,
...@@ -1396,7 +1396,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = { ...@@ -1396,7 +1396,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
}, },
[max11645] = { [max11645] = {
.bits = 12, .bits = 12,
.int_vref_mv = 4096, .int_vref_mv = 2048,
.mode_list = max11644_mode_list, .mode_list = max11644_mode_list,
.num_modes = ARRAY_SIZE(max11644_mode_list), .num_modes = ARRAY_SIZE(max11644_mode_list),
.default_mode = s0to1, .default_mode = s0to1,
...@@ -1406,7 +1406,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = { ...@@ -1406,7 +1406,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
}, },
[max11646] = { [max11646] = {
.bits = 10, .bits = 10,
.int_vref_mv = 2048, .int_vref_mv = 4096,
.mode_list = max11644_mode_list, .mode_list = max11644_mode_list,
.num_modes = ARRAY_SIZE(max11644_mode_list), .num_modes = ARRAY_SIZE(max11644_mode_list),
.default_mode = s0to1, .default_mode = s0to1,
...@@ -1416,7 +1416,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = { ...@@ -1416,7 +1416,7 @@ static const struct max1363_chip_info max1363_chip_info_tbl[] = {
}, },
[max11647] = { [max11647] = {
.bits = 10, .bits = 10,
.int_vref_mv = 4096, .int_vref_mv = 2048,
.mode_list = max11644_mode_list, .mode_list = max11644_mode_list,
.num_modes = ARRAY_SIZE(max11644_mode_list), .num_modes = ARRAY_SIZE(max11644_mode_list),
.default_mode = s0to1, .default_mode = s0to1,
...@@ -1680,6 +1680,10 @@ static const struct i2c_device_id max1363_id[] = { ...@@ -1680,6 +1680,10 @@ static const struct i2c_device_id max1363_id[] = {
{ "max11615", max11615 }, { "max11615", max11615 },
{ "max11616", max11616 }, { "max11616", max11616 },
{ "max11617", max11617 }, { "max11617", max11617 },
{ "max11644", max11644 },
{ "max11645", max11645 },
{ "max11646", max11646 },
{ "max11647", max11647 },
{} {}
}; };
......
...@@ -769,7 +769,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data) ...@@ -769,7 +769,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
mutex_lock(&data->lock); mutex_lock(&data->lock);
data->gesture_mode_running = 1; data->gesture_mode_running = 1;
while (cnt-- || (cnt = apds9660_fifo_is_empty(data) > 0)) { while (cnt || (cnt = apds9660_fifo_is_empty(data) > 0)) {
ret = regmap_bulk_read(data->regmap, APDS9960_REG_GFIFO_BASE, ret = regmap_bulk_read(data->regmap, APDS9960_REG_GFIFO_BASE,
&data->buffer, 4); &data->buffer, 4);
...@@ -777,6 +777,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data) ...@@ -777,6 +777,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
goto err_read; goto err_read;
iio_push_to_buffers(data->indio_dev, data->buffer); iio_push_to_buffers(data->indio_dev, data->buffer);
cnt--;
} }
err_read: err_read:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment