summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2012-11-14ALSA: usb-audio: Fix mutex deadlock at disconnectionTakashi Iwai
The recent change for USB-audio disconnection race fixes introduced a mutex deadlock again. There is a circular dependency between chip->shutdown_rwsem and pcm->open_mutex, depicted like below, when a device is opened during the disconnection operation: A. snd_usb_audio_disconnect() -> card.c::register_mutex -> chip->shutdown_rwsem (write) -> snd_card_disconnect() -> pcm.c::register_mutex -> pcm->open_mutex B. snd_pcm_open() -> pcm->open_mutex -> snd_usb_pcm_open() -> chip->shutdown_rwsem (read) Since the chip->shutdown_rwsem protection in the case A is required only for turning on the chip->shutdown flag and it doesn't have to be taken for the whole operation, we can reduce its window in snd_usb_audio_disconnect(). Reported-by: Jiri Slaby <jslaby@suse.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-14ALSA: fm801: precedence bug in snd_fm801_tea575x_get_pins()Dan Carpenter
There is a precedence bug because | has higher precedence than ?:. This code was cut and pasted and I fixed a similar bug a few days ago. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-13ALSA: es1968: precedence bug in snd_es1968_tea575x_get_pins()Dan Carpenter
I don't think this works as intended. '|' higher precedence than ?: so the bitwize OR "0 | (val & STR_MOST)" is a no-op. I have re-written it to be more clear. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-13Merge tag 'asoc-3.7' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v3.7 A few small fixes plus a large but simple change for WM5102 which writes out a bunch of register updates to the device when we enable the clock as recommended following chip evaluation.
2012-11-13Merge branches 'fix/arizona', 'fix/core', 'fix/cs42l52', 'fix/mxs', ↵Mark Brown
'fix/samsung' and 'fix/wm8978' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into tmp
2012-11-12ALSA: hda - Add a missing quirk entry for iMac 9,1Takashi Iwai
This is another variant of iMac 9,1 with a different codec SSID. Reported-and-tested-by: Everaldo Canuto <everaldo.canuto@gmail.com> Cc: <stable@vger.kernel.org> [v3.3+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-09ASoC: core: Double control update err for snd_soc_put_volsw_sxMukund Navada
snd_soc_put_volsw_sx function fails to update second control if first control is updated by snd_soc_update_bits_locked. Signed-off-by: Mukund Navada <navada@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-09ASoC: dapm: Use card_list during DAPM shutdownMisael Lopez Cruz
DAPM shutdown incorrectly uses "list" field of codec struct while iterating over probed components (codec_dev_list). "list" field refers to codecs registered in the system, "card_list" field is used for probed components. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-08ALSA: Fix card refcount unbalanceTakashi Iwai
There are uncovered cases whether the card refcount introduced by the commit a0830dbd isn't properly increased or decreased: - OSS PCM and mixer success paths - When lookup function gets NULL This patch fixes these places. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50251 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08ALSA: hda - Add new codec ALC668 and ALC900 (default name ALC1150)Kailang Yang
Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08ALSA: hda - Improve HP depop when system enter to S3Kailang Yang
alc269_toggle_power_output() was only use in ALC269VB. I rename it to alc269vb_toggle_power_output(). Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08ALSA: usb-audio: Fix crash at re-preparing the PCM streamTakashi Iwai
There are bug reports of a crash with USB-audio devices when PCM prepare is performed immediately after the stream is stopped via trigger callback. It turned out that the problem is that we don't wait until all URBs are killed. This patch adds a new function to synchronize the pending stop operation on an endpoint, and calls in the prepare callback for avoiding the crash above. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=49181 Reported-and-tested-by: Artem S. Tashkinov <t.artem@lycos.com> Cc: <stable@vger.kernel.org> [v3.6] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ALSA: hdspm - Fix sync check reporting on RME RayDATAdrian Knoth
The RayDAT reports the sync status of its inputs in consecutive bit positions, so all we do in hdspm_s1_sync_check is to iterate over idx: status = hdspm_read(hdspm, HDSPM_RD_STATUS_1); lock = (status & (0x1<<idx)) ? 1 : 0; sync = (status & (0x100<<idx)) ? 1 : 0; The index is given in kcontrol->private_value: HDSPM_SYNC_CHECK("WC SyncCheck", 0), HDSPM_SYNC_CHECK("AES SyncCheck", 1), HDSPM_SYNC_CHECK("SPDIF SyncCheck", 2), HDSPM_SYNC_CHECK("ADAT1 SyncCheck", 3), HDSPM_SYNC_CHECK("ADAT2 SyncCheck", 4), HDSPM_SYNC_CHECK("ADAT3 SyncCheck", 5), HDSPM_SYNC_CHECK("ADAT4 SyncCheck", 6), HDSPM_SYNC_CHECK("TCO SyncCheck", 7), HDSPM_SYNC_CHECK("SYNC IN SyncCheck", 8), The patch corrects the indicated sync flags by passing the proper index value to hdspm_s1_sync_check(). Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ASoC: cs42l52: fix the return value of cs42l52_set_fmt()Wei Yongjun
Fix the return value of cs42l52_set_fmt() when clock inversion is not allowed and also remove the useless variable ret. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) [We had been assigning to ret but then ignoring the value we assgined -- broonie] Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-07ASoC: bells: Correct type in sub speaker DAI name for WM5102Charles Keepax
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-07ALSA: hda - Add pin fixups for ASUS G75Takashi Iwai
To parse properly the subwoofer outputs on ASUS G75 laptop with VT1802 codec, correct the default configurations of speaker pins 0x24 and 0x33. Reported-by: Massimo Del Fedele <max@veneto.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ALSA: hda - Fix invalid connections in VT1802 codecTakashi Iwai
VT1802 codec provides the invalid connection lists of NID 0x24 and 0x33 containing the routes to a non-exist widget 0x3e. This confuses the auto-parser. Fix it up in the driver by overriding these connections. Reported-by: Massimo Del Fedele <max@veneto.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ALSA: hda - Fix empty DAC filling in patch_via.cTakashi Iwai
In via_auto_fill_adc_nids(), the parser tries to fill dac_nids[] at the point of the current line-out (i). When no valid path is found for this output, this results in dac = 0, thus it creates a hole in dac_nids[]. This confuses is_empty_dac() and trims the detected DAC in later reference. This patch fixes the bug by appending DAC properly to dac_nids[] in via_auto_fill_adc_nids(). Reported-by: Massimo Del Fedele <max@veneto.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-06ASoC: wm8978: pll incorrectly configured when codec is masterEric Millbrandt
When MCLK is supplied externally and BCLK and LRC are configured as outputs (codec is master), the PLL values are only calculated correctly on the first transmission. On subsequent transmissions, at differenct sample rates, the wrong PLL values are used. Test for f_opclk instead of f_pllout to determine if the PLL values are needed. Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-05ALSA: hda - Force to reset IEC958 status bits for AD codecsTakashi Iwai
Several bug reports suggest that the forcibly resetting IEC958 status bits is required for AD codecs to get the SPDIF output working properly after changing streams. Original fix credit to Javeed Shaikh. BugLink: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/359361 Reported-by: Robin Kreis <r.kreis@uni-bremen.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: es1968: Add ESS vendor ID to pm_whitelistOndrej Zary
Add generic ESS vendor ID to pm_whitelist. This should fix suspend on all Maestro-2 and Maestro-2E based PCI cards. Tested on Terratec DMX and SF64-PCE2. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: HDA: Mark CS260x immutable structures constDaniel J Blueman
Mark structures that won't change const. Signed-off-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: HDA: Fix digital microphone on CS420xDaniel J Blueman
Correctly enable the digital microphones with the right bits in the right coeffecient registers on Cirrus CS4206/7 codecs. It also prevents misconfiguring ADC1/2. This fixes the digital mic on the Macbook Pro 10,1/Retina. Based-on-patch-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Daniel J Blueman <daniel@quora.org> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: hda: Cirrus: Fix coefficient index for beep configurationAlexander Stein
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-04ALSA: hda - support Teradici 2200 host card audioLars R. Damerow
The audio chipset used in Teradici's Tera2 host cards is the same as that in the 1200 host cards. This patch allows ALSA to recognize the Tera2 cards. Signed-off-by: Lars R. Damerow <lars@pixar.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-04ALSA: Fix typo in drivers soundMasanari Iida
Correct spelling typo in debug messages within drivers/sound Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-02ASoC: mxs-saif: Fix channel swap for 24-bit formatFabio Estevam
Playing 24-bit format file leads to channel swap on mx28 and the reason is that the current driver performs one write/read to/from the SAIF_DATA register to trigger the transfer. This approach works fine for S16_LE case because SAIF_DATA is a 32-bit register and thus is capable of storing the 16-bit left and right channels, but for the S24_LE case it can only store one channel, so in order to not lose the FIFO sync an extra read/write is needed. Reported-by: Dan Winner <DWinner@tc-helicon.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Tested-by: Dan Winner <DWinner@tc-helicon.com> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-02ASoC: bells: Select WM1250-EV1 Springbank audio I/O moduleDimitris Papastamos
Ensure we select the WM1250-EV1 as the current software system configuration demands it. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-02ASoC: bells: Add missing select of WM0010Dimitris Papastamos
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-01ASoC: mxs-saif: Add MODULE_ALIASFabio Estevam
Add MODULE_ALIAS information. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-31ALSA: ice1724: Fix rate setup after resumeTakashi Iwai
The rate isn't restored properly after resume since it's only set up in hw_params, and not in prepare callback. For fixing it, put the corresponding call to resume callback as well. Reported-and-tested-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ASoC: wm5102: Write register value corrections after SYSCLK is enabledMark Brown
Evalation of the WM5102 has identified a number of register values which should be written after SYSCLK is enabled on revision A in order to improve performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-30ALSA: Avoid endless sleep after disconnectTakashi Iwai
When disconnect callback is called, each component should wake up sleepers and check card->shutdown flag for avoiding the endless sleep blocking the proper resource release. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: Add a reference counter to card instanceTakashi Iwai
For more strict protection for wild disconnections, a refcount is introduced to the card instance, and let it up/down when an object is referred via snd_lookup_*() in the open ops. The free-after-last-close check is also changed to check this refcount instead of the empty list, too. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: usb-audio: Fix races at disconnection in mixer_quirks.cTakashi Iwai
Similar like the previous commit, cover with chip->shutdown_rwsem and chip->shutdown checks. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: usb-audio: Use rwsem for disconnect protectionTakashi Iwai
Replace mutex with rwsem for codec->shutdown protection so that concurrent accesses are allowed. Also add the protection to snd_usb_autosuspend() and snd_usb_autoresume(), too. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: usb-audio: Fix races at disconnectionTakashi Iwai
Close some races at disconnection of a USB audio device by adding the chip->shutdown_mutex and chip->shutdown check at appropriate places. The spots to put bandaids are: - PCM prepare, hw_params and hw_free - where the usb device is accessed for communication or get speed, in mixer.c and others; the device speed is now cached in subs->speed instead of accessing to chip->dev The accesses in PCM open and close don't need the mutex protection because these are already handled in the core PCM disconnection code. The autosuspend/autoresume codes are still uncovered by this patch because of possible mutex deadlocks. They'll be covered by the upcoming change to rwsem. Also the mixer codes are untouched, too. These will be fixed in another patch, too. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: PCM: Fix some races at disconnectionTakashi Iwai
Fix races at PCM disconnection: - while a PCM device is being opened or closed - while the PCM state is being changed without lock in prepare, hw_params, hw_free ops Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-28Merge tag 'asoc-3.7' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v3.7 Clean up some fallout from the OMAP header reorganisation and a minor fix for DMIC which has no practical effect but is neater.
2012-10-27ASoC: omap-dmic: Correct functional clock namePeter Ujfalusi
We should really use "fck" when asking for the functional clock and not "dmic_fck". This way we can ensure that multiple dmic modules can exist in the system. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-27ASoC: zoom2: Fix compile error by including correct header filesTony Lindgren
Also drop the includes that are no longer needed and just cause problems for the ARM common zImage. Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> [tony@atomide.com: updated to drop unneeded headers] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-26ALSA: hda - Fix mute-LED setup for HP dv5 laptopGustavo Maciel Dias Vieira
The BIOS on HP dv5 doesn't have the DMI string to guide the setup of mute led GPIO and polarity. Associate this laptop with the hp-inv-led model. Signed-off-by: Gustavo Maciel Dias Vieira <gustavo@sagui.org> Tested-by: Vinícius Angiolucci <angiolucci@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-25Merge tag 'asoc-3.7' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v3.7 A couple of driver fixes, one that improves the interoperability of WM8994 with controllers that are sensitive to extra BCLK cycles and some build break fixes for ux500.
2012-10-25Merge remote-tracking branches 'asoc/fix/ux500' and 'asoc/fix/wm8994' into ↵Mark Brown
for-3.7
2012-10-24ASoC: wm8994: Only enable extra BCLK cycles when requiredMark Brown
Rather than always assuming the maximum possible BCLK rate will be required generate BCLKs for stereo if either one or two channels is enabled. In order to support this we also need to ensure that only the relevant channels are enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-22ALSA: als3000: check for the kzalloc return valueDenis Kirjanov
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-21ALSA: sound/isa/opti9xx/miro.c: eliminate possible double freeJulia Lawall
snd_miro_probe is a static function that is only called twice in the file that defines it. At each call site, its argument is freed using snd_card_free. Thus, there is no need for snd_miro_probe to call snd_card_free on its argument on any of its error exit paths. Because snd_card_free both reads the fields of its argument and kfrees its argments, the results of the second snd_card_free should be unpredictable. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier f,free,a; parameter list[n] ps; type T; expression e; @@ f(ps,T a,...) { ... when any when != a = e if(...) { ... free(a); ... return ...; } ... when any } @@ identifier r.f,r.free; expression x,a; expression list[r.n] xs; @@ * x = f(xs,a,...); if (...) { ... free(a); ... return ...; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hda - Fix silent headphone output from Toshiba P200Takashi Iwai
By some reason, Toshiba laptop doesn't like the EAPD turned up for the headphone pin. Add a fix up code to force to turn down EAPD for NID 0x15. Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=569991 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix coding style in CTL_ELEM macrosAdrian Knoth
checkpatch.pl discourages the use of spaces at the beginning of lines. Some of the CTL_ELEM defines were not properly indented. This patch replaces the leading spaces by tabs. No functionality is changed, the commit is purely cosmetic. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-20ALSA: hdspm - Fix typo in kcontrol element on RME MADI cardsAdrian Knoth
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>