Commit Graph

253211 Commits

Author SHA1 Message Date
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
216c7a0f22 Merge branch 'fix/hda' into topic/via-cleanup
Conflicts:
	sound/pci/hda/patch_via.c
2011-06-21 07:34:45 +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
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
cf6f1ff17f ALSA: isight: adjust for new queueing API
Since commit 13882a82ee (optimize iso queueing by setting
wake only after the last packet), drivers are required to call
fw_iso_context_queue_flush() after queueing a batch of packets.
The missing call would have an effect only if the controller
queue underruns, but then the DMA would stop completely.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 11:37:29 +02:00
Torsten Schenk
0ec5258d68 ALSA: 6fire - Fix signedness bug
Fixed remaining issues of the signedness bug discovered by Dan Carpenter.
A check was remaining that tests if unsigned rt->rate is >= 0.
Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates)
as invalid rate value and not -1.

Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-16 21:31:33 +02:00