Commit graph

12785 commits

Author SHA1 Message Date
sam_chen
6fa1fe7eb4 audio: asoc: wcd9310: fix headset mic recording fail.
Headset mic fail in case of inserting headset while dmic is recording.
Keep LDO_H always on while headset is inserted.

Bug: 11506684
Change-Id: I8516d537d2c72d6f71236219e5d3e610e25ecf24
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-11-08 23:24:05 +00:00
sam_chen
af2f3c6ec8 audio: asoc: headset: fix build-in mic recording fail.
During build-in mic recording, insert or remove headphone would
cause LDO_H power down which leads to recording fail.

Power on or down LDO_H by checking dapm widget LDO_H status.

Bug: 11523570

Change-Id: Ib7558748c093b60830eb41b2171c2eae95e4ed0a
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-11-05 18:51:54 +00:00
Karl Yu
a9b960e8f3 Audio: prevent headphone insertion event handler from turning micbias ON.
Always disable micbias when headphone insertion to save power around 1.5mA.

Bug: 9946473

Change-Id: I7cd2df4872b8388287df69a344f1dc1d45653405
Signed-off-by: Karl Yu <Karl_Yu@asus.com>
2013-08-13 06:47:51 +00:00
ChungYi_Guan
9b3ebd48d3 Audio: Support headset button feature.
Support audio control for one-button headsets.
Also refine code formats.

Bug: 9196319
Change-Id: Id572bb86dcefd52ea204c60bf4fda1e6c02fd135
Signed-off-by: ChungYi_Guan <ChungYi_Guan@asus.com>
2013-06-24 10:55:26 -07:00
ChungYi_Guan
48d9df1a1e Audio: Avoid playback paused after a quick headset removal.
Reduce debouncing time for unplug cases according to EE measurement.

Bug: 9083368

Change-Id: I9025f852beb69ece7f85863f86388e833e4ef64a
Signed-off-by: ChungYi_Guan <ChungYi_Guan@asus.com>
2013-05-24 23:44:24 +00:00
sam_chen
56a4f115ea audio: headset: avoid recording noise by setting D-mic vdd to 1.8V.
D-mic Vdd is connected to micbias1.
To set micbias1 to 1.8V, we need to set LDO_H_1 output power to 2.85V
which is the source of micbias1.

Bug: 9042676

Change-Id: I222ac01c24346031d25483e80f554a4dc0833c43
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-05-20 16:22:53 +08:00
Jeeja KP
129fc3f4be ASoC: compress - add support for metadata apis
Compress core added metadata apis in 9727b4, so add same in ASoC

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-18 13:40:36 -07:00
Eric Laurent
5b2a1140bf ASoc: fix compilation error
Fix compilation error after merging commit 00642f5
from master: pop_wait is in struct snd_soc_dai
not in struct snd_soc_pcm_runtime.

Signed-off-by: Eric Laurent <elaurent@google.com>
2013-05-18 13:40:36 -07:00
Charles Keepax
5d9f618167 ASoC: compress: Cancel delayed power down if needed
When a new stream is being opened it is necessary to cancel any delayed
power down of the audio.

[Fixed unused variable -- broonie]

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-18 13:40:35 -07:00
chungyi_guan
6572f26e20 Audio: Remove controls for REV_A.
HW_REV_A is no longer supported.

Bug: 8862570
Change-Id: I92e75c45af54b988f8329ffc212c2d36e09d9796
Signed-off-by: chungyi_guan <ChungYi_Guan@asus.com>
2013-05-09 19:49:47 +08:00
Mekala Natarajan
eb7d99e93f ASoC: msm: Change QOS value for low latency path
There were variations in the time taken to
return from each write. This was due
to the delay in switching in and out of
power collapse. To manage this set QOS
value to 1ms so that the core has enough
time to wake up from power collapse

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
2013-05-02 01:13:24 +00:00
sam_chen
4095062f42 Audio: soc: wcd9310: workaround for d-mic noise on flo hardware revision C.
On flo hardware revision C, micbias1 is not grounded with external
capacity, so it should set micbias1 capless setting as 1
(no external bypass capacity) to avoid noise.

Bug:8611206

Change-Id: I82644a9123d092490ccc0acf6cdfa68964ef9c22
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:09:24 -07:00
Mark Brown
2f7b4f43d6 ASoC: compress: Only mute playback streams
Otherwise capture activity on a compressed DAI would mute any playback
on the same DAI.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2013-04-18 16:08:47 -07:00
Eric Laurent
b8634e24ea ASoc: fix compilation error
Fix compilation error after merging commit 1f88eb0
from master: pop_wait is in struct snd_soc_dai
not in struct snd_soc_pcm_runtime.

Signed-off-by: Eric Laurent <elaurent@google.com>
2013-04-18 16:08:47 -07:00
Charles Keepax
978eeda17a ASoC: soc-compress: Add support for not memory mapped DSPs
The ASoC compressed API did not implement the copy callback in its
compressed ops which is required for DSPs that are not memory mapped.

This patch creates a local copy of the compress ops for each runtime and
modifies them with a copy callback as appropriate.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:47 -07:00
Charles Keepax
8e35e80110 ASoC: soc-compress: Initialise delayed work to power down audio
Delayed work was scheduled but not initialised, this patch adds the
actual work and initialises it.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:46 -07:00
Charles Keepax
c9a8524348 ASoC: soc-compress: Serialise compressed ops
Use the pcm_mutex to serialise the compressed ops.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:46 -07:00
Charles Keepax
97d183e49c ASoC: soc-compress: Add missing brackets around else
Conflicts:
	sound/soc/soc-compress.c

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:46 -07:00
Vinod Koul
91d9712511 ASoC: compress - fix code alignment
Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:46 -07:00
Eric Laurent
e4ad230988 ASoc: fix compilation error
Fix compilation error after merging commit 1245b700
from master: snd_soc_dapm_stream_event() protoype has changed.

Signed-off-by: Eric Laurent <elaurent@google.com>
2013-04-18 16:08:46 -07:00
Eric Laurent
b93dd8e6cb ALSA: compress: fix compilation error
Fix compilation error after merging commit 1245b700
from master: SIZE_MAX is not defined.

Signed-off-by: Eric Laurent <elaurent@google.com>
2013-04-18 16:08:45 -07:00
Namarta Kohli
493ea89cd3 ASoC: add compress stream support
This patch adds the support to parse the compress dai's and then also adds the
soc-compress.c file while handles the compress stream operations, mostly analogus
to what is done in the soc-pcm.c and aditional handling of the compress
opertaions

Conflicts:
	sound/soc/soc-core.c

Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18 16:08:45 -07:00
Jeeja KP
0b74be8050 ALSA: compress: add support for gapless playback
this add new API for sound compress to support gapless playback.
As noted in Documentation change, we add API to send metadata of encoder and
padding delay to DSP. Also add API for indicating EOF and switching to
subsequent track

Also bump the compress API version

Conflicts:
	include/uapi/sound/compress_offload.h

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:45 -07:00
Richard Fitzgerald
e834dab9bd ALSA: core: don't return uninitialized snd_compr_tstamp
The snd_compr_update_tstamp() can only fill in the snd_compr_tstamp
if the codec implements the pointer() function. If that happened
the code was previously returning uninitialized garbage in the
tstamp because it wasn't initialized anywhere.

This change zero-fills the tstamp in the two places it is used
before calling snd_compr_update_tstamp(), and also has
snd_compr_update_tstamp() return an error indication if it
can't provide a tstamp. For the case of snd_compr_calc_avail()
it ignores this error because we still need to return info on
the available buffer space even if we can't provide tstamp
info - when the tstamp is not valid all fields are now
guaranteed to be zero.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:45 -07:00
Vinod Koul
42dac55493 ALSA: Compress - add codec parameter checks
Conflicts:
	include/sound/compress_params.h

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:44 -07:00
Vinod Koul
1fc6bd456b ALSA: compress - move the buffer check
Commit ALSA: compress_core: integer overflow in snd_compr_allocate_buffer()
added a new error check for input params.
this add new routine for input checks and moves buffer overflow check to this
new routine. This allows the error value to be propogated to user space

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:44 -07:00
Dan Carpenter
47efd3dd66 ALSA: compress_core: integer overflow in snd_compr_allocate_buffer()
These are 32 bit values that come from the user, we need to check for
integer overflows or we could end up allocating a smaller buffer than
expected.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:44 -07:00
Dan Carpenter
f984820d1c ALSA: compress_core: fix open flags test in snd_compr_open()
O_RDONLY is zero so the original test (f->f_flags & O_RDONLY) is always
false and it will never do compress capture.  The test for O_WRONLY is
also slightly off.  The original test would consider "->flags =
(O_WRONLY | O_RDWR)" as write only instead of rejecting it as invalid.

I've also removed the pr_err() because that could flood dmesg.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:44 -07:00
Vinod Koul
b3bd4322b7 ALSA: compress_core: cleanup pointers on stop
as the start can be called after stop again, we need to reset state

Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:44 -07:00
Vinod Koul
d63aa128b9 ALSA: compress_core: don't wake up on pause
during pause the core should maintain the status-quo on the device and pointers
and not wake up. If app needs it should call DROP explcitly.

Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 16:08:43 -07:00
Mekala Natarajan
e523090a19 ASoC: msm: Reduce min buffer size for low latency
The current low latency driver has 512 bytes as
the min buffer size threshold. With this reducing
the playback time to lower values is not possible.
Setting it to 128 bytes gives us more room
to try out lower buffer sizes from the user space

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
2013-04-18 16:08:42 -07:00
sam_chen
a8801c73fc Audio: soc: wcd9310: fix wrong kcontrol for RX HPF setting.
The contorl bit should be 0 shift for RX HPF frequency setting.

Change-Id: Ida8981c7e5c3fe693dadf62e95f31a99e1b05001
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:08:16 -07:00
sam_chen
33d48fa019 Audio: headset: disable micbias power after remove headset.
Change-Id: I439e1448b394c93783d85934fadb3ac3d31ab465
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:08:16 -07:00
sam_chen
a966a967c5 Audio: headset: Disable bandgap power according to codec bandgap status.
Change-Id: Ieefd76b0cc02fd58e240a934fd9f84b309d48c5b
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:08:15 -07:00
sam_chen
37f530ec4e Audio: soc: wcd9310: add check bandgap status function.
Export function to headset driver to know whether we should disable
badgap power or not after headset detection.

Change-Id: I1b890c559a26537f510dfabed3cfec16120f59de
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:08:15 -07:00
sam_chen
52e2c2eeca Audio: headset: add debug board detection mechanism.
1.Use gpio-85: low = debug board and high = no debug board.
2.Only support hardware revison A and after.

Change-Id: If4db1fd8f94036dfb7428e63e54b4ae41b60e0cd
Signed-off-by: sam_chen <sam_chen@asus.com>
2013-04-18 16:08:13 -07:00
Iliyan Malchev
2c0066767d ASoC: msm: Flexible period size for pcm playback
PCM driver was configured for fixed buffer
size on the playback path. With this, varying
the buffer sizes on the playback path was not
possible. To fix this, support for flexible
period sizes is added by setting different
values for min and max buffer sizes

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
2013-04-18 16:08:12 -07:00
Iliyan Malchev
caffd83aca Revert "Revert "ASoC: msm: Decrease the playback period size of PCM driver""
This reverts commit 3747be787b4fa0f65c9c112744c28ef7ea438806.
2013-04-18 16:08:05 -07:00
sam_chen
435713f729 Audio: add headset detection function.
Change-Id: I9af88313ecdb072b0aa71c3991359becac9cdcf9
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/68260
Reviewed-by: Jive Hwang <jive_hwang@asus.com>
Tested-by: Jive Hwang <jive_hwang@asus.com>
2013-04-18 16:07:59 -07:00
sam_chen
f09e036eab Audio: Enable speaker.
1.Use PM8921_GPIO_PM_TO_SYS(18) as speaker amp.
2.Disable wcd9310 headset detection function.

Change-Id: I5a5b8a38ef2cd30efb318a919f9490415302d67c
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/67836
Reviewed-by: Jive Hwang <jive_hwang@asus.com>
Tested-by: Jive Hwang <jive_hwang@asus.com>
2013-04-18 16:07:52 -07:00
paris_yeh
a225765d0c deb: initial bring up the deb hardware
Change-Id: I428beb5964726f009cd7a6402de0e83f0cf9924f
Signed-off-by: paris_yeh <paris_yeh@asus.com>
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/67828
Reviewed-by: Sam hblee <Sam_hblee@asus.com>
2013-04-18 16:07:51 -07:00
paris_yeh
e33d2be0f6 flo: separate flo codes from qcom's codes (apq8064_mtp)
Change-Id: Idb2f3bd99fa3a0b4061a1cd65155bc6fed163048
Signed-off-by: paris_yeh <paris_yeh@asus.com>
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/67810
Reviewed-by: Edward Lu <Edward_Lu@asus.com>
2013-04-18 16:07:50 -07:00
Ajay Dudani
ef1120d0a4 Revert "ASoC: msm: Decrease the playback period size of PCM driver"
This reverts commit b0580099ac7d5e735fb42946612a499bf196cda1.

Change-Id: I487797334cf75978daa3c536ff92de8a54b1f7fb
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-15 17:13:31 -07:00
Aviral Gupta
861201c3f0 ASoC: msm: Mixer control to update the sample rate of HDMI interface
Updating the sample rate for the compressed stream playback of the HDMI
interface through the mixer control.

Change-Id: Ib7b01f490f5e209512433a82faf96af0a3a810bd
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
2013-03-15 17:09:19 -07:00
Subhash Chandra Bose Naripeddy
66d4bd46d8 ASoC: msm: Add support to fix up the channels for HDMI
For the use case of Playback over HDMI device, the number of
channels supported varies with the sink capabilities.
Add support to fix the channels based on the sink capabilites
configured by userspace for msm8960

Change-Id: Iba4f1fead17832d7832fabdcba02da671e5fd005
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-03-15 17:09:18 -07:00
Fred Oh
95c41ddd89 ASoC: wcd9310: Reset OTHR_RESET_CTR before power down
There is a missing step to clear OTHR_RESET_CTR before power down.
It could cause a glitch and power hit without it. It has to be reset.

original gerrit is https://review-android.quicinc.com/#/c/191312/
This is cherry-pick gerrit by developer to jb_2.5

Change-Id: Id96070352480be6ea412844d4f71765e2df76afe
CRs-fixed: 420142
Signed-off-by: Fred Oh <fred@codeaurora.org>
2013-03-15 17:09:13 -07:00
Amal Paul
ed056a5a55 ASoC: msm: qdsp6: Add support to configure ISO and ARIB coefficients
Add support for configuring ISO or ARIB stereo mixing
coefficients. This change introduces a function with whichi,
AAC multi-channel driver can configure ISO or ARIB coefficients
according to configuration done by the client.

Change-Id: I72b74033532a276fa3bc1d305a04720ff6767409
Signed-off-by: Amal Paul <amal@codeaurora.org>
2013-03-15 17:09:03 -07:00
Ravi Kumar Alamanda
b8d36696be ASoc: msm: Remove incorrect headset mic gpios
AV switch and US Euro headset switches are not supported
on apq8064 target. Hence removing unnecessary gpio pins
configuration.

Change-Id: Ia4747b59b63b0bf7c37054fb1bcebfc54079b481
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	sound/soc/msm/apq8064.c
2013-03-15 17:09:00 -07:00
Laxminath Kasam
d471a93ec3 ASoC: audio: fix unlock Null pointer issue
-In afe_open, trying to unlock mutex on variable
that is already freed.
-correct the sequence by unlock mutex first then
free the variable.

CRs-Fixed: 423196
Change-Id: If7df0e0f46c7d16843c6d52ae821974cc74539ff
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
(cherry picked from commit 4c120ae85c6c5ac2adfdf61956b45d02461a93e3)
2013-03-15 17:08:43 -07:00
Bhalchandra Gajare
45ab1a7a2b ASoC: WCD9310: Enable codec loopback support through IIR2 path
WCD9310 codec supports loopback through IIR filters. Either IIR1
or IIR2 can be used to setup loopback path. Add support and routing
to enable loopback through IIR2 filter path

CRs-fixed: 364236
Change-Id: I52cb455ad31aa129f81bac3852ac50d4a5a99bc2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
(cherry picked from commit 8ba4446a571ed5f7033dc6cb651e19f5d9485abb)
2013-03-15 17:08:37 -07:00