Skip to content

Commit 5c35ba9

Browse files
nytowlsre
authored andcommitted
power: supply: bq25890_charger: Add the BQ25895 part
The BQ25895 is almost identical to the BQ25890. Signed-off-by: Angus Ainslie (Purism) <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2042058 commit 5c35ba9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/power/supply/bq25890_charger.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define BQ25890_IRQ_PIN "bq25890_irq"
2323

2424
#define BQ25890_ID 3
25+
#define BQ25895_ID 7
2526
#define BQ25896_ID 0
2627

2728
enum bq25890_fields {
@@ -171,7 +172,7 @@ static const struct reg_field bq25890_reg_fields[] = {
171172
[F_WD] = REG_FIELD(0x07, 4, 5),
172173
[F_TMR_EN] = REG_FIELD(0x07, 3, 3),
173174
[F_CHG_TMR] = REG_FIELD(0x07, 1, 2),
174-
[F_JEITA_ISET] = REG_FIELD(0x07, 0, 0),
175+
[F_JEITA_ISET] = REG_FIELD(0x07, 0, 0), // reserved on BQ25895
175176
/* REG08 */
176177
[F_BATCMP] = REG_FIELD(0x08, 5, 7),
177178
[F_VCLAMP] = REG_FIELD(0x08, 2, 4),
@@ -180,15 +181,15 @@ static const struct reg_field bq25890_reg_fields[] = {
180181
[F_FORCE_ICO] = REG_FIELD(0x09, 7, 7),
181182
[F_TMR2X_EN] = REG_FIELD(0x09, 6, 6),
182183
[F_BATFET_DIS] = REG_FIELD(0x09, 5, 5),
183-
[F_JEITA_VSET] = REG_FIELD(0x09, 4, 4),
184+
[F_JEITA_VSET] = REG_FIELD(0x09, 4, 4), // reserved on BQ25895
184185
[F_BATFET_DLY] = REG_FIELD(0x09, 3, 3),
185186
[F_BATFET_RST_EN] = REG_FIELD(0x09, 2, 2),
186187
[F_PUMPX_UP] = REG_FIELD(0x09, 1, 1),
187188
[F_PUMPX_DN] = REG_FIELD(0x09, 0, 0),
188189
/* REG0A */
189190
[F_BOOSTV] = REG_FIELD(0x0A, 4, 7),
190191
/* PFM_OTG_DIS 3 on BQ25896 */
191-
[F_BOOSTI] = REG_FIELD(0x0A, 0, 2),
192+
[F_BOOSTI] = REG_FIELD(0x0A, 0, 2), // reserved on BQ25895
192193
/* REG0B */
193194
[F_VBUS_STAT] = REG_FIELD(0x0B, 5, 7),
194195
[F_CHG_STAT] = REG_FIELD(0x0B, 3, 4),
@@ -392,6 +393,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
392393
case POWER_SUPPLY_PROP_MODEL_NAME:
393394
if (bq->chip_id == BQ25890_ID)
394395
val->strval = "BQ25890";
396+
else if (bq->chip_id == BQ25895_ID)
397+
val->strval = "BQ25895";
395398
else if (bq->chip_id == BQ25896_ID)
396399
val->strval = "BQ25896";
397400
else
@@ -862,7 +865,8 @@ static int bq25890_probe(struct i2c_client *client,
862865
return bq->chip_id;
863866
}
864867

865-
if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25896_ID)) {
868+
if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25895_ID)
869+
&& (bq->chip_id != BQ25896_ID)) {
866870
dev_err(dev, "Chip with ID=%d, not supported!\n", bq->chip_id);
867871
return -ENODEV;
868872
}

0 commit comments

Comments
 (0)