8 years agoALSA: hda - Fix VIA output-path init for VT2002P/1802/1812
Lydia Wang [Fri, 8 Jul 2011 06:02:52 +0000]
ALSA: hda - Fix VIA output-path init for VT2002P/1802/1812

For VT2002P, VT1802 and VT1812 codecs, the original activate_output_path()
function can't initialize output and hp path correctly, since mixers connected to
output pin widgets are not considered. So modify the activate_output_path()
function to satisify this kind of codec.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Split quirk codes from patch_realtek.c
Takashi Iwai [Thu, 7 Jul 2011 16:23:21 +0000]
ALSA: hda - Split quirk codes from patch_realtek.c

Put the all static quirk codes out of patch_realtek.c, split into the
file for each codec model.  For controlling the build of quirk codes,
a new Kconfig, CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS is introduced.
By setting this off, all quirk codes won't be built, thus you can save
lots of memory.

The codes in patch_realtek.c are also shuffled and more comments are
given, but the contents aren't changed.  This is just a refactoring.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Use common paser for digital I/O for ALC260
Takashi Iwai [Thu, 7 Jul 2011 15:05:48 +0000]
ALSA: hda - Use common paser for digital I/O for ALC260

Avoid open-codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - More flexible dynamic-ADC switching for Realtek codecs
Takashi Iwai [Thu, 7 Jul 2011 13:01:13 +0000]
ALSA: hda - More flexible dynamic-ADC switching for Realtek codecs

This patch changes the auto-parser and the auto-mic handling codes to
allow more flexible dynamic ADC-switching with Realtek codecs.

In the new code, the following strategy is taken:

- When a cap-src can't handle all input-sources, either skip it, or
  switch to the ADC-switching mode.  In ADC-switching mode, like the
  former dual-ADC mode for ALC275, it changes ADC on the fly according
  to the current input source.
- When auto-mic is possible, always assign imux.  If the mic pins are
  set statically via a quirk, rebuild imux according to the pins.
  In the auto-mic mode, the driver always changes the imux (although
  the imux isn't exposed as a mixer element).

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix warning with ALC882 digital-out detection
Takashi Iwai [Thu, 7 Jul 2011 13:12:55 +0000]
ALSA: hda - Fix warning with ALC882 digital-out detection

The digital out pin on ALC882 may have multiple connections.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Clean-up PCM assignments in patch_realtek.c
Takashi Iwai [Wed, 6 Jul 2011 16:30:08 +0000]
ALSA: hda - Clean-up PCM assignments in patch_realtek.c

Instead of assigning each default hda_pcm_stream pointers, do NULL-checks
and assign default values in alc_build_pcms().

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify alc*_auto_init_input_src() in patch_realtek.c
Takashi Iwai [Wed, 6 Jul 2011 15:39:59 +0000]
ALSA: hda - Unify alc*_auto_init_input_src() in patch_realtek.c

The only different implmentation was alc880_auto_init_input_src(),
and now it covers this variant, and we can use the single function
for all codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Parse ADCs and CAPSRCs dynamically for Realtek auto-parser
Takashi Iwai [Wed, 6 Jul 2011 14:38:42 +0000]
ALSA: hda - Parse ADCs and CAPSRCs dynamically for Realtek auto-parser

Now with the new code for looking for ADCs and MUXs, we can replace
the whole ADC assignment with the parsed results.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify alc_auto_init_analog_input() calls
Takashi Iwai [Wed, 6 Jul 2011 13:15:12 +0000]
ALSA: hda - Unify alc_auto_init_analog_input() calls

All alc*_auto_init_analog_input() calls are identical, so let's use
the same function more clearly without aliases.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Parse ADCs in alc_auto_create_input_ctls()
Takashi Iwai [Wed, 6 Jul 2011 13:12:46 +0000]
ALSA: hda - Parse ADCs in alc_auto_create_input_ctls()

Parse ADCs and cap-srcs in alc_auto_create_input_ctls() by itself
instead of passing explicitly from the caller.  By this change, all
alc*_auto_create_input_ctls() can be unified to the same calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Code consolidation for ALC88x and ALC662 auto-parsers
Takashi Iwai [Wed, 6 Jul 2011 12:28:39 +0000]
ALSA: hda - Code consolidation for ALC88x and ALC662 auto-parsers

Use the same common code for auto-parsing the output paths and their
initializations, based on the existing ALC662 code, which is smarter
than the old ALC880/2 code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Create bind-mutes appropriately for ALC662 auto-parser
Takashi Iwai [Wed, 6 Jul 2011 12:02:55 +0000]
ALSA: hda - Create bind-mutes appropriately for ALC662 auto-parser

When multiple inputs are present on the mixer widget (typically a DAC
and a loopback), mute/unmute both inputs with the corresponding mixer
element.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Initialize DACs in ALC662 auto-parser mode
Takashi Iwai [Wed, 6 Jul 2011 11:10:42 +0000]
ALSA: hda - Initialize DACs in ALC662 auto-parser mode

The initialization of DACs was missing in ALC662 parser code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Parse HP and speaker DACs even for multi connections for ALC662
Takashi Iwai [Wed, 6 Jul 2011 11:07:54 +0000]
ALSA: hda - Parse HP and speaker DACs even for multi connections for ALC662

In alc662_auto_fill_dac_nids(), the HP and speaker DACs aren't parsed
when the corresponding pins aren't fixed with single DACs.
Now check these DACs even for non-fixed pins.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'fix/hda' into topic/hda
Takashi Iwai [Thu, 7 Jul 2011 07:28:47 +0000]
Merge branch 'fix/hda' into topic/hda

8 years agoALSA: hda - Change all ADCs for dual-adc switching mode for Realtek
Takashi Iwai [Thu, 7 Jul 2011 07:25:54 +0000]
ALSA: hda - Change all ADCs for dual-adc switching mode for Realtek

When the dual-adc switching mode is active in Realtek auto-parser,
we need to couple all ADCs as a single capture-volume.  Currently, the
volume control changes only the first ADC, thus others may remain silent.
This patch fixes the problem.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Add Realtek ALC269VC codec support
Kailang Yang [Wed, 6 Jul 2011 07:51:29 +0000]
ALSA: hda - Add Realtek ALC269VC codec support

Add the support of ALC269VC codec.
Also delete the unnecessary codec_variant type enum list:
now only three variants (ALC269VA ALC269VB ALC269VC) are needed.

In addition, added some aliases:
 - Add ALC269VB alias name ALC277
 - Add ALC269VC alias name ALC259 ALC281X
 - Add ALC269VC for Lenovo device 0x21f3 name ALC3202

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Don't add aa-mix for VIA surrounds
Takashi Iwai [Mon, 4 Jul 2011 15:35:51 +0000]
ALSA: hda - Don't add aa-mix for VIA surrounds

Since we now route the front DAC via aa-mix widget, adding the aa-mix
to surrounds will result in a mix-up of both front and surround PCM
signals.  For avoiding this, the aa-mix routes have to be disabled
for surround paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Create HP-vol control properly for VIA codecs
Takashi Iwai [Mon, 4 Jul 2011 13:55:44 +0000]
ALSA: hda - Create HP-vol control properly for VIA codecs

When the individual DAC is available for the headphone output, the driver
should create the DAC for its volume control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Define some constants in patch_via.c
Takashi Iwai [Mon, 4 Jul 2011 12:46:42 +0000]
ALSA: hda - Define some constants in patch_via.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix invalid multi-channel amplifiers for VT1718S
Lydia Wang [Mon, 4 Jul 2011 09:01:33 +0000]
ALSA: hda - Fix invalid multi-channel amplifiers for VT1718S

For VT1718S, the multi-channel path should be like following:
DAC 0-->Mixer 9(index 5)-->Mixer 0(index 1)-->Front Pin;
DAC 1-->Mixer 1(index 0)-->Surround Pin;
DAC 2-->C/LFE Pin;
DAC 3-->Mixer 2(index 0)-->Side Pin;

But current code built Surround and Side path through index 1 of
Mixer 1 and 2. So Adjusting Surround and Side channel amplifier is
invalid. This patch fixes the issue.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix issue that front can't output sound for VT1718S
Lydia Wang [Mon, 4 Jul 2011 08:54:15 +0000]
ALSA: hda - Fix issue that front can't output sound for VT1718S

For VT1718S, Mixer 9 doesn't expose the connection to DAC 0. So when
building up a 'PCM Playback' amplifier control, it will fail since
getting DAC 0 index of Mixer 9 returned -1. So I added a dac_mixer_idx
to indicated the actual index of DAC 0 to Mixer 9. Following is the
patch and next mail is another.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix the silent front with independent-HP for VIA codecs
Lydia Wang [Fri, 1 Jul 2011 02:55:07 +0000]
ALSA: hda - Fix the silent front with independent-HP for VIA codecs

Unmute DAC on front speaker path when Independent HP is enabled.

When to enable Independent HP, the front speaker won't output any sound
for VT1708, VT1708B, VT1708S and VT1702.
I find the via_independent_hp_put() routine will mute DAC 0 path in Mixer 0.
For these codecs, when using Independent HP, there could have two
independent streams, one is from DAC0-->Mixer0-->Front Pin, the other is
from DAC3-->GainSW3-->Side Pin.
So I added a check for DAC-->Mixer path in activate_output_path().

If current path is DAC-->Mixer, no need to mute DAC index in Mixer.
In fact, to change connection of Headphone pin or Mux connected with HP
is enough.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix missing initialization in alc662 auto-parser
Takashi Iwai [Thu, 30 Jun 2011 19:29:12 +0000]
ALSA: hda - Fix missing initialization in alc662 auto-parser

A missing initialization resulted in wrong DAC assignments in
ALC662 (and other) auto-parsers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Re-implementation of VIA Independent-HP sharing with side stream
Takashi Iwai [Thu, 30 Jun 2011 15:24:47 +0000]
ALSA: hda - Re-implementation of VIA Independent-HP sharing with side stream

This patch adds the re-implementation of Independent-HP mode in the
case where the DAC is shared between HP and side-channel streams.
Now the driver tries to parse the output-path using the pre-parsed
side-channel DAC for the independent HP output, too.

When a playback PCM stream is opened with this shared mode, the
Independent-HP mixer switch can't be changed for avoiding the conflict,
thus it returns -EBUSY error.

One remaining unintuitive issue is that the DAC volume is still
controlled as "Side" volume although it's shared by both independent-HP
and side streams.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: sb16 - Fix build errors on MIPS and others with 13bit ioctl size
Takashi Iwai [Thu, 30 Jun 2011 13:08:04 +0000]
ALSA: sb16 - Fix build errors on MIPS and others with 13bit ioctl size

One of ioctl definition in sound/sb16_csp.h contains the data size
over 8kB, and this causes build errors on architectures like MIPS,
which define _IOC_SIZEBITS=13.

For avoiding this build errors but keeping the compatibility, manually
expand with _IOC() instead of using _IOW() for the problematic ioctl.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hdspm - Fix compile warnings with PPC
Takashi Iwai [Thu, 30 Jun 2011 10:45:36 +0000]
ALSA: hdspm - Fix compile warnings with PPC

The char can be unsigned on some architectures.  Since the code checks
the negative values, they should be declared as signed char explicitly.

  sound/pci/rme9652/hdspm.c:5449: warning: comparison is always false due to limited range of data type
  sound/pci/rme9652/hdspm.c:5462: warning: comparison is always false due to limited range of data type

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: cs5535 - Fix invalid big-endian conversions
Takashi Iwai [Thu, 30 Jun 2011 10:31:23 +0000]
ALSA: cs5535 - Fix invalid big-endian conversions

Fix the wrongly converted short values:
  sound/pci/cs5535audio/cs5535audio_pcm.c:152: warning: large integer implicitly truncated to unsigned type
  sound/pci/cs5535audio/cs5535audio_pcm.c:160: warning: large integer implicitly truncated to unsigned type

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: HDMI - fix ELD monitor name length
Wu Fengguang [Wed, 29 Jun 2011 06:26:07 +0000]
ALSA: HDMI - fix ELD monitor name length

I noticed that the last character of the ELD monitor name is lost,
this fixes the issue.

This fix should be confirming to the HDA spec, and works together with
the DRM part of the ELD patch.

The HDA spec does not mention that Monitor_Name_String is an '\0'
ending string, and it allows NML to be 1, which is only valid when MNL
does not count the possible ending '\0'.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix jack-detection on non-VT1708 VIA codecs
Lydia Wang [Wed, 29 Jun 2011 05:52:02 +0000]
ALSA: hda - Fix jack-detection on non-VT1708 VIA codecs

Move codec init verb which is only applicatable for VT1708.

I've found the root cause that jack plugged in can't be detected.
The verb in vt1708_init_verbs is used to power down jack detect circuit.
This verb is only applicable to VT1708. vt1708 didn't implement jack
detect function in hardware, so we should shut down this function to
avoid noise. But for other codecs, hardware implement jack detect
function. If sending this verb during initialization, jack detect will
be invalid. So I move this verb from via_parse_auto_config() to
patch_vt1708().

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix unused variable warning
Takashi Iwai [Tue, 28 Jun 2011 15:00:33 +0000]
ALSA: hda - Fix unused variable warning

sound/pci/hda/patch_cmedia.c: In function ‘cmi9880_fill_multi_init’:
sound/pci/hda/patch_cmedia.c:401:15: warning: unused variable ‘len’

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Enable auto-parser as default for Conexant codecs
Takashi Iwai [Tue, 28 Jun 2011 12:17:17 +0000]
ALSA: hda - Enable auto-parser as default for Conexant codecs

Let's use auto-parser as default now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'fix/hda' into topic/hda
Takashi Iwai [Wed, 29 Jun 2011 06:02:09 +0000]
Merge branch 'fix/hda' into topic/hda

8 years agoALSA: hda - Create snd_hda_get_conn_index() helper function
Takashi Iwai [Tue, 28 Jun 2011 10:45:47 +0000]
ALSA: hda - Create snd_hda_get_conn_index() helper function

Create snd_hda_get_conn_index() helper function for obtaining the
connection index of the widget.  Replaced the similar codes used in
several codec-drivers with this common helper.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix unsol event initializations for VIA codecs
Lydia Wang [Tue, 28 Jun 2011 09:29:10 +0000]
ALSA: hda - Fix unsol event initializations for VIA codecs

Fix a issue to enable unsolicited response to line-out pins.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: atmel - update author email for ABDAC, AC97C and AT73C213
Hans-Christian Egtvedt [Tue, 28 Jun 2011 14:59:14 +0000]
ALSA: atmel - update author email for ABDAC, AC97C and AT73C213

This patch updates the email address of the sound drivers supported by me to an
email account I will use on a more regular basis in the future.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: HDA: Add model=auto quirk for Acer Aspire 3830TG
David Henningsson [Tue, 21 Jun 2011 19:01:52 +0000]
ALSA: HDA: Add model=auto quirk for Acer Aspire 3830TG

Since we're not using the new auto parser as a fallback yet,
add it manually as a quirk.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: HDA: Add a new Conexant codec ID (506c)
David Henningsson [Tue, 21 Jun 2011 18:51:34 +0000]
ALSA: HDA: Add a new Conexant codec ID (506c)

Conexant ID 506c was found on Acer Aspire 3830TG. As users report
no playback, sending to stable should be safe.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/783582
Reported-by: andROOM
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix warnings with CONFIG_SND_POWER_SAVE=n
Takashi Iwai [Tue, 28 Jun 2011 06:59:30 +0000]
ALSA: hda - Fix warnings with CONFIG_SND_POWER_SAVE=n

Use static inline for dummy function to fix the warnings like below
  sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_init’:
  sound/pci/hda/patch_sigmatel.c:4387:3: warning: statement with no effect
  sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_resume’:
  sound/pci/hda/patch_sigmatel.c:4927:3: warning: statement with no effect

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - remove SND_HDA_POWER_SAVE protection of struct hda_loopback_check
Stephen Rothwell [Tue, 28 Jun 2011 06:50:39 +0000]
ALSA: hda - remove SND_HDA_POWER_SAVE protection of struct hda_loopback_check

to fix build problems when it is disabled.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - More volume-init fixes for ALC267 codec
Takashi Iwai [Mon, 27 Jun 2011 14:17:07 +0000]
ALSA: hda - More volume-init fixes for ALC267 codec

More similar fixes like previous commits: handle the exceptional case
like ALC267 where no volume amp is found in ADC widget but in the
capsrc widget instead.

Also minor checks for avoiding possible erros: no connection-select
when the pin has a single selection, and add beep verbs only when the
0x1d is used for beep.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix volume-init for ALC259 with invalid widget caps
Takashi Iwai [Mon, 27 Jun 2011 13:53:38 +0000]
ALSA: hda - Fix volume-init for ALC259 with invalid widget caps

ALC259 seems to provide an invalid widget capability for the input-src
selector widget.  The widget shows the input-amp while it's a selector,
and this confuses the current ALC882 initialization code that is used
for ALC259, too.  For fixing this, check the amp capability and handle
the connection selection individually.

Also, ALC259 has no mute bit in DAC volume, so we need to initialize
it as ZERO instead of MUTE.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix volume-init of ALC299 & co
Takashi Iwai [Mon, 27 Jun 2011 13:48:17 +0000]
ALSA: hda - Fix volume-init of ALC299 & co

ALC269 and compatible codecs have the output volume in DACs, thus we
can't use the ALC880's code as is.  Fixed by checking the amp caps and
picking up the right widget for initialization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Simplify EAPD control in patch_realtek.c
Takashi Iwai [Mon, 27 Jun 2011 13:28:57 +0000]
ALSA: hda - Simplify EAPD control in patch_realtek.c

Look through the known NIDs that may have EAPD capabilities and turn
on/off them appropriately instead of checking the individual vendor ids.

This will also avoid the forgotten entries of newly added codec ids
in future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix auto-init of output volumes of Realtek codecs
Takashi Iwai [Mon, 27 Jun 2011 13:00:48 +0000]
ALSA: hda - Fix auto-init of output volumes of Realtek codecs

Fix the regression introduced by the commit
1f0f4b8036b1fe1347cb4f1f199601b87de9be46
  ALSA: hda - Reduce static init verbs for Realtek auto-parsers

The input amps of mixer widgets should be unmuted as default (as
usually they have no assigned mixer switches).

More fixes in this commit are, however, for ALC260: ALC260 codec can
have multiple output mixers connnected to a single DAC althouh the
driver didn't pick up them properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'topic/via-cleanup' into topic/hda
Takashi Iwai [Mon, 27 Jun 2011 12:32:50 +0000]
Merge branch 'topic/via-cleanup' into topic/hda

8 years agoALSA: hda - Check hard-wired DACs at first for ALC662 & co
Takashi Iwai [Mon, 27 Jun 2011 10:34:01 +0000]
ALSA: hda - Check hard-wired DACs at first for ALC662 & co

Some Realtek codecs have the output pins hardwired with certain DACs.
These DACs have to be assigned at first and assign the rest for
multi-DAC pins so that all DACs can be assigned properly.

Without such an optimization, speaker outputs may be assigned to the
same DAC as the headphone or others.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Call proper DAC-filler function for Realtek auto-parser
Takashi Iwai [Mon, 27 Jun 2011 09:32:07 +0000]
ALSA: hda - Call proper DAC-filler function for Realtek auto-parser

In alc_auto_add_multi_channel_mode(), when the primary HP workaround
is enabled, it re-initializes the DAC list but calls alc662's function
in a fixed way.  This isn't pretty suitable for other codecs, of course.

Now we call it with fill_dac function pointer so that the proper
function can be called at that point.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Reduce static init verbs for Realtek auto-parsers
Takashi Iwai [Mon, 27 Jun 2011 08:52:59 +0000]
ALSA: hda - Reduce static init verbs for Realtek auto-parsers

Instead of using fixed init verbs, initialize DACs, ADCs and mixers
more dynamically for Realtek auto-parsers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Add snd_hda_get_conn_list() helper function
Takashi Iwai [Fri, 24 Jun 2011 12:10:28 +0000]
ALSA: hda - Add snd_hda_get_conn_list() helper function

Add a new helper function snd_hda_get_conn_list().
Unlike snd_hda_get_connections(), this function doesn't copy the
connection-list but gives the raw pointer for the cached list.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Fri, 24 Jun 2011 10:36:25 +0000]
Merge branch 'fix/asoc' into for-linus

8 years agoALSA: Remove unneeded version.h includes from sound/
Jesper Juhl [Thu, 23 Jun 2011 21:54:40 +0000]
ALSA: Remove unneeded version.h includes from sound/

In the sound/ directory there are two files (flagged by 'make
versioncheck'); sound/pci/asihpi/asihpi.c and
sound/soc/codecs/wm8991.c that include linux/version.h although they
don't need it. This patch removes the unneeded includes.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Use alc_get_pfx_name() for all Realtek codecs
Takashi Iwai [Fri, 24 Jun 2011 09:27:22 +0000]
ALSA: hda - Use alc_get_pfx_name() for all Realtek codecs

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Clean up multi-channel mixer name assignment in patch_realtek.c
Takashi Iwai [Fri, 24 Jun 2011 09:03:58 +0000]
ALSA: hda - Clean up multi-channel mixer name assignment in patch_realtek.c

Change alc_get_line_out_pfx() in patch_realtek.c to provide the channel
specific name and assign the index so that each caller doesn't have to
set the channel name by itself.

Also, check the multi-io case with the primary hp-out; for the multi-io
channels, assign the channel name instead of "Headphone" with indices.
This makes the mixer names more intuitive and reduces confusion.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Add a workaround for invalid line-out setups
Takashi Iwai [Fri, 24 Jun 2011 08:43:03 +0000]
ALSA: hda - Add a workaround for invalid line-out setups

Some BIOS set up the pin config wrongly as line-out although it's
supposed to be a speaker out.  In most cases, though, we can judge
the validity by checking the connection type -- when it's FIXED,
mostly it's an invalid line-out but a speaker.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'fix/hda' into topic/hda
Takashi Iwai [Fri, 24 Jun 2011 08:36:25 +0000]
Merge branch 'fix/hda' into topic/hda

8 years agoALSA: hda - Allow multi-io with HP output for ALC662 & co
Takashi Iwai [Fri, 24 Jun 2011 08:35:05 +0000]
ALSA: hda - Allow multi-io with HP output for ALC662 & co

Even if the machine has no line-out but only HP-out, try to detect the
multi-io.  It'll allow more possibilities for 5.1 outputs on laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoASoC: pxa-ssp: Correct check for stream presence
Daniel Mack [Wed, 22 Jun 2011 18:48:25 +0000]
ASoC: pxa-ssp: Correct check for stream presence

Don't rely on the codec's channels_min information to decide wheter or
not allocate a substream's DMA buffer. Rather check if the substream
itself was allocated previously.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org

8 years agoASoC: imx: add missing module informations
Arnaud Patard (Rtp) [Wed, 22 Jun 2011 20:21:49 +0000]
ASoC: imx: add missing module informations

- add some modules aliases
- add module license to avoid tainted kernel when loading the imx-pcm-audio
  driver

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

8 years agoASoC: imx: Remove unused Kconfig SND_MXC_SOC_SSI entry
Arnaud Patard (Rtp) [Wed, 22 Jun 2011 20:21:48 +0000]
ASoC: imx: Remove unused Kconfig SND_MXC_SOC_SSI entry

SND_MXC_SOC_SSI looks to be unused, so kill it.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

8 years agoALSA: HDA: Pinfix quirk for HP Z200 Workstation
David Henningsson [Wed, 22 Jun 2011 07:58:37 +0000]
ALSA: HDA: Pinfix quirk for HP Z200 Workstation

BIOS lists the internal speaker as an internal line-out. Change to
internal speaker + model=auto for better auto-mute capabilities.

BugLink: http://bugs.launchpad.net/bugs/754964
Reported-by: Marc Legris <marc.legris@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Implement dynamic-ADC switching for VIA codecs
Takashi Iwai [Wed, 22 Jun 2011 13:23:25 +0000]
ALSA: hda - Implement dynamic-ADC switching for VIA codecs

Some VIA codecs like VT1702 provide the input-route only to specific
ADCs such as digital-mic inputs.  These routes aren't covered by the
normal primary ADC, and for now, user had to open the capture stream
assigned to that special ADC manually for using such inputs.

This patch implements a way to switch the current ADC dynamically per
the input-source selection in such a case.  When this workaround is
activated, the driver provides only one capture stream and one input-
source control but with the full possible inputs.  The driver switches
the ADC to be used (or being used) according to the input-source on the
fly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Auto-mute smart51 surround pins for VIA codecs
Takashi Iwai [Tue, 21 Jun 2011 14:52:39 +0000]
ALSA: hda - Auto-mute smart51 surround pins for VIA codecs

When smart51 mode is enabled, auto-mute these surround outputs
as well as the primary line-out.  Also this patch includes minor
clean-ups.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Remove redundant VT1709 and VT1708B codes
Takashi Iwai [Tue, 21 Jun 2011 14:33:55 +0000]
ALSA: hda - Remove redundant VT1709 and VT1708B codes

Unify the VT1709 10ch and 6ch parsers, as well as VT1708B 8ch and 4ch
parsers.  They have no difference now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - VT1708 independent HP routing fix
Takashi Iwai [Tue, 21 Jun 2011 13:57:44 +0000]
ALSA: hda - VT1708 independent HP routing fix

The codecs like VT1708 needs more complicated routing using the mixer
widget rather than the simple selector widgets.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix surround-volume parsing for VT1708B codecs
Takashi Iwai [Tue, 21 Jun 2011 12:22:14 +0000]
ALSA: hda - Fix surround-volume parsing for VT1708B codecs

The surround/CLFE/side DACs on VT1708B and co have no amp but the
connected selector widgets have the amp instead.  Fix the parser to
check these selector widgets for the possible mixer controls as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix the check of loopback-mixer element index in patch_via.c
Takashi Iwai [Tue, 21 Jun 2011 10:57:22 +0000]
ALSA: hda - Fix the check of loopback-mixer element index in patch_via.c

Fix the check of the multiple loopback-mixer, which gave sometimes
a wrong index assigned to an element even for different names, e.g.
Mic and Front Mic.  Now check the label properly for avoid duplication.

Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Assign smart51 only in the same stack for VIA codecs
Takashi Iwai [Tue, 21 Jun 2011 10:51:33 +0000]
ALSA: hda - Assign smart51 only in the same stack for VIA codecs

The input jacks assigned as the smart51 outputs must be in the same
stack, either rear, front or other.  Also, prefer line-in as the surround
to mic-in.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix re-routing of HP-independent mode in patch_via.c
Takashi Iwai [Tue, 21 Jun 2011 09:48:29 +0000]
ALSA: hda - Fix re-routing of HP-independent mode in patch_via.c

Re-route the whole output path when HP-independent mode is changed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix creations of playback volume controls in patch_via.c
Lydia Wang [Tue, 21 Jun 2011 08:11:11 +0000]
ALSA: hda - Fix creations of playback volume controls in patch_via.c

Fix a issue to create playback volume control if pin has amplifier capability
but not DAC.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Revisit output_path parsing in patch_via.c
Takashi Iwai [Tue, 21 Jun 2011 07:01:36 +0000]
ALSA: hda - Revisit output_path parsing in patch_via.c

Change the order of the output-path list in a way from the DAC to the
target pin.  Also now the list include the target pin, too.

Together with this format change, simplify the arguments of
parse_output_path() function, and fix the initialization in
via_auto_init_output().

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Use xxx Boost Volume for VIA
Takashi Iwai [Tue, 21 Jun 2011 06:37:41 +0000]
ALSA: hda - Use xxx Boost Volume for VIA

Drop "Capture" prefix from the mic-boost names.
Otherwise some control names can overflow the max name length.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix a compile error in patch_ca0132.c for the recent SPDIF change
Takashi Iwai [Tue, 21 Jun 2011 05:44:51 +0000]
ALSA: hda - Fix a compile error in patch_ca0132.c for the recent SPDIF change

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoMerge branch 'fix/hda' into topic/via-cleanup
Takashi Iwai [Tue, 21 Jun 2011 05:34:00 +0000]
Merge branch 'fix/hda' into topic/via-cleanup

Conflicts:
sound/pci/hda/patch_via.c

8 years agoALSA: hda - Add Creative CA0132 HDA codec support
Ian Minett [Wed, 15 Jun 2011 22:35:17 +0000]
ALSA: hda - Add Creative CA0132 HDA codec support

Create patch_ca0132.c, to add support for devices featuring the
Creative CA0132 HD-audio codec.

This driver implements :-
* 1 playback subdevice to headphone and speaker
* 2 capture subdevices:
   i - Mic-in
   ii- Line-in
* mixer device

Advanced DSP features are not yet included.
Developed and maintained by Creative Labs, Inc.

Signed-off-by: Ian Minett <ian_minett@creativelabs.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: VIA HDA: Create a master amplifier control for VT1718S.
Lydia Wang [Mon, 20 Jun 2011 06:17:56 +0000]
ALSA: VIA HDA: Create a master amplifier control for VT1718S.

Create a master volume and mute control of playback for VT1718S.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: VIA HDA: Mute/unmute mixer conncted to Headphone for VT1718S.
Lydia Wang [Mon, 20 Jun 2011 06:16:33 +0000]
ALSA: VIA HDA: Mute/unmute mixer conncted to Headphone for VT1718S.

When switch HP independent mode, mute/unmute connctions of mixer  which is
connected to headphone for VT1718S.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: VIA HDA: Modify initial verbs list for VT1718S.
Lydia Wang [Mon, 20 Jun 2011 06:14:37 +0000]
ALSA: VIA HDA: Modify initial verbs list for VT1718S.

Remove some invalid initial verbs and correct some wrong initial verbs
for VT1718S codec.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Remove ALC268 model override for CPR2000
Tony Vroon [Mon, 20 Jun 2011 21:11:11 +0000]
ALSA: hda - Remove ALC268 model override for CPR2000

The "diverse" Quanta ID 0x0763 is overridden to ALC268_ACER.
This keeps headphone automute and microphone input from operating
on at least one laptop from Opti Systems.
Without the override, the BIOS parser does a fine job setting the
card up and everything works.

Tested-By: Peter Schneider <e.at.chi.kaen@googlemail.com>
Signed-off-by: Tony Vroon <tony@linx.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: HDA: Remove quirk for an HP device
David Henningsson [Mon, 20 Jun 2011 08:27:07 +0000]
ALSA: HDA: Remove quirk for an HP device

The reporter, who is running kernel 2.6.38, reports that
he needs to set model=auto for the headphone output to work
correctly.

BugLink: http://bugs.launchpad.net/bugs/761022
Cc: stable@kernel.org (v2.6.38+)
Reported-by: Jo
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Simplify analog-low-current mode check for VIA codecs
Takashi Iwai [Mon, 20 Jun 2011 13:40:19 +0000]
ALSA: hda - Simplify analog-low-current mode check for VIA codecs

Use the existing aa-loop list for simplifying the check for analog
low-current mode.  Also fix the stream count test for playback streams.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Remove NID_MAPPING hacks in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 13:10:28 +0000]
ALSA: hda - Remove NID_MAPPING hacks in patch_via.c

There is no longer virtual kmixer element for NID mapping.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Remove unused defines and struct fields in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 12:11:59 +0000]
ALSA: hda - Remove unused defines and struct fields in patch_via.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Name the primary out as Speaker when needed for VIA codecs
Takashi Iwai [Mon, 20 Jun 2011 12:09:02 +0000]
ALSA: hda - Name the primary out as Speaker when needed for VIA codecs

When the primary output is the speaker output, rather name it as
"Speaker".  This will be more intuitive.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Create loopback-list dynamically in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 12:05:46 +0000]
ALSA: hda - Create loopback-list dynamically in patch_via.c

Create loopback list dynamically from the parsed input pins for VIA
codecs instead of the fixed arrays.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix smart51 handling again
Takashi Iwai [Mon, 20 Jun 2011 11:52:33 +0000]
ALSA: hda - Fix smart51 handling again

Fix the broken detection of smart51 and its handling.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Create virtual-master control for VIA codecs
Takashi Iwai [Mon, 20 Jun 2011 10:47:45 +0000]
ALSA: hda - Create virtual-master control for VIA codecs

Now let's add the missing Master control to VIA codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Initialize unsol events dynamically in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 10:39:26 +0000]
ALSA: hda - Initialize unsol events dynamically in patch_via.c

Issue the init verbs of unsolicited events dynamically from the parsed
results for VIA codecs.  Also, consolidate the unsol handlers for HP
and line-out mutes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Initialize input-path dynamically in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 10:09:02 +0000]
ALSA: hda - Initialize input-path dynamically in patch_via.c

Similarly like the previous commit, initialize the input-paths dynamically
from the parsed results instead of the fixed array for VIA codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Initialize output path dynamically in patch_via.c
Takashi Iwai [Mon, 20 Jun 2011 09:32:27 +0000]
ALSA: hda - Initialize output path dynamically in patch_via.c

Instead of fixed array for each codec type, initialize the output path
dynamically from the parsed results.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Replace with standard consts in patch_via.c
Takashi Iwai [Sun, 19 Jun 2011 14:27:53 +0000]
ALSA: hda - Replace with standard consts in patch_via.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Fix independent-HP handling in patch_via.c
Takashi Iwai [Sun, 19 Jun 2011 14:24:21 +0000]
ALSA: hda - Fix independent-HP handling in patch_via.c

Fix races in handling of HP DAC and independent streams for VIA codecs.
Also, allow the HP output path without front-DAC, and removed
unnecessary activation of HP mixer elements.

This also removes the handling of shared side/HP stream; it's anyway
implemented in a broken way, so we need to re-implement the feature
later...

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify auto-parser in patch_via.c
Takashi Iwai [Sat, 18 Jun 2011 15:45:49 +0000]
ALSA: hda - Unify auto-parser in patch_via.c

Now all codecs use the same parser-path, so we can reduce into a single
auto-parser function.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Return error for invalid setup for VIA
Takashi Iwai [Sat, 18 Jun 2011 15:33:34 +0000]
ALSA: hda - Return error for invalid setup for VIA

Instead of ignoring the invalid pin configuration, return the error.
This will avoid unexpected crash, anyway.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify capture-mixer creations in patch_via.c
Takashi Iwai [Sat, 18 Jun 2011 15:24:46 +0000]
ALSA: hda - Unify capture-mixer creations in patch_via.c

Create capture-related mixer elements dynamically from the parsed
ADCs and input-pins instead of fixed values for each codec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Assign HP-independent PCM to individual stream
Takashi Iwai [Sat, 18 Jun 2011 14:40:14 +0000]
ALSA: hda - Assign HP-independent PCM to individual stream

Instead of using the secondary substream, create an individual PCM
stream for HP-independent PCM.  Otherwise it's difficult to handle
different channel numbers with multi-channel stream in the sam PCM
stream structure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify PCM assignments in patch_via.c
Takashi Iwai [Sat, 18 Jun 2011 14:17:45 +0000]
ALSA: hda - Unify PCM assignments in patch_via.c

Unify PCM streams for all codecs by assigning the NID dynamically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Don't create secondary substream when no independent-hp is used
Takashi Iwai [Sat, 18 Jun 2011 08:58:49 +0000]
ALSA: hda - Don't create secondary substream when no independent-hp is used

For VIA codecs, we shouldn't create a substream for independent HP mode,
when no individual HP DAC is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Re-implement smart51 detection for VIA codecs
Takashi Iwai [Fri, 17 Jun 2011 16:46:48 +0000]
ALSA: hda - Re-implement smart51 detection for VIA codecs

Signed-off-by: Takashi Iwai <tiwai@suse.de>

8 years agoALSA: hda - Unify output-control parsing in patch_via.c
Takashi Iwai [Fri, 17 Jun 2011 15:53:38 +0000]
ALSA: hda - Unify output-control parsing in patch_via.c

Parse the output-paths more dynamically, i.e. traverse the paths
from each output pin instead of fixed assignment for each codec.
Now all codecs are using the same output parser code.

The smart51 setup doesn't work with this change, and will be fixed
in the next commits.

Signed-off-by: Takashi Iwai <tiwai@suse.de>