]> git.sur5r.net Git - groeck-it87/commitdiff
Add comment explaining why smbus_disable is needed in probe
authorGuenter Roeck <linux@roeck-us.net>
Sun, 3 Dec 2017 18:28:15 +0000 (10:28 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 3 Dec 2017 18:28:15 +0000 (10:28 -0800)
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
it87.c

diff --git a/it87.c b/it87.c
index 7c1e7e41dcbaa882ec13600dda674b6a790cd569..92415e3e91a5daf3332da37901131df17fc012b6 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -3949,6 +3949,17 @@ static int it87_probe(struct platform_device *pdev)
        /* Initialize register pointers */
        it87_init_regs(pdev);
 
+       /*
+        * We need to disable SMBus before we can read any registers in
+        * the envmon address space, even if it is for chip identification
+        * purposes. If the chip has SMBus client support, it likely also has
+        * multi-page envmon registers, so we have to set the page anyway
+        * before accessing those registers. Kind of a chicken-and-egg
+        * problem.
+        * Fortunately, the chip was already identified through the SIO
+        * address space, only recent chips are affected, and this is just
+        * an additional safeguard.
+        */
        err = smbus_disable(data);
        if (err)
                return err;