diff options
Diffstat (limited to 'drivers/hwmon/pmbus/zl6100.c')
-rw-r--r-- | drivers/hwmon/pmbus/zl6100.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c index 48c7b4a716ae..e3e8420b7b81 100644 --- a/drivers/hwmon/pmbus/zl6100.c +++ b/drivers/hwmon/pmbus/zl6100.c | |||
@@ -33,6 +33,7 @@ enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 }; | |||
33 | struct zl6100_data { | 33 | struct zl6100_data { |
34 | int id; | 34 | int id; |
35 | ktime_t access; /* chip access time */ | 35 | ktime_t access; /* chip access time */ |
36 | int delay; /* Delay between chip accesses in uS */ | ||
36 | struct pmbus_driver_info info; | 37 | struct pmbus_driver_info info; |
37 | }; | 38 | }; |
38 | 39 | ||
@@ -52,10 +53,10 @@ MODULE_PARM_DESC(delay, "Delay between chip accesses in uS"); | |||
52 | /* Some chips need a delay between accesses */ | 53 | /* Some chips need a delay between accesses */ |
53 | static inline void zl6100_wait(const struct zl6100_data *data) | 54 | static inline void zl6100_wait(const struct zl6100_data *data) |
54 | { | 55 | { |
55 | if (delay) { | 56 | if (data->delay) { |
56 | s64 delta = ktime_us_delta(ktime_get(), data->access); | 57 | s64 delta = ktime_us_delta(ktime_get(), data->access); |
57 | if (delta < delay) | 58 | if (delta < data->delay) |
58 | udelay(delay - delta); | 59 | udelay(data->delay - delta); |
59 | } | 60 | } |
60 | } | 61 | } |
61 | 62 | ||
@@ -199,16 +200,11 @@ static int zl6100_probe(struct i2c_client *client, | |||
199 | data->id = mid->driver_data; | 200 | data->id = mid->driver_data; |
200 | 201 | ||
201 | /* | 202 | /* |
202 | * ZL2005, ZL2008, ZL2105, and ZL6100 are known to require a wait time | 203 | * According to information from the chip vendor, all currently |
203 | * between I2C accesses. ZL2004 and ZL6105 are known to be safe. | 204 | * supported chips are known to require a wait time between I2C |
204 | * Other chips have not yet been tested. | 205 | * accesses. |
205 | * | ||
206 | * Only clear the wait time for chips known to be safe. The wait time | ||
207 | * can be cleared later for additional chips if tests show that it | ||
208 | * is not needed (in other words, better be safe than sorry). | ||
209 | */ | 206 | */ |
210 | if (data->id == zl2004 || data->id == zl6105) | 207 | data->delay = delay; |
211 | delay = 0; | ||
212 | 208 | ||
213 | /* | 209 | /* |
214 | * Since there was a direct I2C device access above, wait before | 210 | * Since there was a direct I2C device access above, wait before |