summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2024-07-09 15:41:07 -0700
committerGuenter Roeck <linux@roeck-us.net>2024-07-09 15:45:48 -0700
commitf4a180247e06c69e7d8fac4eb14d172c3a5d43a3 (patch)
tree5452f961f1334d922b0d1973006d92ce6fad46df /drivers/hwmon
parent4814241a5817ce8140dda8f1375bf76f99e68697 (diff)
downloadlinux-stable-f4a180247e06c69e7d8fac4eb14d172c3a5d43a3.tar.gz
linux-stable-f4a180247e06c69e7d8fac4eb14d172c3a5d43a3.tar.bz2
linux-stable-f4a180247e06c69e7d8fac4eb14d172c3a5d43a3.zip
hwmon: (g762) Initialize fans after configuring clock
Adding support for G761 included adding support for an internal clock. Enabling the internal clock requires setting a bit in the FAN_CMD2 register. This is implemented in g762_fan_init(). However, g762_fan_init() is called before clock support is selected, and the flag indicating that the internal clock should be used is not yet set. Initialize the clock before initializing the fan to solve the problem. While at it, also add "g7621" to the i2c_device_id array. Cc: Christian Marangi <ansuelsmth@gmail.com> Fixes: 6ce402327a6f ("hwmon: g672: add support for g761") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/g762.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hwmon/g762.c b/drivers/hwmon/g762.c
index a00cf3245eec..4fa3aa1271da 100644
--- a/drivers/hwmon/g762.c
+++ b/drivers/hwmon/g762.c
@@ -44,6 +44,7 @@
#define DRVNAME "g762"
static const struct i2c_device_id g762_id[] = {
+ { "g761" },
{ "g762" },
{ "g763" },
{ }
@@ -1083,15 +1084,16 @@ static int g762_probe(struct i2c_client *client)
data->client = client;
mutex_init(&data->update_lock);
- /* Enable fan failure detection and fan out of control protection */
- ret = g762_fan_init(dev);
+ /* Get configuration via DT ... */
+ ret = g762_of_clock_enable(client);
if (ret)
return ret;
- /* Get configuration via DT ... */
- ret = g762_of_clock_enable(client);
+ /* Enable fan failure detection and fan out of control protection */
+ ret = g762_fan_init(dev);
if (ret)
return ret;
+
ret = g762_of_prop_import(client);
if (ret)
return ret;