Skip to content

Commit 3c7c176

Browse files
jwrdegoedesre
authored andcommitted
power: supply: bq24190: Add BQ24297 support
The BQ24297 is identical to the BQ24296 except that it uses USB D+ / D- data-lines for charger-type (max. input-current) detection instead of a PSEL input pin. This is the same difference as between the already supported BQ24190 (D+ / D-) and the BQ24192 (PSEL). Note just like with the BQ24190 vs BQ24192 there is no difference how the charger-IC works at the register-level. The only difference is in the external hardware interface. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent da4ac0b commit 3c7c176

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/power/supply/bq24190_charger.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
#define BQ24296_REG_VPRS_PN_MASK (BIT(7) | BIT(6) | BIT(5))
153153
#define BQ24296_REG_VPRS_PN_SHIFT 5
154154
#define BQ24296_REG_VPRS_PN_24296 0x1
155+
#define BQ24296_REG_VPRS_PN_24297 0x3
155156
#define BQ24190_REG_VPRS_TS_PROFILE_MASK BIT(2)
156157
#define BQ24190_REG_VPRS_TS_PROFILE_SHIFT 2
157158
#define BQ24190_REG_VPRS_DEV_REG_MASK (BIT(1) | BIT(0))
@@ -208,6 +209,7 @@ enum bq24190_chip {
208209
BQ24192i,
209210
BQ24196,
210211
BQ24296,
212+
BQ24297,
211213
};
212214

213215
/*
@@ -1898,6 +1900,7 @@ static int bq24296_check_chip(struct bq24190_dev_info *bdi)
18981900

18991901
switch (v) {
19001902
case BQ24296_REG_VPRS_PN_24296:
1903+
case BQ24296_REG_VPRS_PN_24297:
19011904
break;
19021905
default:
19031906
dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
@@ -2027,6 +2030,17 @@ static const struct bq24190_chip_info bq24190_chip_info_tbl[] = {
20272030
.ichg_array_size = BQ24296_CCC_ICHG_VALUES_LEN,
20282031
#ifdef CONFIG_REGULATOR
20292032
.vbus_desc = &bq24296_vbus_desc,
2033+
#endif
2034+
.check_chip = bq24296_check_chip,
2035+
.set_chg_config = bq24296_battery_set_chg_config,
2036+
.ntc_fault_mask = BQ24296_REG_F_NTC_FAULT_MASK,
2037+
.get_ntc_status = bq24296_charger_get_ntc_status,
2038+
.set_otg_vbus = bq24296_set_otg_vbus,
2039+
},
2040+
[BQ24297] = {
2041+
.ichg_array_size = BQ24296_CCC_ICHG_VALUES_LEN,
2042+
#ifdef CONFIG_REGULATOR
2043+
.vbus_desc = &bq24296_vbus_desc,
20302044
#endif
20312045
.check_chip = bq24296_check_chip,
20322046
.set_chg_config = bq24296_battery_set_chg_config,
@@ -2290,6 +2304,7 @@ static const struct i2c_device_id bq24190_i2c_ids[] = {
22902304
{ "bq24192i", (kernel_ulong_t)&bq24190_chip_info_tbl[BQ24192i] },
22912305
{ "bq24196", (kernel_ulong_t)&bq24190_chip_info_tbl[BQ24196] },
22922306
{ "bq24296", (kernel_ulong_t)&bq24190_chip_info_tbl[BQ24296] },
2307+
{ "bq24297", (kernel_ulong_t)&bq24190_chip_info_tbl[BQ24297] },
22932308
{ },
22942309
};
22952310
MODULE_DEVICE_TABLE(i2c, bq24190_i2c_ids);
@@ -2300,6 +2315,7 @@ static const struct of_device_id bq24190_of_match[] = {
23002315
{ .compatible = "ti,bq24192i", .data = &bq24190_chip_info_tbl[BQ24192i] },
23012316
{ .compatible = "ti,bq24196", .data = &bq24190_chip_info_tbl[BQ24196] },
23022317
{ .compatible = "ti,bq24296", .data = &bq24190_chip_info_tbl[BQ24296] },
2318+
{ .compatible = "ti,bq24297", .data = &bq24190_chip_info_tbl[BQ24297] },
23032319
{ },
23042320
};
23052321
MODULE_DEVICE_TABLE(of, bq24190_of_match);

0 commit comments

Comments
 (0)