]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2015 00:30:00 +0000 (17:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2015 00:30:00 +0000 (17:30 -0700)
added patches:
iio-add-inverse-unit-conversion-macros.patch
iio-adis16480-fix-scale-factors.patch
iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch
iio-event-remove-negative-error-code-from-iio_event_poll.patch
iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch
s390-sclp-fix-compile-error.patch
staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch

queue-3.14/iio-add-inverse-unit-conversion-macros.patch [new file with mode: 0644]
queue-3.14/iio-adis16480-fix-scale-factors.patch [new file with mode: 0644]
queue-3.14/iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch [new file with mode: 0644]
queue-3.14/iio-event-remove-negative-error-code-from-iio_event_poll.patch [new file with mode: 0644]
queue-3.14/iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch [new file with mode: 0644]
queue-3.14/s390-sclp-fix-compile-error.patch [new file with mode: 0644]
queue-3.14/series
queue-3.14/staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch [new file with mode: 0644]

diff --git a/queue-3.14/iio-add-inverse-unit-conversion-macros.patch b/queue-3.14/iio-add-inverse-unit-conversion-macros.patch
new file mode 100644 (file)
index 0000000..9ec4717
--- /dev/null
@@ -0,0 +1,70 @@
+From c689a923c867eac40ed3826c1d9328edea8b6bc7 Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Wed, 5 Aug 2015 15:38:14 +0200
+Subject: iio: Add inverse unit conversion macros
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream.
+
+Add inverse unit conversion macro to convert from standard IIO units to
+units that might be used by some devices.
+
+Those are useful in combination with scale factors that are specified as
+IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will
+contain the maximum raw value the sensor will generate and the numerator
+the value it maps to in a specific unit. Sometimes datasheets specify those
+in different units than the standard IIO units (e.g. degree/s instead of
+rad/s) and so we need to do a unit conversion.
+
+From a mathematical point of view it does not make a difference whether we
+apply the unit conversion to the numerator or the inverse unit conversion
+to the denominator since (x / y) / z = x / (y * z). But as the denominator
+is typically a larger value and we are rounding both the numerator and
+denominator to integer values using the later method gives us a better
+precision (E.g. the relative error is smaller if we round 8000.3 to 8000
+rather than rounding 8.3 to 8).
+
+This is where in inverse unit conversion macros will be used.
+
+Marked for stable as used by some upcoming fixes.
+
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/iio/iio.h |   17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+--- a/include/linux/iio/iio.h
++++ b/include/linux/iio/iio.h
+@@ -593,6 +593,15 @@ int iio_str_to_fixpoint(const char *str,
+ #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL)
+ /**
++ * IIO_RAD_TO_DEGREE() - Convert rad to degree
++ * @rad: A value in rad
++ *
++ * Returns the given value converted from rad to degree
++ */
++#define IIO_RAD_TO_DEGREE(rad) \
++      (((rad) * 18000000ULL + 314159ULL / 2) / 314159ULL)
++
++/**
+  * IIO_G_TO_M_S_2() - Convert g to meter / second**2
+  * @g: A value in g
+  *
+@@ -600,4 +609,12 @@ int iio_str_to_fixpoint(const char *str,
+  */
+ #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL)
++/**
++ * IIO_M_S_2_TO_G() - Convert meter / second**2 to g
++ * @ms2: A value in meter / second**2
++ *
++ * Returns the given value converted from meter / second**2 to g
++ */
++#define IIO_M_S_2_TO_G(ms2) (((ms2) * 100000ULL + 980665ULL / 2) / 980665ULL)
++
+ #endif /* _INDUSTRIAL_IO_H_ */
diff --git a/queue-3.14/iio-adis16480-fix-scale-factors.patch b/queue-3.14/iio-adis16480-fix-scale-factors.patch
new file mode 100644 (file)
index 0000000..d433198
--- /dev/null
@@ -0,0 +1,101 @@
+From 7abad1063deb0f77d275c61f58863ec319c58c5c Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Wed, 5 Aug 2015 15:38:15 +0200
+Subject: iio: adis16480: Fix scale factors
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit 7abad1063deb0f77d275c61f58863ec319c58c5c upstream.
+
+The different devices support by the adis16480 driver have slightly
+different scales for the gyroscope and accelerometer channels.
+
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/imu/adis16480.c |   39 +++++++++++++++++++++++++++++++++------
+ 1 file changed, 33 insertions(+), 6 deletions(-)
+
+--- a/drivers/iio/imu/adis16480.c
++++ b/drivers/iio/imu/adis16480.c
+@@ -110,6 +110,10 @@
+ struct adis16480_chip_info {
+       unsigned int num_channels;
+       const struct iio_chan_spec *channels;
++      unsigned int gyro_max_val;
++      unsigned int gyro_max_scale;
++      unsigned int accel_max_val;
++      unsigned int accel_max_scale;
+ };
+ struct adis16480 {
+@@ -533,19 +537,21 @@ static int adis16480_set_filter_freq(str
+ static int adis16480_read_raw(struct iio_dev *indio_dev,
+       const struct iio_chan_spec *chan, int *val, int *val2, long info)
+ {
++      struct adis16480 *st = iio_priv(indio_dev);
++
+       switch (info) {
+       case IIO_CHAN_INFO_RAW:
+               return adis_single_conversion(indio_dev, chan, 0, val);
+       case IIO_CHAN_INFO_SCALE:
+               switch (chan->type) {
+               case IIO_ANGL_VEL:
+-                      *val = 0;
+-                      *val2 = IIO_DEGREE_TO_RAD(20000); /* 0.02 degree/sec */
+-                      return IIO_VAL_INT_PLUS_MICRO;
++                      *val = st->chip_info->gyro_max_scale;
++                      *val2 = st->chip_info->gyro_max_val;
++                      return IIO_VAL_FRACTIONAL;
+               case IIO_ACCEL:
+-                      *val = 0;
+-                      *val2 = IIO_G_TO_M_S_2(800); /* 0.8 mg */
+-                      return IIO_VAL_INT_PLUS_MICRO;
++                      *val = st->chip_info->accel_max_scale;
++                      *val2 = st->chip_info->accel_max_val;
++                      return IIO_VAL_FRACTIONAL;
+               case IIO_MAGN:
+                       *val = 0;
+                       *val2 = 100; /* 0.0001 gauss */
+@@ -702,18 +708,39 @@ static const struct adis16480_chip_info
+       [ADIS16375] = {
+               .channels = adis16485_channels,
+               .num_channels = ARRAY_SIZE(adis16485_channels),
++              /*
++               * storing the value in rad/degree and the scale in degree
++               * gives us the result in rad and better precession than
++               * storing the scale directly in rad.
++               */
++              .gyro_max_val = IIO_RAD_TO_DEGREE(22887),
++              .gyro_max_scale = 300,
++              .accel_max_val = IIO_M_S_2_TO_G(21973),
++              .accel_max_scale = 18,
+       },
+       [ADIS16480] = {
+               .channels = adis16480_channels,
+               .num_channels = ARRAY_SIZE(adis16480_channels),
++              .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
++              .gyro_max_scale = 450,
++              .accel_max_val = IIO_M_S_2_TO_G(12500),
++              .accel_max_scale = 5,
+       },
+       [ADIS16485] = {
+               .channels = adis16485_channels,
+               .num_channels = ARRAY_SIZE(adis16485_channels),
++              .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
++              .gyro_max_scale = 450,
++              .accel_max_val = IIO_M_S_2_TO_G(20000),
++              .accel_max_scale = 5,
+       },
+       [ADIS16488] = {
+               .channels = adis16480_channels,
+               .num_channels = ARRAY_SIZE(adis16480_channels),
++              .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
++              .gyro_max_scale = 450,
++              .accel_max_val = IIO_M_S_2_TO_G(22500),
++              .accel_max_scale = 18,
+       },
+ };
diff --git a/queue-3.14/iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch b/queue-3.14/iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch
new file mode 100644 (file)
index 0000000..bada9ee
--- /dev/null
@@ -0,0 +1,33 @@
+From 06d2f6ca5a38abe92f1f3a132b331eee773868c3 Mon Sep 17 00:00:00 2001
+From: Markus Pargmann <mpa@pengutronix.de>
+Date: Wed, 29 Jul 2015 15:46:03 +0200
+Subject: iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required
+
+From: Markus Pargmann <mpa@pengutronix.de>
+
+commit 06d2f6ca5a38abe92f1f3a132b331eee773868c3 upstream.
+
+This patch adds selects for IIO_BUFFER and IIO_TRIGGERED_BUFFER. Without
+IIO_BUFFER, the driver does not compile.
+
+Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
+Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/gyro/Kconfig |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/gyro/Kconfig
++++ b/drivers/iio/gyro/Kconfig
+@@ -93,7 +93,8 @@ config IIO_ST_GYRO_SPI_3AXIS
+ config ITG3200
+       tristate "InvenSense ITG3200 Digital 3-Axis Gyroscope I2C driver"
+       depends on I2C
+-      select IIO_TRIGGERED_BUFFER if IIO_BUFFER
++      select IIO_BUFFER
++      select IIO_TRIGGERED_BUFFER
+       help
+         Say yes here to add support for the InvenSense ITG3200 digital
+         3-axis gyroscope sensor.
diff --git a/queue-3.14/iio-event-remove-negative-error-code-from-iio_event_poll.patch b/queue-3.14/iio-event-remove-negative-error-code-from-iio_event_poll.patch
new file mode 100644 (file)
index 0000000..50f231d
--- /dev/null
@@ -0,0 +1,33 @@
+From 41d903c00051d8f31c98a8136edbac67e6f8688f Mon Sep 17 00:00:00 2001
+From: Cristina Opriceana <cristina.opriceana@gmail.com>
+Date: Mon, 3 Aug 2015 13:00:47 +0300
+Subject: iio: event: Remove negative error code from iio_event_poll
+
+From: Cristina Opriceana <cristina.opriceana@gmail.com>
+
+commit 41d903c00051d8f31c98a8136edbac67e6f8688f upstream.
+
+Negative return values are not supported by iio_event_poll since
+its return type is unsigned int.
+
+Fixes: f18e7a068a0a3 ("iio: Return -ENODEV for file operations if the device has been unregistered")
+
+Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/industrialio-event.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/industrialio-event.c
++++ b/drivers/iio/industrialio-event.c
+@@ -83,7 +83,7 @@ static unsigned int iio_event_poll(struc
+       unsigned int events = 0;
+       if (!indio_dev->info)
+-              return -ENODEV;
++              return events;
+       poll_wait(filep, &ev_int->wait, wait);
diff --git a/queue-3.14/iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch b/queue-3.14/iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch
new file mode 100644 (file)
index 0000000..0143e52
--- /dev/null
@@ -0,0 +1,34 @@
+From 1bdc0293901cbea23c6dc29432e81919d4719844 Mon Sep 17 00:00:00 2001
+From: Cristina Opriceana <cristina.opriceana@gmail.com>
+Date: Mon, 3 Aug 2015 13:37:40 +0300
+Subject: iio: industrialio-buffer: Fix iio_buffer_poll return value
+
+From: Cristina Opriceana <cristina.opriceana@gmail.com>
+
+commit 1bdc0293901cbea23c6dc29432e81919d4719844 upstream.
+
+Change return value to 0 if no device is bound since
+unsigned int cannot support negative error codes.
+
+Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
+device has been unregistered")
+
+Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/industrialio-buffer.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/industrialio-buffer.c
++++ b/drivers/iio/industrialio-buffer.c
+@@ -96,7 +96,7 @@ unsigned int iio_buffer_poll(struct file
+       struct iio_buffer *rb = indio_dev->buffer;
+       if (!indio_dev->info)
+-              return -ENODEV;
++              return 0;
+       poll_wait(filp, &rb->pollq, wait);
+       if (iio_buffer_data_available(rb))
diff --git a/queue-3.14/s390-sclp-fix-compile-error.patch b/queue-3.14/s390-sclp-fix-compile-error.patch
new file mode 100644 (file)
index 0000000..92376b1
--- /dev/null
@@ -0,0 +1,35 @@
+From a313bdc5310dd807655d3ca3eb2219cd65dfe45a Mon Sep 17 00:00:00 2001
+From: Sebastian Ott <sebott@linux.vnet.ibm.com>
+Date: Thu, 25 Jun 2015 09:32:22 +0200
+Subject: s390/sclp: fix compile error
+
+From: Sebastian Ott <sebott@linux.vnet.ibm.com>
+
+commit a313bdc5310dd807655d3ca3eb2219cd65dfe45a upstream.
+
+Fix this error when compiling with CONFIG_SMP=n and
+CONFIG_DYNAMIC_DEBUG=y:
+
+drivers/s390/char/sclp_early.c: In function 'sclp_read_info_early':
+drivers/s390/char/sclp_early.c:87:19: error: 'EBUSY' undeclared (first use in this function)
+   } while (rc == -EBUSY);
+                   ^
+
+Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/s390/char/sclp_early.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/s390/char/sclp_early.c
++++ b/drivers/s390/char/sclp_early.c
+@@ -7,6 +7,7 @@
+ #define KMSG_COMPONENT "sclp_early"
+ #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
++#include <linux/errno.h>
+ #include <asm/ctl_reg.h>
+ #include <asm/sclp.h>
+ #include <asm/ipl.h>
index 14a79c37cf1f0ac6e5b75fe53f208689dc23a814..bf384e4bd253a07b68b33ff6a6546be4bef8e6b4 100644 (file)
@@ -1,2 +1,9 @@
 drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch
 drm-qxl-validate-monitors-config-modes.patch
+s390-sclp-fix-compile-error.patch
+iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch
+iio-event-remove-negative-error-code-from-iio_event_poll.patch
+iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch
+iio-add-inverse-unit-conversion-macros.patch
+iio-adis16480-fix-scale-factors.patch
+staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch
diff --git a/queue-3.14/staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch b/queue-3.14/staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch
new file mode 100644 (file)
index 0000000..d8ceb71
--- /dev/null
@@ -0,0 +1,56 @@
+From ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Tue, 11 Aug 2015 13:05:10 +0100
+Subject: staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream.
+
+The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432"
+drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x
+driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and
+adl_pci7432 drivers").  Although the new driver code agrees with the
+user manuals for the respective boards, digital outputs stopped working
+on the PCI-7230.  This has 16 digital output channels and the previous
+adl_pci7230 driver shifted the 16 bit output state left by 16 bits
+before writing to the hardware register.  The new adl_pci7x3x driver
+doesn't do that.  Fix it in `adl_pci7x3x_do_insn_bits()` by checking
+for the special case of the subdevice having only 16 channels and
+duplicating the 16 bit output state into both halves of the 32-bit
+register.  That should work both for what the board actually does and
+for what the user manual says it should do.
+
+Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver")
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/adl_pci7x3x.c |   16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
++++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
+@@ -113,8 +113,20 @@ static int adl_pci7x3x_do_insn_bits(stru
+ {
+       unsigned long reg = (unsigned long)s->private;
+-      if (comedi_dio_update_state(s, data))
+-              outl(s->state, dev->iobase + reg);
++      if (comedi_dio_update_state(s, data)) {
++              unsigned int val = s->state;
++
++              if (s->n_chan == 16) {
++                      /*
++                       * It seems the PCI-7230 needs the 16-bit DO state
++                       * to be shifted left by 16 bits before being written
++                       * to the 32-bit register.  Set the value in both
++                       * halves of the register to be sure.
++                       */
++                      val |= val << 16;
++              }
++              outl(val, dev->iobase + reg);
++      }
+       data[1] = s->state;