Commit graph

23 commits

Author SHA1 Message Date
Joonwoo Park
a76e7e31e0 ASoC: wcd9304: Turn off mclk during clock transition
The clock is not usable when either the clock source changes between
external MCLK and internal RCO or the bandgap mode changes to fast mode.
In such cases, turn off master clock and turn on again later to avoid
codec from going into bad state

CRs-fixed: 442464
Change-Id: Id8d07bbbd4bf6c7be16016800d19ab332b960d1a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-03-15 17:08:23 -07:00
Duy Truong
04e554807c Update copyright to The Linux Foundation
Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-03-15 17:07:39 -07:00
Bhalchandra Gajare
66eb764d85 ASoC: WCD9304: Fix threshold value for class G headphone
When playing a full scale tone with highest gain in the codec, OCP
(Over Current Protection) event is generated. This is caused due to
lower switching frequency for the class G amplifier on headphone
path. Fix the false OCP event trigger by appropriately setting the
class G switching frequency

CRs-fixed: 415990
Change-Id: I9563ab2d06c970b47693293175fe7ae4a711348c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-03-15 17:07:16 -07:00
Banajit Goswami
ced1ad3ad7 ASoC: wcd9304: avoid decrementing active channel count if already zero
During error cases, there might be situation, when slimbus channels
are being closed even when the number of active channels for
that DAI is 0. Avoid decrementing ch_act field if it is already 0.

Change-Id: Ie988eb049a20fc7cf5725ddc183ee1ae5fcb758d
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
2013-03-07 15:24:47 -08:00
Laxminath Kasam
cc6ce665ba ASoC: WCD9304: Fix deadlock in mutex while HS insert
-While music playback is done and PCM close sequence
is in progress, if headset is inserted this will report
headset insert to snd_soc_jack_report. But it will get
stuck here waiting for lock that is already acquired by
DAPM at PCM stream close snd_soc_dapm_stream_event.
-Change the function call used to report insert/removal
from snd_soc_jack_report to snd_soc_jack_report_no_dapm
that fixes this deadlock.

CRs-Fixed: 429766
Change-Id: I167e45bdce9790ff7e878528629c4d652029bf26
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2013-03-07 15:24:43 -08:00
Bhalchandra Gajare
e11f472d33 ASoC: WCD9304: Fix pop level during start of recording
When recording is started, it is observed that the pop level is
much higher than expected. Fix this issue by enabling the High
Pass Filter on microphone path with a cut off frequency of 150Hz
when recording starts and reprogram the cut off frequency back
after a timeout of 300 millisecond.

CRs-fixed: 380966
(cherry picked from commit f9ed163835d1634a86cabc233d85bfe857f0eacf)
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>

Change-Id: If98dfaf0f9b8f14c306f2d6a59154a615752823b

Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:21:05 -08:00
Bhalchandra Gajare
1cb63628d8 ASoC: WCD9304: Wait for earpiece PA to settle down
During playback of audio on earpiece path, the PA on the path
is the last component to be turned on. The turn on of PA can
cause a glitch in the output signal because the level of the PA
is not yet settled. Waiting for 20 msec after turning on the PA
avoids this glitch.

CRs-fixed: 417031
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
(cherry picked from commit 1fa994d4aa256a536523f116232c4822b3495400)

Change-Id: Iaa7a47526c71d8b037df3d09cf30ede296c21356
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:20:57 -08:00
Asish Bhattacharya
0665d30db8 ASoC: wcd9304: reconfig LDO_H_MODE_1 to the ldoh from board file.
The LDO_H_MODE_1 is reset bandgap off mode. This needs to be reconfigured
for audio mode.

CRs-Fixed: 378182
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
(cherry picked from commit 63032b49f45f61660a46acd61bbf529d62ea4d36)

Change-Id: I9fd94624619efc615141f720d8de93e21eafe97a
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:48 -08:00
Bhalchandra Gajare
17b5bcc376 ASoC: WCD9304: Pull in fixes for slimbus connect/disconnect.
Pull in all the recent codec driver changes for connect / disconnect
slimbus ports.

CRs-fixed: 398686
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
(cherry picked from commit c131e9fd7f091b931977bb5280c9071aabb3a3fd)
(cherry picked from commit 1ac4178dfcbfe6de6cea6ac13ef0be18f4a53303)

Change-Id: I2d4f155d840abd3a425fec35ed1407ab13db64c1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:52 -08:00
Asish Bhattacharya
3b7ea4104b ASoC: WCD9304: remove dependency between DMIC's and Decimators.
The source of input signal(ADC or DMIC) needs to configured correctly
in CDC_TXn_MUX_CTL registers for correct operation of Decimators.
Currently for DMIC's, this configuration is done in DMIC DAPM widget
power up/down call back creating dependency between DMIC number and
Decimator number (with current code, DMIC1 can send signal to only
DEC1, DMIC2 can send signal to only DEC2). Remove this dependency by
setting type of input signal when Decimator MUX input is set.

CRs-Fixed: 384279
Change-Id: Ic084bb892d663dea51ca5a5a95c6bdba30453744
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-02-27 18:21:18 -08:00
Bhalchandra Gajare
34847385a5 ASoC: WCD9304: Vote for runtime pm off after slimbus port disconnect
If the vote for pm runtime is done while codec shutdown, it is possible
that the runtime pm vote occurs even before the slimbus port for tx/rx
audio channel is disconnected. This can cause problem in audio playback/
record. Fix by moving the vote for runtime pm after slimbus port has
been disconnected

Change-Id: I711bc5cfee5b832575ea0b91cf68e826f1a3c0f5
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:21:03 -08:00
Bhalchandra Gajare
ebf2101d60 ASoC: WCD9304: Fix to enable Headphone in class G mode
Headphone path can either be in CLASS G mode or CLASS AB mode.
The class G mode in the codec hardware is used to adjust the
supply voltage of the PA's according to the signal level. This
makes the system as efficient as possible. Fix the register
sequence to enable headphone in class G mode

CRs-fixed: 380598
Change-Id: I110c4e0ea958ef55c0b407c566deb7da58f4d99a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:20:43 -08:00
Kuirong Wang
fefcfb5f4e ASoC: wcd9310/9304: Pull down Mic Bias output by default.
If Mic Bias is high Z by default and when the LDOH is enabled,
the Mic Bias output can pull-up to a non-zero voltage if there
is no loading or if the load leakage is very small.  Pulling
down the Mic Bias output so it is not in high Z to eliminate
the floating voltage.

Change-Id: I38e76a8c03107879727564f177b2713c9dfa4631
CRs-Fixed: 368898
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2013-02-27 18:18:27 -08:00
Bhalchandra Gajare
b1c726527e ASoC: WCD9304: Make sure slimbus port disconnected before opening port
During rapid open and close of slimbus ports, it may happen that when
port open is performed, the port is not disconnected from the previous
open. This will cause inconsistent state and may result in failure to
playback audio. Fix by waiting for the slimbus port disconnect to happen
before opening the port.

CRs-fixed: 375689
Change-Id: Id1303deae296eb6842074837183ab231aa2b4dad
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:17:53 -08:00
Bhalchandra Gajare
1407b94e9e ASoC: WCD9304: Fix register sequence for analog mic recording
Found that the register sequence for enabling recording on analog
microphone was updating a wrong register. Fix by correcting the
register sequence

CRs-fixed: 378189
Change-Id: I3598cbc77b279684b28677943ac13f446bc2f78e
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:17:10 -08:00
Bhalchandra Gajare
56b1a21666 ASoC: WCD9xxx: Add Micbias capless mode to platform data
Microphone Bias may or may not have an external bypass capacitor
depending on the board configurations. Add the microphone bias
capless mode setting to the platform data for codec

CRs-fixed: 363941
Change-Id: Ia949d240b3b3122bc4bd6aca02ee5b6cd785d246
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:15:21 -08:00
Asish Bhattacharya
29f60b149b ASoC: wcd9304: Fix IIR filter controls
Add IIR2 filter interface for the wcd9304 codec.
Control the two 5 band IIR filters in the audio
codec through mixer controls. Enable individual
IIR filter bands and set band coefficients.

Change the IIR filter code to use snd_soc_write
instead of snd_soc_update_bits. If update bits
is used the IIR registers may not be correctly
updated.

Change-Id: I92fc147641e9eb270d8176f20445371fe5cc2f92
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-02-27 18:15:17 -08:00
Bhalchandra Gajare
493d2db384 ASoC: WCD9304: Apply digital gain after digital path is turned ON
For the digital gain to be applied on the codec it is required to write
the digital gain register after the digital portion of the codec is
turned ON. This applies both for RX and TX digital path setup. Fix digital
gain setting sequence for RX and TX paths by rewriting the gain register
once the digital path is turned ON

Change-Id: I7b9c59c1b29b838845d27e406ba0f8a004c868b1
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:14:44 -08:00
Bhalchandra Gajare
f05987035b ASoC: WCD9304: Expose all possible Gain Settings for Earpiece PA
WCD9304 supports 4 gain values for Earpiece PA. Only 2 of them are
exposed through the mixer control. Fix to add ability to program
all of the available gain levels

Change-Id: Ie768dc3aebb476ac47dd739654703f7e3cccfd5a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:14:11 -08:00
Asish Bhattacharya
6bc62a66f0 ASoC: wcd9304: add I2C\I2S support for sitar codec
Add support for I2C\I2S interface for sitar codec along
With SLIMBUS interface.

Change-Id: I68666fd10cf9fb8d871d4b2a3d9b2e454dd1efe7
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-02-27 18:12:33 -08:00
Bhalchandra Gajare
7b7f397d6e ASoC: WCD9304: Fix OCP register default value
The default value for the OCP current setting register was wrongly updated
causing OCP to trigger when the volume on headphone is maximum. Fix by
correcting the default current setting value for OCP

Change-Id: I9aa6bfe7e4f9dbacdbd1cf1030f83660418bc37f
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:12:16 -08:00
Bhalchandra Gajare
7dba81ccd9 ASoC: WCD9304: Enable charge pump for lineout
WCD9310 requires the charge pump to be enable for lineout (speaker)
as well. Fix to add charge pump in the routing for lineout

CRs-fixed: 369639
Change-Id: Ia6f699d1e659c68062d599820768a495d1f8d05a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:11:40 -08:00
Patrick Lai
dcb77e20ae sound: Add MSM sound drivers
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:41:24 -08:00