diff mbox series

[1/1] power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce

Message ID 20201230144440.d92028b58527b5011525cca3@uvos.xyz (mailing list archive)
State New
Headers show
Series [1/1] power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce | expand

Commit Message

Carl Philipp Klemm Dec. 30, 2020, 1:44 p.m. UTC
Adds 40000 ms sleep before cpcap_charger_enable to hopfully avoid the bounce on 
plug in

Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
---
 drivers/power/supply/cpcap-charger.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index be7d1da7a5a5..2ff5fd1a9e9e 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -708,6 +708,7 @@  static void cpcap_usb_detect(struct work_struct *work)
 
 		ichrg = cpcap_charger_current_to_regval(max_current);
 		vchrg = cpcap_charger_voltage_to_regval(ddata->voltage);
+		usleep_range(40000, 60000);
 		error = cpcap_charger_enable(ddata,
 					     CPCAP_REG_CRM_VCHRG(vchrg),
 					     ichrg, 0);