Skip to content

Commit f4a1802

Browse files
committed
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 <[email protected]> Fixes: 6ce4023 ("hwmon: g672: add support for g761") Signed-off-by: Guenter Roeck <[email protected]>
1 parent 4814241 commit f4a1802

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/hwmon/g762.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define DRVNAME "g762"
4545

4646
static const struct i2c_device_id g762_id[] = {
47+
{ "g761" },
4748
{ "g762" },
4849
{ "g763" },
4950
{ }
@@ -1083,15 +1084,16 @@ static int g762_probe(struct i2c_client *client)
10831084
data->client = client;
10841085
mutex_init(&data->update_lock);
10851086

1086-
/* Enable fan failure detection and fan out of control protection */
1087-
ret = g762_fan_init(dev);
1087+
/* Get configuration via DT ... */
1088+
ret = g762_of_clock_enable(client);
10881089
if (ret)
10891090
return ret;
10901091

1091-
/* Get configuration via DT ... */
1092-
ret = g762_of_clock_enable(client);
1092+
/* Enable fan failure detection and fan out of control protection */
1093+
ret = g762_fan_init(dev);
10931094
if (ret)
10941095
return ret;
1096+
10951097
ret = g762_of_prop_import(client);
10961098
if (ret)
10971099
return ret;

0 commit comments

Comments
 (0)