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

Skip to content
Commit c0361676 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Subbaraman Narayanamurthy
Browse files

qcom: smb-lib: add delay for parallel enable



Currently, the driver enables parallel charger as soon
as a favorable charger is seen. This causes many, unnecessary
splits of AICL results as AICL runs for the first time. Besides
the detection logic could further update charger type and rerun
AICL.

Its best to simply delay enabling parallel charger for 30 seconds.
This ensures that type detection and its AICL run to completion and
parallel charging starts with a stable AICL result.

To realize this
- implement a workqueue which will be scheduled/cancelled 30 seconds
  later when vbus plugin interrupt happens.
- The workqueue signifies that 30 seconds have elapsed and parallel
  charging should be enabled by PL_DELAY_VOTER.
- remove PL_DELAY_HDVP_VOTER since PL_DELAY_VOTER will
  ensure parallel gets enabled after 30 seconds of insertion.
- unvote from PL_DELAY_VOTER only when the typeC removal event happens.
  A PR_SWAP during a sink session will keep the PL_DELAY_VOTER's vote
  enabled, we expect CHG_STATE_VOTER to disable parallel since device will
  be supplying VBUS and not charging the battery. This also means that
  when another PR_SWAP happens and the device starts operating in sink mode
  again, PL_DELAY_VOTER's vote will remain enabled and parallel charging
  would begin when other conditions become favorable. IOW PL_DELAY_VOTER
  tracks 30 second after physical insertion and remains unaffected by
  PR_SWAPs.

CRs-Fixed: 2014572
Change-Id: Ibe10768e61c6d2661bc8946f7f6b9be06f0c28e6
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 44b8740f
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