Skip to content

Commit 457b42f

Browse files
Liu Xiangsre
authored andcommitted
power: supply: bq27xxx: Add support for BQ27411
According to the datasheet, bq27411 is similar to bq27421. Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn> Reviewed-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 1c3d7b0 commit 457b42f

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

Documentation/devicetree/bindings/power/supply/bq27xxx.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Required properties:
2323
* "ti,bq27546" - BQ27546
2424
* "ti,bq27742" - BQ27742
2525
* "ti,bq27545" - BQ27545
26+
* "ti,bq27411" - BQ27411
2627
* "ti,bq27421" - BQ27421
2728
* "ti,bq27425" - BQ27425
2829
* "ti,bq27426" - BQ27426

drivers/power/supply/bq27xxx_battery.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ static u8
432432
[BQ27XXX_REG_AP] = 0x18,
433433
BQ27XXX_DM_REG_ROWS,
434434
};
435+
#define bq27411_regs bq27421_regs
435436
#define bq27425_regs bq27421_regs
436437
#define bq27426_regs bq27421_regs
437438
#define bq27441_regs bq27421_regs
@@ -665,6 +666,7 @@ static enum power_supply_property bq27421_props[] = {
665666
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
666667
POWER_SUPPLY_PROP_MANUFACTURER,
667668
};
669+
#define bq27411_props bq27421_props
668670
#define bq27425_props bq27421_props
669671
#define bq27426_props bq27421_props
670672
#define bq27441_props bq27421_props
@@ -725,6 +727,12 @@ static struct bq27xxx_dm_reg bq27545_dm_regs[] = {
725727
#define bq27545_dm_regs 0
726728
#endif
727729

730+
static struct bq27xxx_dm_reg bq27411_dm_regs[] = {
731+
[BQ27XXX_DM_DESIGN_CAPACITY] = { 82, 10, 2, 0, 32767 },
732+
[BQ27XXX_DM_DESIGN_ENERGY] = { 82, 12, 2, 0, 32767 },
733+
[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 82, 16, 2, 2800, 3700 },
734+
};
735+
728736
static struct bq27xxx_dm_reg bq27421_dm_regs[] = {
729737
[BQ27XXX_DM_DESIGN_CAPACITY] = { 82, 10, 2, 0, 8000 },
730738
[BQ27XXX_DM_DESIGN_ENERGY] = { 82, 12, 2, 0, 32767 },
@@ -802,6 +810,7 @@ static struct {
802810
[BQ27546] = BQ27XXX_DATA(bq27546, 0 , BQ27XXX_O_OTDC),
803811
[BQ27742] = BQ27XXX_DATA(bq27742, 0 , BQ27XXX_O_OTDC),
804812
[BQ27545] = BQ27XXX_DATA(bq27545, 0x04143672, BQ27XXX_O_OTDC),
813+
[BQ27411] = BQ27XXX_DATA(bq27411, 0x80008000, BQ27XXX_O_UTOT | BQ27XXX_O_CFGUP | BQ27XXX_O_RAM),
805814
[BQ27421] = BQ27XXX_DATA(bq27421, 0x80008000, BQ27XXX_O_UTOT | BQ27XXX_O_CFGUP | BQ27XXX_O_RAM),
806815
[BQ27425] = BQ27XXX_DATA(bq27425, 0x04143672, BQ27XXX_O_UTOT | BQ27XXX_O_CFGUP),
807816
[BQ27426] = BQ27XXX_DATA(bq27426, 0x80008000, BQ27XXX_O_UTOT | BQ27XXX_O_CFGUP | BQ27XXX_O_RAM),

drivers/power/supply/bq27xxx_battery_i2c.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static const struct i2c_device_id bq27xxx_i2c_id_table[] = {
247247
{ "bq27546", BQ27546 },
248248
{ "bq27742", BQ27742 },
249249
{ "bq27545", BQ27545 },
250+
{ "bq27411", BQ27411 },
250251
{ "bq27421", BQ27421 },
251252
{ "bq27425", BQ27425 },
252253
{ "bq27426", BQ27426 },
@@ -279,6 +280,7 @@ static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = {
279280
{ .compatible = "ti,bq27546" },
280281
{ .compatible = "ti,bq27742" },
281282
{ .compatible = "ti,bq27545" },
283+
{ .compatible = "ti,bq27411" },
282284
{ .compatible = "ti,bq27421" },
283285
{ .compatible = "ti,bq27425" },
284286
{ .compatible = "ti,bq27426" },

include/linux/power/bq27xxx_battery.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ enum bq27xxx_chip {
2424
BQ27546,
2525
BQ27742,
2626
BQ27545, /* bq27545 */
27+
BQ27411,
2728
BQ27421, /* bq27421, bq27441, bq27621 */
2829
BQ27425,
2930
BQ27426,

0 commit comments

Comments
 (0)