]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Mon, 27 Mar 2023 01:40:40 +0000 (21:40 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 27 Mar 2023 01:40:40 +0000 (21:40 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/hwmon-it87-fix-voltage-scaling-for-chips-with-10.9mv.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/hwmon-it87-fix-voltage-scaling-for-chips-with-10.9mv.patch b/queue-4.14/hwmon-it87-fix-voltage-scaling-for-chips-with-10.9mv.patch
new file mode 100644 (file)
index 0000000..27174a7
--- /dev/null
@@ -0,0 +1,47 @@
+From cb4295381808bf11af9d62944126f2c92674d994 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 18 Mar 2023 19:05:42 +1100
+Subject: hwmon (it87): Fix voltage scaling for chips with 10.9mV  ADCs
+
+From: Frank Crawford <frank@crawford.emu.id.au>
+
+[ Upstream commit 968b66ffeb7956acc72836a7797aeb7b2444ec51 ]
+
+Fix voltage scaling for chips that have 10.9mV ADCs, where scaling was
+not performed.
+
+Fixes: ead8080351c9 ("hwmon: (it87) Add support for IT8732F")
+Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
+Link: https://lore.kernel.org/r/20230318080543.1226700-2-frank@crawford.emu.id.au
+[groeck: Update subject and description to focus on bug fix]
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/it87.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
+index f8499cb95fec8..4e4e151760db2 100644
+--- a/drivers/hwmon/it87.c
++++ b/drivers/hwmon/it87.c
+@@ -495,6 +495,8 @@ static const struct it87_devices it87_devices[] = {
+ #define has_pwm_freq2(data)   ((data)->features & FEAT_PWM_FREQ2)
+ #define has_six_temp(data)    ((data)->features & FEAT_SIX_TEMP)
+ #define has_vin3_5v(data)     ((data)->features & FEAT_VIN3_5V)
++#define has_scaling(data)     ((data)->features & (FEAT_12MV_ADC | \
++                                                   FEAT_10_9MV_ADC))
+ struct it87_sio_data {
+       int sioaddr;
+@@ -3107,7 +3109,7 @@ static int it87_probe(struct platform_device *pdev)
+                        "Detected broken BIOS defaults, disabling PWM interface\n");
+       /* Starting with IT8721F, we handle scaling of internal voltages */
+-      if (has_12mv_adc(data)) {
++      if (has_scaling(data)) {
+               if (sio_data->internal & BIT(0))
+                       data->in_scaled |= BIT(3);      /* in3 is AVCC */
+               if (sio_data->internal & BIT(1))
+-- 
+2.39.2
+
index d2087f0f1b96c0482b1192cd1463d3086c11d4fd..f66dc653e35e5c52336e071da607cabd328332a1 100644 (file)
@@ -17,3 +17,4 @@ hvc-xen-prevent-concurrent-accesses-to-the-shared-ri.patch
 net-mdio-thunder-add-missing-fwnode_handle_put.patch
 bluetooth-btqcomsmd-fix-command-timeout-after-settin.patch
 bluetooth-btsdio-fix-use-after-free-bug-in-btsdio_re.patch
+hwmon-it87-fix-voltage-scaling-for-chips-with-10.9mv.patch