summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_via.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-16ALSA: hda - Manage unsol tags in hda_jack.cTakashi Iwai1-2/+1
Manage the tags assigned for unsolicited events dynamically together with the jack-detection routines. Basically this is almost same as what we've done in patch_sigmatel.c. Assign the new tag number for each new unsol event, associate with the given NID and the action type, etc. With this change, now all pins looked over in snd_hda_jack_add_kctls() are actually enabled for detection now even if the pins aren't used for jack-retasking by the driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Create jack-detection kcontrolsTakashi Iwai1-0/+7
Create kcontrols for pin jack-detections, which work similarly like jack-input layer. Each control will notify when the jack is plugged or unplugged, and also user can read the value at any time via the normal control API. The control elements are created with iface=CARD, so that they won't appear in the mixer apps. So far, only the pins that enabled the jack-detection are registered. For covering all pins, the transition of the common unsol-tag handling would be needed. Stay tuned. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Cache the jack-detection valueTakashi Iwai1-9/+10
Introduce a table containing the pins and their jack-detection states for avoiding the unnecessary verbs to check the pin status at each time. When the unsol event is enabled via snd_hda_jack_detect_enable(), it automatically adds the given NID to the table. Then the driver supposes that the codec driver will set the dirty flag appropariately when an unsolicited event is invoked for that pin. The behavior for reading other pins that aren't registered in the table doesn't change. Only the pins assigned to the table are cached, so far. In near futre, this table can be extended to use the central place for the unsolicited events of all pins, etc, and eventually include the jack-detect kcontrols that replace the current input-jack stuff. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-11-02ALSA: hda - Remove unused variablesTakashi Iwai1-5/+0
Just clean-up what GCC caught. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-31sound: Add module.h to the previously silent sound usersPaul Gortmaker1-0/+1
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up those users now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-28ALSA: hda:via - Skip creations of empty PCM streamsTakashi Iwai1-28/+40
If no analog I/O is defined, skip creating the corresponding PCM stream. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-05ALSA: hda - Fix a complile warning in patch_via.cWang Shaoyan1-1/+1
sound/pci/hda/patch_via.c:2087: warning: 'dac' may be used uninitialized in this function Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-26ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PMTakashi Iwai1-2/+2
It makes little sense to enable power-saving without PM. This removes SND_HDA_NEEDS_RESUME define so that we can use CONFIG_PM in all places. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-21ALSA: hda - Remove a superfluous argument of via_auto_init_output()Takashi Iwai1-14/+10
"force" argument is always true, so let's strip it off. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-21ALSA: hda - Fix indep-HP path (de-)activation for VT1708* codecsTakashi Iwai1-40/+52
This patch fixes non-working indep-HP control on VT1708* codecs. The problems are that via_independent_hp_put() wasn't fixed to follow the recent change of three HP paths, and hp_indep_path didn't contain the amp nids of mixer elements. Together with the fixes, a few code clean-ups are done. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-18ALSA: hda - Switch HP DAC dynamically with indep-HP switch for VIATakashi Iwai1-34/+125
This patch changes the behavior of independent-HP enum switch. Now instead of returning a busy error, the driver switches dynamically the stream of the HP (and shared) DACs according to the current mode. The logic is similar like the dual-mic ADC switch, but a bit more complicated because of the presence of shared DAC. Together with the change, a mutex is introduced to protect against the possible races for the indep-HP mode setting. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-18ALSA: hda - Implement dynamic loopback control for VIA codecsTakashi Iwai1-140/+260
This patch adds the dynamic control of analog-loopback for VIA codecs. When the loopback is enabled, the inputs from line-ins and mics are mixed with the front DAC, and sent to the front outputs. The very same input is routed to the headhpones and speakers in loopback mode. However, since the loopback mix can't take other than the front DAC, there is no longer individual volume controls for headphones and speakers. Once when the loopback control is off, these volumes take effect. Since the individual volumes are more desired in general use caess, the loopback mode is set to off as default for now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-12ALSA: hda - Expose secret DAC-AA connection of some VIA codecsTakashi Iwai1-6/+38
VT1718S and co have a secret connection from DAC to AA-mix, which doesn't appear in the connection list obtained from the h/w. Currently the driver fixes the connection index locally at init, but now we can expose it statically via snd_hda_override_connections() so that this conection can be checked better by the parser in future. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-11ALSA: hda - Preserve input pin-ctl bits in HP-automute for VIA codecTakashi Iwai1-3/+11
For smart51 pins, we need to preserve the input pin-control bits at auto-mute controls instead of overwriting zero or pin-out-only. Otherwise the VREF won't be set properly when smart51 is disabled again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-11ALSA: hda - Set line-out pin-ctls properly when indep-HP mode changesTakashi Iwai1-10/+11
When Independent-HP mode is changed for VIA, the driver needs to re-issue the auto-mute check so that the line-out pins are set properly without influence of HP pin state. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-11ALSA: hda - Via Fix speaker-mute checks in VIA driverTakashi Iwai1-4/+1
When the line-jack is plugged/unplugged, the driver must check also the headphone jack state in addition to the line-out jack. Currently it checks only the line-out state and ignores the headphone. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-08ALSA: hda - Fix output-path of VT1812 codecLydia Wang1-0/+1
For VT1812, add dac_mixer_idx for initialization. Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-08ALSA: hda - Fix Oops in smart51 parsing in VIA codecTakashi Iwai1-1/+1
Typical off-by-one thinko. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-08ALSA: hda - Fix Independent-HP detection on VT2002P/1802/1812 codecsLydia Wang1-0/+6
For VT2002P, VT1802 and VT1812 codecs, to create Independent HP control. Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-08ALSA: hda - Fix DAC checks for VT2002P/1802/1812 codecsLydia Wang1-3/+11
For VT2002P, VT1802 and VT1812 codecs, there're only two DACs. So smart51 control shouldn't be created. Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-08ALSA: hda - Fix VIA output-path init for VT2002P/1802/1812Lydia Wang1-37/+67
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>
2011-07-04ALSA: hda - Don't add aa-mix for VIA surroundsTakashi Iwai1-7/+16
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-04ALSA: hda - Create HP-vol control properly for VIA codecsTakashi Iwai1-3/+7
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-04ALSA: hda - Define some constants in patch_via.cTakashi Iwai1-4/+6
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-04ALSA: hda - Fix invalid multi-channel amplifiers for VT1718SLydia Wang1-5/+20
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-04ALSA: hda - Fix issue that front can't output sound for VT1718SLydia Wang1-0/+4
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-01ALSA: hda - Fix the silent front with independent-HP for VIA codecsLydia Wang1-0/+3
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-06-30ALSA: hda - Re-implementation of VIA Independent-HP sharing with side streamTakashi Iwai1-6/+37
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-29ALSA: hda - Fix jack-detection on non-VT1708 VIA codecsLydia Wang1-1/+2
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-29ALSA: hda - Create snd_hda_get_conn_index() helper functionTakashi Iwai1-36/+4
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-29ALSA: hda - Fix unsol event initializations for VIA codecsLydia Wang1-1/+1
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-22ALSA: hda - Implement dynamic-ADC switching for VIA codecsTakashi Iwai1-125/+391
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-21ALSA: hda - Auto-mute smart51 surround pins for VIA codecsTakashi Iwai1-23/+8
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-21ALSA: hda - Remove redundant VT1709 and VT1708B codesTakashi Iwai1-67/+19
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-21ALSA: hda - VT1708 independent HP routing fixTakashi Iwai1-100/+122
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-21ALSA: hda - Fix surround-volume parsing for VT1708B codecsTakashi Iwai1-3/+16
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-21ALSA: hda - Fix the check of loopback-mixer element index in patch_via.cTakashi Iwai1-2/+4
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-21ALSA: hda - Assign smart51 only in the same stack for VIA codecsTakashi Iwai1-33/+30
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-21ALSA: hda - Fix re-routing of HP-independent mode in patch_via.cTakashi Iwai1-41/+60
Re-route the whole output path when HP-independent mode is changed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-21ALSA: hda - Fix creations of playback volume controls in patch_via.cLydia Wang1-1/+1
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-21ALSA: hda - Revisit output_path parsing in patch_via.cTakashi Iwai1-37/+50
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-21ALSA: hda - Use xxx Boost Volume for VIATakashi Iwai1-1/+1
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-20ALSA: hda - Simplify analog-low-current mode check for VIA codecsTakashi Iwai1-82/+43
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-20ALSA: hda - Remove NID_MAPPING hacks in patch_via.cTakashi Iwai1-16/+0
There is no longer virtual kmixer element for NID mapping. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20ALSA: hda - Remove unused defines and struct fields in patch_via.cTakashi Iwai1-25/+0
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20ALSA: hda - Name the primary out as Speaker when needed for VIA codecsTakashi Iwai1-1/+5
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-20ALSA: hda - Create loopback-list dynamically in patch_via.cTakashi Iwai1-139/+25
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-20ALSA: hda - Fix smart51 handling againTakashi Iwai1-83/+64
Fix the broken detection of smart51 and its handling. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20ALSA: hda - Create virtual-master control for VIA codecsTakashi Iwai1-0/+42
Now let's add the missing Master control to VIA codecs. Signed-off-by: Takashi Iwai <tiwai@suse.de>