summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2021-01-10 22:53:51 +0300
committerSebastian Reichel <sre@kernel.org>2021-01-15 01:42:42 +0300
commit2828ffc2a276e73f8f3182b3385d7f1989178043 (patch)
treed78b2a6d3f311017e5dc63f274c903653d1c1aff /drivers/power
parent97456a24acb41b74ab6910f40fb8f09b206fd3b5 (diff)
downloadlinux-2828ffc2a276e73f8f3182b3385d7f1989178043.tar.xz
power: supply: cpcap-charger: Fix flakey reboot with charger connected
If we have a USB charger connected, reboot is flakey and often fails to reboot the device with the charger LED staying on. Let's fix this by implementing .shutdown. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/cpcap-charger.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index 2c5f2246c6ea..4b0f62dd33f4 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -886,7 +886,7 @@ static int cpcap_charger_probe(struct platform_device *pdev)
return 0;
}
-static int cpcap_charger_remove(struct platform_device *pdev)
+static void cpcap_charger_shutdown(struct platform_device *pdev)
{
struct cpcap_charger_ddata *ddata = platform_get_drvdata(pdev);
int error;
@@ -903,6 +903,11 @@ static int cpcap_charger_remove(struct platform_device *pdev)
error);
cancel_delayed_work_sync(&ddata->vbus_work);
cancel_delayed_work_sync(&ddata->detect_work);
+}
+
+static int cpcap_charger_remove(struct platform_device *pdev)
+{
+ cpcap_charger_shutdown(pdev);
return 0;
}
@@ -913,6 +918,7 @@ static struct platform_driver cpcap_charger_driver = {
.name = "cpcap-charger",
.of_match_table = of_match_ptr(cpcap_charger_id_table),
},
+ .shutdown = cpcap_charger_shutdown,
.remove = cpcap_charger_remove,
};
module_platform_driver(cpcap_charger_driver);