]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return
authorHans de Goede <hdegoede@redhat.com>
Sat, 12 Feb 2022 16:48:16 +0000 (17:48 +0100)
committerSebastian Reichel <sre@kernel.org>
Fri, 25 Feb 2022 19:07:57 +0000 (20:07 +0100)
commit638747c2de3981e4dd8fa8044dbc2481839eabeb
tree8f0534aa12e1890480f854e3368b2cc027c1be97
parente8b4143dd01b34356adca1f9dfcb963143932a69
power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return

The datasheet says that the BQ24190_REG_POC_CHG_CONFIG bits can
have a value of either 10(0x2) or 11(0x3) for OTG (5V boost regulator)
mode.

Sofar bq24190_vbus_is_enabled() was only checking for 10 but some BIOS-es
uses 11 when enabling the regulator at boot.

Make bq24190_vbus_is_enabled() also check for 11 so that it does not
wrongly returns false when the bits are set to 11.

Fixes: a76e5121eb36 ("power: supply: bq24190_charger: Export 5V boost converter as regulator")
Cc: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq24190_charger.c