Commit graph

9477 commits

Author SHA1 Message Date
Takashi Iwai 1a1455de10 ALSA: hda - Add support for Line-Out automute to Realtek auto-parser
By popular demands, I add the functionality to mute / unmute the
line-out jacks per the headphone plug / unplug.  For achieving this
and keeping the compatibility with the old behavior, the new mixer
enum "Auto-Mute Mode" is added.  With this, user can control the
auto-mute behavior either disabled, speaker-only or lineout+speaker.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 17:55:53 +02:00
Takashi Iwai 0f0f391c73 ALSA: hda - More reduction of redundant automute codes in Realtek parser
Removed the redundant codes by replacing with the common helper
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 16:26:24 +02:00
Takashi Iwai e9427969f5 ALSA: hda - Consolidate auto-mute with master-switch for Realtek
Yet another consolidation of auto-mute functions for the devices
controlling the output muts together with the master mixer switch,
typically found for ALC262 machines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 15:46:07 +02:00
Takashi Iwai e6a5e1b709 ALSA: hda - Add support of line-out automute for Realtek
Add the common helper function and flags to support the auto-mute
per line-out jack detection, and also the mute of line-out jacks.

A few model-specific implementations are replaced with the common
helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 14:45:56 +02:00
Takashi Iwai 3b8510ce97 ALSA: hda - Add common automute support for mxier-amp on/off for Reatek
Some models do mute on/off the connected mixer widget for the automatic
muting, instead of controlling the pin widget itself.  This patch adds
the implementation of such type of auto-mute in the common helper
function, and reduces the redundant codes for each model preset.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 14:45:50 +02:00
Takashi Iwai d922b51dab ALSA: hda - Consolidate default automute functions for Realtek
There are two entry points for the headphone automute functions for
Realtek, alc_automute_amp() and alc_automute_pin().  These call the
same function in the end, so we can basically consolidate these
with a flag in spec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-28 14:45:19 +02:00
Takashi Iwai ce764ab22e ALSA: hda - Add channel-mode support to Realtek auto-parser
This patch adds the support of "Channel Mode" enum control to Realtek
auto-parser.  When line-in or mic-in jacks are capable to output and
free DACs are available, the driver allows to switch to multi-channel
mode via "Channel Mode" enum switch, as already implemented in some
preset cases.

Not implemented in all Realtek codecs.  Currently, ALC880, 882, 861,
662 and the compatible codecs are supported.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-27 16:39:00 +02:00
Takashi Iwai 604401a92c ALSA: hda - Minor update for alc662-parser functions
Allow alc662_dac_to_mix() and alc662_look_for_dac() to parse
down the selector widget that is found in ALC880-type codecs,
and rename them to alc_auto_*() accordingly.
This is for the next coming multi-io extensions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-27 15:46:40 +02:00
Lydia Wang cb34c207af ALSA: hda - VIA: Fix Smart5.1 isn't useful for 6 audio jacks motherboard.
For some motherboards with 5 or 6 audio jacks which had six or eight multiple
channels output, smart5.1 item is no useful and should be removed.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-27 11:55:23 +02:00
Takashi Iwai d507cd668a ALSA: hda - Enable sync_write workaround for AMD generically
The workaround for AMD chipset via sync_write flag seems needed for
machines with Realtek codecs.  So, it's better to activate it
generically in hda_intel.c from the beginning.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-26 15:33:43 +02:00
Takashi Iwai 0da2692256 ALSA: hda - Move EAPD power-down into shutup callback for AD codecs
EAPD power-down should be called also for normal shutup cases.
Let's move to there.   This also fixes the compile warnings when
CONFIG_PM isn't set automatically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-26 15:18:33 +02:00
Takashi Iwai 31d44b57c5 Merge branch 'fix/hda' into topic/hda 2011-04-26 15:05:39 +02:00
Takashi Iwai 885f42e1f4 ALSA: hda - Enable sync_write for AMD chipset with IDT 92HD8x codecs
The AMD chipset seems unstable in the normal operation mode, and it
seems requring more sensible access for each verb.  Enabling sync_write
mode and allowing bus-reset is a sort of workaround for these chipset
stability issues.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-21 15:27:58 +02:00
Mike Waychison 1c7276cfc0 ALSA: hda - Fix unused warnings when !SND_HDA_NEEDS_RESUME
When SND_HDA_NEEDS_RESUME is not defined, the compiler identifies that
the following symbols are static but not used:

 restore_shutup_pins
 hda_cleanup_all_streams

Fix warnings by adding SND_HDA_NEEDS_RESUME guards.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-20 21:24:31 +02:00
Seth Heasley d2edeb7c6f ALSA: hda - ALSA HD Audio patch for Intel Panther Point DeviceIDs
This patch adds the HD Audio Controller DeviceIDs for the Intel Panther Point PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-20 21:03:48 +02:00
Takashi Iwai 6981d18437 ALSA: hda - Add a fix-up for Acer dmic with ALC271x codec
Acer laptops with ALC271x needs a magic initialization for digital-mic
to make it working with mono streams (and PulseAudio).
Added a fix-up applied to Acer with ALC271x generically.

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-19 16:45:31 +02:00
Andrew Morton 5b17b077eb ALSA: hda - sound/pci/hda/hda_codec.c: fix warning
sound/pci/hda/hda_codec.c: In function 'snd_hda_get_connections':
sound/pci/hda/hda_codec.c:332: warning: unused variable 'j'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-15 08:41:22 +02:00
Takashi Iwai 84f3b6dab9 Merge branch 'fix/hda' into for-linus 2011-04-09 10:05:53 +02:00
Takashi Iwai 664cee46e7 Merge branch 'fix/asoc' into for-linus 2011-04-09 10:05:30 +02:00
Takashi Iwai a12d3e1e1c ALSA: hda - Remember connection lists
The connection lists are static and we can reuse the previous results
instead of querying via verb at each time.  This will reduce the I/O
in the runtime especially for some codec auto-parsers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 15:55:15 +02:00
Takashi Iwai cd9abc7a22 ALSA: hda - Don't query connections for widgets have no connections
Fixes the kernel warnings with IDT codecs like
    hda_codec: connection list not available for 0x1e

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 14:55:57 +02:00
Takashi Iwai 8e28e3b29f Merge branch 'fix/hda' into topic/hda 2011-04-07 12:57:53 +02:00
Takashi Iwai ad93ffe6e4 ALSA: hda - Fix unused variable warning in patch_realtek.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:49:26 +02:00
Takashi Iwai 35ffe11587 ALSA: hda - Remove superfluous inits for ALC662 auto-parser
Since we now set up the connections and mutes dynamically in the
auto-parser, all static initializations via alc662_init_verbs & co are
no longer needed.  Let's drop them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:49:10 +02:00
Takashi Iwai 10696aa0e5 ALSA: hda - Mute ADC as default in ALC882 and other auto-parsers
Mute the ADC as default in the auto-parser dynamically instead of relying
on the static init verbs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:49:08 +02:00
Takashi Iwai 0e53f34409 ALSA: hda - Unmute mixer dynamically in alc662 auto-parser
Instead of static init array, better to determine the connection and
the mute status of the pin/mixer/DAC route dynamically.  This fixes the
uninitialized mixer 0x0f on ALC892.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:49:05 +02:00
David Henningsson 262ac22d21 ALSA: HDA: Fix single internal mic on ALC275 (Sony Vaio VPCSB1C5E)
In cases where there is only one internal mic connected to ADC 0x11,
alc275_setup_dual_adc won't handle the case, so we need to add the
ADC node to the array of candidates.

Cc: stable@kernel.org
BugLink: http://bugs.launchpad.net/bugs/752792
Reported-by: Vincenzo Pii
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:12:00 +02:00
Aaron Plattner 1f34852284 ALSA: hda - HDMI: Fix MCP7x audio infoframe checksums
The MCP7x hardware computes the audio infoframe channel count
automatically, but requires the audio driver to set the audio
infoframe checksum manually via the Nv_VERB_SET_Info_Frame_Checksum
control verb.

When audio starts playing, nvhdmi_8ch_7x_pcm_prepare sets the checksum
to (0x71 - chan - chanmask).  For example, for 2ch audio, chan == 1
and chanmask == 0 so the checksum is set to 0x70.  When audio playback
finishes and the device is closed, nvhdmi_8ch_7x_pcm_close resets the
channel formats, causing the channel count to revert to 8ch.  Since
the checksum is not reset, the hardware starts generating audio
infoframes with invalid checksums.  This causes some displays to blank
the video.

Fix this by updating the checksum and channel mask when the device is
closed and also when it is first initialized.  In addition, make sure
that the channel mask is appropriate for an 8ch infoframe by setting
it to 0x13 (FL FR LFE FC RL RR RLC RRC).

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 12:04:00 +02:00
Takashi Iwai 5402e4cb80 ALSA: hda - Rewrite alc269_suspend to alc269_shutup
alc269_suspend is just calling the shut-up, so we can use the new shutup
callback for the purpose.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 10:39:25 +02:00
Takashi Iwai 1c716153a8 ALSA: hda - Introduce shutup callback to Realtek spec struct
Add shutup callback to be called codec-specifically for avoiding pop
noises at suspend or shutdown.  As a generic callback, just turn EAPD
off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 10:37:16 +02:00
Takashi Iwai 691f1fccf7 ALSA: hda - Refactoring EAPD controls
Reduced the duplicated codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 10:31:43 +02:00
Takashi Iwai a7f2371f9e ALSA: hda - Split EAPD init to a separate array from alc662_init_verbs
So far, alc662_init_verbs[] is used for all ALC662-compatible chips,
but the EAPD controls for 0x15 in there is invalid for ALC892.
Also, since EAPDs should be set up in alc_auto_init_amp(), these static
elements aren't needed for auto-parser, too.

In this patch, the EAPD init verbs are split from alc662_init_verbs,
and applied only to static quirks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07 10:24:23 +02:00
Takashi Iwai 1304ac8993 ALSA: hda - Fix mix->DAC deduction for ALC892
The current alc662 parser doesn't set the DAC for the mixer 0x0f
properly for ALC892, which has 4 DACs while ALC662 has 3.
Fixed by implementing alc662_mix_to_dac() more genericly with the
dynamic widget list.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 15:16:21 +02:00
Takashi Iwai 1bc7cf99a9 ALSA: hda - Correct initial dac_nids for some ALC272-quirks
Some ALC272-quirks use alc662_dac_nids instead of alc272_dac_nids.
This patch fixes these entries.  No functional change since the first
two elements are identical in both arrays.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 09:42:29 +02:00
Raymond Yau 4bf4a6c5b1 ALSA: hda - Fix alc662_dac_nid and change "6stack-dig" to "5stack-dig"
alc662 series only have 3 DAC, so it can only support 5stack-dig
instead of 6stack-dig.

[updated HD-Audio-Models.txt as well by tiwai]

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:18:39 +02:00
Tarek Soliman 49c039f071 ALSA: usb-audio: define another USB ID for a buggy USB MIDI cable
There are many USB MIDI cables out there that have buggy
firmware that reports it can do more than 4 bytes in a
packet when they can only properly handle 4

This patch adds the ID of yet another one of those cables

Signed-off-by: Tarek Soliman <tarek@bashasoliman.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:05:30 +02:00
David Henningsson b2cb1292b1 ALSA: HDA: Fix dock mic for Lenovo X220-tablet
Without the "thinkpad" quirk, the dock mic in
Lenovo X220 tablet edition won't work.

BugLink: http://bugs.launchpad.net/bugs/751033
Cc: stable@kernel.org
Tested-by: James Ferguson <james.ferguson@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-05 09:17:10 +02:00
Takashi Iwai 4e29402fe4 Merge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into fix/asoc 2011-04-05 09:12:21 +02:00
Stephen Warren 00b317a41c ASoC: format_register_str: Don't clip register values
wordsize is used as the textual width of a register address.

regsize is used as the textual width of a register value.

The assignments to these values were swapped. In the case of WM8903, which
has 8-bit register addresses and 16-bit register values, this caused the
register values to be clipped to 2 digits instead of the full 4.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-03 22:11:26 +09:00
Mark Brown 1b4610ebf3 Merge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.39 2011-04-03 19:28:29 +09:00
Vasily Khoruzhick 97c96c076b ASoC: PXA: Fix oops in __pxa2xx_pcm_prepare
pxa2xx_pcm_hw_free frees dma channel and sets prtd->dma_ch to -1,
but does not set prtd->params to NULL, so if pxa2xx_pcm_hw_params will
be called immediately, it leaves prtd->dma_ch initialized with -1,
and it results in oops in __pxa2xx_pcm_prepare. This bug is triggered
via SDL.

This patch adds check for prtd->dma_ch to __pxa2xx_pcm_prepare and
cleans prtd->params, so now it works properly.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-03 18:48:56 +09:00
Takashi Iwai a0334c50bf Merge branch 'fix/asoc' into for-linus 2011-04-01 18:02:23 +02:00
Kelly Anderson 12ff414e2e ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0()
When period interrupts are disabled, snd_pcm_update_hw_ptr0() compares
the current time against the time estimated for the current hardware
pointer to detect xruns.  The somewhat fuzzy threshold in the while loop
makes it possible that hdelta becomes negative; the comparison being
done with unsigned types then makes the loop go through the entire 263
negative range, and, depending on the value, never reach an unsigned
value that is small enough to stop the loop.  Doing this with interrupts
disabled results in the machine locking up.

To prevent this, ensure that the loop condition uses signed types for
both operands so that the comparison is correctly done.

Many thanks to Kelly Anderson for debugging this.

Reported-by: Nix <nix@esperi.org.uk>
Reported-by: "Christopher K." <c.krooss@googlemail.com>
Reported-and-tested-by: Kelly Anderson <kelly@silka.with-linux.com>
Signed-off-by: Kelly Anderson <kelly@silka.with-linux.com>
[cl: remove unneeded casts; use a temp variable]
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: 2.6.38 <stable@kernel.org>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-01 18:01:23 +02:00
David Henningsson 840126579d ALSA: HDA: Add dock mic quirk for Lenovo Thinkpad X220
This quirk is needed for the docking station mic of
Lenovo Thinkpad X220 to function correctly.

BugLink: http://bugs.launchpad.net/bugs/746259
Cc: stable@kernel.org
Tested-by: James Ferguson <james.ferguson@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-31 20:28:33 +02:00
Clemens Ladisch 6ebb8a4a43 ALSA: ens1371: fix Creative Ectiva support
To make the EV1938 chip work, add a magic bit and an extra delay.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Tino Schmidt <mailtinoshomepage@gmx.net>
Cc: all 2.6.x <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-30 08:57:27 +02:00
Clemens Ladisch 6ff674615c ALSA: firewire-speakers: fix hang when unplugging a running device
When aborting a PCM stream, the xrun is signaled only if the stream is
running.  When disconnecting a PCM stream, calling snd_card_disconnect()
too early would change the stream into a non-running state and thus
prevent the xrun from being noticed by user space.

To prevent this, move the snd_card_disconnect() call after the xrun.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-30 08:56:57 +02:00
Takashi Iwai f8852b1220 Merge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into fix/asoc 2011-03-30 08:35:18 +02:00
Antonio Ospite efd6947945 ASoC: zylonite: set .codec_dai_name in initializer
Fix the initialization of .codec_dai_name in zylonite_dai initializer,
do not mix it with the initialization of .codec_name which is set
already a few lines above.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-03-30 09:26:31 +09:00
Mark Brown 326b9bdc2a ASoC: Fix CODEC device name for Corgi
Got typoed in the multi-component changes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-03-30 07:12:46 +09:00
Takashi Iwai f6994ce4a8 Merge branch 'fix/hda' into topic/hda 2011-03-28 13:03:39 +02:00