dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

4495 Commits

Author SHA1 Message Date
Takashi Iwai f970de2555 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>
2011-07-07 09:35:14 +02:00
Takashi Iwai d6cc9fabd5 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>
2011-07-07 09:34:46 +02:00
Takashi Iwai 0a7f532090 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>
2011-07-07 09:31:25 +02:00
Takashi Iwai b78217096b 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>
2011-07-07 09:31:21 +02:00
Takashi Iwai 343a04be37 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>
2011-07-07 09:31:18 +02:00
Takashi Iwai 97aaab7b49 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>
2011-07-07 09:31:15 +02:00
Takashi Iwai cd51155676 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>
2011-07-07 09:31:13 +02:00
Takashi Iwai bb8bf4d40c 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>
2011-07-07 09:31:09 +02:00
Takashi Iwai 8e89995c58 Merge branch 'fix/hda' into topic/hda 2011-07-07 09:28:47 +02:00
Takashi Iwai 9c7a083d94 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>
2011-07-07 09:25:54 +02:00
Kailang Yang b68785714b 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>
2011-07-06 09:53:28 +02:00
Takashi Iwai bac4b92cf7 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>
2011-07-04 17:37:57 +02:00
Takashi Iwai 18bd2c44b9 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>
2011-07-04 15:55:44 +02:00
Takashi Iwai de6c74f3e3 ALSA: hda - Define some constants in patch_via.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-04 14:53:30 +02:00
Lydia Wang b89596a160 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>
2011-07-04 14:53:25 +02:00
Lydia Wang c4394f5b80 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>
2011-07-04 14:33:23 +02:00
Lydia Wang e5e1468140 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>
2011-07-01 08:33:06 +02:00
Takashi Iwai 350434ee53 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>
2011-06-30 21:29:12 +02:00
Takashi Iwai 2525050518 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>
2011-06-30 17:24:47 +02:00
Takashi Iwai 286bed0f0c 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>
2011-06-30 12:45:36 +02:00
Takashi Iwai 71276410e1 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>
2011-06-30 12:35:45 +02:00
Wu Fengguang f5b2d0ef63 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>
2011-06-29 08:48:24 +02:00
Lydia Wang e322a36d39 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>
2011-06-29 08:02:46 +02:00
Takashi Iwai 94230c11da 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>
2011-06-29 08:02:33 +02:00
Takashi Iwai c82693db52 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>
2011-06-29 08:02:21 +02:00
Takashi Iwai c2549312d2 Merge branch 'fix/hda' into topic/hda 2011-06-29 08:02:09 +02:00
Takashi Iwai 8d087c7600 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>
2011-06-29 08:01:46 +02:00
Lydia Wang 63f10d2ca7 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>
2011-06-29 08:01:23 +02:00
David Henningsson 9966db22ca 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>
2011-06-28 14:09:57 +02:00
David Henningsson f0ca89b031 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>
2011-06-28 14:09:41 +02:00
Takashi Iwai ff2b7e2a3f 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>
2011-06-28 08:59:30 +02:00
Stephen Rothwell 880a050f4a 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>
2011-06-28 08:55:56 +02:00
Takashi Iwai 4f574b7b1a 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>
2011-06-27 16:17:07 +02:00
Takashi Iwai 7ec9c6ccc6 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>
2011-06-27 15:53:38 +02:00
Takashi Iwai 050ea75317 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>
2011-06-27 15:48:17 +02:00
Takashi Iwai 39fa84e94a 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>
2011-06-27 15:28:57 +02:00
Takashi Iwai 6d86b4fb40 ALSA: hda - Fix auto-init of output volumes of Realtek codecs
Fix the regression introduced by the commit
1f0f4b8036
  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>
2011-06-27 15:07:28 +02:00
Takashi Iwai 00c6850dde Merge branch 'topic/via-cleanup' into topic/hda 2011-06-27 14:32:50 +02:00
Takashi Iwai 3af9ee6b83 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>
2011-06-27 12:34:01 +02:00
Takashi Iwai cb053a8265 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>
2011-06-27 11:32:07 +02:00
Takashi Iwai 1f0f4b8036 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>
2011-06-27 10:52:59 +02:00
Takashi Iwai dce2079b89 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>
2011-06-25 09:19:49 +02:00
Tim Blechmann 80b52490cd ALSA: lx6464es - include mac address in device name
each device has a unique mac address, which can be used to distinguish
multiple devices in the same machine. we therefore include the full mac
address in the device shortname and the last 6 bytes in the device id.

Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-25 09:15:31 +02:00
Markus Bollinger 1470579913 ALSA: lola - Fix for Lola280 board
- add/fix comments and debug messages
- fix incomplete matrix init
- comment out creation of buggy lola_dest_gain_mixer controls
- minor optimisations

Signed-off-by: Markus Bollinger <bollinger@digigram.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-24 12:54:43 +02:00
Jesper Juhl 16866741bd 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>
2011-06-24 11:28:17 +02:00
Takashi Iwai 2e925ddeb9 ALSA: hda - Use alc_get_pfx_name() for all Realtek codecs
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-24 11:27:22 +02:00
Joe Perches 7c9d440e90 treewide: transciever/transceiver spelling fixes
Just tyops.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-24 11:20:14 +02:00
Takashi Iwai 6843ca16f5 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>
2011-06-24 11:06:17 +02:00
Takashi Iwai 1af7c5f0d4 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>
2011-06-24 10:43:03 +02:00
Takashi Iwai f9a09e003f Merge branch 'fix/hda' into topic/hda 2011-06-24 10:36:25 +02:00
Takashi Iwai 3fccdfd891 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>
2011-06-24 10:35:05 +02:00
David Henningsson d2a19da79d 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>
2011-06-23 09:25:20 +02:00
Takashi Iwai a86a88eaf6 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>
2011-06-22 15:23:25 +02:00
Takashi Iwai f2b1c9f031 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>
2011-06-21 16:52:39 +02:00
Takashi Iwai ddd304d8be 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>
2011-06-21 16:33:55 +02:00
Takashi Iwai 09a9ad69a5 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>
2011-06-21 16:02:32 +02:00
Takashi Iwai a934d5a983 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>
2011-06-21 14:22:14 +02:00
Takashi Iwai 1e11cae143 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>
2011-06-21 12:59:24 +02:00
Takashi Iwai 0f98c24b80 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>
2011-06-21 12:51:33 +02:00
Takashi Iwai 8df2a3129d 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>
2011-06-21 12:20:13 +02:00
Lydia Wang a00a5fad9d 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>
2011-06-21 10:24:18 +02:00
Takashi Iwai 8e3679dca2 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>
2011-06-21 09:01:36 +02:00
Takashi Iwai 30f7c5d491 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>
2011-06-21 08:37:41 +02:00
Takashi Iwai efb9f469b6 ALSA: hda - Fix a compile error in patch_ca0132.c for the recent SPDIF change
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-21 07:44:51 +02:00
Takashi Iwai 216c7a0f22 Merge branch 'fix/hda' into topic/via-cleanup
Conflicts:
	sound/pci/hda/patch_via.c
2011-06-21 07:34:45 +02:00
Ian Minett 95c6e9cb77 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>
2011-06-21 07:31:25 +02:00
Lydia Wang e905a83acd 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>
2011-06-21 07:24:56 +02:00
Lydia Wang ba31a60d0f 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>
2011-06-21 07:23:19 +02:00
Lydia Wang 42467b32ce 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>
2011-06-21 07:22:57 +02:00
Tony Vroon c933790614 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>
2011-06-21 07:18:36 +02:00
David Henningsson 6f2e810ad5 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>
2011-06-20 16:32:50 +02:00
Takashi Iwai ada509ec00 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>
2011-06-20 16:24:16 +02:00
Takashi Iwai 47be05ce0a 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>
2011-06-20 16:24:16 +02:00
Takashi Iwai c619160787 ALSA: hda - Remove unused defines and struct fields in patch_via.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:15 +02:00
Takashi Iwai 6aadf41d6b 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>
2011-06-20 16:24:14 +02:00
Takashi Iwai 13af8e77ea 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>
2011-06-20 16:24:13 +02:00
Takashi Iwai e3d7a1431f ALSA: hda - Fix smart51 handling again
Fix the broken detection of smart51 and its handling.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:12 +02:00
Takashi Iwai 370bafbdae 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>
2011-06-20 16:24:12 +02:00
Takashi Iwai 4a918ffeaa 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>
2011-06-20 16:24:11 +02:00
Takashi Iwai 096a885494 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>
2011-06-20 16:24:10 +02:00
Takashi Iwai 5d41762a21 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>
2011-06-20 16:24:09 +02:00
Takashi Iwai 0fe0adf82f ALSA: hda - Replace with standard consts in patch_via.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:09 +02:00
Takashi Iwai ece8d0431f 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>
2011-06-20 16:24:08 +02:00
Takashi Iwai 12daef65fd 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>
2011-06-20 16:24:07 +02:00
Takashi Iwai 7f0df88ce0 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>
2011-06-20 16:24:06 +02:00
Takashi Iwai d7a99cce55 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>
2011-06-20 16:24:05 +02:00
Takashi Iwai 7eb56e84e6 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>
2011-06-20 16:24:05 +02:00
Takashi Iwai 9af7421091 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>
2011-06-20 16:24:04 +02:00
Takashi Iwai 57307bf24a 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>
2011-06-20 16:24:03 +02:00
Takashi Iwai f4a7828bc1 ALSA: hda - Re-implement smart51 detection for VIA codecs
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:02 +02:00
Takashi Iwai 4a79616d07 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>
2011-06-20 16:24:01 +02:00
Takashi Iwai 620e2b28b7 ALSA: hda - Unify input-volume creations in patch_via.c
Now storing the analog-mixer widget in spec, we can simplify the rest
parts.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:01 +02:00
Takashi Iwai 64be285b66 ALSA: hda - Auto-mute all LO and speakers in patch_via.c
Muting all line-outs and/or speakers is more common in other drivers,
so we should follow it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:00 +02:00
Takashi Iwai 3e0693e278 ALSA: hda - Change pin-ctl for auto-muting in patch_via.c
Mute the outputs via pin-controls instead of amps for the auto-mute
handling.  This makes our life easier as it avoids conflict of the states
between the mixer elements and the auto-mute toggles.

With this change, we can use vmaster for the master control easily now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:59 +02:00
Takashi Iwai 82673bc895 ALSA: hda - Generate PCM names dynamically in patch_via.c
This reduces lots of static strings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:58 +02:00
Takashi Iwai 291c9e33bf ALSA: hda - Refactor ctl array handling in patch_via.c
No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:57 +02:00
Takashi Iwai e06e5a2974 ALSA: hda - Defer mixer element creation to the right time in patch_via.c
The jack-detect control should be created at the time of build_controls
callback instead of calling snd_hda_add_ctls() at the tree-parsing time.
For that, copy the control to the temporary array like other cases.

Also, fixed typos of vt1708_jack_detect in all places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:56 +02:00
Takashi Iwai a766d0d763 ALSA: hda - Fill ADCs dynamically for VIA codecs
Instead of giving the fixed ADC list, parse the widgets and fill in
ADCs dynamically.

Also, probe the stereo-mixer input more dynamically, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:55 +02:00
Takashi Iwai 24088a58d6 ALSA: hda - Add control to suppress the dynamic pin-power for VIA
Currently VIA driver controls the power-state of each pin per jack
detection.  But, it means that the power-state mismatch may occur when
the machine doesn't give the proper jack-detection.

For avoiding this problem, a new control element "Dynamic Power-Control"
is provided so that user can turn on/off the pin-power control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:55 +02:00
Takashi Iwai 5f4b36d64d ALSA: hda - Remove superfluous NID_MAPPING use for smart51 mixer
Just a minor clean up; nid-mapping can be set directly to the smart51
mixer element.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:07:02 +02:00
David Henningsson b13e552d37 ALSA: HDA: Remove redundant LPIB quirks for ATI chipset
Now that we have changed the position_fix default for ATI and AMD
to be LPIB (see commit 50e3bbf989), we can remove the quirks that
were added for ATI chipsets.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 18:48:23 +02:00
Takashi Iwai 3409fcd1f7 Merge branch 'fix/hda' into topic/misc 2011-06-17 14:54:47 +02:00
Takashi Iwai ad2409413d ALSA: hda - Fix no NID error with VIA codecs
The via driver spews warnigs like
	hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 14:23:46 +02:00
Clemens Ladisch f4b1e98aa9 ALSA: firewire-speakers, oxygen, ua101: allow > 10 s periods
Since commit f2b3614cef (Don't check DMA time-out too shortly),
drivers need no longer restrict their PCM period length to be shorter
than 10 seconds.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 11:36:30 +02:00
Harry Butterworth 030aba53ea ALSA: ctxfi: Change PLL initialization code
This is a reworked patch from Creative to change the PLL code to address
unreliable 44100Hz initialization.

Signed-off-by: Harry Butterworth <heb1001@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-16 07:28:57 +02:00
Takashi Iwai e72888e91c ALSA: lola - Fix section mismatch
Add missing __devinit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-15 15:14:49 +02:00
Takashi Iwai 30bdee0259 ALSA: es1968,maestro3 - Use work for hw-volume control
Instead of tasklet, use workq for handling the hw-volume control.
This reduces lots of spinlocks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 13:59:51 +02:00
Takashi Iwai 85e4d95da0 Merge branch 'test/pci-rename' into topic/misc 2011-06-14 08:56:42 +02:00
Takashi Iwai ca2585afa0 ALSA: hda - Fix missing static inline to beep dummy function
The commit 2308f4add3 missed static inline
thus it resulted in multiple-definitions error at linking.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 08:14:32 +02:00
Harry Butterworth b028b81835 ALSA: ctxfi: Implement a combined capabilities query method to replace multiple have_x query methods.
Signed-off-by: Harry Butterworth <heb1001@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 07:34:03 +02:00
Harry Butterworth 55309216ba ALSA: ctxfi: Add support for Creative Titanium HD
Initialise model-specific DAC and ADC parts.
Add controls for output and mic source selection.
Rename some mixer controls according to ControlNames.txt.
Remove Playback switches for Line-in and IEC958-in - these
were controlling the input mute/unmute which affected
capture too.  Use the capture switches to control the
input mute/unmute instead - it's less confusing.
Initialise the WM8775 to invert the left-right clock
to swap the left and right channels of the mic and aux
input.

Signed-off-by: Harry Butterworth <heb1001@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 07:32:29 +02:00
Greg Thelen 9857edfd4d ALSA: hda: check make_exec_verb() return value
If given a -1 cmd parameter then make_exec_verb() returns -1 without
setting the res output value.

Prior to this change snd_hda_codec_read() assumed that make_exec_verb()
unconditionally set res regardless of the cmd value.

This change explicitly checks the make_exec_verb() return value before
consuming the potentially unset res value.

Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 17:52:06 +02:00
Takashi Iwai 5ab775c707 Merge branch 'fix/hda' into topic/hda 2011-06-13 08:37:53 +02:00
Joe Perches 2308f4add3 ALSA: hda - Fix beep_device compilation warnings
Using static inline functions can reduce compilation messages
and macro misuse.

 sound/pci/hda/patch_conexant.c: In function ‘patch_cxt5045’:
 sound/pci/hda/patch_conexant.c:1232:3: warning: statement with no effect

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 08:36:26 +02:00
Takashi Iwai 54463a66b9 ALSA: hda - Fix wrong auto-mute type for Acer Aspire-one
The auto-mute setup for Acer Aspire-one with ALC268 was set wrongly
during the clean-up of auto-mute function.  Fixed now.

Tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 08:32:06 +02:00
Florian Zeitz ac5d4b404e ALSA: emu10k1: Add details for E-mu 0404 PCIe version
This patch adds the necessary details to support the PCIe version of
E-MU's 0404 card.
From comparing the PCBs it seems the PCIe version just added a PCIe
chipset and left all other components pretty much in place.
For anyone intrigued to take a look at the PCB there are pictures I took
at <http://babelmonkeys.de/~florob/E-MU%200404/>.

Signed-off-by: Florian Zeitz <florob@babelmonkeys.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 21:24:17 +02:00
Adrian Knoth efef054e8c ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
The PCI version of the RME HDSP MADI card uses 0xcf as revision ID. Just
add this to the list of supported cards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:50:08 +02:00
Adrian Knoth fedf1535ab ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
When using Word Clock on RME MADI cards, AutoSync mode was alternating
betweeen MADI and WC due to a typo: AutoSync is indicated in the second
status register (status2), not the first one (status).

While the proc output was always correct, the reported WC frequency to
ALSA was unstable as mentioned in

http://mailman.alsa-project.org/pipermail/alsa-devel/2008-March/006723.html

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:56 +02:00
Adrian Knoth c0da00145f ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
For the MIDI part, we need to acquire (and release) the hmidi->lock,
access to the global hdspm structure is serialized through
hmidi->hdspm->lock instead.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:42 +02:00
Takashi Iwai 934c2b6d0c ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*
The name argument of request_irq() appears in /proc/interrupts, and
it's quite ugly when the name entry contains a space or special letters.
In general, it's simpler and more readable when the module name appears
there, so let's replace all entries with KBUILD_MODNAME.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:36:37 +02:00
Daniel T Chen 7ab1fc0af3 ALSA: hda: Fix inaudible internal speakers on CyberpowerPC Gamer Xplorer N57001 laptop
BugLink: https://launchpad.net/bugs/761171

The original reporter needs the model=auto quirk for his internal
speakers to be audible in the latest daily snapshot, so add an entry in
the quirk table for his PCI SSID.

A trivially different version of this patch using the model=asus quirk
should be applied to the 2.6.38 and 2.6.39 stable kernels. We don't use
the asus quirk in 3.0-rc2, because 3.0-rc2's autoparser is much
improved.

Reported-and-tested-by: tomdeering7
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:31:24 +02:00
Takashi Iwai 3733e424c4 ALSA: Use KBUILD_MODNAME for pci_driver.name entries
The convention for pci_driver.name entry in kernel drivers seem to be
the module name or equivalent ones.  But, so far, almost all PCI sound
drivers use more verbose name like "ABC Xyz (12)", and these are fairly
confusing when appearing as a file name.

This patch converts the all pci_driver.name entries in sound/pci/* to
use KBUILD_MODNAME for more unified appearance.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:20:20 +02:00
Takashi Iwai c0a20263db ALSA: hda - Fix initialization of hp pins with master_mute in Realtek
Some Reatlek model quirks use master_mute bool switch for controlling
the master-mute of outputs.  For these cases, the initialization of HP
pins/amps were forgotten during the transition to the common automute
helper function in 3.0 development time, and resulted in the muted HP
output as default.

This patch fixes the issue by adjusting the HP output explicitly with
master_mute switch.

Tested-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:28:15 +02:00
Takashi Iwai 20f5e0b36d ALSA: hda - Fix invalid unsol tag for some alc262 model quirks
The tag number was forgotten to be fixed after cleaning up the model
quirks for ALC262 fujitsu and lenovo-3000 models.

Tested-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:27:32 +02:00
Takashi Iwai 8b0bd2266f ALSA: hda - Fix SSYNC register value for non-Intel controllers
SSYNC register was once defined as 0x34-37 in the old Intel datasheet,
but corrected later to 0x38-3b.  For fixing the register usage, a new
bit-flag is introduced for indicating the old ICH SSYNC register, and
ICH* PCI entries are added explicitly to enable this quirk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:00:07 +02:00
Takashi Iwai 695cd4a34e ALSA: hda - Disable SPDIF only when no pin config set for HP with AD1981
Some HP laptops with AD1981 have SPDIF connections, but currently the
driver disables it statically.  Better to check the pin default config
to judge whether to enable or disable the SPDIF.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 14:37:04 +02:00
Takashi Iwai b4a655e81d ALSA: hda - Judge playback stream from stream id in azx_via_get_position()
Instead of checking the azx_dev index with a fixed number (4), check
the stream direction of the assigned substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 12:26:56 +02:00
Takashi Iwai a810364a04 ALSA: hda - Handle -1 as invalid position, too
When reading from the position-buffer results in -1, handle as it's
invalid and falls back to LPIB mode as well as 0.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 12:23:23 +02:00
Daniel T Chen 0a1896b27b ALSA: hda: Fix quirk for Dell Inspiron 910
BugLink: https://launchpad.net/bugs/792712

The original reporter states that sound from the internal speakers is
inaudible until using the model=auto quirk. This symptom is due to an
existing quirk mask for 0x102802b* that uses the model=dell quirk. To
limit the possible regressions, leave the existing quirk mask but add
a higher priority specific mask for the reporter's PCI SSID.

Reported-and-tested-by: rodni hipp
Cc: <stable@kernel.org> [2.6.38+]
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 07:26:01 +02:00
Stephen Warren 384a48d715 ALSA: hda: HDMI: Support codecs with fewer cvts than pins
The general concept of this change is to create a PCM device for each
pin widget instead of each converter widget. Whenever a PCM is opened,
a converter is dynamically selected to drive that pin based on those
available for muxing into the pin.

The one thing this model doesn't support is a single PCM/converter
sending audio to multiple pin widgets at once.

Note that this means that a struct hda_pcm_stream's nid variable is
set to 0 except between a stream's open and cleanup calls. The dynamic
de-assignment of converters to PCMs occurs within cleanup, not close,
in order for it to co-incide with when controller stream IDs are
cleaned up from converters.

While the PCM for a pin is not open, the pin is disabled (its widget
control's PIN_OUT bit is cleared) so that if the currently routed
converter is used to drive a different PCM/pin, that audio does not
leak out over a disabled pin.

We use the recently added SPDIF virtualization feature in order to
create SPDIF controls for each pin widget instead of each converter
widget, so that state is specific to a PCM.

In order to support this, a number of more mechanical changes are made:

* s/nid/pin_nid/ or s/nid/cvt_nid/ in many places in order to make it
  clear exactly what the code is dealing with.

* We now have per_pin and per_cvt arrays in hdmi_spec to store relevant
  data. In particular, we store a converter's capabilities in the per_cvt
  entry, rather than relying on a combination of codec_pcm_pars and
  the struct hda_pcm_stream.

* ELD-related workarounds were removed from hdmi_channel_allocation
  into hdmi_instrinsic in order to simplifiy infoframe calculations and
  remove HW dependencies.

* Various functions only apply to a single pin, since there is now
  only 1 pin per PCM. For example, hdmi_setup_infoframe,
  hdmi_setup_stream.

* hdmi_add_pin and hdmi_add_cvt are more oriented at pure codec parsing
  and data retrieval, rather than determining which pins/converters
  are to be used for creating PCMs.

This is quite a large change; it may be appropriate to simply read the
result of the patch rather than the diffs. Some small parts of the change
might be separable into different patches, but I think the bulk of the
change will probably always be one large patch. Hopefully the change
isn't too opaque!

This has been tested on:

* NVIDIA GeForce 400 series discrete graphics card. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM
  audio to a PC monitor that supports audio.

* NVIDIA GeForce 520 discrete graphics card. This model is the new
  1 codec n converters m pins m>n model. Tested stereo PCM audio to a
  PC monitor that supports audio.

* NVIDIA GeForce 400 series laptop graphics chip. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM,
  multi-channel PCM, and AC3 pass-through to an AV receiver.

* Intel Ibex Peak laptop. This model is the new 1 codec n converters m
  pins m>n model. Tested stereo PCM, multi-channel PCM, and AC3 pass-
  through to an AV receiver.

Note that I'm not familiar at all with AC3 pass-through. Hence, I may
not have covered all possible mechanisms that are applicable here. I do
know that my receiver definitely received AC3, not decoded PCM. I tested
with mplayer's "-afm hwac3" and/or "-af lavcac3enc" options, and alsa a
WAV file that I believe has AC3 content rather than PCM.

I also tested:
* Play a stream
* Mute while playing
* Stop stream
* Play some other streams to re-assign the converter to a different
  pin, PCM, set of SPDIF controls, ... hence hopefully triggering
  cleanup for the original PCM.
* Unmute original stream while not playing
* Play a stream on the original pin/PCM.

This was to test SPDIF control virtualization.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:14 +02:00
Stephen Warren 2def8172c6 ALSA: hda: hdmi_eld_update_pcm_info: update a stream in place
A future change won't store an entire hda_pcm_stream just to represent
the capabilities of a codec; a custom data-structure will be used. To
ease that transition, modify hdmi_eld_update_pcm_info to expect the
hda_pcm_stream to be pre-initialized with the codec's capabilities, and
to update those capabilities in-place based on the ELD.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:09 +02:00
Stephen Warren 3aaf898025 ALSA: hda: Separate generic and non-generic implementations
A future change will significantly rework the generic implementation
in order to support codecs with a different number of pins and
converters. Isolate the more custom codec variants from this change by
duplicating the small portions of generic code they share. This
simplifies the later rework of that previously shared code, since we
don't have to consider the more custom codecs, and also prevents
support for those codecs from regressing.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:05 +02:00
Stephen Warren 74b654c957 ALSA: hda: Virtualize SPDIF out controls
The SPDIF output controls apply to converter widgets. A future change
will create a PCM device per pin widget, and hence a set of SPDIF output
controls per pin widget, for certain HDMI codecs. To support this, we
need the ability to virtualize the SPDIF output controls. Specifically:

* Controls can be "unassigned" from real hardware when a converter is
  not used for the PCM the control was created for.
* Control puts only write to hardware when they are assigned.
* Controls can be "assigned" to real hardware when a converter is picked
  to support output for a particular PCM.
* When a converter is assigned, the hardware is updated to the cached
  configuration.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:51:59 +02:00
Stephen Warren 7c93597627 ALSA: hda: Allow multple SPDIF controls per codec
Currently, the data that backs the kcontrols created by
snd_hda_create_spdif_out_ctls is stored directly in struct hda_codec. When
multiple sets of these controls are stored, they will all manipulate the
same data, causing confusion. Instead, store an array of this data, one
copy per converter, to isolate the controls.

This patch would cause a behavioural change in the case where
snd_hda_create_spdif_out_ctls was called multiple times for a single codec.
As best I can tell, this is never the case for any codec.

This will be relevant at least for some HDMI audio codecs, such as the
NVIDIA GeForce 520 and Intel Ibex Peak. A future change will modify the
driver's handling of those codecs to create multiple PCMs per codec. Note
that this issue isn't affected by whether one creates a PCM-per-converter
or PCM-per-pin; there are multiple of both within a single codec in both
of those codecs.

Note that those codecs don't currently create multiple PCMs for the codec
due to the default HW mux state of all pins being to point at the same
converter, hence there is only a single converter routed to any pin, and
hence only a single PCM.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:48:59 +02:00
Stephen Warren c3d5210575 ALSA: hda: Gate ELD usage only by whether ELD is valid
It's perfectly valid for an ELD to contain no SADs. This simply means that
only basic audio is supoprted.

In this case, we still want to limit a PCM's capabilities based on the ELD.

History:

* Originally, ELD application was limited solely by sad_count>0, which
  was used to check that an ELD had been read.
* Later, eld_valid was added to the conditions to satisfy.

This change removes the original sad_count>0 check, which when squashed
with the above two changes ends up replacing if (sad_count) with
if (eld_valid).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:48:45 +02:00
Joe Perches d50a2fb636 ALSA: asihpi: Use angle brackets for system includes
Use the normal include style.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 11:46:37 +02:00
Dan Carpenter 9676001559 ALSA: fm801: add error handling if auto-detect fails
In the original code if auto detect failed and tea575x_tuner == 4
then we copy bogus information to chip->tea.card.  I've changed the
autodetect code to cleanup and return -ENODEV on error instead.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 10:11:17 +02:00
Raymond Yau a01ef051d5 ALSA: hda - Check pin support EAPD in ad198x_power_eapd_write
Check whether the pin supports EAPD in ad198x_power_eapd_write.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 10:08:46 +02:00
Takashi Iwai 4dffbe03d1 ALSA: hda - Fix HP and Front pins of ad1988/ad1989 in ad198x_power_eapd()
In ad198x_power_eapd(), wrong pin NIDs are used for controlling EAPD for
HP and Front outputs of AD1988/AD1989.  These are actually same with the
ones for AD1984 & co, port-A is 0x11 and port-D 0x12.

Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 10:05:02 +02:00
Linus Torvalds 46f2cc8051 ALSA: fix hda AZX_DCAPS_NO_TCSEL quirk check in driver_caps
Commit 9477c58e33 ("ALSA: hda - Reorganize controller quriks with bit
flags") changed the driver type compares into various quirk bits.
However, the check for AZX_DCAPS_NO_TCSEL got reverted: instead of
clearing TCSEL for chipsets that have that standard capability, it
cleared then when the NO_TCSEL bit was set.

This can lead to noise and repeated sounds - a weird "echo" behavior.
As the comment just above says: "Ensuring these bits are 0 clears
playback static on some HD Audio codecs".  Which is definitely true at
least on my Core i5 Westmere system.

Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-27 19:45:28 -07:00
Takashi Iwai 9477c58e33 ALSA: hda - Reorganize controller quriks with bit flags
Introduce bit-flags indicating the necessary controller quirks, and
set them in pci driver_data field.  This simplifies the checks in the
driver code and avoids the pci-id lookup in different places.

Also, this patch adds the PCI ID entry for AMD Hudson.  AMD Hudson
requires a similar workaround like ATI SB while other generic ATI and
AMD controllers don't need but some ATI-HDMI quirks.  So, we need a
different entry for Hudson.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-26 14:43:07 +02:00
Takashi Iwai 0b6267376d ALSA: hda - Use snd_printd() in snd_hda_parse_pin_def_config()
Fixed the wrong usage of snd_printdd() for debug prints of input
entries.  It should be snd_printd() like others.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-26 14:10:44 +02:00
Stephen Warren 739266566a ALSA: HDA: Increase MAX_HDMI_PINS
The recently introduced NVIDIA GeForce GT 520 has 4 pins within a single
codec. Bump MAX_HDMI_PINS to accomodate this. Also bump MAX_HDMI_CVTS
to match it; this might be needed later too.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-26 08:17:59 +02:00
Takashi Iwai af4ccf4f86 ALSA: hda - Use model=auto for Lenovo G555
The new auto-parser fixes problems on Lenovo G555.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-25 07:33:20 +02:00
Stephen Warren 5d44f927a5 ALSA: HDA: Unify HDMI hotplug handling.
This change unifies the initial handling of a pin's state with the code to
update a pin's state after a hotplug (unsolicited response) event. The
initial probing, and all updates, are now routed through hdmi_present_sense.

The stored PD and ELDV status is now always derived from GetPinSense verb
execution, and not from the data in the unsolicited response. This means:

a) The WAR for NVIDIA codec's UR.PD values ("old_pin_detect") can be
   removed, since this only affected the no-longer-used unsolicited
   response payload.

b) In turn, this means that most NVIDIA codecs can simply use
   patch_generic_hdmi instead of having a custom variant just to set
   old_pin_detect.

c) When PD && ELDV becomes true, no extra verbs are executed, because the
   GetPinSense that was previously executed by snd_hdmi_get_eld (really,
   hdmi_eld_valid) has simply moved into hdmi_present_sense.

d) When PD && ELDV becomes false, there is a single extra GetPinSense verb
   executed for codecs where old_pin_detect wasn't set, i.e. some NVIDIA,
   and all ATI/AMD and Intel codecs. I doubt this will be a performance
   issue.

The new unified code in hdmi_present_sense also ensures that eld->eld_valid
is not set unless eld->monitor_present is also set. This protects against
potential invalid combinations of PD and ELDV received from HW, and
transitively from a graphics driver.

Also, print the derived PD/ELDV bits from hdmi_present_sense so the kernel
log always displays the actual state stored, which will differ from the
values in the unsolicited response for NVIDIA HW where old_pin_detect was
previously set.

Finally, a couple of small tweaks originally by Takashi:

* Clear the ELD content to zero before reading it, so that if it's not
  read (i.e. when !(PD && ELDV)) it's in a known state.

* Don't show ELD fields in /proc ELD files when the ELD isn't valid.

The only possibility I can see for regression here is a codec where the
GetPinSense verb returns incorrect data. However, we're already exposed
to that, since that data is used (a) from hdmi_add_pin to set up the
initial pin state, and (b) within snd_hda_input_jack_report to query
a pin's presence value. As such, I don't believe any HW has bugs here.

Includes-changes-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-25 07:31:32 +02:00
Tony Vroon 4e60b4f830 ALSA: hda - Force AD1988_6STACK_DIG for Asus M3N-HT Deluxe
The microphone input on the back panel (pink connector)
stopped operating correctly after an upgrade from
2.6.35 to 2.6.38; the actual problem manifests itself
as a lack of microphone bias voltage (VREF_HIZ) on
node 0x17.
With AD1988_6STACK_DIG the maximum bias voltage (VREF_80)
is applied and the headset operates correctly.

Signed-off-by: Tony Vroon <tony@linx.net>
Tested-by: Doug Redlich <pbrigade@nxltech.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-25 07:30:39 +02:00
Takashi Iwai e2df82ffb8 ALSA: hda - Fix speaker auto-mute in Cxt auto-parser
Fix some logic failures in auto-mute handling in Conexant auto-parser.
Also, modify codes to be a bit more understandable.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-24 12:15:53 +02:00
Takashi Iwai 313d2c0652 ALSA: hda - Fix initial capture-source with auto-mic for Cxt auto-parser
Fix the initialization of capture-source route when auto-mic is enabled
for Conexant auto-parser.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-23 20:27:02 +02:00
Takashi Iwai 506a4196d4 ALSA: hda - Fix auto-mic detection in Conexant codec-parser
Fix the auto-mic detection for Cxt auto-parser due to off-by-one
missing initialization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-23 20:07:15 +02:00
David Henningsson d2859fd492 ALSA: HDA: Add quirk for Lenovo U350
Add model=asus quirk for Lenovo Ideapad U350 to make internal mic
work correctly.

Cc: stable@kernel.org (2.6.38+)
BugLink: http://bugs.launchpad.net/bugs/751681
Reported-by: Kent Baxley <kent.baxley@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-23 08:56:23 +02:00