It is possible that codec hardware can be reset in case of subsystem
restart scenarios. It is required to reset the codec DSP as well in
such cases to make sure the DSP is in usable state after the codec
hardware is reset. Change adds support to handle codec down and up
events and perform the necessary reset on codec DSP.
Change-Id: I79502c043f5e16947c895aab7cd584d72ad1a7dc
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The wdsp_intr_handler is not really processing interrupts in interrupt
context, rather assumes that the caller is not in interrupt context and
performs calls that may sleep. Rename the function in order to avoid
confusion. Interrupt handlers can still call this function as long as
they are in threaded interrupt context and are okay to sleep.
Change-Id: Ia2803d6ca021d505ed2e711e676cbd701b11c492
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
One time initializations like regmap and debugfs init are currently
done in the init function. But, in case of subsystem restart, the
driver can get de-initialized and then initialized again. This causes
the debugfs and regmap entries to get removed and added again during
subsystem restart cases. Avoid this by moving all the one time
initialization of the driver to component bind.
Change-Id: Ideed297fde016b0623616be64875be094e688981
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
To support ADSP SVA on wcd934x, dedicated backend dailink needs
to be created. Add the dailink associating the specific cpu dai
and the MAD codec dai.
CRs-Fixed: 1070327
Change-Id: I4152d81e4e951216a8ecdd93562eb1740dbb962c
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Lowlatency playback is failed to start when FM is going on because
of wrong channel count in backend DAI. Channels are overwritten because
of afe loopback port mixer caching variable(port_sessions) overflow.
Fix this issue by creating an array to track all the loopback
connections.
Change-Id: I47b875df7eae671f8b59ecc76f61ed7fc7147f0e
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
MSMfalcon requires to use COMMON_CLK and COMMON_CLK_QCOM as the clock
framework. Fix the following for CLK_QCOM
- Add new configs for common clock framework.
- Remove compilation of audio-ext for COMMON_CLK.
- Remove ARCH hamster and cobalt from falcon defconfig.
- Remove ARCH falcon from cobalt defconfig.
Change-Id: I560d62f9698ddf73848186a6740632735d574b0f
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Update msmcobalt machine driver to support S32LE format.
Also add support of 384Khz for USB_AUDIO_RX.
Change-Id: I576bd9c3c776ad5c24a15adf1447a9206dc61b89
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for 32 bit data format (SNDRV_PCM_FORMAT_S32_LE)
and sampling rate of 384Khz. Also update platform drivers
to use latest version of pcm media format command
ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4.
Change-Id: I6b7ea860a398a7e4dd5f7e23ac3906ff0c6f2b3e
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4
command. This command adds support to playback/record 32 bit data
in 32 bit word and also provides a way to inform DSP about the
endianness of the data.
Change-Id: I3b013bedde8ccfa97a02e255e237df0cf2de13b8
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Add support for configurable bit width for AFE encoder.
Add new mixer ctl to set for usecases which enables
configuring different input/output bit format
on AFE for usecases such as APTXHD encoder for 24bit input
and 16bit output.
Change-Id: I62326a097cbd71a3ec2b93a0120284d8f71f5d57
Signed-off-by: Naresh Tanniru <ntanniru@codeaurora.org>
During image download, the status is set after post download events
are broadcasted. This could possibly lead to race condition if other
drivers requested to boot the dsp before the status was set. Change
makes sure the wdsp status is set prior to broadcasting post download
events to avoid possible race conditions.
CRs-fixed: 1071949
Change-Id: If3ec6202b4729b24ee839c3a8aa4edf2482d6e59
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
When the codec DSP is crashed / unresponsive, in order to recover
from the crash, it is required to shutdown and restart the DSP.
Add support for subsystem restart feature to recover from crashes.
CRs-fixed: 1071949
Change-Id: Ibe1918cbf525c41d8fa82fc772b3afe20cac6eb7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently, the clock request is performed during init and the clock
is kept on assuming that there will be code download event followed
by init. This assumption may not always be true and might cause the
clock to be enabled when it is really not needed. Change fixes clock
disable such that clock is disabled right after init and re-enabled
again if code download event is raised.
CRs-fixed: 1071949
Change-Id: Icc415e911653012726e5b81b4fc09199560d5691
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that wcd codec DSP can crash or become unresponsive.
During such case, an error interrupt is generated by the codec. Add
support in manager driver to handle this interrupt and perform
subsystem restart to shutdown and reboot the DSP so that the DSP
can be recovered from the crash.
CRs-fixed: 1071949
Change-Id: I4662b5120bf7f731e399a27d8a613e2f3b648b00
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add support to collect the codec memory dumps when any fatal
interrupt is raised from the DSP indicating the DSP is either
unresponsive/crashed. The memory dumps are only collected if
the debugfs node 'ramdump_enable' is set to true since ramdump
collection is debug only support.
Change-Id: I805ec63d125770b869cac892db8cf56f45510d6d
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that the manager driver may try to read codec memory
section through the wcd-spi driver. Add support in the wcd-spi driver
to handle the WDSP_EVENT_READ_SECTION event and perform reading of
the requested memory section.
Change-Id: If7fb228dc15cb47079c8a791443c4d12c29eeb9c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The codec driver is notified through interrupt whenever the
DSP in codec is unresponsive/crashed. In such cases, collecting
dumps of the codec memory is useful in debugging the issues.
Change adds support in the wcd dsp manager driver to collect
the memory dumps upon notification of error interrupt.
Change-Id: Ib91cd4fc1476ee1a9ec448cde1a083070443f726
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently, when manager driver interrupt handler callback is called,
there is no way for the caller to provide any data information along
with the type of interrupt. Change adds argument to the interrupt
handler so that callers can use this to pass agreed data when an
interrupt occurs.
Change-Id: I1c049227875a802491e21998c13c0bcd8eab7de6
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently hs_vref is set to 1.5v and causes mic voltage
to go above 1.5v during audio playback at maximum volume.
Increase the threshold to 1.6v to avoid getting fake plug
removal.
CRs-Fixed: 1066750
Change-Id: I7e5788eda609821792718a276e6fe5fa97e68a4a
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Add support for audio over TDM in msmcobalt.
Time-division multiplexing (TDM) is a method of
transmitting data in the time domain. This can
be used to support data rates that exceed that of
the transmitted signal or to have up to 8 channel
support on a bus that normally supports less in
the frequency domain.
CRs-fixed: 1070768
Change-Id: I20998435591c44d2ca1a7b6bd5eacac2af0611f6
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
Remove 48khz constraint for TDM use cases. This
change is needed to support more sampling rates for
TDM use cases.
CRs-fixed: 1073307
Change-Id: Ic42b2f9e7441ffb4e1bfe8211f85aadb72c22ed3
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
Update the error handling when APR sends packet failed so that audio
driver can perform proper error recovery.
CRs-Fixed: 1050605
Change-Id: I6210e244e6299ec747836f40d03e92c15c6e53ee
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Change all audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.
CRs-Fixed: 1052832
Change-Id: I9ff5cf06b019c566973eb609bf5d37969b98d31d
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Change cpe driver to use %pK instead of %p.
%pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.
CRs-Fixed: 1052832
Change-Id: I741d9e5c5b415011348e862c3f1ee4fe28c3969f
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
AFE requires TX/RX PGD register CFG info based on different wcd
codecs. Send this info when AFE configs are set at initialization.
Change-Id: I0da3d41fe8c1d03baacf2f2a9d2e141c9721981b
CRs-Fixed: 877188
Signed-off-by: Walter Yang <yandongy@codeaurora.org>