Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288336
b: refs/heads/master
c: 7ad6307
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck authored and Guenter Roeck committed Mar 7, 2012
1 parent 4cc94e7 commit 12b3704
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: 7cb3c44fb1f7999e4c53b6a52de6bc25da6de079
refs/heads/master: 7ad6307ad6968ce25cecf209d4822d4c722be030
10 changes: 6 additions & 4 deletions trunk/drivers/hwmon/pmbus/zl6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 };
struct zl6100_data {
int id;
ktime_t access; /* chip access time */
int delay; /* Delay between chip accesses in uS */
struct pmbus_driver_info info;
};

Expand All @@ -52,10 +53,10 @@ MODULE_PARM_DESC(delay, "Delay between chip accesses in uS");
/* Some chips need a delay between accesses */
static inline void zl6100_wait(const struct zl6100_data *data)
{
if (delay) {
if (data->delay) {
s64 delta = ktime_us_delta(ktime_get(), data->access);
if (delta < delay)
udelay(delay - delta);
if (delta < data->delay)
udelay(data->delay - delta);
}
}

Expand Down Expand Up @@ -207,8 +208,9 @@ static int zl6100_probe(struct i2c_client *client,
* can be cleared later for additional chips if tests show that it
* is not needed (in other words, better be safe than sorry).
*/
data->delay = delay;
if (data->id == zl2004 || data->id == zl6105)
delay = 0;
data->delay = 0;

/*
* Since there was a direct I2C device access above, wait before
Expand Down

0 comments on commit 12b3704

Please sign in to comment.