Currently, 0 is written into SWR_PLAY register when disabling SWR play,
it coincidently updates the PLAY_SRC to FIFO mode and disables it. If
there is a FIFO play triggered from SPMI address space, the FIFO play
will be disabled and the FIFO samples will be flushed. To avoid this,
keep in SWR PLAY_SRC when disabling SWR play.
Change-Id: Ib594df57835979a8832f2f7a1954ff36f643f724
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Handle VMAX_CLAMP notification which is notified from charger driver
that hBoost is used by the charger firmware and haptics Vmax need to
be clamped to a specific level for the following vibrations.
Change-Id: I3d783467aad71e0d9b31a96120db7e89fd54c5cb
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
replace all dev(pr)_err/info logs
that could potentially flood kernel logs with
ratelimit functions dev_err_ratelimited and
dev_info_ratelimited
Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd
Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
After ADSP SSR happened, toggle swr_slave_vdd before play to reset
haptics HW so that it can function properly.
Change-Id: I48bc07c923d1af2041c6c156c699e329084f0d34
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Haptics module is supplied by HBoost regulator by default, it requests
voltage to HBoost regulator through hardware channel. Haptics module
can also be configured to use other regulator device, in this case, it
requires software to request the voltage from the regulator before
enabling the play. Add support for this.
Change-Id: I4a8305ff2732a92bc8be90bd3ed197fa643a101e
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Update the slave-vdd regulator control logic to avoid unbalanced
regulator_enable() regulator_disable() calls. Meanwhile, correct
the jump label when bailing out from soundwire enumeration failure.
This helps to avoid the regulator_put() call in the device remove
process throwing a warning for a dangling regulator enable status.
Change-Id: I89157f5f9177db69bbbf6aedcc8e605c43a7584e
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Add control to set VMAX to adjust different vibrator
setting from userspace.
Change-Id: I7300e4f0ae57e403c8fc79db38598946289effb6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Remove disable regulator during system suspend to avoid soundwire
interrupt during system suspend. This change will ensure that
device enter into power collapse during VoLTE usecase in LPI mode.
Change-Id: Ie15d28de9720b83f93ea1a85258b24faadad0db3
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Retry for soundwire slave enumeration during bootup before
EPROBE_DEFER to avoid soundcard enumeration failures.
Change-Id: I083ec76fc84a2b367f93a2dc166a1419a75ff8b4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Per HW recommendation, when stopping SWR playing, SWR_PLAY register need
to get deasserted before disconnecting SWR data channel. Hence adjust the
sequence.
Change-Id: I15f33fefc8b847c9a7f6abd627217f21f8ddee89
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Some prints in the driver have NULL pointer reference, correct them and
clean up on the other possible NULL pointer reference cases.
Change-Id: Iba8682014e21dd716caaaebc1231cb4fe39bdfe1
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Update the configuration and gain settings as per hardware
sequence recommendation for soundwire haptics usecase.
Change-Id: I09b86026f664fec3105af4a8180168fda457d4fd
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update haptics playback sequence to properly disable the soundwire
ports during the teardown path.
Change-Id: Ic6f23c8dae172104f8ae4659293b5ec6ce4ffa1f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
The haptics module in some PMICs has SWR slave data port which connects
to Bolero SWR RX port and it can receive PCM data from that port and use
it as the pattern source to play the vibration. Add the driver to
support it.
Change-Id: I5e6811ac8d81a60c3cd226029ef22ee12ed46f1d
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>