From: Greg Kroah-Hartman Date: Mon, 23 Jun 2014 20:35:53 +0000 (-0400) Subject: 3.15-stable patches X-Git-Tag: v3.4.95~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a88716fb0148ea32760d1658b362e3c066b5c2b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.15-stable patches added patches: iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch iio-adc-checking-for-null-instead-of-is_err-in-probe.patch iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch iio-fix-endianness-issue-in-ak8975_read_axis.patch iio-fix-two-mpl3115-issues-in-measurement-conversion.patch iio-mxs-lradc-fix-divider.patch staging-iio-tsl2x7x_core-fix-proximity-treshold.patch --- diff --git a/queue-3.15/iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch b/queue-3.15/iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch new file mode 100644 index 00000000000..341b2c6ea1f --- /dev/null +++ b/queue-3.15/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 +@@ -322,12 +322,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++) { +@@ -340,15 +339,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) +@@ -358,14 +358,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.15/iio-adc-checking-for-null-instead-of-is_err-in-probe.patch b/queue-3.15/iio-adc-checking-for-null-instead-of-is_err-in-probe.patch new file mode 100644 index 00000000000..07b1abc27ad --- /dev/null +++ b/queue-3.15/iio-adc-checking-for-null-instead-of-is_err-in-probe.patch @@ -0,0 +1,33 @@ +From e94f62e79f7f63a68574ee5e76c19837ec12f3db Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 28 Mar 2014 08:33:00 +0000 +Subject: iio: adc: checking for NULL instead of IS_ERR() in probe + +From: Dan Carpenter + +commit e94f62e79f7f63a68574ee5e76c19837ec12f3db upstream. + +mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL. + +Fixes: 74aeac4da66f ('iio: adc: Add MEN 16z188 ADC driver') +Signed-off-by: Dan Carpenter +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/men_z188_adc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/iio/adc/men_z188_adc.c ++++ b/drivers/iio/adc/men_z188_adc.c +@@ -121,8 +121,8 @@ static int men_z188_probe(struct mcb_dev + indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); + + mem = mcb_request_mem(dev, "z188-adc"); +- if (!mem) +- return -ENOMEM; ++ if (IS_ERR(mem)) ++ return PTR_ERR(mem); + + adc->base = ioremap(mem->start, resource_size(mem)); + if (adc->base == NULL) diff --git a/queue-3.15/iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch b/queue-3.15/iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch new file mode 100644 index 00000000000..9baed9a7148 --- /dev/null +++ b/queue-3.15/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 +@@ -1252,8 +1252,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, +@@ -1262,8 +1262,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, +@@ -1312,8 +1312,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, +@@ -1322,8 +1322,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.15/iio-fix-endianness-issue-in-ak8975_read_axis.patch b/queue-3.15/iio-fix-endianness-issue-in-ak8975_read_axis.patch new file mode 100644 index 00000000000..9da51e39af5 --- /dev/null +++ b/queue-3.15/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 +@@ -352,8 +352,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); +@@ -401,16 +399,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.15/iio-fix-two-mpl3115-issues-in-measurement-conversion.patch b/queue-3.15/iio-fix-two-mpl3115-issues-in-measurement-conversion.patch new file mode 100644 index 00000000000..af8794b32cc --- /dev/null +++ b/queue-3.15/iio-fix-two-mpl3115-issues-in-measurement-conversion.patch @@ -0,0 +1,59 @@ +From d29f592929489d0a7c414396fae28119f3d280e1 Mon Sep 17 00:00:00 2001 +From: Peter Meerwald +Date: Tue, 20 May 2014 08:36:00 +0100 +Subject: iio: Fix two mpl3115 issues in measurement conversion +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Peter Meerwald + +commit d29f592929489d0a7c414396fae28119f3d280e1 upstream. + +(i) pressure is 20-bit unsigned, not signed; the buffer description +is incorrect; for raw reads, this is just cosmetic + +(ii) temperature is 12-bit signed, not 16-bit; this affects +readout of temperatures below zero as the sign bit is incorrectly +processed + +reported via private mail + +Signed-off-by: Peter Meerwald +Reported-by: Robert Deliën +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/pressure/mpl3115.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/iio/pressure/mpl3115.c ++++ b/drivers/iio/pressure/mpl3115.c +@@ -98,7 +98,7 @@ static int mpl3115_read_raw(struct iio_d + mutex_unlock(&data->lock); + if (ret < 0) + return ret; +- *val = sign_extend32(be32_to_cpu(tmp) >> 12, 23); ++ *val = be32_to_cpu(tmp) >> 12; + return IIO_VAL_INT; + case IIO_TEMP: /* in 0.0625 celsius / LSB */ + mutex_lock(&data->lock); +@@ -112,7 +112,7 @@ static int mpl3115_read_raw(struct iio_d + mutex_unlock(&data->lock); + if (ret < 0) + return ret; +- *val = sign_extend32(be32_to_cpu(tmp) >> 20, 15); ++ *val = sign_extend32(be32_to_cpu(tmp) >> 20, 11); + return IIO_VAL_INT; + default: + return -EINVAL; +@@ -185,7 +185,7 @@ static const struct iio_chan_spec mpl311 + BIT(IIO_CHAN_INFO_SCALE), + .scan_index = 0, + .scan_type = { +- .sign = 's', ++ .sign = 'u', + .realbits = 20, + .storagebits = 32, + .shift = 12, diff --git a/queue-3.15/iio-mxs-lradc-fix-divider.patch b/queue-3.15/iio-mxs-lradc-fix-divider.patch new file mode 100644 index 00000000000..f960ada1939 --- /dev/null +++ b/queue-3.15/iio-mxs-lradc-fix-divider.patch @@ -0,0 +1,58 @@ +From 19bc4981a213d0c5b0e1e8b08815c0b26f01ec54 Mon Sep 17 00:00:00 2001 +From: Robert Hodaszi +Date: Mon, 6 Oct 2014 14:41:00 +0100 +Subject: iio: mxs-lradc: fix divider + +From: Robert Hodaszi + +commit 19bc4981a213d0c5b0e1e8b08815c0b26f01ec54 upstream. + +All channels' single measurement are happening on CH 0. So enabling / disabling +the divider once is not enough, because it has impact on all channels. + +Set only a flag, then check this on each measurement, and enable / disable the +divider as required. + +Signed-off-by: Robert Hodaszi +Acked-by: Alexandre Belloni +Acked-by: Marek Vasut +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/adc/mxs-lradc.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/staging/iio/adc/mxs-lradc.c ++++ b/drivers/staging/iio/adc/mxs-lradc.c +@@ -846,6 +846,14 @@ static int mxs_lradc_read_single(struct + LRADC_CTRL1); + mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0); + ++ /* Enable / disable the divider per requirement */ ++ if (test_bit(chan, &lradc->is_divided)) ++ mxs_lradc_reg_set(lradc, 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, ++ LRADC_CTRL2); ++ else ++ mxs_lradc_reg_clear(lradc, ++ 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, LRADC_CTRL2); ++ + /* Clean the slot's previous content, then set new one. */ + mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), + LRADC_CTRL4); +@@ -961,15 +969,11 @@ static int mxs_lradc_write_raw(struct ii + if (val == scale_avail[MXS_LRADC_DIV_DISABLED].integer && + val2 == scale_avail[MXS_LRADC_DIV_DISABLED].nano) { + /* divider by two disabled */ +- writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, +- lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_CLR); + clear_bit(chan->channel, &lradc->is_divided); + ret = 0; + } else if (val == scale_avail[MXS_LRADC_DIV_ENABLED].integer && + val2 == scale_avail[MXS_LRADC_DIV_ENABLED].nano) { + /* divider by two enabled */ +- writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, +- lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_SET); + set_bit(chan->channel, &lradc->is_divided); + ret = 0; + } diff --git a/queue-3.15/series b/queue-3.15/series index 10ac6da2b4e..fb3dbae5f9c 100644 --- a/queue-3.15/series +++ b/queue-3.15/series @@ -38,3 +38,10 @@ hv-use-correct-order-when-freeing-monitor_pages.patch asoc-dapm-make-sure-to-always-update-the-dapm-graph-in-_put_volsw.patch asoc-max98090-fix-reset-at-resume-time.patch asoc-tlv320aci3x-fix-custom-snd_soc_dapm_put_volsw_aic3x-function.patch +iio-adc-max1363-incorrect-resolutions-for-max11604-max11605-max11610-and-max11611.patch +staging-iio-tsl2x7x_core-fix-proximity-treshold.patch +iio-adc-checking-for-null-instead-of-is_err-in-probe.patch +iio-mxs-lradc-fix-divider.patch +iio-adc-at91-signedness-bug-in-at91_adc_get_trigger_value_by_name.patch +iio-fix-endianness-issue-in-ak8975_read_axis.patch +iio-fix-two-mpl3115-issues-in-measurement-conversion.patch diff --git a/queue-3.15/staging-iio-tsl2x7x_core-fix-proximity-treshold.patch b/queue-3.15/staging-iio-tsl2x7x_core-fix-proximity-treshold.patch new file mode 100644 index 00000000000..e90f8f4b05e --- /dev/null +++ b/queue-3.15/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 +@@ -667,9 +667,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) {