When entering ERROR_RECOVERY, the forced disconnect should
be processed first by queuing the work function to handle it
in the usual way. The required minimum delay should then be
done after this, before restoring the port to dual-role, and
thereby re-establishing the source/sink connection.
Change-Id: I672cdb59277af103045236232e54dc24f9f7fb01
Signed-off-by: Jack Pham <jackp@codeaurora.org>
queue_delayed_work(), which is based on jiffies, is not
appropriate for accurate timing, such as timeouts needing
resolution on the order of milliseconds. Instead introduce
an hrtimer which upon timeout will call regular queue_work().
Redefine timeout values based on the PD spec minimum amounts
as these are generally the minimum time the policy engine
needs to wait before peforming the next action.
msleep() is also jiffies-based, so replace with usleep_range()
for the same reason. Further, PE_SRC_TRANSITION_SUPPLY can
simply be inlined as part of the PE_SRC_NEGOTIATE_CAPABILITY state
using an in-place sleep.
Change-Id: Id8c9eb8937b67d4deaad8b61d9ff2349cbe7f4ed
Signed-off-by: Jack Pham <jackp@codeaurora.org>
The QPNP PD PHY supports BIST modes as required by the USB PD
specification. Specifically for BMC signaling, upon reception
of BIST requests to enter Carrier Mode 2 or Test Data Mode,
place the PHY in the appropriate test mode when receiving
these messages in the RX handler.
While at it, remove the unnecessary kmalloc in the RX handler
as the temporary 32-byte buffer can be placed on the stack.
Change-Id: I79f406f7ecc9b938868c383743668df4e579a907
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This allows to check if requested format is supported by
usb audio headset by looking at dmesg log.
Change-Id: I3051dd49a1289e4ab46bb59b3537c664a37c3ee5
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Add explicit write memory barrier before turning off QMP PHY clock to
make sure previous POWER DOWN operation (in disconnect case) or
putting PHY into autonomous mode (in suspend case) is completed.
Similar way add write memory barrier after performing POWER UP
operation (in connect case) or disabling PHY autonomous mode (in
resume case).
Change-Id: I91bb098506eb0c7d5dd6248fad71b8bb9186ea5a
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Operation needs to be read/modify/write. It was write only which
zeroed out bits outside of requested region.
CRs-Fixed: 1055047
Change-Id: I2e010a99ed5961cd501e1eae913c73b3dbee4789
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
Update the size of snprintf function to be PAGE_SIZE, in order
to display the sysfs entry correctly.
CRs-Fixed: 1054946
Change-Id: I75050cb8730f42bc601530b7505e32ec95cf88c0
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
apc0_pwrcl_vreg and apc1_perfcl_vreg correspond to single
regulators powering the power and performance clusters,
respectively. Remove the incorrect regulator handle name for
APC1 CPR regulator device as well as the APC0 CPR regulator
handle name as both are unnecessary.
CRs-Fixed: 1054399
Change-Id: I936d2f0aa84ec247e070cbb46d525d8ae8ca698f
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Allow disabling CPR hardware closed-loop operation via debugfs
on CPRh-compliant controllers. This can be done by setting
either cpr_closed_loop_enable or use_hw_closed_loop to zero.
Both flags must be set to reallow CPRh hardware closed-loop
operation.
CRs-Fixed: 1054095
Change-Id: Ib41f389ab168a747e705446dc621e512f6c95e1a
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
In some cases the userspace can do a back to back write() followed by
close(). In such cases the tty framework does account for this by asking
the driver the status of the tx buffer and if not empty wait for a timeout
computed as a function of the current port baud rate.
However in some cases, this timeout doesn't seem sufficient, so when
checking the state of the tx buffer insert an extra delay if not empty
before returning to the framework. This will do a double wait at driver
and at framework, but this shouldn't adversely affect timing of usecases
and the flip side of having a pending byte in the tx buffer can result
in the peer hardware being left in a bad state.
Change-Id: I372e2e1c68f13f5d537ea33980eb63487f31d589
CRs-Fixed: 1044170
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Enable use of noirq (i.e pull mode and push mode)
playback and capture.
Change-Id: I8edf1eb04ddb4e17c10cc722f30562d24ff1e718
CRs-Fixed: 1054967, 1035545
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Add new pcm device node to use in the ultra low latency
path in noirq mode.
Change-Id: Icf2cb24f60558ffcd6d458e56d2ff967e9d33fa7
CRs-Fixed: 1054967, 1035545
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
In a case where gate work is called as part of cancel work
from ungate path the clk state would be marked as REQ_CLKS_ON.
There is no point gating the clocks and then end up turning
them ON immediately in ungate work, save time by skipping the
gate work and change the clk state to CLKS_ON as they are not
turned off yet.
Change-Id: I3e8edf979c94a8e0954fd77e0b158bec8902b4e9
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>