hwmon: (lm90) Unmask hardware interrupt
authorDmitry Osipenko <digetx@gmail.com>
Fri, 18 Jun 2021 21:54:54 +0000 (00:54 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 19 Jun 2021 11:09:49 +0000 (04:09 -0700)
The ALERT interrupt is enabled by default after power-on, but it could
be masked by bootloader. For example this is the case on Acer A500 tablet
device. Unmask the hardware interrupt if interrupt is provided.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c

index e7b678a..658b486 100644 (file)
@@ -1704,6 +1704,13 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
        if (data->kind == max6696)
                config &= ~0x08;
 
+       /*
+        * Interrupt is enabled by default on reset, but it may be disabled
+        * by bootloader, unmask it.
+        */
+       if (client->irq)
+               config &= ~0x80;
+
        config &= 0xBF; /* run */
        lm90_update_confreg(data, config);