Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280574
b: refs/heads/master
c: 56badac
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jan 5, 2012
1 parent 642eec1 commit 2ec3a0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 443830f6fd986b894da2ea7403163a64c0925f54
refs/heads/master: 56badacb922ac6117c8231716265301118b22b17
19 changes: 14 additions & 5 deletions trunk/drivers/hwmon/pmbus/zl6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ struct zl6100_data {

#define to_zl6100_data(x) container_of(x, struct zl6100_data, info)

#define ZL6100_MFR_CONFIG 0xd0
#define ZL6100_DEVICE_ID 0xe4

#define ZL6100_MFR_XTEMP_ENABLE (1 << 7)

#define ZL6100_WAIT_TIME 1000 /* uS */

static ushort delay = ZL6100_WAIT_TIME;
Expand Down Expand Up @@ -162,7 +165,7 @@ static int zl6100_probe(struct i2c_client *client,
const struct i2c_device_id *mid;

if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_READ_BYTE_DATA
I2C_FUNC_SMBUS_READ_WORD_DATA
| I2C_FUNC_SMBUS_READ_BLOCK_DATA))
return -ENODEV;

Expand Down Expand Up @@ -210,20 +213,26 @@ static int zl6100_probe(struct i2c_client *client,
/*
* Since there was a direct I2C device access above, wait before
* accessing the chip again.
* Set the timestamp, wait, then set it again. This should provide
* enough buffer time to be safe.
*/
data->access = ktime_get();
zl6100_wait(data);
data->access = ktime_get();

info = &data->info;

info->pages = 1;
info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP;
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;

ret = i2c_smbus_read_word_data(client, ZL6100_MFR_CONFIG);
if (ret < 0)
goto err_mem;
if (ret & ZL6100_MFR_XTEMP_ENABLE)
info->func[0] |= PMBUS_HAVE_TEMP2;

data->access = ktime_get();
zl6100_wait(data);

info->read_word_data = zl6100_read_word_data;
info->read_byte_data = zl6100_read_byte_data;
Expand Down

0 comments on commit 2ec3a0a

Please sign in to comment.