When clients are trying to send message while the worker thread is
processing existing messages, there is possibility that the message
queue can get corrupted. This can result into kernel crash. Fix to make
sure the message queue does not get corrupted.
CRs-fixed: 951194
Change-Id: I1eb5232d9d079ecc9d28b95737333c1198a8b20c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
commit a1068045883ed4a18363a4ebad0c3d55e473b716 upstream.
The detection of direction for compress was only taking into account codec
capabilities and not CPU ones. Fix this by checking the CPU side capabilities
as well
Tested-by: Ashish Panwar <ashish.panwar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit e73694d871867cae8471d2350ce89acb38bc2b63 upstream.
For a sample rate of 12kHz the bclk was taken from the 44.1kHz table as
we test for a multiple of 8kHz. This patch fixes this issue by testing
for multiples of 4kHz instead.
Signed-off-by: Nikesh Oswal <Nikesh.Oswal@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Minor version for some of the CPE commands should be
of value "1". Update the minor versions appropriately
for some of the CPE commands.
Change-Id: I034bbe156aab57410aa629f531b9c1eec3489b4f
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Currently class-H controller is not enabled when lineout is enabled
first and then headphone is enabled. Because of this mute is observed
on headphone during lineout and headphone concurrent scenarios. Fix
mute on headphone by enabling class H block during concurrency also.
Change-Id: Ibed962eaacf87c3eb55c569d2ae9c6363a63cace
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
The data channel for buffering has two endpoints, one on the MSM and
another on the codec. When codec endpoint is torn down, it waits for an
interrupt for channel teardown from hardware. But, since MSM endpoint is
still connected, the interrupt is never receieved and the codec wait
gets timed out. This adds delay in data channel teardown. Fix this issue
by making sure the MSM endpoint is torn down first and then the codec
endpoint gets torn down.
CRs-fixed: 940132
Change-Id: Ie6529e9269aa29fb3d312b816c3d83e9e3e6e10e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The channel setup errors are not handled in some cases, add fix to
handle the errors gracefully for look ahead buffering.
CRs-fixed: 943741
Change-Id: Ifbaf8a05e0e1f4c7e099a1664e914d430345ee37
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently, it is possible there could be race condition when there are
multiple messages to be sent to CPE. Add changes to fix the possible
race conditions.
CRs-fixed: 946375
Change-Id: I6a290c00b08fa3afc64acf40cd339a0203f73d96
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently lsm client data is deallocated when q6lsm_open() fails
which can cause memory corruption if lsm client data is accessed
after freed. Fix this issue by deallocating the client data only
in msm_lsm_close().
Change-Id: If048c26a0ffd8a346a28622183cbf2ba1e7e5ff3
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
During subsystem restart, it is possible that while the underlying bus
is down, the irq driver has already performed its cleanup. In such case,
when CPE driver requests to cleanup its own irq, the irq driver attempts
to hold an lock that is already freed. Fix this issue by performing the
CPE driver irq cleanup after bus is up rather than when bus is down.
CRs-fixed: 948899
Change-Id: I2772e89bbdc855baa9fcf7a34a9c16f2f5c05c32
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
After subsystem restart is completed, driver will try to restore the
internal clock state to state before subsystem restart. In some cases,
it is possible that the internal clock state is not restored properly.
This causes the internal clock to be off when it is expected to be
turned on. Fix this issue by making sure the clock states are restored
correctly post subsystem restart.
CRs-fixed: 948899
Change-Id: I0084287b2d3b62c7498bae423952e64dd0d6e0f4
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
When CPE services notifies the client that response to any message is
received, it is possible that the client may send another message even
before the CPE services cleared the current message response as these
both are run in different thread contexts, this will cause the command
queue to be corrupted. Fix this issue by clearing internal state of CPE
services command queue before notifying clients the clients the result
of message transfer completion.
CRs-fixed: 946375
Change-Id: I4b31201747edd7fdee57294ff559ccb21e582608
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Reduce insert and remove debounce value on wcd9335 to 96msec
to improve device switch latency during audio playback usecase.
Change sets the insert and remove debounce to 96msec.
Change-Id: I62a4e29af050da3b6be4afc1267b1b03f786c63e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
The buffer used for look-ahead-buffering is allocated during IOCTL from
userspace. It is possible that userspace can invoke this IOCTL multiple
times without invoking the IOCTL to de-allocate the buffer. This results
in out of memory issue for buffer allocation during stress testing. Fix
this issue by avoiding multiple buffer allocations.
CRs-fixed: 942452
Change-Id: Id9eb99dc2c8527fbbe1fe79fca1cdcea232c33da
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Currently worker thread in cpe service is created twice.
The second thread handler overwrites the first one. The first
thread is not freed when the service is cleaned up. The fix
prevents creation of the redundant thread.
CRs-Fixed: 949165
Change-Id: Idd76b76d4f7f25d2592ca7c336dbee77b6efc7eb
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
HW MAD bypass feature is to facilitate input to CPE by avoiding
MAD in codec. This is done by routing DEC1 data to CPE. Add the
required changes to support this feature.
CRs-fixed: 938514
Change-Id: I7788b1475cd22bdea291bcae47f048131b220ce3
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Clear TX HOLD when ANC is enabled and decimator
10 to 13 are selected.
Change-Id: I18c1ddeacc59c1ae7d88daf371c84140c0459693
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Change RX disconnect port sequence so as to avoid
slimbus underflow and audio mute issues during
playback.
Change-Id: I0260e61b78e3bcfe422896dc60b15af84be424a4
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Since the underlying codec can have different memory map, it is possible
the starting offset and size for DRAM can be different as well. This
causes the collected dumps to be incorrect on some platforms. Fix the
ramdump collection to obtain DRAM offset and size from CPE services
which is aware of the codec being used.
CRs-fixed: 929517
Change-Id: I6a592d8f97da117d1e58154460cd0b8f3cbf62c7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
The DRAM size used for codec WCD9335 is incorrect, this is causing the
dumps to be wrong. Update the DRAM size for WCD9335 as per the memory
map.
CRs-fixed: 929517
Change-Id: Ie4815b4cedf429b0d7045b84381d945bde62d5ce
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
When BUSID pin is connected to ground, wsa speaker should be
set as left. When it is connected to VDD, wsa speaker should
be set as right. Current setting is inversed.
Correct stereo wsa speaker left/right setting for 8976.
Change-Id: If2b44be202f084d76cd9e58307d36c3fce802e3f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Port fixes for TX pop and spkr gain updates for tasha.
Also add fix in WSA for retry when device re-enumeration.
Change-Id: I6573517a101a4e5b0c34ef07a78c7dd0a4f127e5
Signed-off-by: Laxminath Kasam <lkasam@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>
After SSR, MICBIAS is not enabled as micb_ref is not correct.
So set micb_ref to zero post SSR.
Change-Id: Iaffa7a29799a9b3ed7a46da3cb11a2d4c47e45e9
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
From second detection onwards, buffered data has one extra
stale sample before the actual data even though CPE TX PP
(PingPong) buffer is properly disabled. Avoid this extra data
by clearing TX PP buffer memory after reading the complete buffer.
Change-Id: Id3183f64136e827641ab4d00450dbdb7806f00ab
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Default FIFO watermark value is set as 8 bytes. Observed data skipping
randomly at higher sample rates with default watermark value. Increase
the watermark value to 16 bytes to avoid data loss.
Change-Id: Ic595f62f243b6087ceb2dc61089f957b6a6f8121
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
When userspace requests small duration of buffer then it is possible
that the buffer can overflow if only one buffer is queued at a time.
This is because of more channel setup time than buffer size duration.
Queue two buffers with slimbus before starting AFE port to avoid
data loss.
Change-Id: Iabb6f6b1d0e3ee8227ed8be26a64e7eb025e7018
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently 16KHz is the maximum supported CPE data transfer
rate. Add support to transfer LAB(Look Ahead buffer) data
from CPE at maximum rate of 384KHz/32bit.
Change-Id: Ic4475d91ca2962c90f424816ef03df0a68ccdf92
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
CPE PP(ping-pong) buffer hardware block is added to support
higher data transfers from CPE in WCD9335 V2. Update codec
driver to enable CPE PP buffer path.
Change-Id: I030cef25d6eddc72a02859f6ee78f201efc3dd43
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently only one CPE AFE output port is supported. Add
an API to get CPE AFE port ID from codec driver. Use that
port ID for LAB buffering.
Change-Id: I74fdeb1800a64ed775608967e4d315f28d48e9ef
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
In compressed driver streams might get stopped while
ioctl drain is started but not completed, since buffers
are drained in multiple stages when gapless mode is
enabled.
Check stream state before issuing wait commands to
prevent waiting for drain ack on stopped streams.
Change-Id: I606639c103a7aed90dd9a4561fa6dffc3d4c3822
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Issue slim slave port disconnect command to tear
down the audio playback path and then wait for
the channel removal interrupt from the slimbus slave.
This is required because of the slim protocol (pull
mode) being used for 44.1KHz native audio playback.
If MSM side slimbus channels are closed first followed
by slim slave ports, it will lead to underflow errors
at the end of audio playback with 44.1KHz sample rate.
To avoid underflow errors, slim slave port disconnect
command is issued explicitly.
Change-Id: Ib7ae6f7c5301073f7a9cf51ec3536504b9cdd7c7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
MCLK needs to be turned on for efuse sensing to be successful.
During post SSR codec bring up, make sure MCLK is restored
before efuse sensing, if audio use cases were running when
SSR happened.
Change-Id: I3a04775ebd88ca81804e472ffa20cb91a66ecaee
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
When device down is called, the work queue for temparature
reading should be cancelled. Without this, there might be
read/write happening while WSA881x device is still in
down (no clock) state.
Change-Id: Ib0a6a9e5f8b45c3952e6a7fe5889901971bf0f08
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
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>
When XO shutdown happens, workqueue scheduled for digital
power collapse is not triggered. In tasha suspend, put
digital core in power collapse if workqueue is pending.
Change-Id: I4ae9bad6b18dd54217fcad5ad60673ee726f4700
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Re-align ANC(Active Noise Cancellation) coefficients per ANC block
to avoid click and pop during ANC headset device path bringup.
Change enables ANC re-alignment based on codec path.
Change-Id: I7af75942fc714a96e478f862b4c8ecacb3f20fdc
Signed-off-by: Sudheer Papothi <spapothi@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>
Add debugfs nodes for CPE FTM.
The callback will load the instruction and execute it.
CPE status will be retrieved and be read by userspace.
New CPE service command validation is added to guarantee
the concurrency of CPE FTM and normal CPE SVA detection.
Change-Id: I0748e357a21d873af5a85bbb80e982db0323beb7
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Add support to control external audio switch thru
machine driver. This is to support msm8952 Polaris
devices.
Change-Id: I42e0779b1f18e4883006fdfa71d99da0d2519784
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
commit 4873867e5f2bd90faad861dd94865099fc3140f3 upstream.
from Designware I2S datasheet, tx/rx XRUN irq is cleared by
reading register TOR/ROR, rather than by writing into them.
Signed-off-by: Yitian Bu <yitian.bu@tangramtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 3c8f7710c1c44fb650bc29b6ef78ed8b60cfaa28 upstream.
The previous fix of pxa library support, which was introduced to fix the
library dependency, broke the previous SoC behavior, where a machine
code binding pxa2xx-ac97 with a coded relied on :
- sound/soc/pxa/pxa2xx-ac97.c
- sound/soc/codecs/XXX.c
For example, the mioa701_wm9713.c machine code is currently broken. The
"select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for
compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared
in sound/arm/Kconfig and sound/soc/pxa/Kconfig.
Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct
pxa2xx-ac97 compilation.
Fixes: 846172dfe3 ("ASoC: fix SND_PXA2XX_LIB Kconfig warning")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
changes to optimize wsa881x register writes that will help in
reducing cold start output latency during audio playback
usecase.
Change-Id: I5b316f77bfbd74ca01da491f263a9e9ae80ec63b
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
During playback close, ioctl call to prepare for same
session is triggered resulting in access to null pointer
access. Add null pointer check before access audio
client and private data in prepare functions.
Change-Id: I88dee5526b4308a710535d966aa7aeceee668e18
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Mark few registers non-cache as they are supposed to be
volatile. This will avoid audio mute after SSR.
Change-Id: I44a99c2b609fbfbd6c9ce7fd2e4b1354ed03bc20
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When no LSM session is active, return from msm_lsm_close
and avoid null pointer dereference.
Change-Id: I9f57c08e080497765eaefef0c031bbf956c02914
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Update RX shutdown sequence so that port underflow/
overflows can be avoided when slim data protocol
is changed.
Change-Id: I3428623658633ca88e279bcb5c23025214586985
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
WCD9335 codec version 2.0 supports multiple headphone
modes namely LOHIFI, LOWPWR for audio playback. Add
support to configure codec registers for these modes
in version 2.0.
Change-Id: I62eb409868795ea3913f6e967429b76f45cde2f9
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Update RX shutdown sequence so that codec
path gets tear down first followed by cpu dai.
This will avoid slim port underflow/overflows
when slim data protocol is changed.
Change-Id: I6e3582fa010d18d4e0ccfde319dfc4d81af1351f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
To make power savings during sleep in tasha 2.0, add
required changes for setting codec registers for
rock bottom current. Apply RBSC(rock bottom sleep current)
settings only when no audio and no SVA usecase running.
Apply default value back when any of audio or SVA usecase
starts.
Change-Id: If8516b15cf38575ed2e1a1f6ebfdf49566bc8237
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
SIDO buck voltage can be dropped down to low voltage
when no audio usecase running. Update the sido buck
voltage to nominal or low voltage(svs) based on CPE
and audio usecases running.
Change-Id: Ie6caff7c264fa7f169098acf4e8fe1cc60c97d22
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
WSA881x version based register default values are
updated using regmap_register_patch() API, which
will bypass the cache. Fix this by enabling cache_only
flag before updating the register reset values.
Change-Id: I5c6838d9c84f9e0233c22f638238afc5d4a8980d
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
During playback, read wsa881x temperature and update
ocp register based on certain temperature conditions
to avoid speaker damage.
Change-Id: I3c8dd9fdc8ef480f8997338b349f31b72c7cfa48
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
When FB spkr. prot. calibration is set check
the mode flag received from userspace instead
of the stale mode in the local structure.
Change-Id: I4fa2074d19a1c8eb1341eaca5405d4183ea9f848
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
During bootup, probe function will get called multiple times until
sound card is registered. And it calls msm8952_init_wsa_switch_supply
for each probe. If registeration fails, it'll not call
regulator_put to decrease regulator ref. In regulator consumers,
there are multiple sound-msm-vdd-wsa-switch.
Use devm_regulator_get instead of regulator_get to correct regulator
ref.
Change-Id: Ie270d235102f784241e3bf9566b811bbda22e419
Signed-off-by: Meng Wang <mwang@codeaurora.org>
The e-fuse sensing for WCD9335 codec should be done
before reg_cache_sync in ADSP SSR post reset callback.
This is to make sure that the SIDO BUCK settings are
done before the codec is completely brought out of
reset.
Change-Id: Ic391307ca26b2d9203f0a8646e17fa650540c9e5
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Before enabling the power amplifier during start of the playback,
read wsa temperature and update ocp register based on temperature.
Change-Id: I3fa58d73e324bab8286d558dc4634eb1e08df325
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Add ignore suspend for input and output widgets so that dapm will
not power down these widgets while they are in use and the system
is going to suspend.
Change-Id: Iec9972c9ff2c9e7d3d653e5f809d9aeaf085155b
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Add support in machine driver to be able to parse device
tree for all possible wsa881x that are supported in the
target, find out from ALSA core about how many wsa881x out
of the list of devices passed from device tree are present
in the target and already registered with ALSA as codec,
and eventually register those wsa881x devices (which are
present) as AUX codec to be used with the sound card.
Change-Id: I69a5cf7d542178aca97eb0dd91e5b35e23467c93
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Drivers might need to use the ASoC core function to
find out whether a particular codec is already
registered with ALSA core or not. Export the function
so that drivers can use it outside of the file.
Change-Id: I2e4fb191afab9dccf1be3d380f54a81797b2d6e5
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
For wsa881x dynamic detection, create a new function to
handle the enumeration of a wsa881x device. Once a device
is enumerated successfully, this new function will perform
below 2 tasks on the device-
- register device with regmap
- register device as a codec with ALSA core.
Change-Id: I087b6869361e880814a8f11d5912bc6530b56758
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Interrupt any wait events during free of the compress driver
and move spinlock unlock to after the ASM client is freed.
Change-Id: Idb865ebbb47b86ac32043ba4562053d3f9795b4d
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
openCPE framework allows third party vendors to integrate audio/voice
processing algorithms into CPE. Add support for openCPE.
Change-Id: I8a0e00fa3dd74753834ba653b7ee3c84e72fd39e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add LSM topology calibration blocks. Topology is sent to identify the
modules that will be invoked in CPE.
Change-Id: I62c84ca211398d8d0bde1b826286512cd2d38688
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
For supporting multiple algorithms on CPE, the cpe image needs to be
re-downloaded based on the algorithm. Add changes to expose sysfs
interface to accept cpe firmware image name and download the image with
the name provided at run time.
Change-Id: I0dfd71c45f87b75b694e5a82d66601db11544ee4
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Speaker configuration varies based on the type of aux codec(wsa)
variant. Send speaker configuration from machine driver to wcd9335
based on aux codec variant.
Change-Id: Ib7bfee3a1692e0d33a31f3ec3a756213ac03409e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
pdata->codec is null when referenced from tx hw params
fixup. Use the correct pointer to avoid crash issue.
Change-Id: I4e34dcf569643f72b6b1d337cd6be095228731e2
CRs-fixed: 916976
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Increase slimbus clock gear during device path bringup to
reduce the latency of codec register writes. Change increases
slimbus clock gear before device path bringup and restore
back to default after device path bringup.
Change-Id: I6aae7fffb001c4b0dbf6947bb41200682965a38f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
As soundwire is in wcd9335 codec, all soundwire register writes
should go through codec. To reduce the latency of register
writes during device path bringup, add bulk register write
function to write multiple soundwire registers in one
transaction.
Change-Id: I97055d20ef1e7cfb15b41e00183291a10af35b1f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Codec digital registers need to be synched once codec is
out of digital power collapse. regcache_sync_region will
sync only part of the hardware registers. Change uses
regcache_sync_region to sync codec digital registers
after codec is out of digital power collapse. This will
avoid synching of all the codec registers.
Change-Id: Ib86ff31cfab115e760cf38a2093159cd47e6a8e7
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Currently slimbus_0_rx backend connecting to aif_mix_rx1 codec
DAI does not support 44.1KHz sample rates. Enhance this backend
and aif_mix_rx1 codec dai to support 44.1KHz sample rate playback.
Change-Id: I387f726eb6db11d685eb1fc4969a29dcd14bfd04
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Once the register jack and button jack are registered
to input susystem, we dont need to register the same
again after SSR. Moreover SOC framework will give
warnings if we try to re-register.
CRs-fixed: 894619
Change-Id: I0c16247d507addd0a5b351d620da37dd78473c2d
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Add mixer controls to be exposed to userspace for getting impedance
detection and plug type whether mono or stereo.
Change-Id: I6b587a1c16f507acf99370725b3c098346c42d5e
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Move jack type parsing to audrx_init, otherswise
jack type can be wrong when dtsi has two external
audio codecs.
Change-Id: I38c301ac139e6ba595e2911ba655ecb90b9be233
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Headphone can be mono/stereo type. Add support to detect
whether inserted plug is mono or stereo headset.
Change-Id: I9fff758748b7fd20da81f3f7b2c7fcac290cc3c3
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Enhance the impedance detection logic for wcd9335 codec version 2.0
to improve accuracy and also detecting impedances on varied headsets
like floating, mono and stereo headset combinations.
Change-Id: I16badd6e7906f5aa2a65edb992071cd21898cd6f
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Export wsa881x_get_temp() API from wsa temperature sensor driver
so that wsa881x driver can update the register values based on the
temperature read.
Change-Id: I2fc1298ce9ce896180af202e5f23e39b0dd551ca
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Due to slow insertion of headset, it can get detected as headphone
momentarily and the impedance is also very high which makes the
headset to be detected as lineout. Set a maximum limit for impedance
and do not report it as lineout in report plug if the value is very
high.
Change-Id: I5c95b732ae345e442d1d7251069690b581d66144
CRs-fixed: 902537
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
This change fixes codec HW issues, Slimbus master capability issue
and codec NACK issues caused due to SIDO buck going down abruptly.
Change-Id: I74e94630b2ba4c132d66315ceee5127e05f284c6
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJVoAOcAAoJEDjbvchgkmk+UhcP/1EOwnsJDcZ/sZkkclNgRmrJ
yLBCW65caLAI2E3SmIdKvHQwIx7lHzX5gmWRBrvx+fIl4KhaNKEQ0NCOf1ATaVuQ
MkYMdkicXWpLiFNdKokezryevGS8T1RME+2QlPFv3++Rby1Gy90YD5tu7YlIrEn7
sPRJQHEPCzVAQ7Lqhd66yHICM6/QvdefXj4pjh7vV8IMb2YwnY4vqYt7RxnJCUfP
tqljxrT274kzpA2awzALNh+o3B3/Y4W9ROmlDWviw3JBc9gEqFXYwbDf8KDwA5c0
sp9GPGed/dV5DFuqRcAHksJenFnE3E4gZjo/R5hluHQU27peBuRfXev2hZyBfZqG
796eUOky8fb0OiyxHfT2vhfGeD7CHI/asvIAORjDBVUqzJy9nkkby3XJ0U4tW+pz
VkcilD2oHw1uRIFH3JoBWTJ9W6CYSNFG1qxw+brgfKT5otJG/dBiI8kBABx+aTq7
V+A2cvf11oVwDEb93dnVypMGsfCywqzJUwEIRli9fTFjK7Fg9CBSGX38nwVGUaRv
M2/NeloTyWqUQE41Nd11gCu+hKQRtUU77nxpZcSeKn1XsbpO9/7dHTwcELRuKnTD
9XDksqPznXmC9KXGj7XMcRkLyWyB//JHjay0FCS6b4S6v7R5nrEIRjcpdB+H1WLd
zMOXRH4ZlcOAS/Yt2QMd
=8AB3
-----END PGP SIGNATURE-----
Merge upstream tag 'v3.10.84' into LA.BR.1.3.3
This merge brings us up-to-date as of upstream tag v3.10.84
* tag 'v3.10.84' (317 commits):
Linux 3.10.84
fs: Fix S_NOSEC handling
KVM: x86: make vapics_in_nmi_mode atomic
MIPS: Fix KVM guest fixmap address
x86/PCI: Use host bridge _CRS info on Foxconn K8M890-8237A
powerpc/perf: Fix book3s kernel to userspace backtraces
arm: KVM: force execution of HCPTR access on VM exit
Revert "crypto: talitos - convert to use be16_add_cpu()"
crypto: talitos - avoid memleak in talitos_alg_alloc()
sctp: Fix race between OOTB responce and route removal
packet: avoid out of bounds read in round robin fanout
packet: read num_members once in packet_rcv_fanout()
bridge: fix br_stp_set_bridge_priority race conditions
bridge: fix multicast router rlist endless loop
sparc: Use GFP_ATOMIC in ldc_alloc_exp_dring() as it can be called in softirq context
Linux 3.10.83
bus: mvebu: pass the coherency availability information at init time
KVM: nSVM: Check for NRIPS support before updating control field
ARM: clk-imx6q: refine sata's parent
d_walk() might skip too much
ipv6: update ip6_rt_last_gc every time GC is run
ipv6: prevent fib6_run_gc() contention
xfrm: Increase the garbage collector threshold
Btrfs: make xattr replace operations atomic
x86/microcode/intel: Guard against stack overflow in the loader
fs: take i_mutex during prepare_binprm for set[ug]id executables
hpsa: add missing pci_set_master in kdump path
hpsa: refine the pci enable/disable handling
sb_edac: Fix erroneous bytes->gigabytes conversion
ACPICA: Utilities: Cleanup to remove useless ACPI_PRINTF/FORMAT_xxx helpers.
ACPICA: Utilities: Cleanup to convert physical address printing formats.
__ptrace_may_access() should not deny sub-threads
include/linux/sched.h: don't use task->pid/tgid in same_thread_group/has_group_leader_pid
netfilter: Zero the tuple in nfnl_cthelper_parse_tuple()
netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings
config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected
get rid of s_files and files_lock
fput: turn "list_head delayed_fput_list" into llist_head
Linux 3.10.82
lpfc: Add iotag memory barrier
pipe: iovec: Fix memory corruption when retrying atomic copy as non-atomic
drm/mgag200: Reject non-character-cell-aligned mode widths
tracing: Have filter check for balanced ops
crypto: caam - fix RNG buffer cache alignment
Linux 3.10.81
btrfs: cleanup orphans while looking up default subvolume
btrfs: incorrect handling for fiemap_fill_next_extent return
cfg80211: wext: clear sinfo struct before calling driver
mm/memory_hotplug.c: set zone->wait_table to null after freeing it
drm/i915: Fix DDC probe for passive adapters
pata_octeon_cf: fix broken build
ozwpan: unchecked signed subtraction leads to DoS
ozwpan: divide-by-zero leading to panic
ozwpan: Use proper check to prevent heap overflow
MIPS: Fix enabling of DEBUG_STACKOVERFLOW
ring-buffer-benchmark: Fix the wrong sched_priority of producer
USB: serial: ftdi_sio: Add support for a Motion Tracker Development Board
USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle
block: fix ext_dev_lock lockdep report
Input: elantech - fix detection of touchpads where the revision matches a known rate
ALSA: usb-audio: add MAYA44 USB+ mixer control names
ALSA: usb-audio: Add mic volume fix quirk for Logitech Quickcam Fusion
ALSA: hda/realtek - Add a fixup for another Acer Aspire 9420
iio: adis16400: Compute the scan mask from channel indices
iio: adis16400: Use != channel indices for the two voltage channels
iio: adis16400: Report pressure channel scale
xen: netback: read hotplug script once at start of day.
udp: fix behavior of wrong checksums
net_sched: invoke ->attach() after setting dev->qdisc
unix/caif: sk_socket can disappear when state is unlocked
net: dp83640: fix broken calibration routine.
bridge: fix parsing of MLDv2 reports
ipv4: Avoid crashing in ip_error
net: phy: Allow EEE for all RGMII variants
Linux 3.10.80
fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
vfs: read file_handle only once in handle_to_path
ACPI / init: Fix the ordering of acpi_reserve_resources()
Input: elantech - fix semi-mt protocol for v3 HW
rtlwifi: rtl8192cu: Fix kernel deadlock
md/raid5: don't record new size if resize_stripes fails.
svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures
ARM: fix missing syscall trace exit
ARM: dts: imx27: only map 4 Kbyte for fec registers
crypto: s390/ghash - Fix incorrect ghash icv buffer handling.
rt2x00: add new rt2800usb device DWA 130
libata: Ignore spurious PHY event on LPM policy change
libata: Add helper to determine when PHY events should be ignored
ext4: check for zero length extent explicitly
ext4: convert write_begin methods to stable_page_writes semantics
mmc: atmel-mci: fix bad variable type for clkdiv
powerpc: Align TOC to 256 bytes
usb: gadget: configfs: Fix interfaces array NULL-termination
usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices
USB: cp210x: add ID for KCF Technologies PRN device
USB: pl2303: Remove support for Samsung I330
USB: visor: Match I330 phone more precisely
xhci: gracefully handle xhci_irq dead device
xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256
xhci: fix isoc endpoint dequeue from advancing too far on transaction error
target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST
ASoC: wm8994: correct BCLK DIV 348 to 384
ASoC: wm8960: fix "RINPUT3" audio route error
ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls
ALSA: hda - Add headphone quirk for Lifebook E752
ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724
d_walk() might skip too much
lib: Fix strnlen_user() to not touch memory after specified maximum
hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE
libceph: request a new osdmap if lingering request maps to no osd
lguest: fix out-by-one error in address checking.
fs, omfs: add NULL terminator in the end up the token list
KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages
net: socket: Fix the wrong returns for recvmsg and sendmsg
kernel: use the gnu89 standard explicitly
staging, rtl8192e, LLVMLinux: Remove unused inline prototype
staging: rtl8712, rtl8712: avoid lots of build warnings
staging, rtl8192e, LLVMLinux: Change extern inline to static inline
drm/i915: Fix declaration of intel_gmbus_{is_forced_bit/is_port_falid}
staging: wlags49_h2: fix extern inline functions
Linux 3.10.79
ACPICA: Utilities: Cleanup to enforce ACPI_PHYSADDR_TO_PTR()/ACPI_PTR_TO_PHYSADDR().
ACPICA: Tables: Change acpi_find_root_pointer() to use acpi_physical_address.
revert "softirq: Add support for triggering softirq work on softirqs"
sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND)
mmc: card: Don't access RPMB partitions for normal read/write
pinctrl: Don't just pretend to protect pinctrl_maps, do it for real
drm/i915: Add missing MacBook Pro models with dual channel LVDS
ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC
ARM: dts: imx23-olinuxino: Fix dr_mode of usb0
ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name
ARM: dts: imx25: Add #pwm-cells to pwm4
gpio: sysfs: fix memory leaks and device hotplug
gpio: unregister gpiochip device before removing it
xen/console: Update console event channel on resume
mm/memory-failure: call shake_page() when error hits thp tail page
nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
ocfs2: dlm: fix race between purge and get lock resource
Linux 3.10.78
ARC: signal handling robustify
UBI: fix soft lockup in ubi_check_volume()
Drivers: hv: vmbus: Don't wait after requesting offers
ARM: dts: dove: Fix uart[23] reg property
staging: panel: fix lcd type
usb: gadget: printer: enqueue printer's response for setup request
usb: host: oxu210hp: use new USB_RESUME_TIMEOUT
3w-sas: fix command completion race
3w-9xxx: fix command completion race
3w-xxxx: fix command completion race
ext4: fix data corruption caused by unwritten and delayed extents
rbd: end I/O the entire obj_request on error
serial: of-serial: Remove device_type = "serial" registration
ALSA: hda - Fix mute-LED fixed mode
ALSA: emu10k1: Emu10k2 32 bit DMA mode
ALSA: emu10k1: Fix card shortname string buffer overflow
ALSA: emux: Fix mutex deadlock in OSS emulation
ALSA: emux: Fix mutex deadlock at unloading
ipv4: Missing sk_nulls_node_init() in ping_unhash().
Linux 3.10.77
s390: Fix build error
nosave: consolidate __nosave_{begin,end} in <asm/sections.h>
memstick: mspro_block: add missing curly braces
C6x: time: Ensure consistency in __init
wl18xx: show rx_frames_per_rates as an array as it really is
lib: memzero_explicit: use barrier instead of OPTIMIZER_HIDE_VAR
e1000: add dummy allocator to fix race condition between mtu change and netpoll
ksoftirqd: Enable IRQs and call cond_resched() before poking RCU
RCU pathwalk breakage when running into a symlink overmounting something
drm/i915: cope with large i2c transfers
drm/radeon: fix doublescan modes (v2)
i2c: core: Export bus recovery functions
IB/mlx4: Fix WQE LSO segment calculation
IB/core: don't disallow registering region starting at 0x0
IB/core: disallow registering 0-sized memory region
stk1160: Make sure current buffer is released
mvsas: fix panic on expander attached SATA devices
Drivers: hv: vmbus: Fix a bug in the error path in vmbus_open()
xtensa: provide __NR_sync_file_range2 instead of __NR_sync_file_range
xtensa: xtfpga: fix hardware lockup caused by LCD driver
ACPICA: Utilities: split IO address types from data type models.
drivers: parport: Kconfig: exclude arm64 for PARPORT_PC
scsi: storvsc: Fix a bug in copy_from_bounce_buffer()
UBI: fix check for "too many bytes"
UBI: initialize LEB number variable
UBI: fix out of bounds write
UBI: account for bitflips in both the VID header and data
tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile
powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
ext4: make fsync to sync parent dir in no-journal for real this time
arm64: kernel: compiling issue, need delete read_current_timer()
video: vgacon: Don't build on arm64
console: Disable VGA text console support on cris
drivers: parport: Kconfig: exclude h8300 for PARPORT_PC
parport: disable PC-style parallel port support on cris
rtlwifi: rtl8192cu: Add new device ID
rtlwifi: rtl8192cu: Add new USB ID
ptrace: fix race between ptrace_resume() and wait_task_stopped()
fs/binfmt_elf.c: fix bug in loading of PIE binaries
Input: elantech - fix absolute mode setting on some ASUS laptops
ALSA: emu10k1: don't deadlock in proc-functions
usb: core: hub: use new USB_RESUME_TIMEOUT
usb: host: sl811: use new USB_RESUME_TIMEOUT
usb: host: xhci: use new USB_RESUME_TIMEOUT
usb: host: isp116x: use new USB_RESUME_TIMEOUT
usb: host: r8a66597: use new USB_RESUME_TIMEOUT
usb: define a generic USB_RESUME_TIMEOUT macro
usb: phy: Find the right match in devm_usb_phy_match
ARM: S3C64XX: Use fixed IRQ bases to avoid conflicts on Cragganmore
ARM: 8320/1: fix integer overflow in ELF_ET_DYN_BASE
power_supply: lp8788-charger: Fix leaked power supply on probe fail
ring-buffer: Replace this_cpu_*() with __this_cpu_*()
spi: spidev: fix possible arithmetic overflow for multi-transfer message
cdc-wdm: fix endianness bug in debug statements
MIPS: Hibernate: flush TLB entries earlier
KVM: use slowpath for cross page cached accesses
s390/hibernate: fix save and restore of kernel text section
KVM: s390: Zero out current VMDB of STSI before including level3 data.
usb: gadget: composite: enable BESL support
Btrfs: fix inode eviction infinite loop after cloning into it
Btrfs: fix log tree corruption when fs mounted with -o discard
tcp: avoid looping in tcp_send_fin()
tcp: fix possible deadlock in tcp_send_fin()
ip_forward: Drop frames with attached skb->sk
Linux 3.10.76
dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"
arc: mm: Fix build failure
sb_edac: avoid INTERNAL ERROR message in EDAC with unspecified channel
x86: mm: move mmap_sem unlock from mm_fault_error() to caller
vm: make stack guard page errors return VM_FAULT_SIGSEGV rather than SIGBUS
vm: add VM_FAULT_SIGSEGV handling support
deal with deadlock in d_walk()
move d_rcu from overlapping d_child to overlapping d_alias
kconfig: Fix warning "‘jump’ may be used uninitialized"
KVM: x86: SYSENTER emulation is broken
netfilter: conntrack: disable generic tracking for known protocols
Bluetooth: Ignore isochronous endpoints for Intel USB bootloader
Bluetooth: Add support for Intel bootloader devices
Bluetooth: btusb: Add IMC Networks (Broadcom based)
Bluetooth: Add firmware update for Atheros 0cf3:311f
Bluetooth: Enable Atheros 0cf3:311e for firmware upload
mm: Fix NULL pointer dereference in madvise(MADV_WILLNEED) support
splice: Apply generic position and size checks to each write
jfs: fix readdir regression
serial: 8250_dw: Fix deadlock in LCR workaround
benet: Call dev_kfree_skby_any instead of kfree_skb.
ixgb: Call dev_kfree_skby_any instead of dev_kfree_skb.
tg3: Call dev_kfree_skby_any instead of dev_kfree_skb.
bnx2: Call dev_kfree_skby_any instead of dev_kfree_skb.
r8169: Call dev_kfree_skby_any instead of dev_kfree_skb.
8139too: Call dev_kfree_skby_any instead of dev_kfree_skb.
8139cp: Call dev_kfree_skby_any instead of kfree_skb.
tcp: tcp_make_synack() should clear skb->tstamp
tcp: fix FRTO undo on cumulative ACK of SACKed range
ipv6: Don't reduce hop limit for an interface
tcp: prevent fetching dst twice in early demux code
remove extra definitions of U32_MAX
conditionally define U32_MAX
Linux 3.10.75
pagemap: do not leak physical addresses to non-privileged userspace
console: Fix console name size mismatch
IB/mlx4: Saturate RoCE port PMA counters in case of overflow
kernel.h: define u8, s8, u32, etc. limits
net: llc: use correct size for sysctl timeout entries
net: rds: use correct size for max unacked packets and bytes
ipc: fix compat msgrcv with negative msgtyp
core, nfqueue, openvswitch: fix compilation warning
media: s5p-mfc: fix mmap support for 64bit arch
iscsi target: fix oops when adding reject pdu
ocfs2: _really_ sync the right range
be2iscsi: Fix kernel panic when device initialization fails
cifs: fix use-after-free bug in find_writable_file
usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers
cpuidle: ACPI: do not overwrite name and description of C0
dmaengine: omap-dma: Fix memory leak when terminating running transfer
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifo
Defer processing of REQ_PREEMPT requests for blocked devices
USB: ftdi_sio: Use jtag quirk for SNAP Connect E10
USB: ftdi_sio: Added custom PID for Synapse Wireless product
radeon: Do not directly dereference pointers to BIOS area.
writeback: fix possible underflow in write bandwidth calculation
writeback: add missing INITIAL_JIFFIES init in global_update_bandwidth()
mm/memory hotplug: postpone the reset of obsolete pgdat
nbd: fix possible memory leak
iwlwifi: dvm: run INIT firmware again upon .start()
IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic
IB/core: Avoid leakage from kernel to user space
tcp: Fix crash in TCP Fast Open
selinux: fix sel_write_enforce broken return value
ALSA: hda - Fix headphone pin config for Lifebook T731
ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support
ALSA: hda - Add one more node in the EAPD supporting candidate list
Linux 3.10.74
net: ethernet: pcnet32: Setup the SRAM and NOUFLO on Am79C97{3, 5}
powerpc/mpc85xx: Add ranges to etsec2 nodes
hfsplus: fix B-tree corruption after insertion at position 0
dm: hold suspend_lock while suspending device during device deletion
vt6655: RFbSetPower fix missing rate RATE_12M
perf: Fix irq_work 'tail' recursion
Revert "iwlwifi: mvm: fix failure path when power_update fails in add_interface"
mac80211: drop unencrypted frames in mesh fwding
mac80211: disable u-APSD queues by default
nl80211: ignore HT/VHT capabilities without QoS/WMM
tcm_qla2xxx: Fix incorrect use of __transport_register_session
tcm_fc: missing curly braces in ft_invl_hw_context()
ASoC: wm8955: Fix wrong value references for boolean kctl
ASoC: adav80x: Fix wrong value references for boolean kctl
ASoC: ak4641: Fix wrong value references for boolean kctl
ASoC: wm8904: Fix wrong value references for boolean kctl
ASoC: wm8903: Fix wrong value references for boolean kctl
ASoC: wm2000: Fix wrong value references for boolean kctl
ASoC: wm8731: Fix wrong value references for boolean kctl
ASoC: tas5086: Fix wrong value references for boolean kctl
ASoC: wm8960: Fix wrong value references for boolean kctl
ASoC: cs4271: Fix wrong value references for boolean kctl
ASoC: sgtl5000: remove useless register write clearing CHRGPUMP_POWERUP
Change-Id: Ib7976ee2c7224e39074157e28db4158db40b00db
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
Frame info which track size of captured data and offset is dyanmically
allocated data. Some crashes are reported due to frame info is used after
free. Error type is null pointer dereference. Total size of frame info is
relatively small and it is part of msm_audio which is dynamically
allocated structure. No need to allocate and track it separately.
Change-Id: I393a935cb43454af7b208039bf39af7bfe7feb06
Signed-off-by: Fred Oh <fred@codeaurora.org>
Program button 4,5,6 and 7 thresholds correctly
so as to avoid unnecessary button press interrupts
when mic impedance is low enough to cause mic
voltage greater than 500mV.
Change-Id: I934785123413d81ac6d0511ece186d15d18fa752
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
If gnd_mic switch is flipped during cross connection,
revert it back while removal. Otherwise, some special
headsets can not be detected because they depend upon
the mic voltage for detection which is incorrect in
this scenario.
CRs-fixed: 903507
Change-Id: Ia6c62fc987aad66d65f9a69197ff092f130892b3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Program button 4,5,6 and 7 thresholds correctly
so as to avoid unnecessary button press interrupts
when mic impedance is low enough to cause mic
voltage greater than 500mV.
Change-Id: I934785123413d81ac6d0511ece186d15d18fa752
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
After enable temp sensor to register thermal zone, it is left On
and not disabled it when disable path. But bandgap is disabled
at disable path. So temp sensor is being left on without bandgap,
there is chance that it can be fed with wrong/unexpected value from
ADC as per HW team. Disable temp sensor in turn off sequence before
bandgap disable happen.
Change-Id: Iacd3e239fe44d053a3fe55947ca645dc1efc403d
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
After SSR when the clsh registers and state are reset,
all the counters linked to those states should be reset
as well, otherwise it can result in no sound issue.
CRs-fixed: 896210
Change-Id: I395801beee5e5c0d5063df14aa21ebc9c9a5a613
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
CPE hardware block in the codec is currently enabled in debug mode
to override some known issues. Since all issues are fixed, remove
the debug mode for CPE.
Change-Id: Ia7b35aecd2280b40739dc620c4ed76bdf71dacf9
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Update wcd9335 codec version number in sound info entry
used for register read/write access from adie-rtac.
Change-Id: Id2c6a89ddfac51c322631781e4f9023ce9d3daac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Recording at 24 bit format is not supported, so if
recording is done after the playback of 24 bit format
clip, the recording params are also getting updated
at 24 bit and thus the recording data is improper.
Change-Id: I45ef0188eda2597caa0e2e7cf29fa4d0e21027c2
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Correct plug type to lineout only if headphone is detected and
impedance of left and right is above 5000 ohm. This avoids reporting
lineout for valid headset devices like tty.
CRs-Fixed: 899726
Change-Id: I048c5e63e8cdd526fecf20211f061ed61db39522
Signed-off-by: Walter Yang <yandongy@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>
Correct plug type to lineout only if headphone is detected and
impedance of left and right is above 5000 ohm. This avoids reporting
lineout for valid headset devices like tty.
CRs-Fixed: 899726
Change-Id: I048c5e63e8cdd526fecf20211f061ed61db39522
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
When audio stream manager returns READ_DONE event, the payload
which comes with the event contains size of captured audio data
and offset indicating where the data starts in the buffer.
Before this change, size and offset information is stored in
global variable which can be shared by all capture sessions.
If the offset is overwritten by another session with larger value,
buffer can be indexed beyond actual size of buffer when copying
captured data into user-space buffer. Move the structure as part
of per session private data to prevent overwriting.
Change-Id: Iaee12b0153b945a315e95c862fa2522cbd69c6f8
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@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>
When headphone or headset is inserted at the other end of
extension cable, it should be detected correctly and needs
to be reported to the user-space. Update the mbhc driver
to support detection of plug that gets inserted at the other
end of the extension cable.
Change-Id: Ieaed1913479839a73bba21b53e172c249d2fa94a
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Frame info which track size of captured data and offset is dyanmically
allocated data. Some crashes are reported due to frame info is used after
free. Error type is null pointer dereference. Total size of frame info is
relatively small and it is part of msm_audio which is dynamically
allocated structure. No need to allocate and track it separately.
Change-Id: I393a935cb43454af7b208039bf39af7bfe7feb06
Signed-off-by: Fred Oh <fred@codeaurora.org>
When audio stream manager returns READ_DONE event, the payload
which comes with the event contains size of captured audio data
and offset indicating where the data starts in the buffer.
Before this change, size and offset information is stored in
global variable which can be shared by all capture sessions.
If the offset is overwritten by another session with larger value,
buffer can be indexed beyond actual size of buffer when copying
captured data into user-space buffer. Move the structure as part
of per session private data to prevent overwriting.
Change-Id: Iaee12b0153b945a315e95c862fa2522cbd69c6f8
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ANC coefficent indices can change during reading
of all wcd9335 registers. These ANC coefficients indices
should be re-aligned for proper ANC functionality.
Change re-aligns ANC coefficient indices to correct
pointer before enabling ANC functionality.
Change-Id: I42cd1cdb78c89ff860918ea917cfd0da146c07c6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
CPE (Codec Processing Engine) block in the hardware has multiple
exception interrupts. When CPE crashes, it is possible it will generate
multiple and spurious exception interrupts. This is causing some
interrupts to be missed. Fix this by making sure interrupts that are
serviced are masked to avoid spurious interrupts and pending interrupts
are serviced to avoid missing interrupts.
CRs-fixed: 874196
Change-Id: I63f3ef2eac3f194d5e535c607893236d3ae6a4ab
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
CPE (Codec Processing Engine) block in the hardware has multiple
exception interrupts. When CPE crashes, it is possible it will generate
multiple and spurious exception interrupts. This is causing some
interrupts to be missed. Fix this by making sure interrupts that are
serviced are masked to avoid spurious interrupts and pending interrupts
are serviced to avoid missing interrupts.
CRs-fixed: 874196
Change-Id: I63f3ef2eac3f194d5e535c607893236d3ae6a4ab
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Set current(IRef) and voltage(VRef) references to external and use
supply from RCO (RC Oscillator) bandgap.
Change-Id: I9c0d608011e20670aafaa343d7c11c17129b5704
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Define callback function to control headphone auto
pull down for wcd9335. It is required for mbhc to
disable/enable the pull down on headphone when plug
detection is in progress.
Change-Id: I63774a9187124ea69a2baff9099102348d719c52
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
By default, the keeper in NPL(Near Pad Logic) is enabled to
reduce leakage. This bit has to set to zero before enabling
soundwire master functionality. Change toggles keeper to low
before soundwire master is enabled and keeper to high after
soundwire master is disabled.
Change-Id: I72571cb74237f8a98f674a9e8e57c68df17d1c79
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
WCD9335 codec version 2.0 has support for detecting
over current in headphones path and shuts the headphone
PAs whenever over current is detected. Add support to
enable OCP (over current protection) for headphone path.
Change-Id: Iabad301bb8a926bfdef437754b13ba583dd315d7
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Pull down switches on headphone outputs need to be
enabled after accessory detection is completed to
eliminate noise on headphone when no audio gets
played and if device is getting charged through
usb cable. Add support to enable headphone auto
pull down.
Change-Id: Ife83a5843782e8b0e8238be6eaebbeccec4e929d
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
WCD9335 Codec version 2.0 has different efuse sequence
when compared to previous versions v1.0/v1.1. Update
the codec efuse programming sequence based on the version.
Change-Id: I830c3f4f33e246e06c7733d9518353518f8ee752
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
snd_soc_dapm_force_enable_pin takes the dapm mutex
internally and then calls into the function
snd_soc_dapm_force_enable_pin_unlocked, where the mutex
is again acquired resulting into a deadlock. Fix
the double lock by not acquiring the mutex within
the unlocked version of the function.
Change-Id: I6c68f1ef1645997bbcb1e5b197652c41baa609d3
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Currently DMIC pins are configured to drive either high or low mode
but not High-Z mode. There is a requirement to put the DMIC pins in
High-Z mode depends on the usecase in runtime. This change adds
support to drive High-Z state for DMICs through mixer controls.
Change-Id: I6fe76dff757384a634ab173c349b8f87a4fc4195
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently micbias enablement is tied to audio recording
use-cases. However, there are few audio use-cases where
just only micbias needs to be enabled. Add support for
enabling standalone micbias.
Change-Id: Iaad27895a9f1811f97b39ea08ca9d0d80758a6f8
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
When online status is updated as soon as codec is reset after ssr,
afe port start for sva case may fail. Update the sequence to handle
this scenario.
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Change-Id: Ifd71df1ca2e5ac88ae952dd191374c6dbecac848
In external codec, the callback to initialize mbhc is not
registered, which causes no headset detection issue.
CRs-fixed: 895387
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Change-Id: Ic72c82e45f296a4dcaa7b9dc7f8a91ba654b83f4
Temperature reading sequence is updated in wsa881x version 2.0.
This change is to add new sequence for temperature reading.
Change-Id: Ide1dbc5ef450c5e67f10ee038a5763b9d45008f6
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
In external codec, the callback to initialize mbhc is not
registered, which causes no headset detection issue.
CRs-fixed: 895387
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Change-Id: Ic72c82e45f296a4dcaa7b9dc7f8a91ba654b83f4
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>
Multichannel playback over Wifi fails due to use of invalid
afe calibration at the time of opening proxy port. Since
there is no afe calibration content for proxy devices, afe
driver erringly sends afe cal tables of the previous device.
This happens because afe tables aren't updated from acdb
loader as proxy port opening is directly carried out from
WFD module.
Currently there is no mechanism to ensure compatibility
between afe ports and afe cal tables cached in the memory.
Therefore, disallow sending of afe cal table, topology and
hardware delay calibration for proxy ports to fix the above
issue through mixer controls.
CRs-Fixed: 880657
Change-Id: I4914bb1b2fca91d71c2c34904a0ca632468efd5a
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
For some use cases like Ultrasound, AFE calibration is not needed
to be sent to DSP. Add a mixer control to set a flag in AFE native
driver for that particular Slimbus port to help avoid sending AFE
calibration data to DSP for those specific use cases. AFE driver
would check for the flag before sending calibration data to DSP.
Change-Id: Idc254224a9b73995f363668e644b2c08f86817e9
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add kcontrol to allow configuration of the proxy port up to eight
channels. This is to support multichannel playback over proxy
port in 8976.
Change-Id: I5646bcbb7a594d8d42c8ef32c3309c40eddfadd4
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Multichannel playback over Wifi fails due to use of invalid
afe calibration at the time of opening proxy port. Since
there is no afe calibration content for proxy devices, afe
driver erringly sends afe cal tables of the previous device.
This happens because afe tables aren't updated from acdb
loader as proxy port opening is directly carried out from
WFD module.
Currently there is no mechanism to ensure compatibility
between afe ports and afe cal tables cached in the memory.
Therefore, disallow sending of afe cal table, topology and
hardware delay calibration for proxy ports to fix the above
issue through mixer controls.
CRs-Fixed: 880657
Change-Id: I4914bb1b2fca91d71c2c34904a0ca632468efd5a
Signed-off-by: Avinash Vaish <avaish@codeaurora.org>
Temperature reading sequence is updated in wsa881x version 2.0.
This change is to add new sequence for temperature reading.
Change-Id: Ide1dbc5ef450c5e67f10ee038a5763b9d45008f6
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
For louder clips with max volume, observe audio drops.
This is seen due to COMP1_B4_CTL setting is not updated
correctly. As per 8952 power grid, buck voltage is 1.8v
and compander register setting is varied based on this.
Update the setting to 1.8v and also ensure the compander
register bit is reset in power down sequence so that
non-compander usecases like ANC are not affected due
to this setting.
CRs-Fixed: 890042
Change-Id: Ib2bd74877d559c7f473b1c7a8a64054fb1f476bc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
For louder clips with max volume, observe audio drops.
This is seen due to COMP1_B4_CTL setting is not updated
correctly. As per 8952 power grid, buck voltage is 1.8v
and compander register setting is varied based on this.
Update the setting to 1.8v and also ensure the compander
register bit is reset in power down sequence so that
non-compander usecases like ANC are not affected due
to this setting.
CRs-Fixed: 890042
Change-Id: Ib2bd74877d559c7f473b1c7a8a64054fb1f476bc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add kcontrol to allow configuration of the proxy port up to eight
channels. This is to support multichannel playback over proxy
port in 8976.
Change-Id: I5646bcbb7a594d8d42c8ef32c3309c40eddfadd4
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
During soft reboot, some times codec is going to bad state as
all the codec supplies are not going down. Due to which codec is not
responding to slimbus which is effecting soundcard registration.
After disabling the regulator wait for 500msec, to ensure regulators
ramp's down completely.
Change-Id: I21de85f9e7170906a877f9328f088a91d0f69ee8
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@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>
There are few use cases where apps goes down to suspend
but codec should be in active state. Core driver will not
have knowledge of these usescases and hence move suspend and
resume hooks to codec driver.
Change-Id: If5614dd13f24a80d18f53f194c7be1c5b967a003
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
check for temperature register values and log the values if
they are out of range.
Change-Id: I58dd4e9b3348215510f61e790ed81bc9d4972768
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Temperature from wsa881x thermal zone sensor is not correct
when wsa881x codec is in suspend state. Bring codec out of
reset and update register cache to read proper temperature
value from thermal zone sensor.
Change-Id: I428ba35cbc10fd6c8ac80f6eb26f218466f44ebc
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Playback startup and teardown register sequence is different
for WSA881X version 2.0. Update the right register sequence
based on version.
Change-Id: Ifa858ab1db6560a50779800d59492fc0b0ac9e56
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently wsa881x default register table is defined for version 1.1.
Some of the default register values are different for version 2.0.
This change is to update default register values based on version.
Change-Id: Ibfd3efd685786fc8d8a94ddb74175e5f6f9aa43e
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Some of the Bongo read only registers are not set as
volatile. Because of this, register values are read
incorrectly when the driver reads these registers. Fix
this issue by updating read only registers as volatile.
Change-Id: I5775b3e776beeef67874025454a0f232336cc777
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
For WSA 2.0 parts, add required support to identify chip
version using CHIP_ID_1 register. Add sequences for
WSA 2.0 for speaker playback and VI sense support
with QCRG 2_0_0_8.
Change-Id: If61d0d60944c6b51ac795a86d095b2b201da42ed
Signed-off-by: Laxminath Kasam <lkasam@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>
During suspend in 8952 with wcd9330, observe high current leakage
from codec. As per designers, the register MICB_2_MBHC (0x133)
bit 2 (PWR_SWCH_OVRD_EN) is set from software resulting in
this issue, and this is not needed to be set.
Remove setting the register bit from driver, after this
observed the expected power numbers during suspend.
Change-Id: I72ed7b0c953b5bd2fd52065a49d796bf8294bff7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
For some use cases like Ultrasound, AFE calibration is not needed
to be sent to DSP. Add a mixer control to set a flag in AFE native
driver for that particular Slimbus port to help avoid sending AFE
calibration data to DSP for those specific use cases. AFE driver
would check for the flag before sending calibration data to DSP.
Change-Id: Idc254224a9b73995f363668e644b2c08f86817e9
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>