summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_cirrus.c
AgeCommit message (Collapse)Author
2015-05-29ALSA: hda - Set patch_ops before calling auto-parserTakashi Iwai
... so that the parser code can overwrite some optional ops. For Realtek and others, it can be set solely in the spec allocator, so it results in a good code cleanup, too. With this change, we can finally remove the local stream_pm setup and rely on the generic parser's automatic setting. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-16Merge branch 'topic/hda-bus' into for-nextTakashi Iwai
2015-03-12ALSA: hda - Add workaround for MacBook Air 5,2 built-in micTakashi Iwai
MacBook Air 5,2 has the same problem as MacBook Pro 8,1 where the built-in mic records only the right channel. Apply the same workaround as MBP8,1 to spread the mono channel via a Cirrus codec vendor-specific COEF setup. Reported-and-tested-by: Vasil Zlatanov <vasil.zlatanov@gmail.com> Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-12ALSA: hda - Set single_adc_amp flag for CS420x codecsTakashi Iwai
CS420x codecs seem to deal only the single amps of ADC nodes even though the nodes receive multiple inputs. This leads to the inconsistent amp value after S3/S4 resume, for example. The fix is just to set codec->single_adc_amp flag. Then the driver handles these ADC amps as if single connections. Reported-and-tested-by: Vasil Zlatanov <vasil.zlatanov@gmail.com> Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-23ALSA: hda - Bind codecs via standard busTakashi Iwai
Now we create the standard HD-audio bus (/sys/bus/hdaudio), and bind the codec driver with the codec device over there. This is the first step of the whole transition so that the changes to each codec driver are kept as minimal as possible. Each codec driver needs to register hda_codec_driver struct containing the currently existing preset via the new helper macro module_hda_codec_driver(). The old hda_codec_preset_list is replaced with this infrastructure. The generic parsers (for HDMI and other) are also included in the preset with the special IDs to bind uniquely. In HD-audio core side, the device binding code is split to hda_bind.c. It provides the snd_hda_bus_type implementation to match the codec driver with the given codec vendor ID. It also manages the module auto-loading by itself like before: when the matching isn't found, it tries to probe the corresponding codec modules, and finally falls back to the generic drivers. (The special ID mentioned above is set at this stage.) The only visible change to outside is that the hdaudio sysfs entry now appears in /sys/bus/devices, not as a sound class device. More works to move the suspend/resume and remove ops will be (hopefully) done in later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-16ALSA: hda - Allow multiple callbacks for jackTakashi Iwai
So far, hda_jack infrastructure allows only one callback per jack, and this makes things slightly complicated when a driver wants to assign multiple tasks to a jack, e.g. the standard auto-mute with a power up/down sequence. This can be simplified if the hda_jack accepts multiple callbacks. This patch is such an extension: the callback-specific part (the function and private_data) is split to another struct from hda_jack_tbl, and multiple such objects can be assigned to a single hda_jack_tbl entry. The new struct hda_jack_callback is passed to each callback function now, thus the patch became bigger than expected. But these changes are mostly trivial. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-11ALSA: hda - Get rid of action field from struct hda_jack_tblTakashi Iwai
The action value assigned to each hda_jack_tbl entry is mostly superfluous. The actually used values are either the widget NID or a value specific to the callback. The former case can be simply replaced by a reference to widget NID itself. The only place doing the latter is STAC/IDT codec driver for the powermap handling. But, the code doesn't need to check the action field at all -- the function jack_update_power() is called either with a specific pin or with NULL. So the check of jack->action can be removed completely there, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22ALSA: hda - Refactor quirk picking and change quirk priorityDavid Henningsson
Previously, calling one quirk function first and another later would make the latter one take priority, this is now changed to make the former take priority. By adding two special values for fixup_id we can also get rid of the fixup_forced flag. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-15ALSA: hda - Remove superfluous inclusion of linux/pci.hTakashi Iwai
Some codec drivers still have it since using PCI_VENDOR_ID_*. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11ALSA: hda - Control SPDIF out pin on MacBookPro 11,2Takashi Iwai
The SPDIF output MBP11,2 requires the pin control to be set/cleared for turning on/off the optical SPDIF. The red light turns off only when the corresponding pin control is cleared (or powered to D3). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-08ALSA: hda - Apply MacBook fixups for CS4208 correctlyTakashi Iwai
The commit [8fe7b65ab465: ALSA: hda - Apply GPIO setup for MacBooks with CS4208] added a fixup entry matching with the vendor id 0x106b. This broke the fixups for previous MBA6,1 and 6,2, since the PCI SSID vendor id matches before evaluating the codec SSIDs. We had a similar issue on Mac with Sigmatel codecs, and solve this problem again similarly, by introducing a skeleton entry matching with the all MacBooks, then remap to the right one. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401 Fixes: 8fe7b65ab465 ('ALSA: hda - Apply GPIO setup for MacBooks with CS4208') Cc: <stable@vger.kernel.org> [v3.12+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-06ALSA: hda - Apply GPIO setup for MacBooks with CS4208Takashi Iwai
Apply the existing GPIO0 fixup as default for MacBooks with CS4208 codec. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401 Cc: <stable@vger.kernel.org> [v3.12+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05ALSA: hda - Introduce the bitmask for excluding output volumeTakashi Iwai
Add a bitmask to hda_gen_spec indicating NIDs to exclude from the possible volume controls. That is, when the bit is set, the NID corresponding to the bit won't be picked as an output volume control any longer. Basically this is just a band-aid for working around the issue found with CS4208 codec, where only the headphone pin has a volume AMP with different dB steps. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811 Cc: <stable@vger.kernel.org> [v3.12+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-27ALSA: hda - Add fixup for MacBook Air 6,1 and 6,2 with CS4208 codecBen Whitten
This patch adds the default pin configuration and some init verbs for setting COEFs, in addition to the correction of input pin AMP caps for MacBook Air 6,1 and 6,2. With these changes, the headphone jack detection starts working properly. [trivial space fixes by tiwai] Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811 Signed-off-by: Ben Whitten <benwhitten@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-09ALSA: hda - Add CS4208 codec support for MacBook 6,1 and 6,2Takashi Iwai
MacBook 6,1 and 6,2 have a CS4208 codec instead of CS4206/CS4207 on the former models. Most of functions work fine as is, except for the silent speaker output. After debugging sessions, it turned out that the machine needs to set GPIO 0 for the speaker amp. This patch adds the basic support for CS4208 and the fixup for these MacBooks. Basically the codec works just with the generic parser. For re-using the existing GPIO amp code and init/free callbacks, a few places have been changed so that CS4206/4207-specific codes (errata, etc) won't hit with CS4208. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811 Reported-and-tested-by: Imre Kaloz <kaloz@openwrt.org> Reported-and-tested-by: Ian Munsie <darkstarsword@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-17ALSA: hda - Fix pin configurations for MacBook Air 4,2Takashi Iwai
MacBook Air 4,2 requires the whole default pin configuration table to be overridden by the driver, as usual, as Apple's machines don't set up properly after boot. Otherwise mic won't work, and other ill effect may happen. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59381 Reported-and-tested-by: Peter John Hartman <peterjohnhartman@gmail.com> Cc: <stable@vger.kernel.org> [v3.9+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05ALSA: hda/cirrus - Add a quirk for Stumpy ChromeBox.Dylan Reid
The Stumpy ChromeBox needs its pin configs fixed up. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driverTakashi Iwai
I forgot to update spec->gpio_data in the automute hook, so it will be overridden at the init sequence, thus the machine is still silent when no headphone jack is plugged at boot time. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecsTakashi Iwai
During the transition to the generic parser, the hook to the codec specific automute function was forgotten. This resulted in the silent output on some MacBooks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-21ALSA: hda - Remove superfluous header inclusionsTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Use generic parser for Cirrus codec driverTakashi Iwai
This time, the target is Cirrus codec. Its parser is a subset of generic parser, so we can migrate fully with it now. The only tricky part is the handling of SPDIF automute. Cirrus driver sets the SPDIF out plug over the headphone. As a workaround, set spec->gen.master_mute for toggling the headphone (and other) mute. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12ALSA: hda - Move fixup code into struct hda_codecTakashi Iwai
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-23ALSA: hda - Add a fixup for internal mic on MacBook Pro 8,1Takashi Iwai
The internal mic on MBP81 gives only the right channel, and the left channel is static. Add a verb to fix the ADC2 channel mode to expand mono right to stereo. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50781 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-23ALSA: hda - Add missing verb applications in patch_cirrus.cTakashi Iwai
We forgot to apply the fixup verbs in cs_init(). But adding the fixup verbs will break mbp101 fixup that has been fixed recently again, since the mbp101 fixup contains the wrong verbs to override. So these bogus verbs must be removed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-23ALSA: hda - Move static ADC setup for CS4206 to init verbsTakashi Iwai
It's constant, so better to be put in the static init array. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-22Merge branch 'for-linus' into for-nextTakashi Iwai
2012-11-21ALSA: hda - Cirrus: Correctly clear line_out_pins when moving to speakerDavid Henningsson
If this array is not cleared, the jack related code later might fail to create "Internal Speaker Phantom Jack" on Dell Inspiron 3420 and Dell Vostro 2420. BugLink: https://bugs.launchpad.net/bugs/1076840 Cc: stable@vger.kernel.org (3.6+) Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08ALSA: hda - Apply a proper chmap for built-in 2.1 speakersTakashi Iwai
When 2.1 speakers are detected, use the corresponding channel map instead of the standard map with front+rear surrounds. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08ALSA: hda - Give standard "Bass Speaker" mixer for 2.1 speakersTakashi Iwai
When two built-in speakers are found on the machine, we can suppose it's rather a 2.1 speaker system with a bass output instead of front/surround channels. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08Merge branch 'for-linus' into for-nextTakashi Iwai
2012-11-05ALSA: HDA: Mark CS260x immutable structures constDaniel J Blueman
Mark structures that won't change const. Signed-off-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: HDA: Fix digital microphone on CS420xDaniel J Blueman
Correctly enable the digital microphones with the right bits in the right coeffecient registers on Cirrus CS4206/7 codecs. It also prevents misconfiguring ADC1/2. This fixes the digital mic on the Macbook Pro 10,1/Retina. Based-on-patch-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Daniel J Blueman <daniel@quora.org> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-05ALSA: hda: Cirrus: Fix coefficient index for beep configurationAlexander Stein
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-17ALSA: hda - Add workaround for conflicting IEC958 controlsTakashi Iwai
When both an SPDIF and an HDMI device are created on the same card instance, multiple IEC958 controls are created with indices=0, 1, ... But the alsa-lib configuration can't know which index corresponds actually to which PCM device, and both the SPDIF and the HDMI configurations point to the first IEC958 control wrongly. This patch introduces a (hackish and ugly) workaround: the IEC958 controls for the SPDIF device are re-labeled with device=1 when HDMI coexists. The device=1 corresponds to the actual PCM device for SPDIF, so it's anyway a better representation. In future, HDMI controls should be moved with the corresponding PCM device number, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-10ALSA: hda/cirrus - Add missing init/free of hda_gen_specTakashi Iwai
In the transition to the generic fixup code, the call of snd_hda_gen_init() and snd_hda_gen_free() was missing. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-10ALSA: hda - Fix memory leaks at error path in patch_cirrus.cTakashi Iwai
The proper destructor should be called at the error path. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-08ALSA: hda - make Cirrus codec use generic unsol event handlerDavid Henningsson
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13ALSA: hda - Fix disordered enum definitions in patch_cirrus.cTakashi Iwai
Due to the definitions of CS420X_IMAC27_122 and CS420X_APPLE as aliases, the rest enums are set to duplicated values unexpectedly. Move the alias definitions at the end so that the enum values are defined in the proper order. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11ALSA: hda - Add support for MacBook Pro 10,1Takashi Iwai
MacBook Pro 10,1 needs a few adjustments to make it working: - more COEF verbs - some pin config overrides to disable the unused pin (0x0d, 0x12), and fix the internal mic (0x0e) In addition, it uses GPIO 1 and 3 like other MacBooks. The internal digital mic on the machine is still problematic: it seems that only the right channel is used and the left is always static. This looks like a hardware design, so we need to cope in the software side somehow... The primary information and test were brought from Daniel J Blueman. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11ALSA: hda - Replace with the generic fixup codes in patch_cirrus.cTakashi Iwai
... to make easier to integrate into the common generic parser in near future. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.cTakashi Iwai
Instead of calling the jack sync in the init callback of each codec, call it generically at initialization and resume. By calling it at the last of resume sequence, a possible race between the jack sync and the unsol event enablement in the current code will be closed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03ALSA: Convert to new pm_ops for PCI driversTakashi Iwai
Straightforward conversion to the new pm_ops from the legacy suspend/resume ops. Since we change vx222, vx_core and vxpocket have to be converted, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08ALSA: hda - Move BIOS pin-parser code to hda_auto_parser.cTakashi Iwai
Just code shuffles. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-20ALSA: hda - Add snd_hda_get_default_vref() helper functionTakashi Iwai
Add a new helper function to guess the default VREF pin control bits for mic in. This can be used to set the pin control value safely matching with the actual pin capabilities. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-20ALSA: hda - Introduce snd_hda_set_pin_ctl*() helper functionsTakashi Iwai
For setting the pin-control values more safely to match with the actual pin capability bits, a copule of new helper functions, snd_hda_set_pin_ctl() and snd_hda_set_pin_ctl_cache(), are introduced. These are simple replacement of the codec verb write with AC_VERB_SET_PIN_WIDGET but do more sanity checks and filter out superfluous pin-control bits if they don't fit with the corresponding pin capabilities. Some codecs are screwed up or ignore the command when such a wrong bit is set. These helpers will avoid such secret errors. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-02ALSA: hda - Kill hyphenated namesTakashi Iwai
Kill hyphens from "Line-Out" name strings, as suggested by Mark Brown. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-01ALSA: hda - Fix calling cs_automic twice for Cirrus codecs.Dylan Reid
If cs_automic is called twice (like it is during init) while the mic is present, it will over-write the last_input with the new one, causing it to switch back to the automic input when the mic is unplugged. This leaves the driver in a state (cur_input, last_input, and automix_idx the same) where the internal mic can not be selected until it is rebooted without the mic attached. Check that the mic hasn't already been switched to before setting last_input. Signed-off-by: Dylan Reid <dgreid@chromium.org> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-09ALSA: hda/cirrus - support for iMac12,2 modelJérémy Lal
This early 2011 model just need to have headphones on GPI02 instead of GPI01, and use BIOS pincfgs. It is detected by codec SSID. The iMac12,1 model is known to work the same way, although maybe not with the same codec SSID. Signed-off-by: Jérémy Lal <kapouer@melix.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-08ALSA: HDA: Add support for Cirrus Logic 4213David Henningsson
The CS4213 chip is similar to the CS4210, but it does not have SPDIF capabilities. Also, it has fewer pins, and the vendor specific nid is different. With this patch, we have working inputs and outputs (and automute/autoswitch). However, we don't know anything about the vendor specific processing coefficients, so we don't read or write to that node in this patch. BugLink: https://bugs.launchpad.net/bugs/910792 Tested-by: Hsin-Yi Chen <hychen@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-08ALSA: HDA: Fix automute for Cirrus Logic 421xDavid Henningsson
There was a bug in the automute logic causing speakers not to mute when headphones were plugged in. Cc: stable@kernel.org Tested-by: Hsin-Yi Chen <hychen@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>