power: supply: bq25890: Add get_voltage support to Vbus regulator
authorMarek Vasut <marex@denx.de>
Fri, 14 Oct 2022 17:24:26 +0000 (19:24 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 28 Oct 2022 23:40:31 +0000 (01:40 +0200)
commit85052e90007bd9e11123bd691a8131089178a4f8
tree3b186c2129f36c1f411814661b51853b2cde5575
parent5f5c10ecaf3fdeba9b2b0af5301977420c2c4df0
power: supply: bq25890: Add get_voltage support to Vbus regulator

The chip is capable of reporting Vbus voltage, add .get_voltage
implementation to Vbus regulator to report current Vbus voltage.
This requires for the Vbus regulator to be registered always
instead of the current state where the regulator is registered
only in case USB PHY is not found.

Do not provide Vbus regulator enable/disable ops in case USB PHY
is present, as they would race with USB PHY notifier which is also
used to toggle OTG boost mode.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25890_charger.c