Skip to content

Commit 988810e

Browse files
author
Guenter Roeck
committed
Add support for ZL2005, BMR451 (improved), and BMR462
Signed-off-by: Guenter Roeck <[email protected]>
1 parent 654ac21 commit 988810e

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

pmbus.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ static int pmbus_remove(struct i2c_client *client)
201201
static const struct i2c_device_id pmbus_id[] = {
202202
{"adp4000", 1},
203203
{"bmr450", 1},
204-
{"bmr451", 1},
205204
{"bmr453", 1},
206205
{"bmr454", 1},
207206
{"ncp4200", 1},

zl6100.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <linux/delay.h>
2929
#include "pmbus.h"
3030

31-
enum chips { zl2004, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 };
31+
enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 };
3232

3333
struct zl6100_data {
3434
int id;
@@ -65,6 +65,19 @@ static int zl6100_read_word_data(struct i2c_client *client, int page, int reg)
6565
if (page || reg >= PMBUS_VIRT_BASE)
6666
return -ENXIO;
6767

68+
if (data->id == zl2005) {
69+
/*
70+
* Limit register detection is not reliable on ZL2005.
71+
* Make sure registers are not erroneously detected.
72+
*/
73+
switch (reg) {
74+
case PMBUS_VOUT_OV_WARN_LIMIT:
75+
case PMBUS_VOUT_UV_WARN_LIMIT:
76+
case PMBUS_IOUT_OC_WARN_LIMIT:
77+
return -ENXIO;
78+
}
79+
}
80+
6881
zl6100_wait(data);
6982
ret = pmbus_read_word_data(client, page, reg);
7083
data->access = ktime_get();
@@ -122,7 +135,10 @@ static int zl6100_write_byte(struct i2c_client *client, int page, u8 value)
122135
}
123136

124137
static const struct i2c_device_id zl6100_id[] = {
138+
{"bmr451", zl2005},
139+
{"bmr462", zl2008},
125140
{"zl2004", zl2004},
141+
{"zl2005", zl2005},
126142
{"zl2006", zl2006},
127143
{"zl2008", zl2008},
128144
{"zl2105", zl2105},
@@ -178,13 +194,14 @@ static int zl6100_probe(struct i2c_client *client,
178194

179195
/*
180196
* ZL2008, ZL2105, and ZL6100 are known to require a wait time
181-
* between I2C accesses. ZL2004 and ZL6105 are known to be safe.
197+
* between I2C accesses. ZL2004, ZL2005, and ZL6105 are known to be
198+
* safe. Other chips have not yet been tested.
182199
*
183200
* Only clear the wait time for chips known to be safe. The wait time
184201
* can be cleared later for additional chips if tests show that it
185202
* is not needed (in other words, better be safe than sorry).
186203
*/
187-
if (data->id == zl2004 || data->id == zl6105)
204+
if (data->id == zl2004 || data->id == zl2005 || data->id == zl6105)
188205
delay = 0;
189206

190207
/*

0 commit comments

Comments
 (0)