Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287940
b: refs/heads/master
c: 2f2da1a
h: refs/heads/master
v: v3
  • Loading branch information
Chris D Schimp authored and Guenter Roeck committed Feb 21, 2012
1 parent bb2c1e9 commit e5d671d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b63d97a36edb1aecf8c13e5f5783feff4d64c24b
refs/heads/master: 2f2da1ac0ba5b6cc6e1957c4da5ff20e67d8442b
16 changes: 9 additions & 7 deletions trunk/drivers/hwmon/max6639.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client)
struct max6639_data *data = i2c_get_clientdata(client);
struct max6639_platform_data *max6639_info =
client->dev.platform_data;
int i = 0;
int i;
int rpm_range = 1; /* default: 4000 RPM */
int err = 0;
int err;

/* Reset chip to default values, see below for GCONFIG setup */
err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
Expand All @@ -446,18 +446,20 @@ static int max6639_init_client(struct i2c_client *client)
else
data->ppr = 2;
data->ppr -= 1;
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_PPR(i),
data->ppr << 5);
if (err)
goto exit;

if (max6639_info)
rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
data->rpm_range = rpm_range;

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

/* Set Fan pulse per revolution */
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_PPR(i),
data->ppr << 6);
if (err)
goto exit;

/* Fans config PWM, RPM */
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_CONFIG1(i),
Expand Down

0 comments on commit e5d671d

Please sign in to comment.