Add some debug logs to specific places at IPA driver
to improve debugging capabilities.
Change-Id: Ibc53bd27a58c90d309a38937d6de6eef62ddc99a
CRs-Fixed: 1073482
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
During scheduler boost the sched_task_load ftrace event might not log
the correct flag value. Ensure that the flag is always initialized with
the selected cluster information.
Change-Id: Ia986d0fbc512c8e9ed1b5fb5b2ac4bc564cc4ba9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Revert commit 238f87868d ("soc: qcom: Listen to
SUBSYS_AFTER_SHUTDOWN notification").
SUBSYS_AFTER_SHUTDOWN notification is late for subsystem as they
are not able to communicate with firmware.
CRs-Fixed: 1078743
Change-Id: I61b308dce7e92b0e28033750885eac4a003dc01a
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Add support for Lpass PIL which facilitates the loading of Lpass
firmware, authentication and bringing it out of reset.
Change-Id: I367f4b3afdae9d0f78081e142be34132aaf07ab4
Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
As per the hardware programming guide, a period of N needs to be
programmed as N-1.
Change-Id: I58c13a97dd35b3a439ea1af25bc93182e38e29f0
CRs-Fixed: 1066261
Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Set the vfe clock rate before putting the ahb vote into
suspend otherwise the clock vote will bump up the ahb
vote and prevent shutdown.
CRs-Fixed: 1078215
Change-Id: I439ae8aea839af6d9b84fe1384feb18de3d9d276
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Acquire lock before you check if the service exist. This leads to
race condition where you end up adding same service multiple times
in service_list and make multiple registration request to servreg.
CRs-Fixed: 1078753
Change-Id: I8ae92ee1d26bd6687b6b2b4cbed1032485d7450e
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Allow for changing the switching frequency via a power supply property.
The main charger will call this property to ensure optimal power
dissipation.
CRs-Fixed: 1048242
Change-Id: I17aeabe9c20388747dc1965bef22127bd054a828
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Modern battery chargers use a switching buck whose frequency
can be adjusted. Create a property to read/update it.
CRs-Fixed: 1048242
Change-Id: I7611e6b697222427303df47f837716005e013443
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
There is a possibility where the driver fails to change
the usb type to Unknown when the cable is removed - in particular
when pd is not allowed.
Use the debounce done event of the typec change interrupt to update
the usb type to Unknown.
Change-Id: I7f201209101e54461e3d08d677bd7b266f971420
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Currently the driver uses the dev_ variants to print debug information.
This is not useful.
Instead print the function name and use pr_ variants to print debug
information.
Change-Id: I0eeb61e847b07ac9b7622ac521bace24a417bb14
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
If an HVDCP charger is detected and it does not support PD, that means
it is likely a legacy QC2 or QC3 charger. Rerun APSD when PD sets us to
be inactive.
For cases when pd is not allowed, PD won't set inactive status. For such
cases use the hvdcp_timeout interrupt to rerun APSD.
Change-Id: Ibe03e1dc88700b605e2f43ee4bca266ce3dee92b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add support to set current limits from usb and pd.
Ensure that the limit from the pd is only enforced when pd is active
and that the limit from usb is enforced only when pd is inactive.
There is one situation when the input needs to be suspended as
per the usb driver's request when pd sets system_suspend_supported.
For that allow the usb voter to set that low current value to
suspend.
Also ensure that the pd and usb votes are nullified when source
is removed.
In addition, the return the individual valid votes from usb and pd
when their current_max are read.
Change-Id: I215e9e82f44061c4083a4df8cab400beadf6322d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The current driver votes and unvotes for removal/insertion at
two interrupt handlers, debounce done and the type C detach.
The recommendation from hw teams is to use debounce done for both
insertion and removal. Update the code.
While at it, provide clean functions to vote and unvote for four
situations
a typec cable insertion
a typec cable removal
a source insertion
a source removal
Note that this allows us to cleanly handle PD hard resets where
the typec connection remains intact but the source (or vbus) related
state needs to be reset.
This also helps us in cleanly handling power sole swaps where the source
plugged and removed functions handle vbus related states while typec
functions handle the typec related states.
Change-Id: I49fccb1fcf8eaea8fea1ae186906689a628c02f8
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
There could be cables where vbus and cc lines are shorted or connected
using a small resistor. Raising VBUS to higher values could cause CC
line to get damaged. CC line cannot tolerate a voltage higher than 6V.
So if such a cable is seen, prevent pd stack from running so there is no
opportunity to increase vbus by selecting a higher voltage profile. Also
disable HVDP too.
Also, prevent PD_ALLOWED if a legacy cable is seen - the spec mentions
that if VBUS is seen along with CC, the adapter is not pd capable.
Change-Id: I7411bd541ffe704dda97dd869a3dbd4dbfc99518
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>