aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cirrus.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-08ALSA: hda - Move BIOS pin-parser code to hda_auto_parser.cTakashi Iwai1-0/+1
Just code shuffles. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-20ALSA: hda - Add snd_hda_get_default_vref() helper functionTakashi Iwai1-6/+2
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 Iwai1-14/+7
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 Iwai1-2/+2
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 Reid1-2/+4
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 Lal1-0/+9
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 Henningsson1-35/+70
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 Henningsson1-8/+6
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>
2012-01-08ALSA: HDA: Fix master control for Cirrus Logic 421XDavid Henningsson1-12/+1
The control name "HP/Speakers" is non-standard, and since there is only one DAC on this chip there is no need for a virtual master anyway. Cc: stable@kernel.org Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-20Merge branch 'test/hda-jack' into topic/hdaTakashi Iwai1-16/+34
Conflicts: sound/pci/hda/patch_hdmi.c sound/pci/hda/patch_via.c
2011-11-27ALSA: hda - cut and paste typo in cs420x_models[]Dan Carpenter1-1/+1
The CS420X_IMAC27 was copied from the line before but CS420X_APPLE was clearly intented. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-23ALSA: hda - Fix invalid pin and GPIO for Apple laptops with CS codecsTakashi Iwai1-9/+23
The PCI SSID 8086:7270 is commonly used for multiple Apple machines, thus we can't use it as identifier for a unique model. Because of this conflict, some machines show weird behavior. For example, MacBook Air shows Front and Surround speakers although only Surround works due to the wrongly overridden pin-configuration for imac27. This patch fixes two things: - Stop the wrong pin-config override of imac27 by removing PCI SSID entry for avoiding the wrong mappings, - Add the generic GPIO setup for Apple machines by checking the codec SSID vendor bits Tested-by: Linus Torvalds <torvalds@linux-foundation.org> Tested-by: Dirk Hohndel <hohndel@infradead.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Fix the connection selection of ADCs on Cirrus codecsTakashi Iwai1-10/+13
spec->cur_adc isn't set until cs_capture_pcm_prepare() is called although the driver tries to select the connection at init time and at auto-mic switch. This results in the access to the widget NID 0, which is obviously invalid, also a wrong capture source. This patch fixes the issue by issuing the connect-select verb conditionally at appropriate places. Reported-and-tested-by: Dylan Reid <dgreid@chromium.org> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Give more unique names by snd_hda_get_pin_label()Takashi Iwai1-2/+3
The function now gives more unique names for the output pins by adding some prefix and suffix for the location and the channels. Otherwise, it can pass the index number. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Manage unsol tags in hda_jack.cTakashi Iwai1-6/+2
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-2/+25
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-10/+8
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-16ALSA: hda - Introduce snd_hda_get_pin_label()Takashi Iwai1-1/+1
Create a new helper function snd_hda_get_pin_label() for getting a label string for both input and output pins. hda_get_input_pin_label() is obsoleted by this function, and the callers are replaced appropriately now by this patch. 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-14ALSA: HDA: Cirrus - fix "Surround Speaker" volume control nameDavid Henningsson1-1/+1
This patch fixes "Surround Speaker Playback Volume" being cut off. (Commit b4dabfc452a10 was probably meant to fix this, but it fixed only the "Switch" name, not the "Volume" name.) Signed-off-by: David Henningsson <david.henningsson@canonical.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-08-20ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.cTakashi Iwai1-3/+5
snd_hda_get_conn_index() returns a negative value while the current code stores it in an unsigned int. It must be stored in a signed integer. Reported-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-26ALSA: hda - Cirrus Logic CS421x supportTim Howe1-34/+709
This update includes the changes necessary for supporting the CS421x family of codecs. Previously this file only supported the CS420x family of codecs. This file also contains init verbs to correct several issues in the CS421x hardware. Behavior between the CS421x and CS420x codec families is similar, so several functions have been reused with "if" statements to determine which codec family (CS421x or CS420x) is present. Also, this file will be updated sometime in the near future in order to add support for a system using CS421x that requires mono mix on the speaker output only. [Fix const usages and adaption for new APIs by tiwai] Signed-off-by: Tim Howe <tim.howe@cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-29ALSA: hda - Create snd_hda_get_conn_index() helper functionTakashi Iwai1-11/+5
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-06ALSA: hda: Virtualize SPDIF out controlsStephen Warren1-1/+2
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-05-17ALSA: hda - Check unsol-cap in is_jack_detectalbe()Takashi Iwai1-1/+1
Also replace more open-codes with this function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-17ALSA: hda - Use get_wcaps_type()Takashi Iwai1-2/+1
Replace the open-code with get_wcaps_type() macro. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-17ALSA: hda - Use is_jack_detectable() helperTakashi Iwai1-5/+4
Replaced the open-code with the new helper function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02ALSA: hda - Constify fixup and other array data in patch_cirrus.cTakashi Iwai1-19/+19
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-03ALSA: hda - Don't set to D3 in Cirrus errata init verbsTakashi Iwai1-0/+2
The errata init verbs for CS42xx codecs contain the verbs to set the power-state of SPDIF nodes to D3, which seem to break the SPDIF output on some MacBooks. Since this is executed during the power-up initialization, we shouldn't turn them down there. Reported-by: Arun Raghavan <arun.raghavan@collabora.co.uk> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-18ALSA: hda - consitify string arraysTakashi Iwai1-2/+2
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-03ALSA: hda - MacBookAir3,1(3,2) alsa supportEdgar (gimli) Hucek1-0/+1
This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the alsa sound system. Signed-off-by: Edgar (gimli) Hucek <gimli@dark-green.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-11ALSA: hda - Add input volume control for each mic/line-in pinTakashi Iwai1-0/+27
The input pins on cirrus codecs have also input amps. Let's make control elemetns for them. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-11ALSA: hda - Add model=mbp55 entry for MacBookPro 7,1Takashi Iwai1-0/+1
Reference: Novell bnc#645066 https://bugzilla.novell.com/show_bug.cgi?id=645066 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-23ALSA: hda - MacBookPro 5,3 line-in supportVince Weaver1-1/+21
I've found the following patch is necessary to enable line-in on my MacBookPro 5,3 machine. With the patch applied I've successfully recorded audio from the line-in jack. This is based on the existing 5,5 support. Signed-off-by: Vince Weaver <vweaver1@eecs.utk.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-17ALSA: hda - Make snd_hda_get_input_pin_attr() helperTakashi Iwai1-1/+1
Make the helper function to give the input-pin attribute for jack connectivity and location. This simplifies checks of input-pin jacks a bit in some places. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Improve the input source name labelsTakashi Iwai1-1/+3
This patch improves the input-source label strings to be generated from the pin information instead of fixed strings per AUTO_PIN_* type. This gives more suitable labels, especially for mic and line-in pins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Remove AUTO_PIN_FRONT_{MIC|LINE}Takashi Iwai1-3/+3
We can assign multiple pins to a single role now, let's reduce the redundant FRONT_MIC and FRONT_LINE. Also, autocfg->input_pins[] is no longer used, so this is removed as well. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-08Merge branch 'fix/hda' into topic/hdaTakashi Iwai1-0/+50
2010-09-08ALSA: hda - Add errata initverb sequence for CS42xx codecsBrian Austin1-0/+50
Add init verb sequence for errata ER880C3 http://www.cirrus.com/en/pubs/errata/ER880C3.pdf Signed-off-by: Brian Austin <brian.austin@cirrus.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-30ALSA: hda - Use new inputs[] field to parse input-pins for CirrusLogic codecsTakashi Iwai1-21/+17
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-13ALSA: hda - Fix dynamic ADC change working againTakashi Iwai1-1/+1
The commit eb541337b7a43822fce7d0c9d967ee149b2d9a96 ALSA: hda - Make converter setups sticky changes the semantics of snd_hda_codec_cleanup_stream() not to clean up the stream at that moment but delay the action. This broke the codes expecting that the clean-up is done immediately, such as dynamic ADC changes in some codec drivers. This patch fixes the issue by introducing a lower helper, __snd_hda_codec_cleanup_stream(), to allow the immediate clean up. The original snd_hda_codec_cleanup_stream() is kept as is now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-05ALSA: hda - fix array indexing while creating inputs for Cirrus codecsBrian J. Tarricone1-1/+1
This fixes a problem where cards show up as only having a single mixer element, suppressing all sound output. Signed-off-by: Brian J. Tarricone <brian@tarricone.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-23ALSA: hda - Fix NID association for capture mixersTakashi Iwai1-4/+8
Fix the wrong implementation of NID <-> kctl mapping for capture mixers introduced by the ocmmit 5b0cb1d850c26893b1468b3a519433a1b7a176be. So far, the driver returns an error at probe. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-23Merge branch 'fix/hda' into topic/hdaTakashi Iwai1-1/+21
2009-12-22ALSA: hda - Add support for the new 27 inch IMacsRafael Avila de Espindola1-1/+21
With the attached patch I am able to use the sound on a new IMac 27. What works: *) Internal speakers *) Internal microphone *) Headphone I don't have an external mic or a SPDIF device to test the rest. Signed-off-by: Rafael Avila de Espindola <rafael.espindola@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-15ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAGJaroslav Kysela1-2/+2
The HDA_SUBDEV_NID_FLAG is duplicate for amplifier control elements. Move get_amp_nid_() call to the snd_hda_ctl_add() function. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-15ALSA: hda - introduce HDA_SUBDEV_AMP_FLAG (ControlAmp in proc)Jaroslav Kysela1-0/+2
The purpose of this changeset is to show information about amplifier setting in the codec proc file. Something like: Control: name="Front Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Front Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=In, idx=2, ofs=0 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-15ALSA: hda - add more NID->Control mappingJaroslav Kysela1-0/+4
This set of changes add missing NID values to some static control elemenents. Also, it handles all "Capture Source" or "Input Source" controls. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-09Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits) tree-wide: fix misspelling of "definition" in comments reiserfs: fix misspelling of "journaled" doc: Fix a typo in slub.txt. inotify: remove superfluous return code check hdlc: spelling fix in find_pvc() comment doc: fix regulator docs cut-and-pasteism mtd: Fix comment in Kconfig doc: Fix IRQ chip docs tree-wide: fix assorted typos all over the place drivers/ata/libata-sff.c: comment spelling fixes fix typos/grammos in Documentation/edac.txt sysctl: add missing comments fs/debugfs/inode.c: fix comment typos sgivwfb: Make use of ARRAY_SIZE. sky2: fix sky2_link_down copy/paste comment error tree-wide: fix typos "couter" -> "counter" tree-wide: fix typos "offest" -> "offset" fix kerneldoc for set_irq_msi() spidev: fix double "of of" in comment comment typo fix: sybsystem -> subsystem ...
2009-11-18ALSA: hda - introduce snd_hda_jack_detect() and snd_hda_pin_sense()Wu Fengguang1-14/+5
This helps merge duplicate code. v2: add snd_hda_jack_detect() and comments recommended by Takashi. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>