aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_auto_parser.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-10-29ALSA: hda - Fix possible NULL dereference in snd_hda_get_pin_label()Takashi Iwai1-1/+1
Fix a possible NULL access of indexp in fill_audio_out_name() called from snd_hda_get_pin_label(). Spotted by coverity CID 402035. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-02ALSA: hda - Fix missing fixup for Mac Mini with STAC9221Takashi Iwai1-1/+1
A fixup for Apple Mac Mini was lost during the adaption to the generic parser because the fallback for the generic ID 8384:7680 was dropped, and it resulted in the silence output (and maybe other problems). Unfortunately, just adding the missing subsystem ID wasn't enough, in this case. The subsystem ID of this machine is 0000:0100 (what Apple thought...?), and since snd_hda_pick_fixup() doesn't take the vendor id zero into account, the driver ignored this entry. Now it's fixed to regard the vendor id zero as a valid value. Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: <stable@vger.kernel.org> [v3.9+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-11ALSA: hda - allow "Headphone Mic" parser flagDavid Henningsson1-12/+56
This allows a specific mic to get the "Headphone Mic" name, in addition to the existing "Headset Mic" name. Also, it allows for a special mark: if the sequence number is set to 0xc, that's an indication to prefer it for headset mic, and if it's set to 0xd, that's an indication to prefer it for headphone mic. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21ALSA: hda - Introduce "Headset Mic" nameDavid Henningsson1-2/+22
Headset mic jacks, i e TRRS style jacks with Headphone Left, Headphone Right, Mic and GND signals, are becoming increasingly common and are now being shipped by several manufacturers. Unfortunately, the HDA specification does not give us any hint of whether a Mic pin belongs to such a jack or not, but it would still be helpful for the user to know (especially if there is one TRS Mic jack and one TRRS headset jack). This new fixup causes the first (non-dock, non-internal) mic to be a headset mic jack. The algorithm can be later refined if needed. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-25ALSA: Make snd_printd() and snd_printdd() inlineTakashi Iwai1-2/+0
Because currently snd_printd() and snd_printdd() macros are expanded to empty when CONFIG_SND_DEBUG=n, a compile warning like below appears sometimes, and we had to covert it by ugly ifdefs: sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’: sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable] For "fixing" these issues better, this patch replaces snd_printd() and snd_printdd() definitions with empty inline functions instead of macros. This should have the same effect but shut up warnings like above. But since we had already put ifdefs, changing to inline functions would trigger compile errors. So, such ifdefs is removed in this patch. In addition, snd_pci_quirk name field is defined only when CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in snd_printdd() argument triggers the build errors, too. For avoiding these errors, introduce a new macro snd_pci_quirk_name() that is defined no matter how the debug option is set. Reported-by: Stratos Karafotis <stratosk@semaphore.gr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23ALSA: hda - Add chained_before flag to the fixup entryTakashi Iwai1-7/+11
Sometimes we want to call a fixup after applying other existing fixups, but currently the fixup chain mechanism allows only the call the others after the target fixup. This patch adds a new flag, chained_before, to struct hda_fixup, for allowing the chained call before the current execution. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18ALSA: hda - Don't add unnecessary indices on HDMI and SPDIFDavid Henningsson1-10/+16
If there's one each of HDMI and SPDIF, we should not add an index on the one that comes second. [slight code refactoring by tiwai] Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda - Check pincap while parsing the configurationTakashi Iwai1-0/+25
Sometimes (or rather often) BIOS sets the pin default configurations obviously wrongly. Looking through these failures, one common pattern is to enable some dead pins that are usually marked as speaker pins. In such a case, we can skip them if the pins don't have the output capability. In this patch, add a check for the valid pin cap bit for each parsed pin, and filter out when it's invalid. The fix was originally suggested by Raymond Yau. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Allow user to give hints for codec parser behaviorTakashi Iwai1-0/+3
Through the hints via sysfs or patch, user can set specific behavior flags for the generic parser now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Add a new fixup type to override pinctl valuesTakashi Iwai1-0/+15
Add a new fixup type, HDA_FIXUP_PINCTLS, for overriding the pinctl values of the given pins. It takes the same array of struct pintbl like HDA_FIXUP_PINS, but each entry contains the pinctl value instead of the pin default config value. This patch also replaces the corresponding codes in patch_realtek.c. Without this change, the direct call of verbs may be overridden again by the later call of pinctl restoration by the driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Return "Headphone Mic" from hda_get_autocfg_input_label()Takashi Iwai1-0/+2
Instead of handling special cases in the caller side, give a proper name string "Headphone Mic" from hda_get_autocfg_input_label() when the headhpone jack pin is specified as an input. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Handle BOTH jack port as a fixed outputTakashi Iwai1-1/+2
When the default config value shows the connection AC_JACK_PORT_BOTH, it's better to handle it as a speaker pin. This makes the behavior consistent in snd_hda_get_pin_label() and snd_hda_parse_pin_defcfg(). There are only few old machines showing this attribute, and all of them are actually fixed speaker pins, as far as I know. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Rearrange INPUT_PIN_ATTR_*Takashi Iwai1-1/+1
Put INPUT_PIN_ATTR_FRONT after INPUT_PIN_ATTR_REAR, and define INPUT_PIN_ATTR_LAST to point to the last element. This is a preliminary work for cleaning up Realtek auto-mic parser. In the auto-mic implementation, the front panel is preferred over the rear panel. By arranging the attr definitions like in this commit, we can simply use sort() for figuring out the priority order. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Move fixup code into struct hda_codecTakashi Iwai1-21/+18
Since the fixup code is used commonly, it's worth to move it to the common place, struct hda_codec, instead of keeping in hda_gen_spec. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-30ALSA: hda - Use standard sort function in hda_auto_parser.cTakashi Iwai1-59/+47
Just refactoring, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06ALSA: hda - avoid unneccesary indices on "Headphone Jack" controlsDavid Henningsson1-12/+37
In case there is one "Headphone Jack" and one "Dock Headphone Jack", one of them will get an index, even though that is not needed. This patch fixes that issue. BugLink: https://bugs.launchpad.net/bugs/1060729 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11ALSA: hda - Check bit mask for codec SSID in snd_hda_pick_fixup()Takashi Iwai1-1/+2
snd_hda_pick_fixup() didn't check the case where the device mask bits are set, typically used for SND_PCI_QUIRK_VENDOR() entries. Fix this. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-07ALSA: hda - Remove ignore_misc_bitDavid Henningsson1-4/+0
The purpose of this flag is unclear. If the problem is that some machines have broken misc/NO_PRESENCE bits, they should be fixed by pin fixups. In addition, this causes jack detection functionality to be flawed on the M31EI, where there are two jacks without jack detection (which is properly marked as NO_PRESENCE), but due to ignore_misc_bit, these jacks are instead being reported as being present but always unplugged. BugLink: https://bugs.launchpad.net/bugs/939161 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-07ALSA: hda - Fix ugly debug prints with CONFIG_SND_VERBOSE_PRINTK=yTakashi Iwai1-3/+2
When CONFIG_SND_VERBOSE_PRINTK=y is set, the debug print in hda_auto_parser.c looks really ugly like: ALSA sound/pci/hda/hda_auto_parser.c:331 mono: mono_out=0x0 ALSA sound/pci/hda/hda_auto_parser.c:334 dig-out=0x12/0x0 ALSA sound/pci/hda/hda_auto_parser.c:335 inputs: ALSA sound/pci/hda/hda_auto_parser.c:339 Mic=0x11ALSA sound/pci/hda/hda_auto_parser.c:339 Line=0x10 ALSA sound/pci/hda/hda_auto_parser.c:341 ALSA sound/pci/hda/hda_auto_parser.c:343 dig-in=0x13 Better to put one item at each line. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-18ALSA: hda - make sure alc268 does not OOPS on codec parseDavid Henningsson1-2/+2
A recent commit made patch_alc268 call snd_hda_pick_fixup with NULL quirk pointer. Make sure we do not reference that NULL pointer. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-26ALSA: hda - Fix memory leaks in Realtek & Conexant codec parsersTakashi Iwai1-1/+0
When moved to the helper code, forgot to release the verb arrays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08ALSA: hda - Move BIOS pin-parser code to hda_auto_parser.cTakashi Iwai1-0/+597
Just code shuffles. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08ALSA: hda - Move up the fixup helper functions to the library moduleTakashi Iwai1-0/+163
Move the fixup helper functions in patch_realtek.c to hda_auto_parser.c so that they can be used in other codec drivers like patch_conexant.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>