]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/hwmon-lm90-reduce-maximum-conversion-rate-for-g781.patch
5784e1b82b23b42be362e561db38b7edba526329
[thirdparty/kernel/stable-queue.git] / queue-4.4 / hwmon-lm90-reduce-maximum-conversion-rate-for-g781.patch
1 From 4146e8003728dde3d6060ae77d11fb6b24e0217b Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 6 Jan 2022 11:48:52 -0800
4 Subject: hwmon: (lm90) Reduce maximum conversion rate for G781
5
6 From: Guenter Roeck <linux@roeck-us.net>
7
8 [ Upstream commit a66c5ed539277b9f2363bbace0dba88b85b36c26 ]
9
10 According to its datasheet, G781 supports a maximum conversion rate value
11 of 8 (62.5 ms). However, chips labeled G781 and G780 were found to only
12 support a maximum conversion rate value of 7 (125 ms). On the other side,
13 chips labeled G781-1 and G784 were found to support a conversion rate value
14 of 8. There is no known means to distinguish G780 from G781 or G784; all
15 chips report the same manufacturer ID and chip revision.
16 Setting the conversion rate register value to 8 on chips not supporting
17 it causes unexpected behavior since the real conversion rate is set to 0
18 (16 seconds) if a value of 8 is written into the conversion rate register.
19 Limit the conversion rate register value to 7 for all G78x chips to avoid
20 the problem.
21
22 Fixes: ae544f64cc7b ("hwmon: (lm90) Add support for GMT G781")
23 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 drivers/hwmon/lm90.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29 diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
30 index 420f341272621..6f6f173aca6f2 100644
31 --- a/drivers/hwmon/lm90.c
32 +++ b/drivers/hwmon/lm90.c
33 @@ -265,7 +265,7 @@ static const struct lm90_params lm90_params[] = {
34 .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
35 | LM90_HAVE_BROKEN_ALERT,
36 .alert_alarms = 0x7c,
37 - .max_convrate = 8,
38 + .max_convrate = 7,
39 },
40 [lm86] = {
41 .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT,
42 --
43 2.34.1
44