Update machine driver AFE API calls compatible
with adsp version AVS 2.6 and AVS 2.7
Update of mclk flag in suspend call.
Change-Id: Id0b300bcf585895cc659a1882710d825d0e7a808
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
Removed 20ms delay in RX chain PMD as it is not required.
This improves device switch and tear down latency.
CRs-Fixed: 1070432
Change-Id: Id6996dff163f390a662f628da710d8bb238f7fca
Signed-off-by: Rohit kumar <rohitkr@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>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE)
CRs-Fixed: 1011048
Change-Id: I2e72305bdbece822381b56a8a0c0cc9c7b8b0f0b
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
restore the cache values back of last state applied
in SSR recovery using snd_soc_cache_sync API. So
hardware codec configuration will be in sync with
userspace settings. And avoid any race condition
between the userspace updating dapm widgets and
SSR recovery updating any register value.
Change-Id: Ie2a986b5c6827b02aa3d5919cc69e7363155c45e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
For the targets not using boost and boost pin is kept
floating there will be high change that VDD_A53 will be
grounded and MSM will not be responsive
After discussing with PMIC systems team SBL team came up
with the work around to configure the boost register to some
pre defined values so that the issue is not reproduced.
As part of the codec init sequence the codec driver will
reset the analog part of the codec and as part of this sequence
the cofiguration done by the SBL will be defaulted.
This change will restore the 0x1C6 register if it has been configured
by SBL
Change-Id: I1a58b665b01e70bbb21b06665a8fb422d77a5ee7
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
In device switch from bongo speaker to HPH, observe
pop in headset. Since the PA select bit is changed
to HPH before DAC disable when tearing down bongo
speaker, this can result in pop in headset. Move
the PA selection bit to be changed to HPH after
PA and DAC disable.
Change-Id: Idb4f96f03880563e4bb81b98f623b6b05f27da8e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When SSR triggered on speaker in internal codec,
sometimes dapm fails to mark dapm widget dirty after SSR
for specific clips and speaker codec widgets fail
to powerup. As this widget associated with SPK DAC register
which is also changed in driver when SSR power down and
powerup, resulting in timing issue when this register
being read by DAPM. Change the routing to tie up the
speaker codec widgets path with virtual mux switch
and DAC widgets.
Change-Id: I691fed56818a099dc3893eedad6fcd7f9bc61107
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Update mbhc register table entry for moisture detection
to be zero for the targets which do not support moisture
detection. This prevents any impact due to moisture
detection.
Change-Id: I3e026e288788700ea2328ccbd12f79f5c40642ac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Update impedance detection sequence for cajon as per
the new method provided by hardware team.
Change-Id: Iab021752cb5e56bb64776c41bec6825cb4a0d0db
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
After ssr mbhc interrupts need to be enabled for mbhc
to work. If mbhc_init is not called, there are no
interrupts enabled. Call the api so that mbhc is
initialized properly.
Change-Id: I64ba4b8de50da2b527e20c90f99c79c49fabfed3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
After ssr mbhc interrupts need to be enabled for mbhc
to work. If mbhc_init is not called, there are no
interrupts enabled. Call the api so that mbhc is
initialized properly.
Change-Id: I64ba4b8de50da2b527e20c90f99c79c49fabfed3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
In cajon 2.0, as per latest qcrg FSM toggle is required
at powerup. Also update boost mode sequences for speaker.
For combo usecase, HPH turn on is not ensuring MCLK bits
are set before NCP or PA enable. Make changes to turn on
MCLK bits first at HPH powerup sequence always.
Change-Id: Icf858b83be0bdd6890335eaee6b33cc74fd189d3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
If pulldown is enabled when headset is inserted, issues
such as no button press or fake interrupts during extension
cable usecase are seen. Do not enable pulldown when headset
is kept inserted.
Change-Id: I586376a806e8f3495fc94b7a8f4af62a59f17bbe
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
If pulldown is enabled when headset is inserted, issues
such as no button press or fake interrupts during extension
cable usecase are seen. Do not enable pulldown when headset
is kept inserted.
Change-Id: I586376a806e8f3495fc94b7a8f4af62a59f17bbe
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
If there is no boot up sound, the register to bring codec
out of reset is not updated which in turn impact mbhc
functionality, so no detection happens unless any audio
is played.
CRs-fixed: 885738
Change-Id: I36862f9aa6cfa90801e739586e3b371f219f3473
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Update register sequence for impedance detection to
work on cajon and for backward compatibility with
previous targets.
Change-Id: I86831be2c36532ce4ac8f8344587309d7ebfb1ac
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
MBHC acquires a lock in PRE PA turn off event and releases it in
POST PA off event. The codec driver should send the notification
to mbhc for both these events.
Change-Id: I07278cec1d3b29e27deffea02ff30629f796bdd4
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
In 8952 internal codec, add required dmic3 and dmic4 interface support
used for VI sense capture from WSA analog mode.
Change-Id: I17aac07d0c831148844faece8e034f1e6dc6a8bd
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Pop is heard on selecting a ringtone when playback is going on.
There is a device switch from headset to headset and speaker device.
The enable sequence of headset has register writes to 0x197 which is
the cause of pop.
Change-Id: Ia189ade975171e7f2e3b1a7f9d6d26dff4cb10ee
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
For cajon 2.0 hardware, change default setting for boost
current limit register with ENABLE_OCPON_PS 6th bit set
to FOLLOW_PS.
CRs-Fixed: 860840
Change-Id: I8474a798c6fe70a47f3c879cacc8b8400b042a89
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In 8952 using cajon has CnP failure on some parts.
Update QCRG sequence for turn on and turn off on Cajon.
CRs-Fixed: 855729
Change-Id: I352926d0ed8550014ccb2f1031346eacbd522c52
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
For cajon 2.0, we have change in sequences for
boost and ear bypass mode. Add required changes
to support from codec driver.
CRs-Fixed: 855722
Change-Id: Ide5722214b0bee65dea541c172b88861fe449ca4
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
On trigger SSR, audio is not heard on the speaker for cajon
codec.
For the cajon hardware the register set which gets
initialized post SSR didn't have the speaker DAC ctl register.
Hence the whole chain in the DAPM was not established
leading to no audio. Fix by updating the array of the
default registers for cajon codec.
Change-Id: I37efdde6ac10e1026d0657fd0bf64b825f4d91c4
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
If SSR and audio playback/recording occurs simultaneously,
in a rare scenario it can happen that framework initiates
new session. In such scenarios machine driver proceeds further
to setup the MUX configuration which results in un-clocked access
and inturn leads to crash. To resolve this return error from
codec driver which has knowledge on SSR events.
CRs-Fixed: 832098
Change-Id: I3b5d2d786f006e7f0efe94ee4c94f52d05d4f02e
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Refactor WCD MBHC driver so that various wcd
codecs can use the common functionality provided
by the wcd mbhc driver and any codec specific
functionality will be handled by the codec driver.
Change-Id: I9a4a424cd022f7aa08009e5b30b8353fa8784ef9
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Hardcoding the third argument in strnstr function
is resulting in out of bounds access. Set the third argument
to sizeof the character string passed as the first argument
to prevent out of bounds access.
CRs-Fixed: 832915
Change-Id: I61be88701340e271fd866e0e1801722dbe7d63ac
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
From cajon codec onwards, there is no need to keep micbias enabled
for removal interrupt. The hardware issue has been fixed in this
codec.
Change-Id: I810d65556e13a5994e7879eb00c7c67ea951355e
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Set gain as POS_6_DB_DI for headset/headphone with
impedance values more than or equal to 13 ohms. For
loads lower than 13 ohms set gain as POS_1P5_DB_DI.
CRs-Fixed: 829677
Change-Id: Ie7392a38e99c1843ccb31dde4dfdf3bea92f9d13
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
If register is 0x16 or 0x116 mask register read value
as 0, so that SW can disable only the required interrupts.
Which will ensure other interrupts are not effected.
Change-Id: I3d0c24dbd91e781a266ec076db8cfecf6e9c4e60
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
IIR gain has a pre requisite that clock has to be on
for gain changes to take effect.
Add a dapm event handler to ensure that gain is
updated after clock is turned on.
Change-Id: I893eea483f56f2bcf53a7bc04d281932a49211f7
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
While recording, if SSR is triggered POP noise is generated
due to disabling of micbias during impedance detection.
So, skip impedance detection after SSR to resolve the POP.
CRs-Fixed: 809007
Change-Id: I0d74d01d7fae8f019fb8b38d54083f1e169e0d64
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Add codec driver for WCD9335 audio codec. This driver
is an ALSA-compliant and constructs the internal codec
audio paths with DAPM widgets and controls. Provides the
controls to the upper layers to enable and configure
audio paths.
Change-Id: I1c5ec2a7c775153ee6722832cb3a76298979d7f4
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
With WSA881x can be connected of left or right
configuration in case of mono speaker, add both
clients and query bongo presence run-time. Also
update route map in codec driver to update the
dapm sequence to wsa.
Change-Id: If2f7176780ee20684bfec18c20b6cd17b9d37e36
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>