]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Dec 2023 10:58:01 +0000 (10:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Dec 2023 10:58:01 +0000 (10:58 +0000)
added patches:
alsa-usb-audio-increase-delay-in-motu-m-quirk.patch
arm-dts-fix-occasional-boot-hang-for-am3-usb.patch
iio-adc-imx93-add-four-channels-for-imx93-adc.patch
iio-adc-ti_am335x_adc-fix-return-value-check-of-tiadc_request_dma.patch
iio-common-ms_sensors-ms_sensors_i2c-fix-humidity-conversion-time-table.patch
iio-imu-adis16475-add-spi_device_id-table.patch
iio-kx022a-fix-acceleration-value-scaling.patch
iio-tmag5273-fix-temperature-offset.patch
iio-triggered-buffer-prevent-possible-freeing-of-wrong-buffer.patch
usb-storage-add-quirk-for-incorrect-wp-on-kingston-dt-ultimate-3.0-g3.patch

queue-6.6/alsa-usb-audio-increase-delay-in-motu-m-quirk.patch [new file with mode: 0644]
queue-6.6/arm-dts-fix-occasional-boot-hang-for-am3-usb.patch [new file with mode: 0644]
queue-6.6/iio-adc-imx93-add-four-channels-for-imx93-adc.patch [new file with mode: 0644]
queue-6.6/iio-adc-ti_am335x_adc-fix-return-value-check-of-tiadc_request_dma.patch [new file with mode: 0644]
queue-6.6/iio-common-ms_sensors-ms_sensors_i2c-fix-humidity-conversion-time-table.patch [new file with mode: 0644]
queue-6.6/iio-imu-adis16475-add-spi_device_id-table.patch [new file with mode: 0644]
queue-6.6/iio-kx022a-fix-acceleration-value-scaling.patch [new file with mode: 0644]
queue-6.6/iio-tmag5273-fix-temperature-offset.patch [new file with mode: 0644]
queue-6.6/iio-triggered-buffer-prevent-possible-freeing-of-wrong-buffer.patch [new file with mode: 0644]
queue-6.6/series
queue-6.6/usb-storage-add-quirk-for-incorrect-wp-on-kingston-dt-ultimate-3.0-g3.patch [new file with mode: 0644]

diff --git a/queue-6.6/alsa-usb-audio-increase-delay-in-motu-m-quirk.patch b/queue-6.6/alsa-usb-audio-increase-delay-in-motu-m-quirk.patch
new file mode 100644 (file)
index 0000000..0320ae2
--- /dev/null
@@ -0,0 +1,48 @@
+From 48d6b91798a6694fdd6edb62799754b9d3fe0792 Mon Sep 17 00:00:00 2001
+From: Jeremie Knuesel <knuesel@gmail.com>
+Date: Sun, 17 Dec 2023 12:22:43 +0100
+Subject: ALSA: usb-audio: Increase delay in MOTU M quirk
+
+From: Jeremie Knuesel <knuesel@gmail.com>
+
+commit 48d6b91798a6694fdd6edb62799754b9d3fe0792 upstream.
+
+Increase the quirk delay from 2 seconds to 4 seconds. This reflects a
+change in the Windows driver in which the delay was increased to about
+3.7 seconds. The larger delay fixes an issue where the device fails to
+work unless it was powered up early during boot.
+
+Also clarify in the quirk comment that the quirk is only applied to
+older devices (USB ID 07fd:0008).
+
+Signed-off-by: Jeremie Knuesel <knuesel@gmail.com>
+Suggested-by: Alexander Tsoy <alexander@tsoy.me>
+Cc: <stable@vger.kernel.org>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=211975
+Link: https://lore.kernel.org/r/20231217112243.33409-1-knuesel@gmail.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/usb/quirks.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -1387,7 +1387,7 @@ free_buf:
+ static int snd_usb_motu_m_series_boot_quirk(struct usb_device *dev)
+ {
+-      msleep(2000);
++      msleep(4000);
+       return 0;
+ }
+@@ -1630,7 +1630,7 @@ int snd_usb_apply_boot_quirk_once(struct
+                                 unsigned int id)
+ {
+       switch (id) {
+-      case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
++      case USB_ID(0x07fd, 0x0008): /* MOTU M Series, 1st hardware version */
+               return snd_usb_motu_m_series_boot_quirk(dev);
+       }
diff --git a/queue-6.6/arm-dts-fix-occasional-boot-hang-for-am3-usb.patch b/queue-6.6/arm-dts-fix-occasional-boot-hang-for-am3-usb.patch
new file mode 100644 (file)
index 0000000..4354fd3
--- /dev/null
@@ -0,0 +1,35 @@
+From 9b6a51aab5f5f9f71d2fa16e8b4d530e1643dfcb Mon Sep 17 00:00:00 2001
+From: Tony Lindgren <tony@atomide.com>
+Date: Tue, 12 Dec 2023 15:50:35 +0200
+Subject: ARM: dts: Fix occasional boot hang for am3 usb
+
+From: Tony Lindgren <tony@atomide.com>
+
+commit 9b6a51aab5f5f9f71d2fa16e8b4d530e1643dfcb upstream.
+
+With subtle timings changes, we can now sometimes get an external abort on
+non-linefetch error booting am3 devices at sysc_reset(). This is because
+of a missing reset delay needed for the usb target module.
+
+Looks like we never enabled the delay earlier for am3, although a similar
+issue was seen earlier with a similar usb setup for dm814x as described in
+commit ebf244148092 ("ARM: OMAP2+: Use srst_udelay for USB on dm814x").
+
+Cc: stable@vger.kernel.org
+Fixes: 0782e8572ce4 ("ARM: dts: Probe am335x musb with ti-sysc")
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/boot/dts/ti/omap/am33xx.dtsi |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/boot/dts/ti/omap/am33xx.dtsi
++++ b/arch/arm/boot/dts/ti/omap/am33xx.dtsi
+@@ -359,6 +359,7 @@
+                                       <SYSC_IDLE_NO>,
+                                       <SYSC_IDLE_SMART>,
+                                       <SYSC_IDLE_SMART_WKUP>;
++                      ti,sysc-delay-us = <2>;
+                       clocks = <&l3s_clkctrl AM3_L3S_USB_OTG_HS_CLKCTRL 0>;
+                       clock-names = "fck";
+                       #address-cells = <1>;
diff --git a/queue-6.6/iio-adc-imx93-add-four-channels-for-imx93-adc.patch b/queue-6.6/iio-adc-imx93-add-four-channels-for-imx93-adc.patch
new file mode 100644 (file)
index 0000000..52d27c0
--- /dev/null
@@ -0,0 +1,42 @@
+From 2475ecdb9b6e177b133cf26e64e8d441d37bebde Mon Sep 17 00:00:00 2001
+From: Haibo Chen <haibo.chen@nxp.com>
+Date: Thu, 16 Nov 2023 15:10:26 +0800
+Subject: iio: adc: imx93: add four channels for imx93 adc
+
+From: Haibo Chen <haibo.chen@nxp.com>
+
+commit 2475ecdb9b6e177b133cf26e64e8d441d37bebde upstream.
+
+According to the spec, this ADC totally support 8 channels.
+i.MX93 contain this ADC with 4 channels connected to pins in
+the package. i.MX95 contain this ADC with 8 channels connected
+to pins in the package.
+
+Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
+Fixes: 7d02296ac8b8 ("iio: adc: add imx93 adc support")
+Link: https://lore.kernel.org/r/20231116071026.611269-1-haibo.chen@nxp.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/imx93_adc.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/iio/adc/imx93_adc.c b/drivers/iio/adc/imx93_adc.c
+index 9bb1e4ba1aee..4ccf4819f1f1 100644
+--- a/drivers/iio/adc/imx93_adc.c
++++ b/drivers/iio/adc/imx93_adc.c
+@@ -93,6 +93,10 @@ static const struct iio_chan_spec imx93_adc_iio_channels[] = {
+       IMX93_ADC_CHAN(1),
+       IMX93_ADC_CHAN(2),
+       IMX93_ADC_CHAN(3),
++      IMX93_ADC_CHAN(4),
++      IMX93_ADC_CHAN(5),
++      IMX93_ADC_CHAN(6),
++      IMX93_ADC_CHAN(7),
+ };
+ static void imx93_adc_power_down(struct imx93_adc *adc)
+-- 
+2.43.0
+
diff --git a/queue-6.6/iio-adc-ti_am335x_adc-fix-return-value-check-of-tiadc_request_dma.patch b/queue-6.6/iio-adc-ti_am335x_adc-fix-return-value-check-of-tiadc_request_dma.patch
new file mode 100644 (file)
index 0000000..effb89c
--- /dev/null
@@ -0,0 +1,40 @@
+From 60576e84c187043cef11f11d015249e71151d35a Mon Sep 17 00:00:00 2001
+From: Wadim Egorov <w.egorov@phytec.de>
+Date: Mon, 25 Sep 2023 15:44:27 +0200
+Subject: iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma()
+
+From: Wadim Egorov <w.egorov@phytec.de>
+
+commit 60576e84c187043cef11f11d015249e71151d35a upstream.
+
+Fix wrong handling of a DMA request where the probing only failed
+if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV
+value is returned. This makes DMAs explicitly optional. Even if the
+DMA request is unsuccessfully, the ADC can still work properly.
+We do also handle the defer probe case by making use of dev_err_probe().
+
+Fixes: f438b9da75eb ("drivers: iio: ti_am335x_adc: add dma support")
+Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
+Reviewed-by: Bhavya Kapoor <b-kapoor@ti.com>
+Link: https://lore.kernel.org/r/20230925134427.214556-1-w.egorov@phytec.de
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/ti_am335x_adc.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/ti_am335x_adc.c
++++ b/drivers/iio/adc/ti_am335x_adc.c
+@@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_d
+       platform_set_drvdata(pdev, indio_dev);
+       err = tiadc_request_dma(pdev, adc_dev);
+-      if (err && err == -EPROBE_DEFER)
++      if (err && err != -ENODEV) {
++              dev_err_probe(&pdev->dev, err, "DMA request failed\n");
+               goto err_dma;
++      }
+       return 0;
diff --git a/queue-6.6/iio-common-ms_sensors-ms_sensors_i2c-fix-humidity-conversion-time-table.patch b/queue-6.6/iio-common-ms_sensors-ms_sensors_i2c-fix-humidity-conversion-time-table.patch
new file mode 100644 (file)
index 0000000..0e48d2d
--- /dev/null
@@ -0,0 +1,106 @@
+From 54cf39ec16335dadbe1ba008d8e5e98dae3e26f8 Mon Sep 17 00:00:00 2001
+From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+Date: Thu, 26 Oct 2023 17:44:49 +0200
+Subject: iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table
+
+From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+
+commit 54cf39ec16335dadbe1ba008d8e5e98dae3e26f8 upstream.
+
+The HTU21 offers 4 sampling frequencies: 20, 40, 70 and 120, which are
+associated to an index that is used to select the right measurement
+resolution and its corresponding measurement time. The current
+implementation selects the measurement resolution and the temperature
+measurement time properly, but it does not select the right humidity
+measurement time in all cases.
+
+In summary, the 40 and 70 humidity measurement times are swapped.
+
+The reason for that is probably the unusual coding for the measurement
+resolution. According to the datasheet, the bits [7,0] of the "user
+register" are used as follows to select the bit resolution:
+
+--------------------------------------------------
+| Bit 7 | Bit 0 | RH | Temp | Trh (us) | Tt (us) |
+--------------------------------------------------
+|   0   |   0   | 12 |  14  |  16000   |  50000  |
+--------------------------------------------------
+|   0   |   1   | 8  |  12  |  3000    |  13000  |
+--------------------------------------------------
+|   1   |   0   | 10 |  13  |  5000    |  25000  |
+--------------------------------------------------
+|   1   |   1   | 11 |  11  |  8000    |  7000   |
+--------------------------------------------------
+*This table is available in the official datasheet, page 13/21. I have
+just appended the times provided in the humidity/temperature tables,
+pages 3/21, 5/21. Note that always a pair of resolutions is selected.
+
+The sampling frequencies [20, 40, 70, 120] are assigned to a linear
+index [0..3] which is then coded as follows [1]:
+
+Index    [7,0]
+--------------
+idx 0     0,0
+idx 1     1,0
+idx 2     0,1
+idx 3     1,1
+
+That is done that way because the temperature measurements are being
+used as the reference for the sampling frequency (the frequencies and
+the temperature measurement times are correlated), so increasing the
+index always reduces the temperature measurement time and its
+resolution. Therefore, the temperature measurement time array is as
+simple as [50000, 25000, 13000, 7000]
+
+On the other hand, the humidity resolution cannot follow the same
+pattern because of the way it is coded in the "user register", where
+both resolutions are selected at the same time. The humidity measurement
+time array is the following: [16000, 3000, 5000, 8000], which defines
+the following assignments:
+
+Index    [7,0]    Trh
+-----------------------
+idx 0     0,0     16000  -> right, [0,0] selects 12 bits (Trh = 16000)
+idx 1     1,0     3000   -> wrong! [1,0] selects 10 bits (Trh = 5000)
+idx 2     0,1     5000   -> wrong! [0,1] selects 8 bits (Trh = 3000)
+idx 3     1,1     8000   -> right, [1,1] selects 11 bits (Trh = 8000)
+
+The times have been ordered as if idx = 1 -> [0,1] and idx = 2 -> [1,0],
+which is not the case for the reason explained above.
+
+So a simple modification is required to obtain the right humidity
+measurement time array, swapping the values in the positions 1 and 2.
+
+The right table should be the following: [16000, 5000, 3000, 8000]
+
+Fix the humidity measurement time array with the right idex/value
+coding.
+
+[1] The actual code that makes this coding and assigns it to the current
+value of the "user register" is the following:
+config_reg &= 0x7E;
+config_reg |= ((i & 1) << 7) + ((i & 2) >> 1);
+
+Fixes: d574a87cc311 ("Add meas-spec sensors common part")
+Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
+Link: https://lore.kernel.org/r/20231026-topic-htu21_conversion_time-v1-1-bd257dc44209@gmail.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/common/ms_sensors/ms_sensors_i2c.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
++++ b/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
+@@ -15,8 +15,8 @@
+ /* Conversion times in us */
+ static const u16 ms_sensors_ht_t_conversion_time[] = { 50000, 25000,
+                                                      13000, 7000 };
+-static const u16 ms_sensors_ht_h_conversion_time[] = { 16000, 3000,
+-                                                     5000, 8000 };
++static const u16 ms_sensors_ht_h_conversion_time[] = { 16000, 5000,
++                                                     3000, 8000 };
+ static const u16 ms_sensors_tp_conversion_time[] = { 500, 1100, 2100,
+                                                    4100, 8220, 16440 };
diff --git a/queue-6.6/iio-imu-adis16475-add-spi_device_id-table.patch b/queue-6.6/iio-imu-adis16475-add-spi_device_id-table.patch
new file mode 100644 (file)
index 0000000..cec5002
--- /dev/null
@@ -0,0 +1,171 @@
+From ee4d79055aeea27f1b8c42233cc0c90d0a8b5355 Mon Sep 17 00:00:00 2001
+From: Nuno Sa <nuno.sa@analog.com>
+Date: Thu, 2 Nov 2023 13:52:58 +0100
+Subject: iio: imu: adis16475: add spi_device_id table
+
+From: Nuno Sa <nuno.sa@analog.com>
+
+commit ee4d79055aeea27f1b8c42233cc0c90d0a8b5355 upstream.
+
+This prevents the warning message "SPI driver has no spi_device_id for..."
+when registering the driver. More importantly, it makes sure that
+module autoloading works as spi relies on spi: modaliases and not of.
+
+While at it, move the of_device_id table to it's natural place.
+
+Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
+Signed-off-by: Nuno Sa <nuno.sa@analog.com>
+Link: https://lore.kernel.org/r/20231102125258.3284830-1-nuno.sa@analog.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/imu/adis16475.c |  117 +++++++++++++++++++++++++++-----------------
+ 1 file changed, 72 insertions(+), 45 deletions(-)
+
+--- a/drivers/iio/imu/adis16475.c
++++ b/drivers/iio/imu/adis16475.c
+@@ -1244,50 +1244,6 @@ static int adis16475_config_irq_pin(stru
+       return 0;
+ }
+-static const struct of_device_id adis16475_of_match[] = {
+-      { .compatible = "adi,adis16470",
+-              .data = &adis16475_chip_info[ADIS16470] },
+-      { .compatible = "adi,adis16475-1",
+-              .data = &adis16475_chip_info[ADIS16475_1] },
+-      { .compatible = "adi,adis16475-2",
+-              .data = &adis16475_chip_info[ADIS16475_2] },
+-      { .compatible = "adi,adis16475-3",
+-              .data = &adis16475_chip_info[ADIS16475_3] },
+-      { .compatible = "adi,adis16477-1",
+-              .data = &adis16475_chip_info[ADIS16477_1] },
+-      { .compatible = "adi,adis16477-2",
+-              .data = &adis16475_chip_info[ADIS16477_2] },
+-      { .compatible = "adi,adis16477-3",
+-              .data = &adis16475_chip_info[ADIS16477_3] },
+-      { .compatible = "adi,adis16465-1",
+-              .data = &adis16475_chip_info[ADIS16465_1] },
+-      { .compatible = "adi,adis16465-2",
+-              .data = &adis16475_chip_info[ADIS16465_2] },
+-      { .compatible = "adi,adis16465-3",
+-              .data = &adis16475_chip_info[ADIS16465_3] },
+-      { .compatible = "adi,adis16467-1",
+-              .data = &adis16475_chip_info[ADIS16467_1] },
+-      { .compatible = "adi,adis16467-2",
+-              .data = &adis16475_chip_info[ADIS16467_2] },
+-      { .compatible = "adi,adis16467-3",
+-              .data = &adis16475_chip_info[ADIS16467_3] },
+-      { .compatible = "adi,adis16500",
+-              .data = &adis16475_chip_info[ADIS16500] },
+-      { .compatible = "adi,adis16505-1",
+-              .data = &adis16475_chip_info[ADIS16505_1] },
+-      { .compatible = "adi,adis16505-2",
+-              .data = &adis16475_chip_info[ADIS16505_2] },
+-      { .compatible = "adi,adis16505-3",
+-              .data = &adis16475_chip_info[ADIS16505_3] },
+-      { .compatible = "adi,adis16507-1",
+-              .data = &adis16475_chip_info[ADIS16507_1] },
+-      { .compatible = "adi,adis16507-2",
+-              .data = &adis16475_chip_info[ADIS16507_2] },
+-      { .compatible = "adi,adis16507-3",
+-              .data = &adis16475_chip_info[ADIS16507_3] },
+-      { },
+-};
+-MODULE_DEVICE_TABLE(of, adis16475_of_match);
+ static int adis16475_probe(struct spi_device *spi)
+ {
+@@ -1301,7 +1257,7 @@ static int adis16475_probe(struct spi_de
+       st = iio_priv(indio_dev);
+-      st->info = device_get_match_data(&spi->dev);
++      st->info = spi_get_device_match_data(spi);
+       if (!st->info)
+               return -EINVAL;
+@@ -1341,12 +1297,83 @@ static int adis16475_probe(struct spi_de
+       return 0;
+ }
++static const struct of_device_id adis16475_of_match[] = {
++      { .compatible = "adi,adis16470",
++              .data = &adis16475_chip_info[ADIS16470] },
++      { .compatible = "adi,adis16475-1",
++              .data = &adis16475_chip_info[ADIS16475_1] },
++      { .compatible = "adi,adis16475-2",
++              .data = &adis16475_chip_info[ADIS16475_2] },
++      { .compatible = "adi,adis16475-3",
++              .data = &adis16475_chip_info[ADIS16475_3] },
++      { .compatible = "adi,adis16477-1",
++              .data = &adis16475_chip_info[ADIS16477_1] },
++      { .compatible = "adi,adis16477-2",
++              .data = &adis16475_chip_info[ADIS16477_2] },
++      { .compatible = "adi,adis16477-3",
++              .data = &adis16475_chip_info[ADIS16477_3] },
++      { .compatible = "adi,adis16465-1",
++              .data = &adis16475_chip_info[ADIS16465_1] },
++      { .compatible = "adi,adis16465-2",
++              .data = &adis16475_chip_info[ADIS16465_2] },
++      { .compatible = "adi,adis16465-3",
++              .data = &adis16475_chip_info[ADIS16465_3] },
++      { .compatible = "adi,adis16467-1",
++              .data = &adis16475_chip_info[ADIS16467_1] },
++      { .compatible = "adi,adis16467-2",
++              .data = &adis16475_chip_info[ADIS16467_2] },
++      { .compatible = "adi,adis16467-3",
++              .data = &adis16475_chip_info[ADIS16467_3] },
++      { .compatible = "adi,adis16500",
++              .data = &adis16475_chip_info[ADIS16500] },
++      { .compatible = "adi,adis16505-1",
++              .data = &adis16475_chip_info[ADIS16505_1] },
++      { .compatible = "adi,adis16505-2",
++              .data = &adis16475_chip_info[ADIS16505_2] },
++      { .compatible = "adi,adis16505-3",
++              .data = &adis16475_chip_info[ADIS16505_3] },
++      { .compatible = "adi,adis16507-1",
++              .data = &adis16475_chip_info[ADIS16507_1] },
++      { .compatible = "adi,adis16507-2",
++              .data = &adis16475_chip_info[ADIS16507_2] },
++      { .compatible = "adi,adis16507-3",
++              .data = &adis16475_chip_info[ADIS16507_3] },
++      { },
++};
++MODULE_DEVICE_TABLE(of, adis16475_of_match);
++
++static const struct spi_device_id adis16475_ids[] = {
++      { "adis16470", (kernel_ulong_t)&adis16475_chip_info[ADIS16470] },
++      { "adis16475-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_1] },
++      { "adis16475-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_2] },
++      { "adis16475-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_3] },
++      { "adis16477-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_1] },
++      { "adis16477-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_2] },
++      { "adis16477-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_3] },
++      { "adis16465-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_1] },
++      { "adis16465-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_2] },
++      { "adis16465-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_3] },
++      { "adis16467-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_1] },
++      { "adis16467-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_2] },
++      { "adis16467-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_3] },
++      { "adis16500", (kernel_ulong_t)&adis16475_chip_info[ADIS16500] },
++      { "adis16505-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_1] },
++      { "adis16505-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_2] },
++      { "adis16505-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_3] },
++      { "adis16507-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_1] },
++      { "adis16507-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_2] },
++      { "adis16507-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_3] },
++      { }
++};
++MODULE_DEVICE_TABLE(spi, adis16475_ids);
++
+ static struct spi_driver adis16475_driver = {
+       .driver = {
+               .name = "adis16475",
+               .of_match_table = adis16475_of_match,
+       },
+       .probe = adis16475_probe,
++      .id_table = adis16475_ids,
+ };
+ module_spi_driver(adis16475_driver);
diff --git a/queue-6.6/iio-kx022a-fix-acceleration-value-scaling.patch b/queue-6.6/iio-kx022a-fix-acceleration-value-scaling.patch
new file mode 100644 (file)
index 0000000..4c9aabc
--- /dev/null
@@ -0,0 +1,102 @@
+From 92bfa4ab1b79be95c4f52d13f5386390f0a513c2 Mon Sep 17 00:00:00 2001
+From: Matti Vaittinen <mazziesaccount@gmail.com>
+Date: Thu, 19 Oct 2023 16:23:56 +0300
+Subject: iio: kx022a: Fix acceleration value scaling
+
+From: Matti Vaittinen <mazziesaccount@gmail.com>
+
+commit 92bfa4ab1b79be95c4f52d13f5386390f0a513c2 upstream.
+
+The IIO ABI mandates acceleration values from accelerometer to be
+emitted in m/s^2. The KX022A was emitting values in micro m/s^2.
+
+Fix driver to report the correct scale values.
+
+Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
+Reported-by: Jagath Jog J <jagathjog1996@gmail.com>
+Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")
+Tested-by: Jagath Jog J <jagathjog1996@gmail.com>
+Link: https://lore.kernel.org/r/ZTEt7NqfDHPOkm8j@dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/accel/kionix-kx022a.c |   37 ++++++++++++++++++++++++++-----------
+ 1 file changed, 26 insertions(+), 11 deletions(-)
+
+--- a/drivers/iio/accel/kionix-kx022a.c
++++ b/drivers/iio/accel/kionix-kx022a.c
+@@ -273,17 +273,17 @@ static const unsigned int kx022a_odrs[]
+  *    (range / 2^bits) * g = (range / 2^bits) * 9.80665 m/s^2
+  *    => KX022A uses 16 bit (HiRes mode - assume the low 8 bits are zeroed
+  *    in low-power mode(?) )
+- *    => +/-2G  => 4 / 2^16 * 9,80665 * 10^6 (to scale to micro)
+- *    => +/-2G  - 598.550415
+- *       +/-4G  - 1197.10083
+- *       +/-8G  - 2394.20166
+- *       +/-16G - 4788.40332
++ *    => +/-2G  => 4 / 2^16 * 9,80665
++ *    => +/-2G  - 0.000598550415
++ *       +/-4G  - 0.00119710083
++ *       +/-8G  - 0.00239420166
++ *       +/-16G - 0.00478840332
+  */
+ static const int kx022a_scale_table[][2] = {
+-      { 598, 550415 },
+-      { 1197, 100830 },
+-      { 2394, 201660 },
+-      { 4788, 403320 },
++      { 0, 598550 },
++      { 0, 1197101 },
++      { 0, 2394202 },
++      { 0, 4788403 },
+ };
+ static int kx022a_read_avail(struct iio_dev *indio_dev,
+@@ -302,7 +302,7 @@ static int kx022a_read_avail(struct iio_
+               *vals = (const int *)kx022a_scale_table;
+               *length = ARRAY_SIZE(kx022a_scale_table) *
+                         ARRAY_SIZE(kx022a_scale_table[0]);
+-              *type = IIO_VAL_INT_PLUS_MICRO;
++              *type = IIO_VAL_INT_PLUS_NANO;
+               return IIO_AVAIL_LIST;
+       default:
+               return -EINVAL;
+@@ -366,6 +366,20 @@ static int kx022a_turn_on_unlock(struct
+       return ret;
+ }
++static int kx022a_write_raw_get_fmt(struct iio_dev *idev,
++                                  struct iio_chan_spec const *chan,
++                                  long mask)
++{
++      switch (mask) {
++      case IIO_CHAN_INFO_SCALE:
++              return IIO_VAL_INT_PLUS_NANO;
++      case IIO_CHAN_INFO_SAMP_FREQ:
++              return IIO_VAL_INT_PLUS_MICRO;
++      default:
++              return -EINVAL;
++      }
++}
++
+ static int kx022a_write_raw(struct iio_dev *idev,
+                           struct iio_chan_spec const *chan,
+                           int val, int val2, long mask)
+@@ -510,7 +524,7 @@ static int kx022a_read_raw(struct iio_de
+               kx022a_reg2scale(regval, val, val2);
+-              return IIO_VAL_INT_PLUS_MICRO;
++              return IIO_VAL_INT_PLUS_NANO;
+       }
+       return -EINVAL;
+@@ -712,6 +726,7 @@ static int kx022a_fifo_flush(struct iio_
+ static const struct iio_info kx022a_info = {
+       .read_raw = &kx022a_read_raw,
+       .write_raw = &kx022a_write_raw,
++      .write_raw_get_fmt = &kx022a_write_raw_get_fmt,
+       .read_avail = &kx022a_read_avail,
+       .validate_trigger       = iio_validate_own_trigger,
diff --git a/queue-6.6/iio-tmag5273-fix-temperature-offset.patch b/queue-6.6/iio-tmag5273-fix-temperature-offset.patch
new file mode 100644 (file)
index 0000000..30ca7cc
--- /dev/null
@@ -0,0 +1,52 @@
+From 3b8157ec4573e304a29b7bced627e144dbc3dfdb Mon Sep 17 00:00:00 2001
+From: Javier Carrasco <javier.carrasco@wolfvision.net>
+Date: Tue, 21 Nov 2023 06:48:39 +0100
+Subject: iio: tmag5273: fix temperature offset
+
+From: Javier Carrasco <javier.carrasco@wolfvision.net>
+
+commit 3b8157ec4573e304a29b7bced627e144dbc3dfdb upstream.
+
+The current offset has the scale already applied to it. The ABI
+documentation defines the offset parameter as "offset to be added
+to <type>[Y]_raw prior to scaling by <type>[Y]_scale in order to
+obtain value in the <type> units as specified in <type>[Y]_raw
+documentation"
+
+The right value is obtained at 0 degrees Celsius by the formula provided
+in the datasheet:
+
+T = Tsens_t0 + (Tadc_t - Tadc_t0) / Tadc_res
+
+where:
+T = 0 degrees Celsius
+Tsens_t0 (reference temperature) = 25 degrees Celsius
+Tadc_t0 (16-bit format for Tsens_t0) = 17508
+Tadc_res = 60.1 LSB/degree Celsius
+
+The resulting offset is 16005.5, which has been truncated to 16005 to
+provide an integer value with a precision loss smaller than the 1-LSB
+measurement precision.
+
+Fix the offset to apply its value prior to scaling.
+
+Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
+Link: https://lore.kernel.org/r/9879beec-05fc-4fc6-af62-d771e238954e@wolfvision.net
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/magnetometer/tmag5273.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/magnetometer/tmag5273.c
++++ b/drivers/iio/magnetometer/tmag5273.c
+@@ -356,7 +356,7 @@ static int tmag5273_read_raw(struct iio_
+       case IIO_CHAN_INFO_OFFSET:
+               switch (chan->type) {
+               case IIO_TEMP:
+-                      *val = -266314;
++                      *val = -16005;
+                       return IIO_VAL_INT;
+               default:
+                       return -EINVAL;
diff --git a/queue-6.6/iio-triggered-buffer-prevent-possible-freeing-of-wrong-buffer.patch b/queue-6.6/iio-triggered-buffer-prevent-possible-freeing-of-wrong-buffer.patch
new file mode 100644 (file)
index 0000000..a077269
--- /dev/null
@@ -0,0 +1,58 @@
+From bce61476dc82f114e24e9c2e11fb064781ec563c Mon Sep 17 00:00:00 2001
+From: David Lechner <dlechner@baylibre.com>
+Date: Tue, 31 Oct 2023 16:05:19 -0500
+Subject: iio: triggered-buffer: prevent possible freeing of wrong buffer
+
+From: David Lechner <dlechner@baylibre.com>
+
+commit bce61476dc82f114e24e9c2e11fb064781ec563c upstream.
+
+Commit ee708e6baacd ("iio: buffer: introduce support for attaching more
+IIO buffers") introduced support for multiple buffers per indio_dev but
+left indio_dev->buffer for a few legacy use cases.
+
+In the case of the triggered buffer, iio_triggered_buffer_cleanup()
+still assumes that indio_dev->buffer points to the buffer allocated by
+iio_triggered_buffer_setup_ext(). However, since
+iio_triggered_buffer_setup_ext() now calls iio_device_attach_buffer()
+to attach the buffer, indio_dev->buffer will only point to the buffer
+allocated by iio_device_attach_buffer() if it the first buffer attached.
+
+This adds a check to make sure that no other buffer has been attached
+yet to ensure that indio_dev->buffer will be assigned when
+iio_device_attach_buffer() is called.
+
+As per discussion in the review thread, we may want to deal with multiple
+triggers per device, but this is a fix for the issue in the meantime and
+any such support would be unlikely to be suitable for a backport.
+
+Fixes: ee708e6baacd ("iio: buffer: introduce support for attaching more IIO buffers")
+Signed-off-by: David Lechner <dlechner@baylibre.com>
+Acked-by: Nuno Sa <nuno.sa@analog.com>
+Link: https://lore.kernel.org/r/20231031210521.1661552-1-dlechner@baylibre.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/buffer/industrialio-triggered-buffer.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/iio/buffer/industrialio-triggered-buffer.c
++++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
+@@ -46,6 +46,16 @@ int iio_triggered_buffer_setup_ext(struc
+       struct iio_buffer *buffer;
+       int ret;
++      /*
++       * iio_triggered_buffer_cleanup() assumes that the buffer allocated here
++       * is assigned to indio_dev->buffer but this is only the case if this
++       * function is the first caller to iio_device_attach_buffer(). If
++       * indio_dev->buffer is already set then we can't proceed otherwise the
++       * cleanup function will try to free a buffer that was not allocated here.
++       */
++      if (indio_dev->buffer)
++              return -EADDRINUSE;
++
+       buffer = iio_kfifo_allocate();
+       if (!buffer) {
+               ret = -ENOMEM;
index dc7f38a3f7c97e56b107c8eb0f161e942bf83b5a..e1f00218f0ed5434ad53ae479dda021a5ab0286c 100644 (file)
@@ -86,3 +86,13 @@ iio-adc-meson-add-separate-config-for-axg-soc-family.patch
 scsi-bnx2fc-fix-skb-double-free-in-bnx2fc_rcv.patch
 scsi-ufs-qcom-return-ufs_qcom_clk_scale_-errors-in-u.patch
 scsi-ufs-core-let-the-sq_lock-protect-sq_tail_slot-a.patch
+iio-kx022a-fix-acceleration-value-scaling.patch
+iio-adc-imx93-add-four-channels-for-imx93-adc.patch
+iio-common-ms_sensors-ms_sensors_i2c-fix-humidity-conversion-time-table.patch
+iio-imu-adis16475-add-spi_device_id-table.patch
+iio-adc-ti_am335x_adc-fix-return-value-check-of-tiadc_request_dma.patch
+iio-tmag5273-fix-temperature-offset.patch
+iio-triggered-buffer-prevent-possible-freeing-of-wrong-buffer.patch
+alsa-usb-audio-increase-delay-in-motu-m-quirk.patch
+arm-dts-fix-occasional-boot-hang-for-am3-usb.patch
+usb-storage-add-quirk-for-incorrect-wp-on-kingston-dt-ultimate-3.0-g3.patch
diff --git a/queue-6.6/usb-storage-add-quirk-for-incorrect-wp-on-kingston-dt-ultimate-3.0-g3.patch b/queue-6.6/usb-storage-add-quirk-for-incorrect-wp-on-kingston-dt-ultimate-3.0-g3.patch
new file mode 100644 (file)
index 0000000..ae63070
--- /dev/null
@@ -0,0 +1,56 @@
+From 772685c14743ad565bb271041ad3c262298cd6fc Mon Sep 17 00:00:00 2001
+From: Tasos Sahanidis <tasos@tasossah.com>
+Date: Thu, 7 Dec 2023 15:44:41 +0200
+Subject: usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3
+
+From: Tasos Sahanidis <tasos@tasossah.com>
+
+commit 772685c14743ad565bb271041ad3c262298cd6fc upstream.
+
+This flash drive reports write protect during the first mode sense.
+
+In the past this was not an issue as the kernel called revalidate twice,
+thus asking the device for its write protect status twice, with write
+protect being disabled in the second mode sense.
+
+However, since commit 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to
+avoid calling revalidate twice") that is no longer the case, thus the
+device shows up read only.
+
+[490891.289495] sd 12:0:0:0: [sdl] Write Protect is on
+[490891.289497] sd 12:0:0:0: [sdl] Mode Sense: 2b 00 80 08
+
+This does not appear to be a timing issue, as enabling the usbcore quirk
+USB_QUIRK_DELAY_INIT has no effect on write protect.
+
+Fixes: 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twice")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
+Link: https://lore.kernel.org/r/20231207134441.298131-1-tasos@tasossah.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/storage/unusual_devs.h |   11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -1306,6 +1306,17 @@ UNUSUAL_DEV(  0x090c, 0x6000, 0x0100, 0x
+               US_FL_INITIAL_READ10 ),
+ /*
++ * Patch by Tasos Sahanidis <tasos@tasossah.com>
++ * This flash drive always shows up with write protect enabled
++ * during the first mode sense.
++ */
++UNUSUAL_DEV(0x0951, 0x1697, 0x0100, 0x0100,
++              "Kingston",
++              "DT Ultimate G3",
++              USB_SC_DEVICE, USB_PR_DEVICE, NULL,
++              US_FL_NO_WP_DETECT),
++
++/*
+  * This Pentax still camera is not conformant
+  * to the USB storage specification: -
+  * - It does not like the INQUIRY command. So we must handle this command