mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
power: supply: Add driver for TI BQ25630 charger
TI BQ25630 is a battery charger that is I2C controlled. Despite its model name, it is rather different from the other devices in the BQ256xx family; it has a completely different register layout and some other additional functionality (see the datasheet for more details [1]). The most "annoying" thing is that it has two different register lengths: 8-bit and 16-bit. Moreover, the 16-bit registers are further partitioned into either being little- or big-endian... Luckily, `regmap` has support for multiple `regmap_config`s (by setting unique names). Therefore, use three different `regmap_config`s for the corresponding registers. ADC functionality has been left out, due to it not having any real-world use-cases. The `enum power_supply_property` values are straightforward to map. Some properties are clamped (e.g. voltage/current ranges). Common `bq25630_read/write_limit()` functions for this are therefore suitable. Interrupts are sent whenever a state change is detected. Save the state status registers in `bq25630_data` and `memcmp()` this in order to decide if `power_supply_changed()` should be called or not. The actual state values are in (and fetched from) the other `power_supply_property`-mapped registers. [1] https://www.ti.com/lit/gpn/bq25630 Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://patch.msgid.link/ca5228dc74705adf96f0af5363ccb65bb965640b.1782683551.git.waqar.hameed@axis.com [Set power-supply type to POWER_SUPPLY_TYPE_USB] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
7380075135
commit
81a10126cb
|
|
@ -839,6 +839,13 @@ config CHARGER_BQ25980
|
|||
Say Y to enable support for the TI BQ25980, BQ25975 and BQ25960
|
||||
series of fast battery chargers.
|
||||
|
||||
config CHARGER_BQ25630
|
||||
tristate "TI BQ25630 battery charger driver"
|
||||
depends on I2C
|
||||
select REGMAP_I2C
|
||||
help
|
||||
Say Y to enable support for the TI BQ25630 battery charger.
|
||||
|
||||
config CHARGER_BQ256XX
|
||||
tristate "TI BQ256XX battery charger driver"
|
||||
depends on I2C
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ obj-$(CONFIG_CHARGER_BQ2515X) += bq2515x_charger.o
|
|||
obj-$(CONFIG_CHARGER_BQ257XX) += bq257xx_charger.o
|
||||
obj-$(CONFIG_CHARGER_BQ25890) += bq25890_charger.o
|
||||
obj-$(CONFIG_CHARGER_BQ25980) += bq25980_charger.o
|
||||
obj-$(CONFIG_CHARGER_BQ25630) += bq25630_charger.o
|
||||
obj-$(CONFIG_CHARGER_BQ256XX) += bq256xx_charger.o
|
||||
obj-$(CONFIG_CHARGER_RK817) += rk817_charger.o
|
||||
obj-$(CONFIG_CHARGER_S2M) += s2m-charger.o
|
||||
|
|
|
|||
1073
drivers/power/supply/bq25630_charger.c
Normal file
1073
drivers/power/supply/bq25630_charger.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user