OSDN Git Service

power: supply: bq24190_charger: Program charger with fwnode supplied ccc_ireg and...
authorHans de Goede <hdegoede@redhat.com>
Sun, 6 Feb 2022 18:35:41 +0000 (19:35 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 11 Feb 2022 18:08:34 +0000 (19:08 +0100)
commit445c21d2080f6ffaad3482409fe90e8ed22db6a2
treedb992aec95eafa895f72966bc6bff21de610a98b
parent73633ccbba38b9e7bc1ac0527f52cb421beb68f1
power: supply: bq24190_charger: Program charger with fwnode supplied ccc_ireg and cvc_vreg

So far the bq24190_charger driver has been relying on either the chips
default constant_charge_current_max_ua and constant_charge_voltage_max_uv
values, or on the BIOS or bootloader to program these for us.

This does not happen on all boards, causing e.g. the wrong (too low)
values to be used on Lenovo Yoga Tablet 2 830F/L and 1050F/L tablets.

If power_supply_get_battery_info() provides us with values for these
settings, then program the charger accordingly.

And if the user later overrides these values then save the user-values
so that these will be restored after a suspend/resume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq24190_charger.c