summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
AgeCommit message (Collapse)Author
2012-03-12ALSA: hda - Add a fake mute featureTakashi Iwai
commit 3868137ea41866773e75d9ac4b9988dcc361ff1d upstream. Some codecs don't supply the mute amp-capabilities although the lowest volume gives the mute. It'd be handy if the parser provides the mute mixers in such a case. This patch adds an extension amp-cap bit (which is used only in the driver) to represent the min volume = mute state. Also modified the amp cache code to support the fake mute feature when this bit is set but the real mute bit is unset. In addition, conexant cx5051 parser uses this new feature to implement the missing mute controls. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42825 Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13ALSA: HDA: Fix duplicated output to more than one codecDavid Henningsson
commit 54c2a89f60fd71b924d0f848ac892442951401a6 upstream. This typo caused the wrong codec's nid to be checked for wcaps type. As a result, sometimes speakers would duplicate the output sent to HDMI output. BugLink: https://bugs.launchpad.net/bugs/924320 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-11-21ALSA: hda - Don't add elements of other codecs to vmaster slaveTakashi Iwai
commit aeb4b88ec0a948efce8e3a23a8f964d3560a7308 upstream. When a virtual mater control is created, the driver looks for slave elements from the assigned card instance. But this may include the elements of other codecs when multiple codecs are on the same HD-audio bus. This works at the first time, but it'll give Oops when it's once freed and re-created via reconfig sysfs. This patch changes the element-look-up strategy to limit only to the mixer elements of the same codec. Reported-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-26ALSA: hda - Use snd_printd() in snd_hda_parse_pin_def_config()Takashi Iwai
Fixed the wrong usage of snd_printdd() for debug prints of input entries. It should be snd_printd() like others. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-19ALSA: HDA: Add jack detection for HDMIDavid Henningsson
Just as for headphones and microphone jacks, this patch adds reporting of HDMI jack status through the input layer. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02ALSA: hda - Constify some API function argumentsTakashi Iwai
Also fixed the assignment of multiout.dac_nids to satisfy const. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02ALSA: hda - Constify some API function argumentsTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2011-04-29ALSA: hda - Show the line-out type in snd_hda_parse_pin_def_config()Takashi Iwai
Helpful for debugging. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-26Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2011-04-21Merge branch 'fix/hda' into for-linusTakashi Iwai
2011-04-20ALSA: hda - Fix unused warnings when !SND_HDA_NEEDS_RESUMEMike Waychison
When SND_HDA_NEEDS_RESUME is not defined, the compiler identifies that the following symbols are static but not used: restore_shutup_pins hda_cleanup_all_streams Fix warnings by adding SND_HDA_NEEDS_RESUME guards. Signed-off-by: Mike Waychison <mikew@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-15ALSA: hda - sound/pci/hda/hda_codec.c: fix warningAndrew Morton
sound/pci/hda/hda_codec.c: In function 'snd_hda_get_connections': sound/pci/hda/hda_codec.c:332: warning: unused variable 'j' Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-07ALSA: hda - Remember connection listsTakashi Iwai
The connection lists are static and we can reuse the previous results instead of querying via verb at each time. This will reduce the I/O in the runtime especially for some codec auto-parsers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-03ALSA: hda - Make common input-jack helper functionsTakashi Iwai
Since multiple codec drivers already use the input-jack stuff, let's make common helper functions to reduce the duplicated codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-18ALSA: hda - consitify string arraysTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10ALSA: hda - Fix multi-headphone handling for Realtek codecsTakashi Iwai
When multiple headphone pins are defined without line-out pins, the driver takes them as primary outputs. But it forgot to set line_out_type to HP by assuming there is some rest of HP pins. This results in some mis-handling of these pins for Realtek codec parser. It takes as if these are pure line-out jacks. Signed-off-by: Takashi Iwai <tiwai@suse.de> Cc: <stable@kernel.org>
2010-12-23ALSA: hda - Try to find an empty control index when it's occupiedTakashi Iwai
When a mixer control element was already created with the given name, try to find another index for avoiding conflicts, instead of breaking with an error. This makes the driver more robust. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-25ALSA: hda - Disable sticky PCM stream assignment for AD codecsTakashi Iwai
The sticky PCM stream assignment introduced in 2.6.36 kernel seems causing problems on AD codecs. At some time later, the streaming no longer works by unknown reason. A simple workaround is to disable sticky-assignment for these codecs. Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-22ALSA: hda - Add workarounds for CT-IBG controllersTakashi Iwai
Creative IBG controllers require the playback stream-tags to be started from 1, instead of capture+1. Otherwise the stream stalls. Reported-by: Wai Yew CHAY <wychay@ctl.creative.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17ALSA: tlv - Define numbers in sound/tlv.hTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17ALSA: HDA: Sigmatel: work around incorrect master mutingClemens Ladisch
The HDA specification does not allow for a codec to mute itself just because the volume is reduced, so _of course_ somebody had to go and do it. This wouldn'\''t hurt too much when the volume is adjusted by hand, but programs like PA that try to set the volume automatically could inadvertently mute the output. To work around this, change the TLV dB information for the Master volume on all Sigmatel HDA codecs to indicate the the minimal volume setting actually mutes. Reported-by: Colin Guthrie <gmane@colin.guthr.ie> Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com> Tested-by: Colin Guthrie <cguthrie@mandriva.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-21ALSA: hda - Introduce hda_call_check_power_status() helperTakashi Iwai
Replace the explicit ifdef check and call of check_power_status ops with a new helper function, hda_call_check_power_status(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-17ALSA: hda - Make snd_hda_get_input_pin_attr() helperTakashi Iwai
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-17ALSA: hda - Fix mic attribute check for internal micsTakashi Iwai
Now Windows claims that the BIOS sets pins for internal mics to be BOTH connection instead of FIXED. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Sort input pins in snd_hda_parse_pin_def_config()Takashi Iwai
Sort inputs[] array in autocfg so that the codec parsers can filter out easily per input pin types. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Add comments to new helper functionsTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Reduce redundant mic location prefix in input source labelsTakashi Iwai
When the mic pins are assigned to the same location, we can omit the redundant location prefix like "Front" or "Rear". Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09ALSA: hda - Improve the input source name labelsTakashi Iwai
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 Iwai
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-09ALSA: hda - Keep char arrays in input_mux itemsTakashi Iwai
Keep char array in the input_mux item itself instead of pointing to an external string. This is a preliminary work for improving the input-mux name based on the pin role. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-08ALSA: hda - Clear left-over hp_pins in snd_hda_parse_pin_def_config()Takashi Iwai
In snd_hda_parse_def_config(), some unused values may remain in hp_pins[] array during the headphone-reassignment workaround. This patch clears the unused array members. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-08Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2010-09-08ALSA: hda - Fix wrong HP pin detection in snd_hda_parse_pin_def_config()Takashi Iwai
snd_hda_parse_pin_def_config() has some workaround for re-assigning some pins declared as headphones to line-outs. This didn't work properly for some cases because it used memmove() stupidly wrongly. Reference: Novell bnc#637263 https://bugzilla.novell.com/show_bug.cgi?id=637263 Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-30ALSA: hda - Add snd_hda_get_input_pin_label() helper functionTakashi Iwai
Added snd_hda_get_input_pin_label() helper function to return the string that can be used for control or capture-source ids. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-30ALSA: hda - Add inputs[] to auto_pin_cfg structTakashi Iwai
Added the new fields to contain all input-pins to struct auto_pin_cfg. Unlike the existing input_pins[], this array contains all input pins even if the multiple pins are assigned for a single role (i.e. two front mics). The former input_pins[] still remains for a while, but will be removed in near future. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-20ALSA: hda - Fix stream and channel-ids codec-bus wideTakashi Iwai
The new sticky PCM parameter introduced the delayed clean-ups of stream- and channel-id tags. In the current implementation, this check (adding dirty flag) and actual clean-ups are done only for the codec chip. However, with HD-audio architecture, multiple codecs can be on a single bus, and the controller assign stream- and channel-ids in the bus-wide. In this patch, the stream-id and channel-id are checked over all codecs connected to the corresponding bus. Together with it, the mutex is moved to struct hda_bus, as this becomes also bus-wide. Reported-and-tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-13ALSA: hda - Fix dynamic ADC change working againTakashi Iwai
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-08-06ALSA: hda - Make converter setups stickyTakashi Iwai
So far, we reset the converter setups like the stream-tag, the channel-id and format-id in prepare callbacks, and clear them in cleanup callbacks. This often causes a silence of the digital receiver for a couple of seconds. This patch tries to delay the converter setup changes as much as possible. The converter setups are cached and aren't reset as long as the same values are used. At suspend/resume, they are cleared to be recovered properly, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-05Merge branch 'topic/misc' into for-linusTakashi Iwai
2010-08-03ALSA: hda - Define AC_FMT_* constantsTakashi Iwai
Define constants for the HD-audio stream format bits, and replace the magic numbers in codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-03ALSA: hda - Set Stream Type in Stream Format according to AES0Anssi Hannula
Set bit 15 (Stream Type) of HDA Stream Format to 1 (Non-PCM) when IEC958 channel status bit 1 (AES0 & 0x02) is set to 1 (non-audio). This is a prequisite for HDMI HBR passthrough. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-30ALSA: hda - Make error messages more verboseTakashi Iwai
Add a prefix and more information for error messages regarding the connection-list in hda_codec.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-26ALSA: hda - Fix max amp cap calculation for IDT/STAC codecsTakashi Iwai
The commit afbd9b8448f4b7d15673c6858012f384f18d28b8 ALSA: hda - Limit the amp value to write introduced a regression for codec setups with amp offsets like IDT/STAC codecs. The limit value should be a raw value without offset calculation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-20ALSA: hda-intel - fix function_id rework (add missing bitmask)Jaroslav Kysela
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-19ALSA: hda-intel - do not mix audio and modem function IDsJaroslav Kysela
The function IDs are different for audio and modem. Do not mix them. Also, show the unsolicited bit in the function_id register. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-07-09Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2010-07-09ALSA: hda - Limit the amp value to writeTakashi Iwai
Check the amp max value at put callbacks and set the upper limit so that the driver won't write any invalid value over the defined range. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-09ALSA: hda - Restore cleared pin controls on resumeTakashi Iwai
Many codecs now clear the pin controls at suspend via snd_hda_shutup_pins() for reducing the click noise at power-off. But this leaves some pins uninitialized, and they'll be never recovered after resume. This patch adds the proper recovery of cleared pin controls on resume. Also it adds a check of bus->shutdown so that pins won't be cleared at module unloading. Reference: Kernel bug 16339 http://bugzilla.kernel.org/show_bug.cgi?id=16339 Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>