From: Greg Kroah-Hartman Date: Mon, 23 Jun 2014 20:35:23 +0000 (-0400) Subject: 3.10-stable patches X-Git-Tag: v3.4.95~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14fc06400587bd1a1baee72d229f808389b6528f;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch iio-fix-endianness-issue-in-ak8975_read_axis.patch staging-iio-tsl2x7x_core-fix-proximity-treshold.patch --- diff --git a/queue-3.10/iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch b/queue-3.10/iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch new file mode 100644 index 00000000000..9dd411cc9a9 --- /dev/null +++ b/queue-3.10/iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch @@ -0,0 +1,77 @@ +From 4f3bcd878f1d3c730fe00f619b7260c6125d49eb Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 6 Nov 2014 09:13:00 +0000 +Subject: iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name() + +From: Dan Carpenter + +commit 4f3bcd878f1d3c730fe00f619b7260c6125d49eb upstream. + +at91_adc_get_trigger_value_by_name() was returning -ENOMEM truncated to +a positive u8 and that doesn't work. I've changed it to int and +refactored it to preserve the error code. + +Signed-off-by: Dan Carpenter +Acked-by: Alexandre Belloni +Tested-by: Alexandre Belloni +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/at91_adc.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/iio/adc/at91_adc.c ++++ b/drivers/iio/adc/at91_adc.c +@@ -161,12 +161,11 @@ static int at91_adc_channel_init(struct + return idev->num_channels; + } + +-static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev, ++static int at91_adc_get_trigger_value_by_name(struct iio_dev *idev, + struct at91_adc_trigger *triggers, + const char *trigger_name) + { + struct at91_adc_state *st = iio_priv(idev); +- u8 value = 0; + int i; + + for (i = 0; i < st->trigger_number; i++) { +@@ -179,15 +178,16 @@ static u8 at91_adc_get_trigger_value_by_ + return -ENOMEM; + + if (strcmp(trigger_name, name) == 0) { +- value = triggers[i].value; + kfree(name); +- break; ++ if (triggers[i].value == 0) ++ return -EINVAL; ++ return triggers[i].value; + } + + kfree(name); + } + +- return value; ++ return -EINVAL; + } + + static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) +@@ -197,14 +197,14 @@ static int at91_adc_configure_trigger(st + struct iio_buffer *buffer = idev->buffer; + struct at91_adc_reg_desc *reg = st->registers; + u32 status = at91_adc_readl(st, reg->trigger_register); +- u8 value; ++ int value; + u8 bit; + + value = at91_adc_get_trigger_value_by_name(idev, + st->trigger_list, + idev->trig->name); +- if (value == 0) +- return -EINVAL; ++ if (value < 0) ++ return value; + + if (state) { + st->buffer = kmalloc(idev->scan_bytes, GFP_KERNEL); diff --git a/queue-3.10/iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch b/queue-3.10/iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch new file mode 100644 index 00000000000..714831d7d6c --- /dev/null +++ b/queue-3.10/iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch @@ -0,0 +1,64 @@ +From a91a73c8b39a6b8bcc53fafa5372c65387c81233 Mon Sep 17 00:00:00 2001 +From: Jonathan Cameron +Date: Sat, 24 May 2014 12:52:10 +0100 +Subject: iio:adc:max1363 incorrect resolutions for max11604, max11605, max11610 and max11611. + +From: Jonathan Cameron + +commit a91a73c8b39a6b8bcc53fafa5372c65387c81233 upstream. + +Reported-by: Erik Habbinga +Signed-off-by: Jonathan Cameron +Acked-by: Hartmut Knaack +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/max1363.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/iio/adc/max1363.c ++++ b/drivers/iio/adc/max1363.c +@@ -1214,8 +1214,8 @@ static const struct max1363_chip_info ma + .num_modes = ARRAY_SIZE(max1238_mode_list), + .default_mode = s0to11, + .info = &max1238_info, +- .channels = max1238_channels, +- .num_channels = ARRAY_SIZE(max1238_channels), ++ .channels = max1038_channels, ++ .num_channels = ARRAY_SIZE(max1038_channels), + }, + [max11605] = { + .bits = 8, +@@ -1224,8 +1224,8 @@ static const struct max1363_chip_info ma + .num_modes = ARRAY_SIZE(max1238_mode_list), + .default_mode = s0to11, + .info = &max1238_info, +- .channels = max1238_channels, +- .num_channels = ARRAY_SIZE(max1238_channels), ++ .channels = max1038_channels, ++ .num_channels = ARRAY_SIZE(max1038_channels), + }, + [max11606] = { + .bits = 10, +@@ -1274,8 +1274,8 @@ static const struct max1363_chip_info ma + .num_modes = ARRAY_SIZE(max1238_mode_list), + .default_mode = s0to11, + .info = &max1238_info, +- .channels = max1238_channels, +- .num_channels = ARRAY_SIZE(max1238_channels), ++ .channels = max1138_channels, ++ .num_channels = ARRAY_SIZE(max1138_channels), + }, + [max11611] = { + .bits = 10, +@@ -1284,8 +1284,8 @@ static const struct max1363_chip_info ma + .num_modes = ARRAY_SIZE(max1238_mode_list), + .default_mode = s0to11, + .info = &max1238_info, +- .channels = max1238_channels, +- .num_channels = ARRAY_SIZE(max1238_channels), ++ .channels = max1138_channels, ++ .num_channels = ARRAY_SIZE(max1138_channels), + }, + [max11612] = { + .bits = 12, diff --git a/queue-3.10/iio-fix-endianness-issue-in-ak8975_read_axis.patch b/queue-3.10/iio-fix-endianness-issue-in-ak8975_read_axis.patch new file mode 100644 index 00000000000..ee5a8696259 --- /dev/null +++ b/queue-3.10/iio-fix-endianness-issue-in-ak8975_read_axis.patch @@ -0,0 +1,49 @@ +From 8ba42fb7b17649c9ab5b5e79d4e90370a0b4645e Mon Sep 17 00:00:00 2001 +From: Peter Meerwald +Date: Tue, 6 May 2014 09:53:00 +0100 +Subject: iio: Fix endianness issue in ak8975_read_axis() + +From: Peter Meerwald + +commit 8ba42fb7b17649c9ab5b5e79d4e90370a0b4645e upstream. + +i2c_smbus_read_word_data() does host endian conversion already, +no need for le16_to_cpu() + +Signed-off-by: Peter Meerwald +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/magnetometer/ak8975.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +--- a/drivers/iio/magnetometer/ak8975.c ++++ b/drivers/iio/magnetometer/ak8975.c +@@ -276,8 +276,6 @@ static int ak8975_read_axis(struct iio_d + { + struct ak8975_data *data = iio_priv(indio_dev); + struct i2c_client *client = data->client; +- u16 meas_reg; +- s16 raw; + int ret; + + mutex_lock(&data->lock); +@@ -322,16 +320,11 @@ static int ak8975_read_axis(struct iio_d + dev_err(&client->dev, "Read axis data fails\n"); + goto exit; + } +- meas_reg = ret; + + mutex_unlock(&data->lock); + +- /* Endian conversion of the measured values. */ +- raw = (s16) (le16_to_cpu(meas_reg)); +- + /* Clamp to valid range. */ +- raw = clamp_t(s16, raw, -4096, 4095); +- *val = raw; ++ *val = clamp_t(s16, ret, -4096, 4095); + return IIO_VAL_INT; + + exit: diff --git a/queue-3.10/series b/queue-3.10/series index c48db727076..4eea70aac91 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -36,3 +36,7 @@ usb-cdc-acm-fix-i-o-after-failed-open.patch usb-cdc-acm-fix-runtime-pm-imbalance-at-shutdown.patch drivers-hv-balloon-ensure-pressure-reports-are-posted-regularly.patch asoc-max98090-fix-reset-at-resume-time.patch +iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch +staging-iio-tsl2x7x_core-fix-proximity-treshold.patch +iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch +iio-fix-endianness-issue-in-ak8975_read_axis.patch diff --git a/queue-3.10/staging-iio-tsl2x7x_core-fix-proximity-treshold.patch b/queue-3.10/staging-iio-tsl2x7x_core-fix-proximity-treshold.patch new file mode 100644 index 00000000000..8b3db9c44d4 --- /dev/null +++ b/queue-3.10/staging-iio-tsl2x7x_core-fix-proximity-treshold.patch @@ -0,0 +1,38 @@ +From c404618cd06dad771495fe1cf9d5a63b5664f65f Mon Sep 17 00:00:00 2001 +From: Mario Schuknecht +Date: Tue, 27 May 2014 07:19:00 +0100 +Subject: staging: iio: tsl2x7x_core: fix proximity treshold + +From: Mario Schuknecht + +commit c404618cd06dad771495fe1cf9d5a63b5664f65f upstream. + +Consider high byte of proximity min and max treshold in function +'tsl2x7x_chip_on'. So far, the high byte was not set. + +Signed-off-by: Mario Schuknecht +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/light/tsl2x7x_core.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/staging/iio/light/tsl2x7x_core.c ++++ b/drivers/staging/iio/light/tsl2x7x_core.c +@@ -672,9 +672,13 @@ static int tsl2x7x_chip_on(struct iio_de + chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] = + chip->tsl2x7x_settings.prox_pulse_count; + chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] = +- chip->tsl2x7x_settings.prox_thres_low; ++ (chip->tsl2x7x_settings.prox_thres_low) & 0xFF; ++ chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHHI] = ++ (chip->tsl2x7x_settings.prox_thres_low >> 8) & 0xFF; + chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] = +- chip->tsl2x7x_settings.prox_thres_high; ++ (chip->tsl2x7x_settings.prox_thres_high) & 0xFF; ++ chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHHI] = ++ (chip->tsl2x7x_settings.prox_thres_high >> 8) & 0xFF; + + /* and make sure we're not already on */ + if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {