From: Greg Kroah-Hartman Date: Sun, 11 Sep 2022 05:40:21 +0000 (+0200) Subject: 5.19-stable patches X-Git-Tag: v5.19.9~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c44a906f5c058e5468debea725b652784132575;p=thirdparty%2Fkernel%2Fstable-queue.git 5.19-stable patches added patches: asoc-mchp-spdiftx-fix-clang-wbitfield-constant-conversion.patch asoc-mchp-spdiftx-remove-references-to-mchp_i2s_caps.patch hwmon-tps23861-fix-byte-order-in-resistance-register.patch --- diff --git a/queue-5.19/asoc-mchp-spdiftx-fix-clang-wbitfield-constant-conversion.patch b/queue-5.19/asoc-mchp-spdiftx-fix-clang-wbitfield-constant-conversion.patch new file mode 100644 index 00000000000..f14f3638010 --- /dev/null +++ b/queue-5.19/asoc-mchp-spdiftx-fix-clang-wbitfield-constant-conversion.patch @@ -0,0 +1,46 @@ +From 5c5c2baad2b55cc0a4b190266889959642298f79 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 9 Aug 2022 18:08:09 -0700 +Subject: ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion + +From: Nathan Chancellor + +commit 5c5c2baad2b55cc0a4b190266889959642298f79 upstream. + +A recent change in clang strengthened its -Wbitfield-constant-conversion +to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can +only be 0 or -1, not 1: + + sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion] + dev->gclk_enabled = 1; + ^ ~ + 1 error generated. + +The actual value of the field is never checked, just that it is not +zero, so there is not a real bug here. However, it is simple enough to +silence the warning by making the bitfield unsigned, which matches the +mchp-spdifrx driver. + +Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") +Link: https://github.com/ClangBuiltLinux/linux/issues/1686 +Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691 +Signed-off-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/atmel/mchp-spdiftx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/atmel/mchp-spdiftx.c ++++ b/sound/soc/atmel/mchp-spdiftx.c +@@ -196,7 +196,7 @@ struct mchp_spdiftx_dev { + struct clk *pclk; + struct clk *gclk; + unsigned int fmt; +- int gclk_enabled:1; ++ unsigned int gclk_enabled:1; + }; + + static inline int mchp_spdiftx_is_running(struct mchp_spdiftx_dev *dev) diff --git a/queue-5.19/asoc-mchp-spdiftx-remove-references-to-mchp_i2s_caps.patch b/queue-5.19/asoc-mchp-spdiftx-remove-references-to-mchp_i2s_caps.patch new file mode 100644 index 00000000000..d1a2977271b --- /dev/null +++ b/queue-5.19/asoc-mchp-spdiftx-remove-references-to-mchp_i2s_caps.patch @@ -0,0 +1,51 @@ +From 403fcb5118a0f4091001a537e76923031fb45eaf Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Wed, 27 Jul 2022 12:08:14 +0300 +Subject: ASoC: mchp-spdiftx: remove references to mchp_i2s_caps + +From: Claudiu Beznea + +commit 403fcb5118a0f4091001a537e76923031fb45eaf upstream. + +Remove references to struct mchp_i2s_caps as they are not used. + +Signed-off-by: Claudiu Beznea +Link: https://lore.kernel.org/r/20220727090814.2446111-3-claudiu.beznea@microchip.com +Signed-off-by: Mark Brown +Cc: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/atmel/mchp-spdiftx.c | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/sound/soc/atmel/mchp-spdiftx.c ++++ b/sound/soc/atmel/mchp-spdiftx.c +@@ -196,7 +196,6 @@ struct mchp_spdiftx_dev { + struct clk *pclk; + struct clk *gclk; + unsigned int fmt; +- const struct mchp_i2s_caps *caps; + int gclk_enabled:1; + }; + +@@ -766,8 +765,6 @@ static const struct of_device_id mchp_sp + MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids); + static int mchp_spdiftx_probe(struct platform_device *pdev) + { +- struct device_node *np = pdev->dev.of_node; +- const struct of_device_id *match; + struct mchp_spdiftx_dev *dev; + struct resource *mem; + struct regmap *regmap; +@@ -781,11 +778,6 @@ static int mchp_spdiftx_probe(struct pla + if (!dev) + return -ENOMEM; + +- /* Get hardware capabilities. */ +- match = of_match_node(mchp_spdiftx_dt_ids, np); +- if (match) +- dev->caps = match->data; +- + /* Map I/O registers. */ + base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(base)) diff --git a/queue-5.19/hwmon-tps23861-fix-byte-order-in-resistance-register.patch b/queue-5.19/hwmon-tps23861-fix-byte-order-in-resistance-register.patch new file mode 100644 index 00000000000..fe997e22dd6 --- /dev/null +++ b/queue-5.19/hwmon-tps23861-fix-byte-order-in-resistance-register.patch @@ -0,0 +1,53 @@ +From 1f05f65bddd6958d25b133f886da49c1d4bff3fa Mon Sep 17 00:00:00 2001 +From: Alexandru Gagniuc +Date: Mon, 5 Sep 2022 09:28:04 -0500 +Subject: hwmon: (tps23861) fix byte order in resistance register + +From: Alexandru Gagniuc + +commit 1f05f65bddd6958d25b133f886da49c1d4bff3fa upstream. + +The tps23861 registers are little-endian, and regmap_read_bulk() does +not do byte order conversion. On BE machines, the bytes were swapped, +and the interpretation of the resistance value was incorrect. + +To make it work on both big and little-endian machines, use +le16_to_cpu() to convert the resitance register to host byte order. + +Signed-off-by: Alexandru Gagniuc +Fixes: fff7b8ab22554 ("hwmon: add Texas Instruments TPS23861 driver") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220905142806.110598-1-mr.nuke.me@gmail.com +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hwmon/tps23861.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/hwmon/tps23861.c ++++ b/drivers/hwmon/tps23861.c +@@ -489,18 +489,20 @@ static char *tps23861_port_poe_plus_stat + + static int tps23861_port_resistance(struct tps23861_data *data, int port) + { +- u16 regval; ++ unsigned int raw_val; ++ __le16 regval; + + regmap_bulk_read(data->regmap, + PORT_1_RESISTANCE_LSB + PORT_N_RESISTANCE_LSB_OFFSET * (port - 1), + ®val, + 2); + +- switch (FIELD_GET(PORT_RESISTANCE_RSN_MASK, regval)) { ++ raw_val = le16_to_cpu(regval); ++ switch (FIELD_GET(PORT_RESISTANCE_RSN_MASK, raw_val)) { + case PORT_RESISTANCE_RSN_OTHER: +- return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB) / 10000; ++ return (FIELD_GET(PORT_RESISTANCE_MASK, raw_val) * RESISTANCE_LSB) / 10000; + case PORT_RESISTANCE_RSN_LOW: +- return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB_LOW) / 10000; ++ return (FIELD_GET(PORT_RESISTANCE_MASK, raw_val) * RESISTANCE_LSB_LOW) / 10000; + case PORT_RESISTANCE_RSN_SHORT: + case PORT_RESISTANCE_RSN_OPEN: + default: diff --git a/queue-5.19/series b/queue-5.19/series index 5764164a62f..27aa9e57111 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -153,3 +153,6 @@ libperf-evlist-fix-per-thread-mmaps-for-multi-thread.patch perf-dlfilter-dlfilter-show-cycles-fix-types-for-pri.patch perf-script-fix-cannot-print-iregs-field-for-hybrid-.patch perf-record-fix-synthesis-failure-warnings.patch +hwmon-tps23861-fix-byte-order-in-resistance-register.patch +asoc-mchp-spdiftx-remove-references-to-mchp_i2s_caps.patch +asoc-mchp-spdiftx-fix-clang-wbitfield-constant-conversion.patch