Read instance type from device tree node to know the storage type
for ICE configuration, which is used to program the corresponding
ICE register during ICE reset.
Change-Id: I0eb423fb84dc89115227abc7c5688df7ae9a4a3c
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Commit b76105e359 ("usb: pd: Read sink capabilities from device
tree") added support in usbpd driver to pass sink capablities from
device tree. But it introduced bug in case of no sink capablities
passed from device tree as in this case, device_property_read_u32_array()
returns -EINVAL. Due to this, usbpd driver probe fails as usbpd_create()
returns errors. Fix this issue by checking if return value > 0 and then
only try to read sink capablities from device tree. If not, use default
sink capabliites defined in usbpd driver.
Change-Id: I51beeba282c6e067881c664d38c2657843a1c716
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Currently when 3 switcher_power_ok interrupts are seen within a
second, the driver thinks that the switcher is reverse boosting
and suspends USB input path.
However, switcher_power_ok could happen 3 times within a second
while AICL is run from a charger collapse, a valid usecase which
ends up in an USB suspended state.
Note that AICL run caused switcher_power_ok is accompanied by an
USBIN_UV interrupt. Use that to distinguish reverse boost Vs AICL
runs. In particular, reset the switcher_power_ok interrupt count
updated by storm_watch when an USBIN_UV interrupt is seen.
Change-Id: I6817c66319f9af03ac28324a8d863876fdadafb3
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Since the interrupt information for both smb2 and smb138x charger
devices are almost common, abstract it to a single smb_irq_info
struct. Also, keep an interrupt index for every interrupt which
can be used when necessary.
Change-Id: I4e42dd15a46b59c1a9c27412ca6fdff281fa71ec
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
There are some circumstances where we have to reset the storm
watch interrupt count. Add support for it.
Change-Id: Iacbeb3258d53010aab8ba881d10de773fe54dd93
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
To force qnovo FCC and FV through parallel framework
more conveniently, batt psy is bridged to replace votable
in qnovo driver. The two properties are -
POWER_SUPPLY_PROP_CURRENT_QNOVO and
POWER_SUPPLY_PROP_VOLTAGE_QNOVO.
CRs-Fixed: 2004173
Change-Id: I40b179fe5535e0209fcdbc1cb7e64cbfdf45a14b
Signed-off-by: Harry Yang <harryy@codeaurora.org>
CURRENT_QNOVO and VOLTAGE_QNOVO allow "forcing" fast charge
current and float voltage value, implemented around votable
such that one can have previlige in FCC and FV voting.
CRs-Fixed: 2004173
Change-Id: I2df30220aa89e15c4bace9980990f227218a5bdd
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Print the ICL settled value within the icl-changed IRQ handler.
Change-Id: I5553abecfc5e32b24bef3525f532f4b3505c0757
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Currently, fixed 5V adapter voltage is used for calculating slave FCC.
When HVDCP 3.0 is used it skews the desired FCC distribution. Fix this
by using the HVDCP3 pulse count to determine the actual adapter voltage
when limiting the slave battery current.
Change-Id: Ib4735ffe7b6287a3e57e0f74eb24c13c6a2b7a5a
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
INPUT_VOLTAGE_SETTLED is the negotiated adapter voltage setting.
Change-Id: I2ac529a77e8ed007c908c4f37eea718a80bc11d3
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
The chg-state-change IRQ will be used to notify when the parallel slave
charger changes its charge state. Enable it.
Change-Id: Ia57db8ec5f2263b62217c235725ee9caa07f86e4
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Add an IRQ handler function that notifies when the slave charge state
changes.
Change-Id: I359ed08c5ad289ceeabd6fa8720a959c74b6bb5e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
CURRENT_QNOVO - force fast charge current value
VOLTAGE_QNOVO - force float voltage value
CRs-Fixed: 2004173
Change-Id: I7569052fd2cb6d1ce9a3a8e69e79b950a6c62d57
Signed-off-by: Harry Yang <harryy@codeaurora.org>
FCC_MAX votable was introduced as an intermediate votable used by
Qnovo driver for fast charge current vote, but does not fit in
the new requirement that Qnovo force its vote value.
Remove it.
CRs-Fixed: 2004173
Change-Id: Iff8b74113550f808546d61ef864f3935fc5d61fa
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Input suspend on fake battery feature is by default enabled in the
software, add a DT property to enable/disable the feature.
Change-Id: I06bda6c72010699f4be24ff6044fe3bb248b06fb
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Incorrect checks in MHI drivers may crash the system.
Fix these checks so that MHI drivers will handle the
errors gracefully.
Change-Id: I462263799c2e76573300ed43b51e39ecba42914b
Signed-off-by: Tony Truong <truong@codeaurora.org>
Kernel address is relocated to the VMALLOC region. Update the check
to use KIMAGE_VADDR.
Change-Id: Ie2539a78a8180a3dbc2c8075a891e99892d809f2
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
On pipe setup, enable data path should happen for after
all pipe resources are allocated.
This change prevents a race condition where the pipe is enabled
before RX buffers are submitted to IPA.
Then, when buffers are submitted to IPA there is a race between
submitting the buffers and getting RX packets.
CRs-Fixed: 1096357
Change-Id: Ic32924b6893bb8c7813b1b8e68e03b5e09560b69
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Enable QCOM_EL2_TLB_HANDLER so that tlb conflict is handled
by EL2.
Change-Id: I8af8be929293e5419d58712d742cb62fb82f8897
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
Raise exception to EL2 for every EL1 sync data aborts,
so that EL2 handles the TLB conflicts.
Change-Id: Ib140599e23c399b23c12ddbeb59979d6caf5d38e
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Runmin Wang <runminw@codeaurora.org>