I forgot this again... codec->in_pm is in #ifdef CONFIG_PM
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This device doesn't have a pdata definition for legacy boards, and
unless anyone need to control the reset GPIO, it's not worth adding one.
So this feature is only available to DT users for now.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Jeffrey Barish reported an obvious bug in the pcm part of the usb-audio
driver which causes the code to not initialize the sync endpoint from
configure_endpoint().
Reported-by: Jeffrey Barish <jeff_barish@earthlink.net>
Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: stable@kernel.org [3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If this array is not cleared, the jack related code later might
fail to create "Internal Speaker Phantom Jack" on Dell Inspiron 3420 and
Dell Vostro 2420.
BugLink: https://bugs.launchpad.net/bugs/1076840
Cc: stable@vger.kernel.org (3.6+)
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We found a new codec ID 292, and that just a simple quirk would enable
sound output/input on this ALC292 chip.
BugLink: https://bugs.launchpad.net/bugs/1081466
Cc: stable@vger.kernel.org
Tested-by: Acelan Kao <acelan.kao@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The biggest batch of fixes here is the Kirkwood DMA fixes, plus a couple
of other small fixes.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQrEALAAoJELSic+t+oim9BHgP/37A90Xw+cLnTNnr4BRYPl0b
eeyaCiYxr1VEg11zz+hyID4dBfca+ijUUmEsL/gSMRXb2L228l7P5FcXEKOVac9d
xqcq59ZFu3QA5m2CcachT0t9QXegFTMMlqJ4G2lp6RDoXeU+RpSxC/M28wdLpOt+
CNV/qgptupEXTQJxLxyQ8B3rNU98yAWNruuZ2NWFeQxbxJZVFEHhQtBgAzOxPu2e
aKMPt7NzV3KSYySOffwCCW0Pj1DC85oSQR0SzI8lcJd8FtmKxJS3wjpZyNwXb3tN
D2o5MEuyHckJE3JHnmtfbj2VtD97EhiewSiAwqh6pCb8/qO7Pte/+5QVBNv0mBnk
TIKN68YTeheNVP8v0C9baBW99bqFofGpA6nOw4v0G3k7B11GxtQ9lp5BdDH3tz8m
lI1zJckAwuSfvC/H9xqS89GKaW3JBpu1nRuICBYGsbWAjPbLKr4i8YMJyVLi3CPN
o+ocfC5ZT/TdICE7VW09+4viiVO+gg7Tvp5VndIZX5/rpJU1vmKc5ag149t+fhRt
rmlGSumO9KyTVxEI8CnGsZJXYOF8kJ5BxvKJI7FFUjLa1pE6FYLa6kaaSDs0HGG9
PdkoplCg7hVSaWSio5tzRfj5ObZWzIoiBBzLTp5PgBTL38YhCvVaK4aw0bjqWSJN
d5ar1sD4uznNqkjYkdbv
=V7+d
-----END PGP SIGNATURE-----
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.7
The biggest batch of fixes here is the Kirkwood DMA fixes, plus a couple
of other small fixes.
This patch removed struct ak4642_priv which had
meaningless variable.
It is no longer needed
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Don't even momentarily set the pause status when starting the channel;
if we do, we should check the busy bit to ensure that we comply with
the spec. In any case, it isn't necessary; we will not active on a
START event so there is no need to pause the DMA.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Stress testing the driver with multiple start/stop events causes
kirkwood-dma to report underrun errors (which used to cause the kernel
to lock up solidly). This is because kirkwood-i2s is not respecting
the restrictions imposed on clearing the 'pause' bit. Follow what the
spec says; the busy bit must be read as being clear twice before the
pause bit can be released. This solves the underruns.
However, it has been noticed that the busy bit occasionally does not
clear itself, hence the waiting is bounded to 5ms maximum to avoid a
new reason for the kernel to lockup.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is part of a patch found in Rabeeh Khoury's git tree for the
cubox, which is further attributed to Sebastian Hesselbrath.
Rather than masking the KIRKWOOD_DCO_SPCR_STATUS register contents
against the registers virtual address, let's actually use the bit
definition for the locked status, as required in the documentation.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ignoring the real cause of the interrupt is not a good idea; this
behaviour has been observed to bring Dove platforms to silently
lockup. Instead, on error fall through to the normal interrupt
processing.
This is especially important on Dove platforms as errors are
handled separately, and allows us to clear down the real cause of
the interrupt.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is part of a patch found in Rabeeh Khoury's git tree for the
cubox.
You can not use virt_to_phys() on the address returned from
dma_alloc_coherent(); it may not be part of the kernel direct-mapped
memory. Fix this to use the DMA address instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It seems WM_ADSP2("DSP1", 0) is added twice to the widgets list, remove
that and in place use ARIZONA_DSP_WIDGETS(DSP1, "DSP1").
We need to make sure that the DSP1 Aux widgets are provided otherwise
we'll see errors such as "Failed to add route DSP1 Aux 1 -> DSP1" etc.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
We've got a report that the runtime PM may make the codec the
unresponsive on AMD platforms. Since the feature has been tested only
on the recent Intel platforms, it's safer to limit the support to such
devices for now.
This patch adds a new DCAPS bit flag indicating the runtime PM
support, and mark it for Intel controllers.
Reported-and-tested-by: Julian Wollrath <jwollrath@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the bus reset is performed during the suspend/resume (including
the power-saving too), it calls snd_hda_suspend() and
snd_hda_resume() again, and deadlocks eventually.
For avoiding the recursive call, add a new flag indicating that the PM
is being performed, and don't go to the bus reset mode when it's on.
Reported-and-tested-by: Julian Wollrath <jwollrath@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commit 88a8516a21 (ALSA: usbaudio: implement USB autosuspend) added
autosuspend code to all files making up the snd-usb-audio driver.
However, midi.c is part of snd-usb-lib and is also used by other
drivers, not all of which support autosuspend. Thus, calls to
usb_autopm_get_interface() could fail, and this unexpected error would
result in the MIDI output being completely unusable.
Make it work by ignoring the error that is expected with drivers that do
not support autosuspend.
Reported-by: Colin Fletcher <colin.m.fletcher@googlemail.com>
Reported-by: Devin Venable <venable.devin@gmail.com>
Reported-by: Dr Nick Bailey <nicholas.bailey@glasgow.ac.uk>
Reported-by: Jannis Achstetter <jannis_achstetter@web.de>
Reported-by: Rui Nuno Capela <rncbc@rncbc.org>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: 2.6.39+ <stable@vger.kernel.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
convert at91sam9g20ek with wm8731 to device tree support
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Remove unneeded code with the new method of dai and pcm register
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
change the method for register dai and pcm
- let the atmel-ssc-dai no longer as a standalone platform device
- remap ssc and then register dai directly
- register pcm from dai directly
- modify the code which related with this change
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
It seems git has been getting confused by the very similar contexts
for the speaker DAIs and has been applying patches to the wrong places
causing all sorts of confusion. Fix this up by hand.
Reported-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
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>
There is no mixer attached to the ASRC on the wm5110 only a multiplexer
to select the source for the single input line. This change correctly
defines this in the wm5110 CODEC driver.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There is no mixer attached to the ASRC on the wm5102 only a multiplexer
to select the source for the single input line. This change correctly
defines this in the wm5102 CODEC driver.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The Asynchronous Sample Rate Converters on the wm5102/wm5110 have no
mixer attached to their input, but they do allow the input to be
selected from a number of sources via a multiplexer. Currently the
platform assumes the presence of 4 multiplexers and a mixer for each
block.
This patch adds support multiplexed single input blocks into the Arizona
platform.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQoeX6AAoJELSic+t+oim9Yg8P/j49T5obxIXTZNMmMjrdc//f
xM61/gLoRfVtY2deHdAzpUw6OSUOCQ0iVuasQalmnz2KNb/htzXXT+npjwPo93ok
QZ4NBiMVJdOj/8m2u64K7flcGv2/llj2kvrj+8HmAI7KZ++zXMbBPVmvCSz0NpBL
tFyd4zQ5Fp7n4MCDiQ7fRKwgUbbkwuW4jm/R4YEJS0tOrEgy0vG4MP/v8oEYcu/f
tsOo0cMo8yESwpsy+fzfzqw7WS8LW/nKJJkRkYkO96YvgpDKbiPHadTJZDZ/+vg4
uDpNOcLP2t7cRV5kh0fIQpjPYxtDFeV9HCua/2NcDwSRbIn2gd4/vP08q8iZeZK7
F7c7VCZs9LgWnur0+RxS/yvlQJD0hmFEnaYobMXsULTZs4cRceigkBWOBSThG19y
iCxRdy0XLaog4yTHb5Aql0szAQ8PkxdtOP7JoyF0nUQn9hwinISWtgyxfHzHXWKb
SZHh2RLyzyyBWDh8VVBr4VM6q6WbQzS5MzS1IHipphoMGuGRKwQ5huPb048XjThB
w1suZvX8aMw1vJy2au/d38P4891c9qUBA4woNqd1r+xrYOBAw8VPw7c5CxCyBgIg
RUuCjEy/4RTkiXrhKzJA0kHmLXJKb53i2yNtzwe+w1lG6zdnhqGIuuHqLmdm89fL
qgm/dUv6FIXhkMxtYz0+
=3xEm
-----END PGP SIGNATURE-----
Merge tag 'asoc-3.7' of 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.
In case of probe deferral, the allocated GPIO line is not freed, which
prevents it from being claimed and properly asserted in later attempts.
Fix this by using devm_gpio_request().
Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Michael Hirsch <hirsch@teufel.de>
Cc: Alexander Sverdlin <subaparts@yandex.ru>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
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
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
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>
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>
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>
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>
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
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Many Arizona class devices contain ADSP2 cores with a standard method for
hooking them into the audio map. Define standard helpers for this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Many current Wolfson devices feature DSPs based around an architecture
known as ADSP. Since there is a lot of commonality in the system
integration of these devices a common library will be used to provide
support for them.
This version provides equivalent support for ADSP1 to that currently
included in the WM2200 driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Clean up some fallout from the OMAP header reorganisation and a minor
fix for DMIC which has no practical effect but is neater.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQjFnSAAoJELSic+t+oim9vO4P/3uAd9BxxDJe6X4wFdNO2/qn
3kgihOX/uhA0x6gZUmXnoNClM6Mxwm61dz88FZ+IsU92MTxQAKwa5jnW5CsuaDkv
t6AWbhQ6tHVz4OJ54Vtq+PirYNXe9+mldBPYaPfke06R6eaat7XkU0HG9342GKqv
bcHn+ON0vzN89QlxLvnt+wbaOJitXrFnGLLgnAEhwkhjfJgZ6bN5a8uB7IuG4F4g
2IYMh6hbsirWm3nG7oVynAG6gZzYyqLf4uVA5AY5DREUfSu0oVjlHa0v9EjRIFK3
7a7NcZ8MRNr7bfEa1xQFssVhPAdj4xrqRoYyb3dsCQwj8Gsj6rca4tC1dHBT4FdM
dtNNCfcypEFBBfs5RZ1eSvIfqIJNI3isBILbnJ+lIF8rmxalsoLZuRDWqXDh7ryH
8RAGNfggxjUpxLjddcsX+LeLZgQYt61Su+69Anc1xt+N2S//in9PXhbsWR6/GgUS
Ke03g0fqmfVpoG54eqCVX1qg0qKiScCWYDpbTBPNO93yzYzszk2HfY1RtVx2dLjP
n99haf2wYC4YL0+wAFYgNRY6hQ85hAZRLG0exafKrFwnVIpCukcHc47nZ8M3DF3E
xBhxMhxQSSfAMcbn1QtMPMm7w7YpXzSw/7amKrNL2ifY/L31G/8GJ+kNgxtIot0H
Yx8TM2usfb8FCeJ48k+V
=F87m
-----END PGP SIGNATURE-----
Merge tag 'asoc-3.7' of 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.
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>
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>
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>
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQiWqmAAoJELSic+t+oim9T3sP/j9orIyrpGWKsqxS69wLkM+W
uSTbuYu+KM3lj5xtMrvYhDUGph1ke6kvEs6NkP/MsqlBErLhjniFhFeCoyFsH3JL
SyfuhRysWUpFnVA8huNtJYNfrNac9tY5/RmmbcN9FjAfJQUGGce0Q0uBL9aEk4r8
8BHkHThBuhHS5SxVzZppFZNMguOYWC3DyICsYZ/qOsOBiiUBFu1iLxUh+hizDO07
B1L6OzSyL9g7exnE99p3j9/p74TuvII0iyUXDm/sjZfHnOZn+TXrGqHZPOsTLEZ3
sJ8OnIEcf++ezhTSJHP5+6jM5VuCl0BiIQYJIiPus61RRh8sOHIJZRUQwuXiX2Pq
cjfo604CF59a/Skb9dfj+aqaNg0QSOOm1Zdx8rI+RVrFzVQ5h9JLdlKU4xAaT4zj
mHPwK3Zea0PK7mXz/WfLAsZqRdiReNkprXVy+ZRURXIqFy3mGbIvISlkudHZmsqv
BZ6BXh938C3d9F5Uw3t4VJF0RuEruUuYUebP7hDMt2bfZu0gV9Z9vlAhAR23hYA9
vx2HK+9Pi5Kji1/LoV7Np0BOZ7Xy89jSp3wzkH+cS6Vdq6cui68y1mPpdESPfYyN
OakUWHBejeNEu5bv7VctPLnXBleZBM+YT0cMBpXLjk6QP+cCPg5J0gojrVgBEf75
EyCyfewntRi+turNBDoo
=rd2A
-----END PGP SIGNATURE-----
Merge tag 'asoc-3.7' of 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.
ARIZONA_MICB1_ENA_SHIFT was used for micbias 2 and 3. This change
correctly uses the ARIZONA_MICBX_ENA_SHIFT for each corresponding DAPM
supply. This should not have caused any problems as the micbias enables
are in the same place in each register.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
Removes the DaVinci private SRAM API and replaces it with
the genalloc API. The SRAM gen_pool is passed in pdata since
DaVinci is in the early stages of DT conversion.
[zonque@gmail.com: stub out gen_pool functions for
!CONFIG_GENERIC_ALLOCATOR]
Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
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>
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>
According to the documentation, AES32 cards use a different bit position
for reporting the sync_in status.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In contrast to AES32, MADI uses the first status register to report the
sync_in status.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
MADI and MADIface used to report the autosync_sample_rate. This
functionality was lost in commit
0dca179306, this commit now adds it back.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Missing breaks lead to a fall-through, thus causing the wrong
autosync_sample_rate to be reported.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Due to missing breaks and the resulting fall-through, card subtype
selection was effectively missing, thus causing the wrong sync check
functions to be called.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
As a follow-up to a97bda7d29, report the
external sample rate as system_sample_rate when in slave mode.
For PCIe MADI cards, the DDS value automatically contains the external
sample rate, but the PCI version needs this manual workaround.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The DDS value is the actual physical sample rate. We set it indirectly
when selecting 44100, 48000 and so on via snd_hdspm_hw_params or
hdspm_set_clock_source.
This commit now allows the DDS value to be altered at runtime, thus
speeding up or slowing down the physical sample rate. This is required
for MADI's varispeed that allows for ±12.5% speed adjustment from the
"selected" rate (32kHz, 44100kHz, 48kHz and so on).
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
I have a Lenovo ThinkPad T430 and an UltraBase Series 3 docking
station.
Without this patch, if I plug my headphones into the jack on the
computer, everything works fine. The computer speakers mute and the
audio is played in the headphones. However, if I plug into the docking
station headphone jack the computer speakers are muted but there is no
audio in the headphones.
Addresses https://bugs.launchpad.net/bugs/1060372
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add chip details for E-mu 1010 PCIe card. It has the same
chip as found in E-mu 1010b but it uses different PCI id.
Signed-off-by: Maxim Kachur <mcdebugger@duganet.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch DAPMises headphone and lineout output enable controls.
Earlier these output enable bits were permanently turned on in probe.
In da9055 codec, right outmixer is directly connected with right HP and
Line out. This resulted in two side effects,
(1) When you only want to use lineout, right HP (and connected charge
pump) also gets enabled
(2) When you only want to use stereo HP, lineout also gets enabled
This patch adds three switches to select which output(s) should be
enabled.
Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <david.chen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Nothing too exciting except for the ams-delta change which is relatively
lerge due to the fact that the driver loading had been totally broken as
the driver needed a newer API to function.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQfoIaAAoJELSic+t+oim9uWcP/jZDrx8YlG1zjDqTiZ3jSL4Q
K+s2992epyA6CgqagpcReyofExEGIitQ0rArT6++ViTAISnysZ9wFS/GbGsFDd5j
b0m2zZMJFNhnLOD83djYeubSdP17d9WAfI7CbPzn4skSBFx8WIjt7Ti9++eHqrMd
gxhHBRmNSAsa5FiA69Acf1BW0HgaW8JyzPMOEz5d5BRhoJ233z3GJ6UUawxQ2c4l
cbSt66Bs19gOkiIiPbqEDRs6JBalJnbxAjDqkwsFZU1Lq/1fUJ3CsZ/TsR/rkaY0
RL+32So1CpMqmFKNSJ26Tqwzi7xGkGeTW/o/nYGhvloITKx1jbdHOOA+BfAGDagW
Rc/CY2HbG5o+2rrPDWs4aM7xwh56UIoftww500Oeq+4+Pu+rmEpxuvu2ewjqcLv3
MZia9mDTXiOg7ETCLDweCLh3JRrAJZqSkyAkTtTmcx7GPiCa2lu8ns3F1+vA6CGR
jOx3SoX7KDfh99xZOR2AdpsPqce3VqVx4EnQ9zrDiGKik9QGwp37e7KaeUPCMAVP
Y4XcmIx94KKUjyBO2wZgTuXjPHZcZWtCSUdhxrb1Ohf/2IQpFf8jic1nknCA5k/M
77BNhmijxha2zfVBvglLTUKJLa2eExxM53m71rjrrF31f4jpwUX+VjAgVP5thXDG
4mFnuX+KN6sWumFFY1X1
=lEIC
-----END PGP SIGNATURE-----
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.7
Nothing too exciting except for the ams-delta change which is relatively
lerge due to the fact that the driver loading had been totally broken as
the driver needed a newer API to function.