Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115512
b: refs/heads/master
c: 47064d6
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and Jean Delvare committed Oct 17, 2008
1 parent e374d83 commit 34ce229
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 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: d2cac802feae6f0c246a9251eefc482bf5ec0f0f
refs/heads/master: 47064d645bc55863c7887a7c96cde39c9a37ee5f
9 changes: 4 additions & 5 deletions trunk/Documentation/hwmon/lm87
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ The LM87 has four pins which can serve one of two possible functions,
depending on the hardware configuration.

Some functions share pins, so not all functions are available at the same
time. Which are depends on the hardware setup. This driver assumes that
the BIOS configured the chip correctly. In that respect, it differs from
the original driver (from lm_sensors for Linux 2.4), which would force the
LM87 to an arbitrary, compile-time chosen mode, regardless of the actual
chipset wiring.
time. Which are depends on the hardware setup. This driver normally
assumes that firmware configured the chip correctly. Where this is not
the case, platform code must set the I2C client's platform_data to point
to a u8 value to be written to the channel register.

For reference, here is the list of exclusive functions:
- in0+in5 (default) or temp3
Expand Down
17 changes: 11 additions & 6 deletions trunk/drivers/hwmon/lm87.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
* http://www.national.com/pf/LM/LM87.html
*
* Some functions share pins, so not all functions are available at the same
* time. Which are depends on the hardware setup. This driver assumes that
* the BIOS configured the chip correctly. In that respect, it differs from
* the original driver (from lm_sensors for Linux 2.4), which would force the
* LM87 to an arbitrary, compile-time chosen mode, regardless of the actual
* chipset wiring.
* time. Which are depends on the hardware setup. This driver normally
* assumes that firmware configured the chip correctly. Where this is not
* the case, platform code must set the I2C client's platform_data to point
* to a u8 value to be written to the channel register.
* For reference, here is the list of exclusive functions:
* - in0+in5 (default) or temp3
* - fan1 (default) or in6
Expand Down Expand Up @@ -843,7 +842,13 @@ static void lm87_init_client(struct i2c_client *client)
{
struct lm87_data *data = i2c_get_clientdata(client);

data->channel = lm87_read_value(client, LM87_REG_CHANNEL_MODE);
if (client->dev.platform_data) {
data->channel = *(u8 *)client->dev.platform_data;
lm87_write_value(client,
LM87_REG_CHANNEL_MODE, data->channel);
} else {
data->channel = lm87_read_value(client, LM87_REG_CHANNEL_MODE);
}
data->config = lm87_read_value(client, LM87_REG_CONFIG) & 0x6F;

if (!(data->config & 0x01)) {
Expand Down

0 comments on commit 34ce229

Please sign in to comment.