Skip to content

Commit

Permalink
hwmon: (max6639) Add option to disable !THERM assertion
Browse files Browse the repository at this point in the history
Add support to disable !THERM assertion via
maxim,disable_therm_full_speed property.

Signed-off-by: Patrick Rudolph <[email protected]>
Signed-off-by: Marcello Sylvester Bauer <[email protected]>
  • Loading branch information
sylv-io committed Dec 27, 2021
1 parent 1a28885 commit a47bd10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/hwmon/max6639.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static int max6639_init_client(struct i2c_client *client,
dev_get_platdata(&client->dev);
int i;
int rpm_range = 1; /* default: 4000 RPM */
bool disable_therm_full_speed = false;
int err;

if (!max6639_info && client->dev.of_node) {
Expand All @@ -472,6 +473,10 @@ static int max6639_init_client(struct i2c_client *client,
rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
data->rpm_range = rpm_range;

if (client->dev.of_node)
disable_therm_full_speed = of_property_read_bool(client->dev.of_node,
"maxim,disable_therm_full_speed");

for (i = 0; i < 2; i++) {

/* Set Fan pulse per revolution */
Expand Down Expand Up @@ -504,7 +509,8 @@ static int max6639_init_client(struct i2c_client *client,
*/
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_CONFIG3(i),
MAX6639_FAN_CONFIG3_THERM_FULL_SPEED | 0x03);
(disable_therm_full_speed ?
0 : MAX6639_FAN_CONFIG3_THERM_FULL_SPEED) | 0x03);
if (err)
goto exit;

Expand Down

0 comments on commit a47bd10

Please sign in to comment.