]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: bq25890: Add a bq25890_rw_init_data() helper
authorHans de Goede <hdegoede@redhat.com>
Tue, 1 Feb 2022 13:06:50 +0000 (14:06 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 1 Feb 2022 13:55:11 +0000 (14:55 +0100)
commit78fcacdd23f3cf91c45c09a49a52258e61566d7a
tree40f34e591f980ec1cba51c662ef3e2efba870821
parente51bc90f8a5246030832748e17021472621ea57e
power: supply: bq25890: Add a bq25890_rw_init_data() helper

On most x86/ACPI devices there is no devicetree to supply the necessary
init-data. Instead the firmware already fully initializes the bq25890
charger at boot.

Factor out the current code to write all the init_data from devicetree
into a new bq25890_rw_init_data() helper which can both write the data
to the charger (the current behavior) as well as read it back from
the charger into the init_data struct.

This is a preparation patch for adding support for x86/ACPI device's
where the init_data must be read back from the bq25890 charger.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25890_charger.c