Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96d2cb53 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Subbaraman Narayanamurthy
Browse files

power: qpnp-smbcharger: set allow detection in UV interrupt



The current driver uses rerun APSD to detect the proper charger type
if SDP is reported. The pull downs on D+/D- by USB PHY causes any charger
type to be reported as SDP and in rerun APSD trick the detection is made
to run after USB PHY has been notified to remove its pull downs.

This works great except for when the charger is really an SDP. Rerunning
APSD is an expensive operation timewise - it takes 1 second to do it.
To confirm an SDP is plugged in , APSD is run twice. That exceeds the time
limits mentioned in the spec for SDP detection.

Fix this by utilizing the usbin_uv falling edge interrupt to notify the
USB PHY to remove the pulls. The USBIN_UV interrupt is raised within 20mS
of USB insertion. APSD is configured to run 600mS after USB insertion.
That gives the interrupt thread 600-20 = 580mS to notify USB PHY.

580mS is plenty time to notify the USB PHY and for it to remove the pull
down. However, that may not be the case if the device is resuming from
suspend state. Mark the USBIN UV interrupt EARLY to handle this.

CRs-Fixed: 832907
Change-Id: I6ec512f1f3f6680702cd532b32f0b75c6cf4d6f0
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 4f6b90cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment