Commit graph

13128 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
Takashi Iwai
dad61bad42 ALSA: hda - Add fixup for ASUS N56VZ
commit c6cc3d58b4 upstream.

ASUS N56VZ needs a fixup for the bass speaker pin, which was already
provided via model=asus-mode4.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=841645
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-22 09:02:25 +01:00
Daniel Mack
863b6d816a ALSA: snd-usb-usx2y: remove bogus frame checks
commit a9d14bc0b1 upstream.

The frame check in i_usX2Y_urb_complete() and
i_usX2Y_usbpcm_urb_complete() is bogus and produces false positives as
described in this LAU thread:

  http://linuxaudio.org/mailarchive/lau/2013/5/20/200177

This patch removes the check code entirely.

Cc: fzu@wemgehoertderstaat.de
Reported-by: Dr Nicholas J Bailey <nicholas.bailey@glasgow.ac.uk>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-22 09:02:24 +01:00
Dan Carpenter
6b0dcab1d8 ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st()
commit d967967e8d upstream.

This is called from snd_ctl_elem_write() with user supplied data so we
need to add some bounds checking.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13 15:42:48 -07:00
Dan Carpenter
e504aeaec8 ASoC: max98095: a couple array underflows
commit f8d7b13e14 upstream.

The ->put() function are called from snd_ctl_elem_write() with user
supplied data.  The limit checks here could underflow leading to a
crash.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-13 15:42:48 -07:00
Liam Girdwood
01a74c11d3 ALSA: compress: Fix compress device unregister.
commit 4028b6c4c0 upstream.

snd_unregister_device() should return the device type and not stream
direction.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-05 07:06:54 -07:00
Takashi Iwai
bd925e29c6 ALSA: hda - Add Toshiba Satellite C870 to MSI blacklist
commit 83f7215135 upstream.

Toshiba Satellite C870 shows interrupt problems occasionally when
certain mixer controls like "Mic Switch" is toggled.  This seems
worked around by not using MSI.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=833585
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:15:33 -07:00
Mike Dyer
64c2a17997 ASoC: wm8960: Fix PLL register writes
commit 85fa532b6e upstream.

Bit 9 of PLL2,3 and 4 is reserved as '0'. The 24bit fractional part
should be split across each register in 8bit chunks.

Signed-off-by: Mike Dyer <mike.dyer@md-soft.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:15:33 -07:00
Takashi Iwai
aa5189165d ALSA: opti9xx: Fix conflicting driver object name
commit fb615499f0 upstream.

The recent commit to delay the release of kobject triggered NULL
dereferences of opti9xx drivers.  The cause is that all
snd-opti92x-ad1848, snd-opti92x-cs4231 and snd-opti93x drivers
register the PnP card driver with the very same name, and also
snd-opti92x-ad1848 and -cs4231 drivers register the ISA driver with
the same name, too.  When these drivers are built in, quick
"register-release-and-re-register" actions occur, and this results in
Oops because of the same name is assigned to the kobject.

The fix is simply to assign individual names.  As a bonus, by using
KBUILD_MODNAME, the patch reduces more lines than it adds.

The fix is based on the suggestion by Russell King.

Reported-and-tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-07 21:58:14 -07:00
Paul Bolle
9eae33247a sound: Fix make allmodconfig on MIPS correctly
commit a62ee234a5 upstream.

Commit d4702b189c ("sound: Fix make allmodconfig on MIPS") added a
(negative) dependency on ISA_DMA_SUPPORT_BROKEN. Since that Kconfig
symbol doesn't exist, this dependency will always evaluate to true.
Apparently GENERIC_ISA_DMA_SUPPORT_BROKEN was meant to be used here.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:26:27 -07:00
Takashi Iwai
2f540fd1bb sound: Fix make allmodconfig on MIPS
commit d4702b189c upstream.

The compile of soundcard.c is broken on MIPS when allmodconfig is used
because of the missing MAX_DMA_CHANNELS definition.  As a simple
workaround, just add a Kconfig dependency.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20 08:26:27 -07: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
Vinod Koul
353f59cac3 ALSA: compress: fix the return value for SNDRV_COMPRESS_VERSION
commit a8d30608ea upstream.

the return value of SNDRV_COMPRESS_VERSION always return default -ENOTTY as the
return value was never updated for this call
assign return value from put_user()

Reported-by: Haynes <hgeorge@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-11 15:38:41 -07:00
Nicolin Chen
a38de994b0 ASoC: wm8962: Remove remaining direct register cache accesses
commit 2e7ee15ced upstream.

Also fix return values for headphone switch updates.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-04 16:25:43 +08:00
Chih-Chung Chang
c541a6f5d2 ASoC: max98088 - fix element type of the register cache.
commit cb6f66a2d2 upstream.

The registers of max98088 are 8 bits, not 16 bits. This bug causes the
contents of registers to be overwritten with bad values when the codec
is suspended and then resumed.

Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-04 16:25:42 +08:00
Eldad Zack
acaeda3564 ALSA: usb-audio: 6fire: return correct XRUN indication
commit be2f93a4c4 upstream.

Return SNDRV_PCM_POS_XRUN (snd_pcm_uframes_t) instead of
SNDRV_PCM_STATE_XRUN (snd_pcm_state_t) from the pointer
function of 6fire, as expected by snd_pcm_update_hw_ptr0().

Caught by sparse.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-28 16:26:48 -07:00
Fabio Estevam
8899476bd4 ASoC: sglt5000: Fix SGTL5000_PLL_FRAC_DIV_MASK
commit 5c78dfe87e upstream.

SGTL5000_PLL_FRAC_DIV_MASK is used to mask bits 0-10 (11 bits in total) of
register CHIP_PLL_CTRL, so fix the mask to accomodate all this bit range.

Reported-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-28 16:25:43 -07:00
Clemens Ladisch
e02a738d98 ALSA: usb-audio: work around Android accessory firmware bug
commit 342cda2934 upstream.

When the Android firmware enables the audio interfaces in accessory
mode, it always declares in the control interface's baInterfaceNr array
that interfaces 0 and 1 belong to the audio function.  However, the
accessory interface itself, if also enabled, already is at index 0 and
shifts the actual audio interface numbers to 1 and 2, which prevents the
PCM streaming interface from being seen by the host driver.

To get the PCM interface interface to work, detect when the descriptors
point to the (for this driver useless) accessory interface, and redirect
to the correct one.

Reported-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
Tested-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-27 11:27:30 -07:00
Takashi Iwai
2dc07099dd ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam c310
commit 36691e1be6 upstream.

Just like the previous fix for LogitechHD Webcam c270 in commit
11e7064f35, c310 model also requires the
same workaround for avoiding the kernel warning.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59741
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-27 11:27:30 -07: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
Takashi Iwai
395801f773 ALSA: usb-audio - Fix invalid volume resolution on Logitech HD webcam c270
commit 11e7064f35 upstream.

USB audio driver spews an error message when probing Logitech HD
webcam c270:
  ALSA mixer.c:1300 usb_audio: Warning! Unlikely big volume range (=6144), cval->res is probably wrong.
  ALSA mixer.c:1304 usb_audio: [5] FU [Mic Capture Volume] ch = 1, val = 1536/7680/1

Obviously the device needs a fixed volume resolution (cval->res = 384)
like other Logitech devices.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=821735

Reported-and-tested-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-13 09:44:53 -07:00
Takashi Iwai
8e411de6df ALSA: usb-audio - Apply Logitech QuickCam Pro 9000 quirk only to audio iface
commit 8eafc0a161 upstream.

... instead of applying to all interfaces.

Reference: http://forums.gentoo.org/viewtopic-p-6886404.html

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-13 09:44:53 -07:00
Clemens Ladisch
6ba9458dbb ALSA: usb-audio: fix Roland/Cakewalk UM-3G support
commit a0c6d309c6 upstream.

Commit 927c9423dd (ALSA: usb-audio: add
Edirol UM-3G support) used a wrong quirk type, which would make the
driver refuse to attach with the error message "MIDIStreaming interface
descriptor not found".

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-13 09:44:52 -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
Wang YanQing
a855502146 ALSA: HDA: Fix Oops caused by dereference NULL pointer
commit 2195b063f6 upstream.

The interrupt handler azx_interrupt will call azx_update_rirb,
which may call snd_hda_queue_unsol_event, snd_hda_queue_unsol_event
will dereference chip->bus pointer.

The problem is we alloc chip->bus in azx_codec_create
which will be called after we enable IRQ and enable unsolicited
event in azx_probe.

This will cause Oops due dereference NULL pointer. I meet it, good luck:)

[Rearranged the NULL check before the tracepoint and added another
 NULL check of bus->workq -- tiwai]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-19 10:54:36 -07:00
Dan Carpenter
3fbe1888ca ASoC: wm8994: missing break in wm8994_aif3_hw_params()
commit 4495e46fe1 upstream.

The missing break here means that we always return early and the
function is a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-19 10:54:34 -07: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
Dylan Reid
a91a9f1e12 ASoC: max98088: Fix logging of hardware revision.
commit 9868206354 upstream.

The hardware revision of the codec is based at 0x40.  Subtract that
before convering to ASCII.  The same as it is done for 98095.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-07 19:51:55 -07:00
Takashi Iwai
8a70ddb052 ALSA: usb-audio: Fix autopm error during probing
commit 60af3d037e upstream.

We've got strange errors in get_ctl_value() in mixer.c during
probing, e.g. on Hercules RMX2 DJ Controller:

  ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
  ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
  ....

It turned out that the culprit is autopm: snd_usb_autoresume() returns
-ENODEV when called during card->probing = 1.

Since the call itself during card->probing = 1 is valid, let's fix the
return value of snd_usb_autoresume() as success.

Reported-and-tested-by: Daniel Schürmann <daschuer@mixxx.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-07 19:51:55 -07:00
Clemens Ladisch
b01ae289a3 ALSA: usb-audio: disable autopm for MIDI devices
commit cbc200bca4 upstream.

Commit 88a8516a21 (ALSA: usbaudio: implement USB autosuspend)
introduced autopm for all USB audio/MIDI devices.  However, many MIDI
devices, such as synthesizers, do not merely transmit MIDI messages but
use their MIDI inputs to control other functions.  With autopm, these
devices would get powered down as soon as the last MIDI port device is
closed on the host.

Even some plain MIDI interfaces could get broken: they automatically
send Active Sensing messages while powered up, but as soon as these
messages cease, the receiving device would interpret this as an
accidental disconnection.

Commit f5f165418c (ALSA: usb-audio: Fix missing autopm for MIDI input)
introduced another regression: some devices (e.g. the Roland GAIA SH-01)
are self-powered but do a reset whenever the USB interface's power state
changes.

To work around all this, just disable autopm for all USB MIDI devices.

Reported-by: Laurens Holst
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-07 19:51:55 -07:00
Daniel Mack
919fa1da0c ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
commit ebfc594c02 upstream.

The USB_DT_CS_ENDPOINT class-specific endpoint descriptor is usually
stuffed directly after the standard USB endpoint descriptor, and this is
where the driver currently expects it to be.

There are, however, devices in the wild that have it the other way
around in their descriptor sets, so the USB_DT_CS_ENDPOINT comes
*before* the standard enpoint. Devices known to implement it that way
are "Sennheiser BTD-500" and Plantronics USB headsets.

When the driver can't find the USB_DT_CS_ENDPOINT, it won't be able to
change sample rates, as the bitmask for the validity of this command is
storen in bmAttributes of that descriptor.

Fix this by searching the entire interface instead of just the extra
bytes of the first endpoint, in case the latter fails.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Torstein Hegge <hegge@resisty.net>
Reported-and-tested-by: Yves G <alsa-user@vivigatt.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-07 19:51:55 -07: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
Linus Torvalds
ada37d8578 vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
commit 0fe09a45c4 upstream.

This is my example conversion of a few existing mmap users.  The pcm
mmap case is one of the more straightforward ones.

Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-25 21:19:56 -07: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
Alban Bedel
b43105dee8 ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is running
commit f1ca493b0b upstream.

The Charge Pump needs the DSP clock to work properly, without it the
bypass to HP/LINEOUT is not working properly. This requirement is not
mentioned in the datasheet but has been confirmed by Mark Brown from
Wolfson.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-16 21:27:26 -07:00
Eldad Zack
dd541ae5fb ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_*
commit 889d66848b upstream.

The usb_control_msg() function expects __u16 types and performs
the endianness conversions by itself.
However, in three places, a conversion is performed before it is
handed over to usb_control_msg(), which leads to a double conversion
(= no conversion):
* snd_usb_nativeinstruments_boot_quirk()
* snd_nativeinstruments_control_get()
* snd_nativeinstruments_control_put()

Caught by sparse:

sound/usb/mixer_quirks.c:512:38: warning: incorrect type in argument 6 (different base types)
sound/usb/mixer_quirks.c:512:38:    expected unsigned short [unsigned] [usertype] index
sound/usb/mixer_quirks.c:512:38:    got restricted __le16 [usertype] <noident>
sound/usb/mixer_quirks.c:543:35: warning: incorrect type in argument 5 (different base types)
sound/usb/mixer_quirks.c:543:35:    expected unsigned short [unsigned] [usertype] value
sound/usb/mixer_quirks.c:543:35:    got restricted __le16 [usertype] <noident>
sound/usb/mixer_quirks.c:543:56: warning: incorrect type in argument 6 (different base types)
sound/usb/mixer_quirks.c:543:56:    expected unsigned short [unsigned] [usertype] index
sound/usb/mixer_quirks.c:543:56:    got restricted __le16 [usertype] <noident>
sound/usb/quirks.c:502:35: warning: incorrect type in argument 5 (different base types)
sound/usb/quirks.c:502:35:    expected unsigned short [unsigned] [usertype] value
sound/usb/quirks.c:502:35:    got restricted __le16 [usertype] <noident>

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-16 21:27:25 -07:00
David Henningsson
54144193ab ALSA: hda - fix typo in proc output
commit aeb3a97222 upstream.

Rename "Digitial In" to "Digital In". This function is only used for
proc output, so should not cause any problems to change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12 09:38:44 -07:00
Rainer Koenig
3379d52303 ALSA: hda - Enabling Realtek ALC 671 codec
commit 1d87caa69c upstream.

* Added the device ID to the modalias list and assinged ALC662 patches
for it
* Added 4 port support for the device ID 0671 in alc662_parse_auto_config

Signed-off-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12 09:38:44 -07:00
Mengdong Lin
276674490c ALSA: hda - bug fix on return value when getting HDMI ELD info
commit 2ef5692efa upstream.

In function snd_hdmi_get_eld(), the variable 'ret' should be initialized to 0.
Otherwise it will be returned uninitialized as non-zero after ELD info is got
successfully. Thus hdmi_present_sense() will always assume ELD info is invalid
by mistake, and /proc file system cannot show the proper ELD info.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12 09:38:44 -07:00
Lars-Peter Clausen
93c86c4916 ASoC: dma-sh7760: Fix compile error
commit 417a1178f1 upstream.

The dma-sh7760 currently fails with the following compile error:
	sound/soc/sh/dma-sh7760.c:346:2: error: unknown field 'pcm_ops' specified in initializer
	sound/soc/sh/dma-sh7760.c:346:2: warning: initialization from incompatible pointer type
	sound/soc/sh/dma-sh7760.c:347:2: error: unknown field 'pcm_new' specified in initializer
	sound/soc/sh/dma-sh7760.c:347:2: warning: initialization makes integer from pointer without a cast
	sound/soc/sh/dma-sh7760.c:348:2: error: unknown field 'pcm_free' specified in initializer
	sound/soc/sh/dma-sh7760.c:348:2: warning: initialization from incompatible pointer type
	sound/soc/sh/dma-sh7760.c: In function 'sh7760_soc_platform_probe':
	sound/soc/sh/dma-sh7760.c:353:2: warning: passing argument 2 of 'snd_soc_register_platform' from incompatible pointer type
	include/sound/soc.h:368:5: note: expected 'struct snd_soc_platform_driver *' but argument is of type 'struct snd_soc_platform *'

This is due the misnaming of the snd_soc_platform_driver type name and 'ops'
field. The issue was introduced in commit f0fba2a("ASoC: multi-component - ASoC
Multi-Component Support").

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12 09:38:43 -07:00
Daniel Mack
cb8a0948b8 ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()
commit 83ea5d18d7 upstream.

Creation of individual mixer controls may fail, but that shouldn't cause
the entire mixer creation to fail. Even worse, if the mixer creation
fails, that will error out the entire device probing.

All the functions called by parse_audio_unit() should return -EINVAL if
they find descriptors that are unsupported or believed to be malformed,
so we can safely handle this error code as a non-fatal condition in
snd_usb_mixer_controls().

That fixes a long standing bug which is commonly worked around by
adding quirks which make the driver ignore entire interfaces. Some of
them might now be unnecessary.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Rodolfo Thomazelli <pe.soberbo@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 12:12:05 -07:00
Daniel Mack
184f526252 ALSA: snd-usb: mixer: propagate errors up the call chain
commit 4d7b86c98e upstream.

In check_input_term() and parse_audio_feature_unit(), propagate the
error value that has been returned by a failing function instead of
-EINVAL. That helps cleaning up the error pathes in the mixer.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 12:12:05 -07:00
Takashi Iwai
e97814511e ALSA: hda - Fix typo in checking IEC958 emphasis bit
commit a686fd141e upstream.

There is a typo in convert_to_spdif_status() about checking the
emphasis IEC958 status bit.  It should check the given value instead
of the resultant value.

Reported-by: Martin Weishart <martin.weishart@telosalliance.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 12:12:04 -07:00
Takashi Iwai
184e91c693 ALSA: hda/cirrus - Fix the digital beep registration
commit a86b1a2cd2 upstream.

The argument passed to snd_hda_attach_beep_device() is a widget NID
while spec->beep_amp holds the composed value for amp controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 12:12:04 -07:00
Takashi Iwai
fe88b8bc2e ALSA: seq: Fix missing error handling in snd_seq_timer_open()
commit 66efdc71d9 upstream.

snd_seq_timer_open() didn't catch the whole error path but let through
if the timer id is a slave.  This may lead to Oops by accessing the
uninitialized pointer.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000002ae
 IP: [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
 PGD 785cd067 PUD 76964067 PMD 0
 Oops: 0002 [#4] SMP
 CPU 0
 Pid: 4288, comm: trinity-child7 Tainted: G      D W 3.9.0-rc1+ #100 Bochs Bochs
 RIP: 0010:[<ffffffff819b3477>]  [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
 RSP: 0018:ffff88006ece7d38  EFLAGS: 00010246
 RAX: 0000000000000286 RBX: ffff88007851b400 RCX: 0000000000000000
 RDX: 000000000000ffff RSI: ffff88006ece7d58 RDI: ffff88006ece7d38
 RBP: ffff88006ece7d98 R08: 000000000000000a R09: 000000000000fffe
 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
 R13: ffff8800792c5400 R14: 0000000000e8f000 R15: 0000000000000007
 FS:  00007f7aaa650700(0000) GS:ffff88007f800000(0000) GS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00000000000002ae CR3: 000000006efec000 CR4: 00000000000006f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process trinity-child7 (pid: 4288, threadinfo ffff88006ece6000, task ffff880076a8a290)
 Stack:
  0000000000000286 ffffffff828f2be0 ffff88006ece7d58 ffffffff810f354d
  65636e6575716573 2065756575712072 ffff8800792c0030 0000000000000000
  ffff88006ece7d98 ffff8800792c5400 ffff88007851b400 ffff8800792c5520
 Call Trace:
  [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff819b17e9>] snd_seq_queue_timer_open+0x29/0x70
  [<ffffffff819ae01a>] snd_seq_ioctl_set_queue_timer+0xda/0x120
  [<ffffffff819acb9b>] snd_seq_do_ioctl+0x9b/0xd0
  [<ffffffff819acbe0>] snd_seq_ioctl+0x10/0x20
  [<ffffffff811b9542>] do_vfs_ioctl+0x522/0x570
  [<ffffffff8130a4b3>] ? file_has_perm+0x83/0xa0
  [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff811b95ed>] sys_ioctl+0x5d/0xa0
  [<ffffffff813663fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
  [<ffffffff81faed69>] system_call_fastpath+0x16/0x1b

Reported-and-tested-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-20 13:04:59 -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
Patrick Lai
c58e2f4bb2 ASoC: msm: avoid negative time stamp check
Time stamp is unsigned. There is no need to check for
negative value.

Change-Id: I15e380f81e46908f6a9fe8d29c174de1b7c33173
CRs-fixed: 423372
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-03-15 17:08:28 -07:00
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
Subhash Chandra Bose Naripeddy
968c5e7d4f ASoC: msm: skip sending volume in compressed pass through playback
For the playback use of compressed pass through on HDMI device,
post processing features are not supported and should not be sent to
DSP. Hence the change is now to send the volume only for the playback
of decode and render in DSP and skip for compressed pass through

CRs-Fixed: 442140
Change-Id: I2125f08baf1676f6bb1d13463a1f01dfe280963f
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-03-15 17:08:01 -07:00
Patrick Lai
ebd937e2fe ASoC: msm: qdsp6: add check for maximum COPPs allowed
There is maximum number of COPPs ASM session can be routed
to even though there are far more number of AFE ports.
Add the check to make sure caller is not routing to more
than ADM can actually support.

Change-Id: Iee97dd7e5d21820c87244a422fa252c2228185f9
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-03-15 17:07:59 -07:00
Patrick Lai
5f5e11cab1 ASoC: msm: qdsp6: avoid unnecessary check
Remove unnecessary check as it should be reasonable
to assume valid parameter would be issued through
debugfs interface

Change-Id: I1a23d8c5324b813bf9501c5462684234926b5dcc
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-03-15 17:07:58 -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
Haynes Mathew George
043544f462 ASoC: msm: Resume writes only for start command
For compressed and LPA drivers, set pending_buffers flag to 1 only if the client
issues a trigger_start command, not a pause_release command. This flag
is used to initiate writes to the dsp.

Change-Id: I503156863646210b460613a0b9a26a6bfb8854ed
CRs-Fixed: 442269, 449126
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
2013-03-15 17:07:10 -07:00
Damir Didjusto
0ebf5a8502 ASoC: wcd9xxx: Support earpiece ANC
Added virtual widgets for enabling and disabling earpiece ANC.

Change-Id: Ia235928c34022de89ec0e66dbe533143f4d56684
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
2013-03-15 17:06:49 -07:00
Patrick Lai
833bf95817 ASoC: msm: qdsp6: check for invalid port index
Function which converts port ID to port index can return
error value if port ID is invalid. Caller should not
blindly use return value without checking

Change-Id: I02b8112b6714e3364758907e7078bcbb88d45b6b
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-03-15 17:06:34 -07:00
Haynes Mathew George
ed135fe15d ASoC: msm: Allow drain only if a write was called
For compressed drivers, allow the drain ioctl only if
there are pending writes. Return a proper error (-EWOULDBLOCK) otherwise.

Change-Id: I4799351a8930c44d88d6968802df98896fc1531a
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
CRs-Fixed: 445370
2013-03-15 17:06:32 -07:00
Haynes Mathew George
4b8f6f68a6 ASoC: msm: proper error code for drain ioctl
If a drain ioctl on a compressed driver has been interrupted
by a reset ioctl, we need to return a proper error code for the
drain ioctl

Change-Id: I15f42a22b1cc13b3a0e2ae873adfcd1db2ac1e53
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
CRs-Fixed: 445370
2013-03-15 17:06:31 -07:00
Satya Krishna Pindiproli
0d114dfecd ASoC: msm: Fix for proxy port open failure in WFD session
When playback is paused and proxy device disabled, afe is
not closed. This results in failure of proxy port open in the second
iteration. Fix the same by closing and opening the proxy.

Change-Id: Idfa94e5756d87e59dc0101fd688d6accfe6287e7
CRs-Fixed: 447001
CRs-Fixed: 446504
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
2013-03-15 17:06:26 -07:00
Kuirong Wang
54898d0cd6 ASoC: wcd9310: Update wcd9310 compander configuration
Update the Compander register settings to remain the default
settings after the system bootup and optimize compander
configuration sequence.

Change-Id: Ib475f3bb84414546b4ead1d3f013dc173317e1b3
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2013-03-15 17:05:16 -07:00
Satya Krishna Pindiproli
aa50f8292b ASoC: msm: Fix delay in switching from WFD session
- When a running WFD session is paused/disconnected, there is
  a delay of about 10-15 seconds in switching audio from WFD
  sink to target.
- pcm_write is blocked because pausing/disconnecting the WFD
  session closes the backend DAI before a new link is established.
- Avoid closing afe if front end PCM session is still active.

CRs-Fixed: 444163
CRs-Fixed: 425512
Change-Id: I1ad6de1e201aa6130c397007219c0d370c7be2a1
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
2013-03-15 17:05:16 -07:00
Greg Kroah-Hartman
983c9b4e48 Revert "ALSA: hda - hdmi: Make jacks phantom, if they're not detectable"
This reverts commit 30efd8debd upstream
(dd54ec4067 in this tree) as it is not
needed for the 3.4-stable tree.

Cc: David Henningsson <david.henningsson@canonical.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14 11:29:52 -07:00
Takashi Iwai
f4ec9b23b1 ALSA: vmaster: Fix slave change notification
commit 2069d483b3 upstream.

When a value of a vmaster slave control is changed, the ctl change
notification is sometimes ignored.  This happens when the master
control overrides, e.g. when the corresponding master control is
muted.  The reason is that slave_put() returns the value of the actual
slave put callback, and it doesn't reflect the virtual slave value
change.

This patch fixes the function just to return 1 whenever a slave value
is changed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14 11:29:50 -07:00
Sean Connor
1515f18665 ALSA: ice1712: Initialize card->private_data properly
commit 69a4cfdd44 upstream.

Set card->private_data in snd_ice1712_create for fixing NULL
dereference in snd_ice1712_remove().

Signed-off-by: Sean Connor <sconnor004@allyinics.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14 11:29:50 -07:00
Ravi Kumar Alamanda
4352c5326c ASoC: wcd9310: Correct the mixer controls for Compander switches
- Compander1 never gets enabled though the user space sets the
  corresponding mixer control.
- Compander switch kcontrols are configured wrongly as integer
  type with max value as 0.
- Correct kcontrol creation to fix the issue.

CRs-Fixed: 441091

Change-Id: Iad99b44c9226da3bcc1132e61ea989a0543ae56e
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
2013-03-07 15:25:39 -08:00
Ajit Khare
ddfce255b8 msm: Add support for amr-wb+ non-tunnel driver
-Non tunnel playback is use case where compressed
 data is sent to driver(for decoding) and
 caller expects PCM data back from the driver.
-Add non-tunnel driver for amr-wb+.
-Add support for amr-wb+ in asm driver

Change-Id: I266e70dff0466a20b0435da840a31a8a1774cf35
Signed-off-by: Ajit Khare <ajitk@codeaurora.org>
2013-03-07 15:25:01 -08:00
Damir Didjusto
b0af32ef0e ASoC: wcd9xxx: Fix the ANC CnP
Add virtual ANC widgets which are used to enable ANC
before PA is turned on, and to disable ANC before TX is
turned off.

CRs-fixed: 387904
Change-Id: I8c2fa670062f1486499c79653a2c223f7daba84f
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
2013-03-07 15:24:48 -08: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
Asish Bhattacharya
b33d88418a ASoC: compr: change sequence of softvol
As the ASM session is opened in hw_param the soft volume does
not take effect. Hence move it to hw_param so its applied after
asm open.

CRs-Fixed: 434323
Change-Id: I1ce24d74382bd2c1926df2d63ff2eb40b0652f95
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-03-07 15:24:39 -08:00
Subhash Chandra Bose Naripeddy
35959923a9 ASoC: msm: Decrease the playback period size of PCM driver
To support the deep buffer output, the playback buffer size is
increased to 4k from 2k. Reverting the change as the support for
deep buffer output is no longer valid.

Change-Id: I5034245bde4b55a5816506fbdfeac970a8e7804b
CRs-Fixed: 438177
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-03-07 15:24:37 -08:00
Phani Kumar Uppalapati
eb09a2ab1d ASoC: msm: Modify min and max period bytes and num periods
Modify min and max period bytes and number of periods in
compressed driver so as to be consistent with lpa and to
meet ION memory requirements. This avoids using huge
buffer sizes for tunnel decode.

Change-Id: Ib71da4cebfc097e7aeaf0ca0e65ee847ba7cceb7
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
2013-03-07 15:24:16 -08:00
Simmi Pateriya
c48395436b ASoC: apq8064: Fix button detection voltage thresholds
Recent measurements indicate that the button threshold voltages
have changed. Adjust the button voltages accordingly

CRs-fixed: 432596
Change-Id: Ibee4db3b9c76df1d464dcad443f0f90d24751ee3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
2013-03-07 15:23:52 -08:00
Mitchel Humpherys
5ebf0bb53c ion: change ion kernel map function to not take flags argument
Buffer flags are going to be specified at allocation time rather than
map time. This removes the flags argument from the ion kernel map
function.

Change-Id: Ib983ecd0dcd7befb36287ae7037c71d4ca475f90
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-07 15:23:16 -08:00
Stepan Moskovchenko
88a16cc82a msm: Refactor cpu_is macros into SoC classes
Refactor common combinations of cpu_is macros into logical
SoC class macros to reduce the maintenance burden of
implementing support for additional product variants.

Conflicts:

	arch/arm/mach-msm/include/mach/socinfo.h

Change-Id: I6916dcb30378cd3ba33ea8d863403f93f62a13f2
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:23:00 -08:00
Hanumant Singh
19cc56631b ion: Port heap mask change to ion
Heap mask field passes as argument at allocation time to specify ion
heap.

Change-Id: I6951da81b11bfcb0e006d2539c1707aabbb12db6
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-07 15:22:59 -08:00
Subhash Chandra Bose Naripeddy
6c3753b13b ASoC: msm: Fixes for underrun issue in LPA Playback
Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.
The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.

Fixes:
-A disturbance was heard when switching from one song
to the other, or when the song is paused for greater
than 3 seconds and then resumed
-This was due to the previous value of the track
volume being used in the lpa driver
-This was fixed by setting 0 as the initial volume

Change-Id: I035760937d032038fb3f3383dc87ecbdc5f4700d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-03-07 15:22:21 -08:00
Phani Kumar Uppalapati
8e3c504629 kernel/msm: 8974: Audio ocmem driver changes to use bus dt APIs
Populate bus vectors for the audio ocmem driver with use of new
bus device tree APIs.

Change-Id: If965c269706763a3a67b22243f265429f23427d6
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
2013-03-07 15:22:07 -08:00
Phani Kumar Uppalapati
5803131281 ASoC: msm8974: Audio ocmem driver changes to fix playback issues
Fix issues when alloc grow, shrink requests received while display
off/on. Add return statement to the audio/voice workqueue for the safe
exit.

Change-Id: Ifda7823f68ef0f26b9fe781c4c509c7633291169
CRs-fixed: 404445
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
2013-03-07 15:22:06 -08:00
Vicky Sehrawat
c854811a66 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. For APQ8064, MSM8930 and MSM8960

Change-Id: I61d598e2eff546bfc053c5301f992fb7d9ba3268
CRs-fixed: 405772
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
2013-03-07 15:21:56 -08:00
Santosh Mardi
dcc8744c9d ASoC: msm: Register restart api for under run issue.
Update compressed platform driver to register an restart callback.
Implementation of the restart callback is to issue an pending buffer
Written by application to restart the session when  the de queue
Process is stopped due to underrun issue.

Restart callback is triggered from the ALSA core framework when
Framework detects that the render stopped pulling the data
And application is writtig the data.

This callback will be running in atomic context.

Change-Id: Iada382f39bd052beeb0b1d165959d510fa51ff7c
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2013-03-07 15:21:55 -08:00
Santosh Mardi
fb7be07c92 ASoC: soc: Update the restart op of the platform driver.
Update SoC framework to update the restart callback registerd
By platform driver, which inturn be used by ALSA core framework
To trigger the restart callback during the under run issue to
To recover from hang state.

Change-Id: I70f47c0d295526e7f35d4a4f9024e0e87dbc2455
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2013-03-07 15:21:55 -08:00
Santosh Mardi
dec3f44a64 ASoC: core: Update ALSA core to issue restart in underrun.
When compressed and pcm session is started the buffer pull will
Be from the DSP, in mmap mode for the scenario Hardware pointer
Is same as application pointer implies application has not filled the
Buffer to be send to DSP, and platform driver has to break and restart
The de queue process when the application has sufficient buffers.

When hardware pointer is same as application pointer it is an under run
Scenario where the ALSA framework has to trigger the under run and in HAL
The session has to re-prepare and re-triggered. based on the stop
Threshold, but in our system the stop threshold is INT_MAX which
Indicates that under run is not triggered in practical cases.

We have a brodcast usecase in which the mentioned under run case
Is hit mulitple times, and every time re-prepare and re-trigger will be
Expensive

Update the ASoC core framework to restart de queue process stopped
By platform Driver when the under run is hit, based on the available
Buffer and render flag, so the System will recover from the hang state.

To restart de queue process the ASoC core will be calling the restart
Callback registered by platform driver and this callback will be running in
Atomic context.

Change-Id: Ic9ea05a0dc6246346e9913493232882e2f5447d1
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2013-03-07 15:21:54 -08:00
Santosh Mardi
0facfd9f66 ASoC: msm: Enhance multi channel pcm driver to support SYNC and ASYNC
Enhance the multi channel pcm platform driver to support SYNC and
ASYNC mode

Change-Id: Ieca18864ce68055f7806be487b487d305bee2af8
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2013-03-07 15:21:29 -08:00
Ajit Khare
9ebff212cd ASoc: msm: Add amr-wb/wb+ tunnel playback support
Update compress audio platform driver
to support amr-wb/wb+ tunnel mode playback.

Change-Id: I98d087db490441c57c8e2d4fe03a7e91b28e67fc
Signed-off-by: Ajit Khare <ajitk@codeaurora.org>
2013-03-07 15:21:29 -08:00
Phani Kumar Uppalapati
3fb13a4e2c ASoC: msm8974: fall back to have AFE port started at prepare
After upgrading to kernel 3.4, there is 5 second delay
at the closing of PCM playback. The delay is due to missing
EOS from QDSP6 audio session manager causing pcm close function
of PCM platform driver to wait for 5 seconds. The root cause
for missing EOS is that ALSA dynmic PCM shutdown sequence has
changed. Now, trigger stop is called on the back-end DAI-LINK.
Furthermore, back-end trigger stop is called before front-end
trigger stop. Since sink stops rendering data, data at source
will never get consumed. EOS event will not arrive. As trigger
operation has to be atomic, it is very difficult to guarantee
sequence on shutting down various modules in QDSP6. The decision
is to abandon starting and stopping QDSP6 AFE port in trigger
function. This decision is considered acceptable as playback
and capture over SLIMBUS is no longer subject to strict sequence
which Q6 AFE port must be started after CODEC configuration.

Change-Id: Ief351168b08d5cca0a76405834cf3d6aa14a3941
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
2013-03-07 15:21:28 -08:00
Krishnankutty Kolathappilly
671c670fb7 ASoC: msm: implement drain command in compress platform driver
Currently, at the end of compress audio playback, session is
terminated without ensuring compressed audio stream is completely
rendered. Use ioctl drain to drain out all the data before EOS is
signalled and session is closed. This is to make sure all the
data is played out by DSP.

CRs-Fixed: 390897
Change-Id: I3e39b210a8924180de9eb4453c6f6f6435ded0ee
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
2013-03-07 15:21:28 -08:00
Subhash Chandra Bose Naripeddy
e5096b309f ASoC: msm: Add 8-channel L-PCM TX support
There is use case that the HDMI input goes through MI2S TX
interface to ADSP. Add 8-channel L-PCM TX support for this
use case.

Change-Id: Iaf10ec357a25fe4cf80e36a2ceba3d113e9b0416
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-03-07 15:21:27 -08:00
Joonwoo Park
52f55e9f1e ASoC: wcd9310: Resend edge triggered GPIO IRQ
If MBHC GPIO IRQ for mechanical headset detection asserted while power
management's suspend call chain is being called, wcd9xxx_lock_sleep will
fail to wait for system's resume since power management interface has
to finish suspend in order to resume system.
In this case, interrupt cannot be handled as codec driver cannot
guarantee if underlying bus is awake.
Wake up system and resend the IRQ for this situation.

(cherry picked from commit ecf379cd17b7fe94e6f0df0598a472b6f1828ad5)
(cherry picked from commit bdda99b93915d217150f5484f9c718c905703f1e)
CRs-fixed: 404167
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>

Change-Id: Id5970b359b80e0cd1f701b30c61ade23e0f67b9e
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:21:09 -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
Banajit Goswami
0c7c7dc9c9 ASoC: pcm: allow backend hardware to be freed in pause state
When front-end PCM session is in paused state, back-end PCM
session will be put in paused state as well if given front-end
PCM session is the only client of the given back-end. Then,
even though the application closes front-end PCM session, DPCM
framework will not allow back-end to enter into HW_FREE state,
and hence back-end will never get shutdown completely.

(cherry picked from commit 6479fa2d82c5fa8b756a4755bc84e2ce48dad850)
CRs-fixed: 411089
CRs-fixed: 409894
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>

Change-Id: I4d4f856a0401ff96cef98d374c1d12b10e124528
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:21:04 -08:00
Jayasena Sangaraboina
26f9e0e9d1 ASoc: msm8930: Add fix for Unsupported Proxy backend sample rates
- AFE does not support sampling rate 44.1k
- This fix addresses the issue by setting backend proxy device
sampling rate to 48k

(cherry picked from commit 69ab7356a72981032d5d403ec1508dcfaeb7075f)
CRs-fixed: 413871
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>

Change-Id: Ic067178f9d4cdb51b8fee5292b960922088c8539
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:20:58 -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
Bhalchandra Gajare
59a477d976 ASoC: msm8930: Add speaker playback support for 8930+8917
PM8917 does not have speaker amplifier, hence the codec lineout
is directed to the speaker through a onboard amplifier. The
amplifier needs to be enabled in order for speaker playback
to work on a target with PM8917

Change-Id: Ic9f16d335bc1a0cef6fb1eb93c1617fd086cc5b7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
(cherry picked from commit f6d1f7261de810bb07429c25b99187328359b8c4)
2013-03-07 15:20:15 -08:00
Mingming Yin
5379aca632 ASoC: msm: reduce period_bytes_min for voice call
- Allow smaller buffer size for voice call to
  comply with MR1 audio HAL

Change-Id: Iaffca753ad07889b08ae4b6154e8d596950a979e
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
2013-03-07 15:20:12 -08:00
Jay Chokshi
af5646b4a1 msm: Add support for APQ8064AB variant.
Update the call sites of cpu_is_apq8064() to include an
additional check for the APQ8064AB target where
appropriate.

Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
(cherry picked from commit 11abd8bdf369e6ddaf5569e780f2c62180095653)

Change-Id: I3cc0ba7279ce6e111d1b87933a8f8251ca306830
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:19:19 -08:00
Kiran Kandi
efeae841b9 WCD9320: Add support for class H controller
The class H controller is embedded in the digital hardware.
Its purpose is to analyze the signal which will be sent to
the PAs (EAR or HPHL/HPHR) to adjust the supply voltage of
the PA to make the system as efficient as possible.

Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
(cherry picked from commit 4c56c594c16b5f730af3538829cae4e102ac17f5)

Change-Id: I5c269a917427cef918e06eb4599383fd725c3a92
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:19:04 -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
David Collins
fc10b826c1 msm: board-8064: Add support for remapped PM8917 GPIOs
Add support for APQ8064 + PM8917 CDP by conditionally remapping
GPIOs based upon the presence of a PM8917 chip.  GPIOs are
remapped as follows (unmentioned GPIOs are not remapped):

PM8921  PM8917
6       N/C
8       N/C
16      N/C
19      16
30      N/C
37      N/C
38      30
39      19
40      N/C
41      6
42      8
43      37
44      38

Change-Id: I67b385a288a4dbb2843d97dbea6e287b02e621ed
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit d49a1c5c4ca6939745aefd7c872b9299acfb69db)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:31 -08:00
Helen Zeng
01f8e5d872 ASoC: msm: Add support for voice over USB.
Add routes to transfer voice packets to/from the
external modem to USB in APQ, and route the mixed
audio and voice streams to the extertal modem for
echo cancellation.

Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
(cherry picked from commit 5cf6970f74261aecca981c1ee14e5a62e4466bbd)

Conflicts:

	sound/soc/msm/msm-pcm-routing.c

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 0f6ff949a8dac48f7d5771fafbe366e4f4bcc28e)

Change-Id: I6be578ebeadb7ebe0ad6fb7a344eb7cb3a411eee
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:09 -08:00
Joonwoo Park
8c1c7de73b ASoC: wcd9310: Fix NULL pointer dereference.
If sound card is not yet initialized the platform device's private data
is not set either.  Check if private data is NULL before use it.

CRs-fixed: 400055
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit d6e48bd07516ecc683a995ebf8eedf080f14016d)
(cherry picked from commit 87ba6ce49d4f50ad089702135e84ecad5446bfad)

Change-Id: I94e45366d8f316ea8e69def48cc926cdd971f5a6
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:08 -08:00
Kuirong Wang
3589f26bba ASoC: apq8064: Enhance the machine type check for apq8064 devices.
There are cases that some of apq8064 devices has soc minor version as
1 but not apq8064 i2s device. Add the machine type check to enforce
only mpq8064 and apq8064 I2S devices won't use apq8064 machine driver
and rest of apq8064 devices will keep using apq8064 machine driver.

Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
(cherry picked from commit f993eac79891cf519f7a6ab8df274467aa9b273e)
(cherry picked from commit 3c14d0817579453170d49e3fd2d70b108e135dcc)

Change-Id: I5f21a4a3755a9f43c8d2d90f106dc24710671798
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:08 -08:00
Kuirong Wang
4699590504 ASoC: msm/apq: Remove the dependency of AUX PCM TX to AUX PCM RX.
AUX PCM interface is a bi-direction interface which RX and TX paths
share the clock and sync word. In current design, it is assumed
when TX path is activated, RX path was enabled beforehand. So the
AUX PCM clock and GPIO pin configuration is only tied to AUX PCM RX
path.  There is use case that only AUX PCM TX path is activated by
application so the AUX PCM clock and GPIOs are never configured
in this case which causes recording from AUX PCM TX failed to
capture any audio sample.

The solution is to update the clock and GPIO pin configuration to
both RX and TX path and then use an atomic reference counter to
prevent them configured twice.

CRs-Fixed: 397095
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
(cherry picked from commit ae395b024194bf6ae633a67dd1c2a5b3c7f1e019)

Conflicts:

	sound/soc/msm/msm8974.c

Change-Id: If7f044de3cc4819e61fe66cd865755dceb5c45eb
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit eba5065dc6a84da68e5d9bcf6cb1934324698fec)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:08 -08:00
Helen Zeng
390fd7224b ASoC: msm: Set the minimum channels to 2 for HDMI.
The minimum channel number supported by HDMI is 2.
Set the channel to STEREO if the channel is MONO in
fixup function.

CRs-fixed: 384324
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
(cherry picked from commit 12123a1c21b2e9beb469e66cc66d7b5cdd13eb2a)
(cherry picked from commit cc72e236484f1fee01ecd9a6bdf06d7bc690dc9b)

Change-Id: I153e1e0fc73523b3a1e229bd6c8eff2b8ac6e8c1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:07 -08:00
Jay Wang
2642d88534 ASoC: msm: qdsp6: Fixed the volume command timeout issue.
QDSP6 can send out of sequence response and this breaks
the no wait command tracking logic. It results the wait
command response gets ignored and causes the wait time out.
To resolve the issue, each response needs to be checked
to determine if the response is for no wait or wait command.

CRs-Fixed: 402768
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
(cherry picked from commit 186115970e3a1eb38a183fccce4668500f0a7edf)
(cherry picked from commit 605a4c7f220a135709dbb933a760c356cf082bc8)

Change-Id: Ia364fcbb4f093ba683a29f8f209e9318519c4f6c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:07 -08:00
Patrick Lai
a6a81642f1 ASoC: wcd9310: Enhance OCP reporting logic.
CODEC has over current protection(OCP) finite state
machine for both left and right headphone while CODEC
driver tries to delay reporting of OCP event after
CODEC reporting OCP two times. Current CODEC driver
implementation results in unlocking one of headphone
power amplifier when OCP reported on both headphone.
Change the behavior to report OCP event for a give
headphone immediately if OCP already occurs on opposite
headphone.

CRs-fixed: 339620
Signed-off-by: Patrick Lai <plai@codeaurora.org>
(cherry picked from commit c2d833d524c1230c72f2d078b543baba7a8db26f)
(cherry picked from commit 6b8cacf2d5ed669048c3813b56851c10fe5c5af1)

Change-Id: Iea28c8baa1a6372dcb4c0214ec0e74bfc483f563
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:06 -08:00
Banajit Goswami
c0dcb4c596 ASoC: PCM: Release memory allocated for DAPM list to avoid memory leak.
Fix memory leak by releasing the dynamically allocated memory for
DAPM widget list in case of playback.

CRs-fixed: 386917
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
(cherry picked from commit c2b059968770de6e0fd0e37bc7877b05e7e23368)
(cherry picked from commit af7a0215387c8a92dd51ebbd824f7e2444a84c77)

Change-Id: I57e9b5a4ffe0a2ba82280ab00d03b514fa8617be
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:05 -08:00
Jayasena Sangaraboina
dc738ba3e7 ASoc: msm8960: Add msm8960AB board specific change.
- GPIOs 23, 35 are used for headset mic on msm8960
- Do not configure GPIOs 23, 35 on msm8960AB target
  for headset mic, as these GIPOs are used for FAN
  external VDD_CX regulator control

Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
(cherry picked from commit 21c9f483e14dbb5b54ac5bf63f7d8711a157ebcb)
(cherry picked from commit 404e6428e061d11581eb949ae13e53646e925294)

Change-Id: I652f0ee07365fddd31e157b68893bcb749dbc1d7
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:05 -08:00
Sriranjan Srikantam
0ffd75ab43 ASoC: Add locking in DAPM widget power update.
While playback and capture is done concurrently the dapm widget
data is accessed parallelly which results in data corruption and
kernel panic. Fix this problem by serializing the stream event
operation by adding lock

dapm_seq_run will invoke dapm power sequence for pre-sorted list
of widgets to be powered up. Kernel panic issue is observed
during stability runs with the above sequence caused by null
pointer dereference in dapm_seq_run_coalesced. Fix kernel panic
issue by checking for valid snd_soc_dapm_context pointer in
dapm_seq_run before invoking dapm_seq_run_coalesced

Widget list in dapm is getting corrupted during concurrent
use cases where dapm_power_widget is accessed. This corruption
is resulting in kernel crash in dapm. Fix the issue by adding
protection in dapm_power_widgets API.

CRs-Fixed: 388785
Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>
(cherry picked from commit fd7f1ad52d7f848073c90c6a79c1d9fce1ff4ee5)
(cherry picked from commit 343e95447979b2b5592b9523c4abc8422f149487)

Change-Id: I1c91d4a55d0918e36315b9afce367e2f453ea9a7
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:04 -08:00
Deepa Madiregama
085fc084a8 ASoC: msm: Reset the calibration block after subsystem restart.
- After sub system restart ACDB cannot push data to Q6
    - Memory map is not happening after sub system restart, because
      the calibration block address is same as the cached address.
      Without memory map calibration block is sent to DSP, where it is
      failing with memory map error.
    - Reset the calibration block after sub system restart, so that
      memory map happens after sub system restart.

CRs-Fixed: 389214
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
(cherry picked from commit b71818e0ee674b2357d419c6559b5aa009d96a14)
(cherry picked from commit 9bf11c66fb6ec7c39b7cef010b7db99a79ebb6a4)

Change-Id: I9ac78f92afae6711b6eb9604c54db6303199a910
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:04 -08:00
Bhalchandra Gajare
817f71407c ASoC: msm8960: Fix button detection voltage thresholds.
Recent measurements indicate that the button threshold voltages
have changed. Adjust the button voltages accordingly

CRs-fixed: 390846
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
(cherry picked from commit b15d0e39310c93f859b51d382797784717935555)
(cherry picked from commit 9cf308d9926fd3f6ae3f642cb2fabfe6f01fcb47)

Change-Id: I721c89a7d36266926ab1ac343d938cf0f2f3c237
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:03 -08:00
Kuirong Wang
da5359c53d ASoC: apq8064-i2s: Add machine driver for APQ8064 I2S.
This machine driver implements the topology which voice
downlink/uplink streams from/to MDM are received via primary
spkr/mic I2S interfaces and internally loop back within LPASS
to MI2S interface with the other end connected to wcd9310
CODEC.

Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
(cherry picked from commit 80f8ec49294e9698751a5afd8c33fb327f8f5b6a)
(cherry picked from commit bf8f93bc69fb3e6a7333525249984212271ca3ad)

Change-Id: I2d9140c49d14f172ae402d738ab3b6b523250486
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:03 -08:00
Damir Didjusto
9f7844b097 ASoC: wcd9310: Turn on EAR DAC and PA at the same time.
Turn on EAR DAC and EAR PA at the same time to avoid pop
at start of playback.

CRs-Fixed: 386288
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
(cherry picked from commit 7c85d71830e1781c113cf1d69234169e8feb31c9)
(cherry picked from commit deb584f6a8788dcda97a9d83038103ebd2576771)

Change-Id: Ib50f6a488fe93595423bae30164073cc25b90076
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:03 -08:00
Sharad Sangle
82d5354387 ASoC: msm: Change the reset timeout to look the PLL on cs8427.
Change the reset timeout form 100 jiffies to 1 jiffy which
is used for the PLL lock timeout for cs8427 chip

CRs-Fixed: 361937
Signed-off-by: Sharad Sangle <assangle@codeaurora.org>
(cherry picked from commit 1cbe87dd6ef07013dff2e58d6d75adc1d440fe24)
(cherry picked from commit fa5ec08bb0b19b3065b6b5c2db7bc8a13b7e01a2)

Change-Id: I95049ddae148ba951b06ae4fd96f4875d929ced1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:01 -08:00
Aviral Gupta
ecc5afee4a ASoC : msm: HDMI 5.1 LPCM playback support.
Support 6 channels configuration in HDMI driver
and the ALSA framework to play 5.1 LPCM format

CRs-Fixed: 370096
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit fc3b780b571b62f302fe38c9faaa58508ad5464f)
(cherry picked from commit 7fd4b7af623ac3dfef0b23d4e68758b1a65941d6)

Change-Id: I091cd3187e9c68eb2589c9b3412b1d8a7bb59164
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:59 -08:00
Aviral Gupta
37e3f94458 ASoC: msm: Modify default buffer params of compressed driver
There can be a use case where HAL may request for
Smaller period size and corresponding buffer size for
A session, update compressed driver default period size
And buffer size based on the userspace configuration

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit d4e62aeb8839cf9accf2356568a14adb8d24152f)
(cherry picked from commit 462a09e10e32afb49ca50bdbfb8c4a4e13cc068a)

Change-Id: Id1aef6c71c5c71b269b6607816f7c3e5c4fd4314
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:58 -08:00
Santosh Mardi
396ffba1f8 ASoC: msm: Remove the check to break when the app not ready with data.
When the Application pointer is same as hardware pointer, the dequeing
from DSP chain will be broken to start the session again there should
be trigger called explicitly from the user space, to avoid resending
the trigger command from the user space.

Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
(cherry picked from commit 5bb19ee2b22ca42e708da052517853496fc5b98d)
(cherry picked from commit d5d591f945b25b82a7177a6b466387fbc9b1bf93)

Change-Id: I42bb47de76e3f9368188161b5a1a71734fec3b6e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:58 -08:00
Sachin Shah
382f774f33 ASoC: msm: Add AMR-WB tunnel capture support.
Update compress audio platform driver
to support AMR-WB tunnel mode capture.

Signed-off-by: Sachin Shah <sachins@codeaurora.org>
(cherry picked from commit b96124a67cebcbe91e13f5e4c7f2bb9bcb2bb15f)

Conflicts:

	sound/soc/msm/msm-compr-q6.c

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit cbf47c164b124f0d8581be6023adc0827beb0854)

Change-Id: I09cf19698ed0c1ddc321eef03ecf319f63bcfe11
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:57 -08:00
Santosh Mardi
96d416bbec ASoC: msm: Add AIO support for multi channel pcm platform driver.
Add Async write mechanism for multichannel PCM platform driver.
This will facilitate to have meta data information flow from apps
To DSP and vice versa.

Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
(cherry picked from commit 69f2b8ac7106fe5d5fa19ee12131c27efc8e5ec1)
(cherry picked from commit 45e605da5fd57e07609657c0fac43853d3d0658e)

Change-Id: I6a931b4458f14b64040eb7502aee26250938ba9d
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:57 -08:00
Santosh Mardi
f1dd70da44 ASoC: msm: Disable 100 KHz level shifter when not in use
When 100KHz level shifter is enabled this is causing an i2c
Failures for the tuner chips sitting on the same bus, to avoid this
Errors the spdif 100KHz level shifter should be disabled when
The i2c read / write of cs8427 chip is not in use.

How 100KHz disabled is, as and when the driver tries to do I2C
Write / Read Level shifter is enabled and disabled after i2c
Read / Write is done, This is done for every read / write i2c
Transfers on cs8427 chip, though it adds and over head of enabling
And disabling level shifter every time, this is the only better way
To address this.

CRs-Fixed: 390239
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
(cherry picked from commit 3896ed363d0958bde89de2f31709616eb96cb489)
(cherry picked from commit a6fa21f13dac271fc6b9ba971f9746b5fe0d7093)

Change-Id: If0c953771295aac9ddfc2b72389ed30e94fedb9b
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:57 -08:00
Aviral Gupta
07be989988 ASoC: msm: Default format for the compressed driver as LPCM.
Setting the LPCM as default format for the compressed driver.
It is needed for the HDMI IN compressed use case, where we are
not aware of the format beforehand

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(Cherry picked from commit 7e259d841857f06951c41c1159e95bb4b343602f)

Conflicts:

	sound/soc/msm/msm-compr-q6.c

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 390ef43a8103c52273614e09ed1e5e8ceab97f04)

Change-Id: I2d380e97e3225e1b6cb3250d10ca016f8fcc4b1e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:56 -08:00
Joonwoo Park
6ce9b5ec87 ASoC: wcd9310: reduce mbhc button release GPIO debounce time.
Current GPIO debounce time is too long so it delays next button
press detection.  Reduce this debounce time so driver can detect
next button press and release quickly.
Typically mic voltage ramps up within few milliseconds after button
release so 50ms is long enough.

Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit db606b0a39452c90e26692c22300c390f5822f29)
(cherry picked from commit 96e92e0a22a0c54f9cfda447d346c1a2dd9f4639)

Change-Id: Ibf0aa4d4c07fab9cd50021cb0e256ee23b320059
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:56 -08:00
Bhalchandra Gajare
929f5cb92e ASoC: WCD9310: Defer the setup of headphone removal detection.
After the inserted accessory is detected as a valid headphone,
polling is performed on the microphone to correct the accessory
detection in case it was wrongly identified as a headphone.

It was observed that at the end of polling, headphone removal
interrupt was fired, causing headphone playback to stop. Fixed
by deferring the headphone removal setup until either polling is
complete or polling detects a removal

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

Change-Id: Ic2c04aa300fc029957c71294e153aef479967b84
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:55 -08:00
Aviral Gupta
2206e6f1c0 ASoC: msm: Updated the period size of Multichannel driver.
Upadate the multichannel driver period size to accomodate the
8 channels with 1536 bytes for each channel in HDMI IN use case.
Update the channels of wma according to the structure populated
by the HAL

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit 572d504a7a57d521bd5a823a3bb8a443ac34842a)
(cherry picked from commit a955dd94918bc4241d28053d8f6587b1c055238a)

Change-Id: Id043cbf07ff1b8a80ac0961ddeff0c1d3ff1283b
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:55 -08:00
Harmandeep Singh
1142bd1d40 ASoC: msm: Fix seekbar issue while excercising tunnel mode playback
While playing a file via tunnel mode, the timestamp was not getting
updated in the seekbar.

Provide a fix for this by parsing the lsw and msw timestamp
correctly before being sent to userspace.

Signed-off-by: Harmandeep Singh <hsingh@codeaurora.org>
(cherry picked from commit 3377a88c4b4e7b71abd09e2bf66c1844743c329f)
(cherry picked from commit 0c5d9b68488f318538caa7ada53ed6fbb1a2309f)

Change-Id: I0f94e07e43f922ceeb59a83c9628fa47cd17ef4e
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:54 -08:00
Aviral Gupta
128534a9d7 ASoC: msm: Fixup of the SEC I2S port to 2 channels.
Add the fixup function for the SEC I2S backend to
configure the number of channels to 2 and
sample rate to 48000Khz.

CRs-Fixed: 395160
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit 695c30beb5b12f7f4b1169e6c65a1c67bef03c19)
(cherry picked from commit cb3b26e043e1e32a543d799e1ba37a0e882f1aa6)

Change-Id: I670881282655e20059ed7fa039f575b6411366bc
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:54 -08:00
Mitchel Humpherys
f3f2186813 ASoC: msm: include msm-specific ion header.
All msm_ion clients need to use <linux/msm_ion.h> instead of
<linux/ion.h>

 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
(cherry picked from commit 71a6ac9d4fc5e88efd57c2077caaff34afa36603)
(cherry picked from commit 353fac8a22a0253e990c745232d45586adb0defb)

Change-Id: I26165047d3361802ff3957b54a645544a8e9c3b5
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:54 -08:00
Ravi Kumar Alamanda
1408452652 ASoC: msm: Add support for 4-pole extension cable.
- Add the support to report lineout device when inserted plug
  has high impedance on microphone line.
- This feature is enabled only with gpio headset detection.

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
(cherry picked from commit 07b6bd6a9a1e431a86efa76b14030d882ee7771b)
(cherry picked from commit 39c0e134f67fcab824f1457a256c4fbf2525c347)

Change-Id: I6d4e3f147433ee9c0cc313118b540fee0b90f45f
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:53 -08:00
Subhash Chandra Bose Naripeddy
af9c40f4a2 ASoC: msm: Add support timestamp update VCAP playback usecase.
Compressed data in HDMI IN or VCAP usecase is propagated with
timestamp from DSP with each buffer. For playback, the same or
interpolated timestamp is updated with the corresponding buffer.
DSP will render the buffer a) without any delay if timestamp mode is
synchronous to absolute timestamp b) with a delay if timestamp is more
than the absolute timestamp c) drop the buffer if the timestamp is
less than the absolute timestamp. Add support for the same.

Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
(cherry picked from commit aa1f5e51dbc251dc758a1f762802d87d4f2128b7)
(cherry picked from commit cb209b8f0bddcedaf26a181f20de696e4ad729bc)

Change-Id: I5b7b2cb405f72ea9afa4751c6a92cde09f40d69c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:17:53 -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
SathishKumar Mani
b502df8c7c ASoC: wcd9310: force slimbus ports to disconnect during error cases
With shared data channel architecture, SLIMBUS driver
only removes slimbus channel when all clients vote to
have channel removed. In case of subsystem restart,
client such as MDM can go down without withdrawing
vote. During CODEC path shutdown, CODEC driver will
receive slimbus slave interrupt in time indicating
port disconnection because slimbus channel has not
be been voted off. Then, CODEC driver blindly
shutdown rest of CODEC path. This results in
overflow error on Rx path and underflow error on
Tx path. In case of time out waiting for port disconnect
interrupts to arrive, force ports to disconnect

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
BUG-ID: 7313016
2013-03-04 12:47:36 -08:00
SathishKumar Mani
335106e3b4 Asoc: msm: 8064: Set channel number based on recording mode
The shared channel number can be overwritten by front-end
DAI's channel setting. Add fixup function to set the correct
channel number based on recording mode in the machine driver.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
BUG-ID: 7313016
2013-03-04 12:47:36 -08:00
SathishKumar Mani
453e0966b1 ASoc: soc-pcm: Move dev_warn to pr_warn_ratelimited
- Kernel messages are getting flooded with warning
  messages when no valid routing found from source
  to sink
- Ratelimit the warning messages

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:47:09 -08:00
Glenn Kasten
29e4b90027 No world-writable files in debugfs
Change-Id: I60c9107b9f6aef53efbe6fa67f1465b2f1a7c2bb
Signed-off-by: Glenn Kasten <gkasten@google.com>
2013-03-04 12:47:00 -08:00
SathishKumar Mani
69b1f52a8d apq8064: Add support for hdmi multichannel
Provide support for hdmi channel fixup.
Fix channel map order to WAV format.

BUG-ID: 7156174
Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:46:59 -08:00
Iliyan Malchev
800362a852 soc-pcm: WARN_ON invalid playback route
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:46 -08:00
SathishKumar Mani
d44697e328 msm-pcm-q6: Add support for flexible recording period size
- Current implementation supports only fixed buffer size
  of 320 bytes only for audio recording. This results in
  performance overhead for recording at higher sample rate.
- Added support for flexible period size so that user can
  use larger buffers for recording at higher sample rates.

Signed-off-by: SathishKumar Mani<smani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:27 -08:00
Ajay Dudani
4172e74684 ASoC: wcd9310: Turn off slimbus clocks when no ports are active
With the recent change in tabla shutdown, turning off the clocks
were being taken care after all the slimbus ports are closed.
But, there are instants where tabla startup is being called
during bootup, which keeps the runtime PM votes running,
and as there are no ports open, clocks are on all the time,
due to one of the votes. Bringing back tabla shutdown, but
turn off the clocks only if there are no slimbus ports
open at the time of shutdown, else it will taken care when
the slimbus ports are getting closed

Change-Id: Iaa9378b171d7c169a0f3306d55698e18d28dd111
CRs-fixed: 390003
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:46:21 -08:00
SathishKumar Mani
7ef4e8f7db ASoc: msm: Increase default buffersize to 4k for audio playback
- Increase default buffersize to 4k from 2k for audio playback
  when HAL is configured with deep buffer output.

bug-id: 7129131
Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:45:37 -08:00
SathishKumar Mani
f7af370aad ASoc: msm: Increase max buffer size to 4k for lowlatency playback
- Small buffersize is resulting in scheduling issues.
- Increase max buffer size so that user space can
  configure large buffer size to avoid scheduling
  issues.

bug-id: 6865729
Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:45:36 -08:00
SathishKumar Mani
ca5a274feb ASoc: msm: Add lowlatency playback and recording routing
controls

- Add BT, FM, PROXY routing controls for lowlatency playback and
recording

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:45:36 -08:00
SathishKumar Mani
f0adb8bf52 ASoC: WCD9310: Reduce the sleep time after lineout PA enable
- Speaker warm-up time is too long(over 100 ms) due to big delay
  (16*2ms for mono and 16*4ms for stereo)after lineout PA enabled.
- Measured by "adb shell dumpsys media.audio_flinger |grep measuredWarmup",
  speaker warm-up time is reduced to ~70-80ms

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
bug-id: 7022794
2013-03-04 12:45:29 -08:00
ty.lee
b3520d3f1f audio: remove handset pop-noise
When receiver opens immediately after it is  closed, the pop-noise occurs.

Change-Id: I8e5374edea9f8710963b7669e64b109db2354650
2013-03-04 12:45:19 -08:00
SathishKumar Mani
9f9c98e3ac ASoc: msm: Update platform drivers to correctly access audio_client
Update platform driver open function call to access
audio_client pointer only after allocation to avoid crash.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:44:56 -08:00
SathishKumar Mani
9137e5bbac ASoc: Reduce number of periods in low latency driver.
- Reduce number of periods to 2 from 4.

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
2013-03-04 12:44:55 -08:00
ehgrace.kim
2d75bd5396 ASoC: msm: Add back-end enablement for CPU DAIs
ALSA framework in kernel 3.4 requires all CPU DAIs to be routed to
the repective back-end input or output. Add the routing for STUB_1,
SLIMBUS_1, SLIMBUS_3, and SLIMBUS_4 CPU DAIs.
It is from QCT

Change-Id: Ia7b76ce04b4e19f2f0e9acf9886361e3d113cef6
2013-03-04 12:44:08 -08:00
ehgrace.kim
7d9e3a5dcd Revert "Revert "ASoC: msm: Add support for voice over HDMI""
This reverts commit b8b0d13a57e18d3ec33dc2647f567cd62e9d5967.
2013-03-04 12:44:07 -08:00
Sungmin Choi
fba6280818 hdmi: audio: fix up typo on hdmi audio
Change-Id: I27257bdd57f0665dd76f267fbf2503e8b73716cd
2013-03-04 12:43:49 -08:00
Devin Kim
ab29637d1f Revert "ASoC: msm: Add back-end enablement for CPU DAIs."
fixed mute issue on voice call

This reverts commit d1582ffc6c7e95ace9d2d4e75e99a4d30142295c.
2013-03-04 12:43:26 -08:00
Jaeseong GIM
5da34e738d mako: set the mako own machine number
mako specific machine type is updated. we don't use
mtp machine type anymore.

Change-Id: I83b78b5a26a871d2bd97a81a179dd6c9f53d3a1c
2013-03-04 09:12:14 -08:00
ehgrace.kim
5fbfe21b85 audio: enable fsa8008 for earjack detection
Change-Id: Ifc6f9aa6fa6520002dec150808bb9192e48ed0a8
2013-03-04 09:11:55 -08:00
Devin Kim
74312213f4 audio: enable tpa2028d and dual amic only for mako
disable tpa2028d and dual amic as default. if mako, enable both.

Change-Id: Id6b40ada3cdb9e7ddcaaf4c2c9916aeae4030617
2013-03-04 09:11:52 -08:00
ehgrace.kim
a7297ab4b5 Revert "ASoC: msm: Add support for voice over HDMI"
This reverts commit 38c3c968733fd4a458957173909a8d638ce1d4dd.

Conflicts:

	sound/soc/msm/msm-pcm-routing.h

Change-Id: I14993fcc1c25e499ef22b54c58ddfc7c41458f53
2013-03-04 09:11:51 -08:00
ehgrace.kim
45717e0a26 audio : enable tpa2028d
Change-Id: Id35a8bf66b1b730d32d1d8cbc68cd3d7f607e72e
2013-03-04 09:11:49 -08:00
ehgrace.kim
922e87a2a4 audio: enable dual analog mic
Change-Id: Ifdba3a42e81917097a9de8c15b0131f0da6a63d1
2013-03-04 09:11:49 -08:00
Devin Kim
3259f9d959 hdmi: able to build kernel without hdmi feature
If not using HDMI, compiling errors occur. it's fixes to build
kernel without HDMI feature

Change-Id: Ida5babdc2f8ebaf73cd5c52b3f4686b27f6f1aa1
2013-03-04 09:11:48 -08:00
David Henningsson
dd54ec4067 ALSA: hda - hdmi: Make jacks phantom, if they're not detectable
commit 30efd8debd upstream.

Just as for analog codecs, a jack that isn't suitable for detection
(in this case, NO_PRESENCE was set) should be a phantom Jack
instead of a normal one.

Thanks to Raymond Yau for spotting.

BugLink: https://bugs.launchpad.net/bugs/961286
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=903869
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-04 06:06:37 +08:00
Devin Kim
ea89be9220 mako: initial bring up the mako hardware
support the initial mako hardware. enabled basic power, storage,
debug-uart.

Change-Id: Ie9f6d5ef1219cb0c3761bb69a3a8fcfdcbb86f19
2013-02-28 12:13:31 -08:00
Chris Rattray
03e578b921 ASoC: wm2200: correct IN2L and IN3L digital mute
commit 0d2b642252 upstream.

Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:59:04 -08:00
David Henningsson
652328944e ALSA: hda - hdmi: ELD shouldn't be valid after unplug
commit bbfd8a19b6 upstream.

Currently, eld_valid is never set to false, except at kernel module
load time. This patch makes sure that eld is no longer valid when
the cable is (hot-)unplugged.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:59:02 -08:00
Fernando Luis Vazquez Cao
7e8b41d605 ALSA: hda - Workaround for silent output on Sony Vaio VGC-LN51JGB with ALC889
commit 12e31a78c7 upstream.

Some Vaio all-in-one desktop PCs (for example VGC-LN51JGB) are affected by
the same issue that caused Vaio Z laptops to become silent: the speaker pin
must be connected to the first DAC even though the codec itself advertises
flexible routing through any of the DACs.

Use the no-primary-hp fixup for choosing the speaker pin as the primary so
that the right DAC is assigned on this device.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:59:02 -08:00
Takashi Iwai
63b2afe91c ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open()
commit 2ad779b732 upstream.

If the driver detects and invalid ELD, it gives an open error.
But it forgot to release the assigned pin, converter and spdif ctls
before returning.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:59:02 -08:00
Clemens Ladisch
e3fc3cb2a0 ALSA: usb-audio: fix Roland A-PRO support
commit 7da5804648 upstream.

The quirk for the Roland/Cakewalk A-PRO keyboards accidentally used the
wrong interface number, which prevented the driver from attaching to the
device.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:59:02 -08:00
Denis Efremov
ceb0446b6d ALSA: rme32.c irq enabling after spin_lock_irq
commit f49a59c447 upstream.

According to the other code in this driver and similar
code in rme96 it seems, that spin_lock_irq in
snd_rme32_capture_close function should be paired
with spin_unlock_irq.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:58:59 -08:00
Denis Efremov
7fb3e95821 ALSA: ali5451: remove irq enabling in pointer callback
commit dacae5a19b upstream.

snd_ali_pointer function is called with local
interrupts disabled. However it seems very strange to
reenable them in such way.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-28 06:58:59 -08:00
Jayasena Sangaraboina
978b65ca45 ASoc: msm: Add low latency playback and recording support.
- Add lowlatency pcm driver for Playback and Recording.
- Add support in target board files
- Add Recording Path to Multimedia5 FE DAI
- Add support in routing, platform, machine drivers
- Add low latency interfaces support in ASM and ADM drivers.

Change-Id: I1beb11db9010534e5aa91179ac6040a41622185d
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
2013-02-27 18:21:33 -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
Joonwoo Park
22155702cc msm: q6dsp6v2: Configure token in APR packet correctly
The token field is for identification to determine response packet's
source.  Fill this field correctly to address afe_loopback timeout.

Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:21:09 -08:00
Joonwoo Park
c1db2a511a msm: msm8974: Add hostless PCM support
Add PCM hostless device for AFE use cases.

Change-Id: Iac4317ae7be89910b40ff29205c9107e8d13750c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:21:08 -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
Bhalchandra Gajare
731abcd718 ASoC: apq8064: Change MBHC micbias voltage to 2.7 Volts
Upgrade the board file to change the microphone bias used by MBHC to
2.7 Volts. The button voltage ranges need to be updated accordingly

Change-Id: Ia2f91271864e0f8fe25b866bff8006af0dd6f20b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-02-27 18:20:38 -08:00
Joonwoo Park
6e7f05785d ASoC: wcd9310: fix TRRS override
The debugfs TRRS entry is for overriding headset button polling.
Fix regression not to start button polling when this flag is set.

CRs-fixed: 386038
Change-Id: I469c366bc111f37ecbb46708d2800200dd3d7584
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:20:23 -08:00
Joonwoo Park
a456b6d4c8 ASoC: wcd9310: make CFILT adjust time as a module parameter
Some of accessories on the headset jack takes longer to settle down
voltage.  Make adjust time to be configurable so those accessories can
be detected correctly.

Change-Id: I3c2f68c8a4bb1a8f94669bd910728f014ee39874
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:20:22 -08:00
Kiran Kandi
6a05c9e1d4 msm: wcd9xxx: add device tree support for codec slimbus component
Read the codec specific data from device tree instead of board file.

Change-Id: Iad382b89692903d2434b63d34c7121fe0b4b9dda
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
2013-02-27 18:20:08 -08:00
Swaminathan Sathappan
21e5928043 ASoC: wcd9310: Reset channel actual flag only if active
Resetting this channel actual flag without
checking whether the set of channels are already in
use, could cause failures in disconnecting those
set of ports associated with that channels.

Change-Id: If0b917023c8f6d11d6b5cd92708715e10a1408ab
CRs-fixed: 384055
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
2013-02-27 18:19:53 -08:00
Ben Romberger
06bd32b064 msm: audio: qdsp6v2: Add support for VOLTE
Update the number of supported voice networks
in the ACDB driver and change the voice driver
to support concurrent calibration for VOLTE,
VOIP & voice.

Change-Id: I945fa40cbb4ac079a79fa0cb829971f1aa9d07f6
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2013-02-27 18:19:51 -08:00
Subhash Chandra Bose Naripeddy
51b53a1897 ASoC: msm: update SRS Tru media control structure with rreg initialization
When SRS Tru media topology is enabled the mixer controls set from
userspace are not sent to driver as the validation fails with
the missing field initialization in the structure. Update the same
to receive the SRS parameters from userspace

Change-Id: Ia2bf800a540adf3bcc2a99fc6e0d9b043c826272
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-02-27 18:19:50 -08:00
Phani Kumar Uppalapati
053011c417 ASoC: msm8974: Add clock support for AUXPCM CPU DAI
This change sets rate on pcm0 root clock (pcm0_src_clk)
and pcm out enable (PCM_OE) clock for AUX PCM CPU DAI.
Once the rate is set on the source clocks, corresponding
branch clocks get enabled.

Change-Id: I59bc339d69fe836f613c1bebf7561184dced2dcf
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
2013-02-27 18:19:12 -08:00
Asish Bhattacharya
119570c698 ASoC: msm: Fix issues in proxy port driver due to early afe port enable.
After recent movement of afe_start to prepare the interrupts start
coming earlier from proxy port.
This results in proxy port driver not ready for interrupts. Start the
timer later to ensure processing of packet once trigger start happens.

Change-Id: Ie82d982b6c147afdef46a8c7bfe7234dd14486f1
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-02-27 18:19:08 -08:00
Joonwoo Park
d4eafd9091 ASoC: wcd9310: enhance mbhc button press detection performance
If interrupt handler is not quicker than voltage ramp up by button
release, driver requested measurement won't see stable voltage.
Enhance button press detection performance by comparing voltage
measurements from codec hardware only.

CRs-fixed: 376825
Change-Id: I294239df02fb5afeb3527dda85924c06ab15e54c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:18:51 -08:00
Joonwoo Park
6dfcc72deb ASoC: wcd9310: enhance mbhc button release detection performance
Enhance button release detection performance by adopting dynamic release
threshold adjusting logic.
Button release is now detected more quickly.

Change-Id: I3a2379e10663cf91df671e8a3894b8805d1ccf9c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:18:51 -08:00
Helen Zeng
f66663a40c ASoC: msm: Don't use spinlock to protect the code which can block
copy_to_user and copy_from_user can block(go to sleep). These two functions
should be removed from spinlock protection.

Change-Id: I0c10796ece4ac218600ef3b214c88a06004a0a0d
CRs-fixed: 381839
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
2013-02-27 18:18:45 -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
Kuirong Wang
cdf330f35c ASoC: msm: update BTSCO rate put function.
The value for the amix command with the numeric strings is
the actual value not the order of the string in the array
of text so the put function has to be updated to handle it.
For example,  the following amix comand:
amix 'Internal BTSCO SampleRatee' 16000'
The value passed from the alsa-lib is not 2, i.e., the 2nd
paramater in the command string:
static const char *btsco_rate_text[] = {"8000", "16000"};
Instead, it is 16000.

CRs-fixed: 364832

Change-Id: Ie7c83a460900b54e2b317e1c77a064efc22e6bcd
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2013-02-27 18:18:21 -08:00
Vidyakumar Athota
563c22ca38 ASoC: msm: Fix for voice call recording
-Voice call recording is not working because of missing
backends configuration for incall record Tx/Rx.

Change-Id: Ie69112e2929ed98a5bc19164cf9a9c66d73cc8dc
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2013-02-27 18:18:13 -08:00
Joonwoo Park
25362f5d3f ASoC: msm8974: register backend DAI link of Taiko codec
Update DAI link to connect slimbus RX/TX port 0 to CPU.

Change-Id: Id8aa2ca92ea9b1e0d51b6d3ccf113860a9147c44
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:18:04 -08:00
Joonwoo Park
6da360614b ASoC: wcd9320: Enable RX7 speaker drive path
The wcd9320 Taiko codec replaced LINEOUT5 with speaker drive.
Add speaker drive path support.

Change-Id: Ia552dff774312491b8068ea1faf9c6137c7906a9
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:18:03 -08:00
Phani Kumar Uppalapati
f3a98f13bc kernel/msm: 8974: Add audio OCMEM driver support
Add audio OCMEM driver support to exercise On-Chip
Memory (OCMEM) for low power audio and voice. The
driver is implemented as standalone and it gets
exercised based on the usecase. Also, this design
reduces the latency associated with OCMEM handshaking
protocol. The audio OCMEM driver is enabled by default
with a Kconfig option using select. Add device tree node
for audio OCMEM to retrieve platform data.

Change-Id: Iba46ce675fc03843d88cd7cf2aa9bc92fe70a955
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
2013-02-27 18:18:02 -08:00
Joonwoo Park
1238a07489 msm: q6dspv2: Add slimbus data path support
Register slimbus CPU dai link to support slimbus data path.

Change-Id: I3584306ac1e0ad6561a19cecfe71f2a63aadafa9
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:17:57 -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
Joonwoo Park
aa4d497559 defconfig: msm8974: Enable wcd9320 Taiko codec driver
Enable wcd9320 Taiko codec driver for msm8974.

Change-Id: I773af257589c82fe468b7c121cafbf188524f2d2
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:17:45 -08:00
Santosh Mardi
83c4dd7d08 ASoC: msm: Update the AFE-PCM RX and TX dai link for mpq8064
In AFE-PCM RX and TX dai links of MPQ8064 machine driver there
was a conflict in codec dai name and codec name, with this ALSA
Framework is not creating the node in /dev/snd/

CRs-Fixed: 377509
Change-Id: I5337b216a3d0a2cdc36292ccdafe3e144e7f1d41
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2013-02-27 18:17:44 -08:00
Joonwoo Park
4ee1c54e81 ASoC: apq8064: Add unsupported headset detection support
The wcd9310 codec driver already can detect and report unsupported headset
plugging.  Create headset jack with unsupported headset mask to be able to
report via sound core.

Change-Id: I0119d01c039362cc7b185f9f3407d78c958bc49a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-02-27 18:17:35 -08:00
Mingming Yin
4c9c50c134 ASoC: msm: Fix crash during FM recording.
Call reg_phy_stream only after q6asm_open_read succeeds.

CRs-fixed: 376685
Change-Id: I64951b6c51f8cc9212a691ad087ab0008e9fcb7a
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
2013-02-27 18:17:17 -08:00
Asish Bhattacharya
83b31ef0d1 ASoC: 8930: add multi channel support for hdmi
HDMI 1.3 supports Multi channel PCM up to 8 channels with sample
size of 16/20/24 bits and sample rate of 32, 44.1, 48, 96, 176.4,
192K. This patch add supports for 6 channel PCM at 48K sample rate
with sample size of 16 bits.

CRs-Fixed: 380370
Change-Id: I01cb7eb509a0d21072e2e8dcc63624384a1edb0d
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-02-27 18:17:15 -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
Swaminathan Sathappan
e5f67cc2bd ASoC: wcd9310: Clear the status only for active slimbus ports
When closing the slimbus ports, clear only the slimbus
ports which were active at the time of closing on that
slimbus interrupt, which will avoid clearing further
interrupts for other slimbus ports

Change-Id: I43ce9963c0ecb4b8fb79527b8a9c6b13d7780aad
CRs-fixed: 380535
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
2013-02-27 18:17:07 -08:00
Harmandeep Singh
7fdf9a4be3 ASOC: msm: Add device tree specific changes in compressed driver
- Add a front end DAI link for compressed audio driver.
- Add device tree specific changes to sound soc compressed
 drivers which will help the detection of sound card.

Change-Id: I4a8076df8c82cd4e444fc0d68e8f7a228bd1dc02
Signed-off-by: Harmandeep Singh <hsingh@codeaurora.org>
2013-02-27 18:17:06 -08:00
Harmandeep Singh
a9e74c693c ASoc: msm: qdsp6v2: Native drivers to use different pool id.
Some physical pools ids may become unsupported in future targets.
Remove target specific information from API to make it robust against
such architectural changes.

Also different platforms such as MDM, MSM might support some physical
pools but not the other, so choosing a generic name which will could be
mapped internally to different memory pools

Change-Id: I4f003662d9a2a28c17eefa5230530b8608b26c09
Signed-off-by: Harmandeep Singh <hsingh@codeaurora.org>
2013-02-27 18:17:04 -08:00
Neema Shetty
c5409eae07 ASoC: msm: Apply cached volume and mute at call start.
Volume and mute settings before voice call is started are cached
in the driver, apply the cached settings at call start.

Change-Id: Iabc1f47c46a8e986c79106545ac3ee977fbca99c
Signed-off-by: Neema Shetty <nshetty@codeaurora.org>
2013-02-27 18:16:55 -08:00
Subhash Chandra Bose Naripeddy
d7f5276687 ASoC: msm: Add support for meta data in compressed TX
There is a usecase where compressed data is sent over HDMI IN to
ADSP. The format of compressed is detected in ADSP and sent through
the meta data to compressed driver. Add support for meta data in
compressed TX for this use case.

Change-Id: Idbb18fe4a0ad828e9c2e9d7beec048b3cedf002d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-02-27 18:16:45 -08:00
Patrick Lai
c24665621d ASoC: msm: qdsp6: set correct SET_PARAM payload size
QDSP6 AFE module produces error message whenever afe
loopback gain control command is issued. The reason is that
loopback gain control function sets wrong payload size.
Make change to set appropriate payload size for a given
SET_PARAM command

Change-Id: Ida2bf76baf56c35e89fe29f887f5b43af8bceabe
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-02-27 18:16:42 -08:00
Ravi Kumar Alamanda
5b4713798b 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>
2013-02-27 18:16:42 -08:00
Subhash Chandra Bose Naripeddy
c0ba06982b ASoC: msm: Add volume support for Multimedia5
Add support for controlling pcm audio volume in DSP through
Multimedia5. Add TLV mixer control to set the pcm stream volume

Change-Id: Ie5f50c4f47ea57fe4be0aef1320c79a9d3fe7600
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
2013-02-27 18:16:24 -08:00
Swaminathan Sathappan
62ab49c10d ASoC: wcd9310: vote off runtime PM after disable SLIMBUS ports
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: I959a83be7bc381e80dfc0176c50cb60e59ce227b
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2013-02-27 18:16:14 -08:00
Jay Wang
79a415c76b ASoC: msm: qdsp6: Fixed the issue unmap command is sent incorrectly
When session CLOSE command is sent right before session RUN command
is acknowledged, callback function can mistakenly think that
the next received acknowledgement is for CLOSE command instead of
RUN command. This triggers driver to send memory unmap command to
the Q6 while it is still processing the CLOSE command. Eventually,
this leads to an invalid memory access and causes Q6 crash.

Change-Id: Ib5d560fbcb7e8ced79cc1075a9f6bea3b55a86b6
CRs-Fixed: 377281
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
2013-02-27 18:16:06 -08:00
Neema Shetty
3d550a6fe5 ASoC: msm: Add back-end enablement for CPU DAIs.
ALSA framework in kernel 3.4 requires all CPU DAIs to be routed to
the repective back-end input or output. Add the routing for STUB_1,
SLIMBUS_1, SLIMBUS_3, and SLIMBUS_4 CPU DAIs.

CRs-Fixed: 376720
Change-Id: Ie7799777d500194c53520320302e667f2ed07480
Signed-off-by: Neema Shetty <nshetty@codeaurora.org>
2013-02-27 18:15:46 -08:00