summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-16ALSA: hda - Add new GPU codec ID to snd-hdaAaron Plattner1-0/+2
Vendor ID 0x10de0060 is used by a yet-to-be-named GPU chip. Reviewed-by: Andy Ritger <aritger@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-25ALSA: hda/hdmi - poll eld at resume timeWang Xingchao1-0/+21
Hdmi driver may not receive intrinsic event from gfx side when it's in runtime suspend mode. There's no ELD info when exit from runtime suspend. This patch avoid missing ELD info. Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-24ALSA: hda - Remove unused variableWang Xingchao1-1/+0
Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-18ALSA: hda - Use snd_hda_check_power_state() in patch_hdmi.cTakashi Iwai1-6/+2
... instead of open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-18ALSA: hda - Avoid choose same converter for unused pinsWang Xingchao1-14/+75
For Intel Haswell HDMI codecs, the pins choose converter 0 by default. This would cause conflict when playing audio on unused pins,the pin with physical device connected would get audio data too. i.e. Pin 0/1/2 default choose converter 0, pin 1 has HDMI monitor connected. when play audio on Pin 0 or pin 2, pin 1 could get audio data too. This patch configure unused pins to choose different converter. Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-18ALSA: hda - Cache the MUX selection for generic HDMITakashi Iwai1-1/+1
When a selection to a converter MUX is changed in hdmi_pcm_open(), it should be cached so that the given connection can be restored properly at PM resume. We need just to replace the corresponding snd_hda_codec_write() call with snd_hda_codec_write_cache(). Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-18ALSA: hda - Haswell converter power state D0 verifyWang Xingchao1-2/+11
Haswell converters maybe in wrong power state before usage. i.e. only converter 0 is in D0, converter 1/2 are in D3. When pin choose converter 1/2, there's no audio output, this cause dependency when playing differnt stream on pins. AUD_PWRST ConvertorA_Widget_Power_State_Current D0 AUD_PWRST ConvertorA_Widget_Power_State_Requsted D0 AUD_PWRST ConvertorB_Widget_Power_State_Current D3 AUD_PWRST ConvertorB_Widget_Power_State_Requested D3 AUD_PWRST ConvC_Widget_PwrSt_Curr D3 AUD_PWRST ConvC_Widget_PwrSt_Req D3 This patch check converter's power state and set D0 if it's in D3 mode. Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-08ALSA: hda - Apply pin-enablement workaround to all Haswell HDMI codecsTakashi Iwai1-32/+22
This is a revised patch based on Mengdong Lin's fix patch, which is a supplement to a previous patch [1611a9c9: ALSA: hda - Add fixup for Haswell to enable all pin and convertor widgets]. Some Haswell BIOS will disable the 2nd and 3rd pin/covertor widgets when the HD-A controller changes state from D3 to D0. So when the controller resumes after a system or runtime suspend, these widgets are disabled and programming these widgets to D0 will cause H/W error and codec will not respond. In addition, we found out that some BIOS disables the pins at S3 although it shows up at boot. This confuses the driver utterly, and the hardware falls into the fatal communication error like the above. So in this patch, we apply intel_haswell_enable_all_pins() not only as a fixup to a certain device (with 8086:2010) but to all Haswell machines. The codec driver basically assumes that all pins are exposed, so it's anyway better to see them from the beginning. Even if all pins and converters are shown by this call, there should be no regression in practice: the pin default configurations are still kept, thus the disabled pins are handled as disabled by the driver properly. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-17ALSA: hda - fixup D3 pin and right channel mute on Haswell HDMI audioDavid Henningsson1-0/+38
When graphics initializes the HDMI chip, sometimes this leads to pins going into D3 and right channel being muted. If the audio driver finishes initialization before the graphic driver does, this situation becomes permanent. This is a workaround that checks for this situation and corrects it on playback prepare. It has been verified working on at least one machine. BugLink: https://bugs.launchpad.net/bugs/1167270 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-03Merge branch 'for-linus' into for-nextTakashi Iwai1-1/+1
Back-merge for cleaning up usb-audio code the recent commit modified, and further UAC2 autoclock patches.
2013-04-02ALSA: hda - bug fix on HDMI ELD debug messageMengdong Lin1-1/+1
This patch let ELD debug message show 'pin_eld->monitor_present' which reflects the real pin response to verb GET_PIN_SENSE. 'eld->monitor_present' should not be used here because 'eld' is a temp structure now and so its "monitor_present" is not set. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Acked-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13ALSA: hda - Allow unlimited pins and converters in patch_hdmi.cTakashi Iwai1-81/+117
Use the dynamic array allocations for pins, converters and PCM arrays instead of the fixed size arrays. The modern HDMI codecs get more and more pins, and we don't know the sensitive limit. Most of the patch are spent for the straight conversions from the fixed array access to snd_array helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-22ALSA: hda - hdmi: Make jacks phantom, if they're not detectableDavid Henningsson1-0/+3
Just as for analog codecs, a jack that isn't suitable for detection (in this case, NO_PRESENCE was set) should be a phantom Jack instead of a normal one. Thanks to Raymond Yau for spotting. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/961286 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=903869 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Notify userspace when ELD control changesDavid Henningsson1-2/+12
ELD validity can change during the lifetime of a presence detect, so we need to be able to listen for changes on the ELD control. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Protect ELD bufferDavid Henningsson1-12/+39
Because the eld buffer can be simultaneously accessed from both workqueue context (updating) and process context (kcontrol read), we need to protect it with a mutex to guarantee consistency. To avoid holding the mutex while reading the ELD info from the codec, we introduce a temporary eld buffer. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Refactor hdmi_eld into parsed_hdmi_eldDavid Henningsson1-9/+19
For better readability, the information that is parsed out of the ELD data is now put into a separate parsed_hdmi_eld struct. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Do not expose eld data when eld is invalidDavid Henningsson1-7/+18
Previously, it was possible to read the eld data of the previous monitor connected. This should not be allowed. Also refactor the function slightly. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: ELD shouldn't be valid after unplugDavid Henningsson1-0/+1
Currently, eld_valid is never set to false, except at kernel module load time. This patch makes sure that eld is no longer valid when the cable is (hot-)unplugged. Cc: stable@kernel.org Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08ALSA: hda - Yet another fix for broken HSW HDMI pin connectionsTakashi Iwai1-19/+37
A Haswell test machine showed that the invalid connection list, but this time it has only a single pin on the codec, thus the former fixup code doesn't work as it assumes the three pins blindly. This patch splits the former fixup code to two parts: - Enable eDP 1.2 for Haswell codec - Fix the connection list of pins on Haswell codec; the converter list is recorded dynamically in hdmi_add_cvt(), and applied in hdmi_add_pin() Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08ALSA: hda - Add fixup for Haswell to enable all pin and convertor widgetsMengdong Lin1-0/+54
Some Haswell machines support more than one display outputs (HDMI or DP), but its BIOS may not enable the codec's 2nd and 3rd pin and output cvt widgets. This patch implements a board-specific fixup for Intel Haswell Machines: If the hidden pins are not enabled by BIOS, the driver will enable them and call common code to update the codec tree. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07ALSA: hda - Remove limit of widget connectionsTakashi Iwai1-0/+3
Currently we set the max number of connections to be 32, but there seems codec that gives longer connection lists like AD1988, and we see errors in proc output and else. (Though, in the case of AD1988, it's a list of all codecs connected to a single vendor widget, so this must be something fishy, but it's still valid from the h/w design POV.) This patch tries to remove this restriction. For efficiency, we still use the fixed size array in the parser, but takes a dynamic array when the size is reported to be greater than that. Now the fixed array size is found only in patch_hdmi.c, but it should be fine, as the codec itself can't support so many pins. Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-05Merge branch 'for-linus' into for-nextTakashi Iwai1-4/+7
Merge pending fixes that haven't pulled into 3.8.
2013-02-04ALSA: hda - Fix default multichannel HDMI mapping regressionAnssi Hannula1-4/+7
Commit d45e6889ee69456a4d5b1bbb32252f460cd48fa9 ("ALSA: hda - Provide the proper channel mapping for generic HDMI driver") added support for custom channel maps in the HDA HDMI driver. Due to a mistake in an 'if' condition the custom map is always used even when no such map has been set. This causes incorrect channel mapping for multichannel audio by default. Pass per_pin->chmap_set to hdmi_setup_channel_mapping() as a parameter so that it can use it for detecting if a custom map has been set instead of checking if map is NULL (which is never the case). Reported-by: Staffan Lindberg <pike@xbmc.org> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-01ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open()Takashi Iwai1-1/+5
If the driver detects and invalid ELD, it gives an open error. But it forgot to release the assigned pin, converter and spdif ctls before returning. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-15ALSA: hda/hdmi - Work around "alsactl restore" errorsTakashi Iwai1-1/+1
When "alsactl restore" is performed on HDMI codecs, it tries to restore the channel map value since the channel map controls are writable. But hdmi_chmap_ctl_put() returns -EBADFD when no PCM stream is assigned yet, and this results in an error message from alsactl. Although the error is harmless, it's certainly ugly and can be regarded as a regression. As a workaround, this patch changes the return code in such a case to be zero for making others happy. (A slight excuse is: when the chmap is changed through the proper alsa-lib API, the PCM status is checked there anyway, so we don't have to be too strict in the kernel side.) Cc: <stable@vger.kernel.org> [v3.7+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-18ALSA: hda - bug fix for invalid connection list of Haswell HDMI codec pinsMengdong Lin1-0/+28
Haswell HDMI codec pins may report invalid connection list entries, which will cause failure to play audio via HDMI or Display Port. So this patch adds fixup for Haswell to workaround this hardware issue: enable DP1.2 mode and override the pins' connection list entries with proper value. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Xingchao Wang <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-14ALSA: hda - Always turn on pins for HDMI/DPTakashi Iwai1-14/+4
We've seen the broken HDMI *video* output on some machines with GM965, and the debugging session pointed that the culprit is the disabled audio output pins. Toggling these pins dynamically on demand caused flickering of HDMI TV. This patch changes the behavior to keep the pin ON constantly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51421 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-21ALSA: hda - Use standard helper functions in patch_hdmi.cTakashi Iwai1-4/+3
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-07ALSA: hda - Keep power link on for PantherPoint HDMIDavid Henningsson1-2/+6
On some of the PantherPoint HDMI machines we currently enable, we're seeing trouble with unsol events, i e detecting monitor presence, especially when on battery and after suspend/resume. BugLink: https://bugs.launchpad.net/bugs/1075882 Tested-by: Cyrus Lien <cyrus.lien@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-17ALSA: hda - Add workaround for conflicting IEC958 controlsTakashi Iwai1-3/+4
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-09-10ALSA: hda - Allow 3/5/7 channel map for HDMI/DPTakashi Iwai1-1/+1
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: hda - Fix channel maps for Nvidia 7x 8ch HDMI codecsTakashi Iwai1-0/+39
Some old Nvidia HDMI codecs with 8ch support only 2/8 or 2/6/8 channels and with the fixed CLFE-first map. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: hda - Provide the proper channel mapping for generic HDMI driverTakashi Iwai1-5/+303
... instead of the standard fixed channel maps. The generic HDMI is based on the audio infoframe, and its configuration can be selected via CA bits. Thus we need a translation between the CA index and the verbose channel map list. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: hda - Move non-PCM check to per_pin in patch_hdmi.cTakashi Iwai1-21/+25
Recently the check for non-PCM stream state was added to the generic HDMI driver code. But this check should be done rather to each pin instead of each converter. Otherwise when a different converter is assigned at the next open, the audio infoframe can be inconsistent with the setup using the previous converter. For fixing this issue, this patch moves the state of the current non-PCM status from per_cvt to per_pin. (In addition an unused argument cvt_nid is stripped from hdmi_setup_channel_mapping()) Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: HDMI - Setup channel mapping for non_pcm audioWang Xingchao1-0/+5
For HBR stream test, use straight channel mapping way. when switched back to "speaker-test -c8", even the audio infoframe is up-to-date, there should be correct channel mapping setup. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: HDMI - Enable HBR feature on Intel chipsWang Xingchao1-4/+32
HDMI channel remapping apparently effects HBR packets on Intel's chips. For compressed non-PCM audio, use "straight-through" channel mapping. For uncompressed multi-channel pcm audio, use normal channel mapping. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: HDMI - Fix channel_allocation array wrong orderWang Xingchao1-1/+14
The array channel_allocations[] is an ordered list, add function to get correct order by ca_index. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVETakashi Iwai1-1/+1
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its behavior can be well controlled via the default value and module parameter. Let's just replace it with the standard CONFIG_PM. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.cTakashi Iwai1-2/+0
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-08-06ALSA: hda - Fix regression of HDMI codec probingTakashi Iwai1-3/+9
The commit c4bfe94a causes a regression on some codecs at probing. Since this was just a workaround to shut up a kernel warning, it'd be better to revert and fix properly. So we ended up with re-adding the cleanup callback. Tested-and-reported-by: Matt Horan <matt@matthoran.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-27ALSA: hda - Fix WARNING from HDMI/DP parserTakashi Iwai1-0/+3
The recent fix to converter detaching timing in patch_hdmi.c leads to a kernel WARNING due to a sanity check when the debug option is set. Add a workaround by setting a dummy hinfo->nid. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-26ALSA: hda - Detach from converter at closing in patch_hdmi.cTakashi Iwai1-7/+4
The generic HDMI code detaches the converter from the stream when unused, but it must be done rather in the close callback instead of the cleanup callback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-20ALSA: hda - Turn on PIN_OUT from hdmi playback prepare.Dylan Reid1-6/+6
Turn on the pin widget's PIN_OUT bit from playback prepare. The pin is enabled in open, but is disabled in hdmi_init_pin which is called during system resume. This causes a system suspend/resume during playback to mute HDMI/DP. Enabling the pin in prepare instead of open allows calling snd_pcm_prepare after a system resume to restore audio. Signed-off-by: Dylan Reid <dgreid@chromium.org> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-17ALSA: hda - Add new GPU codec ID to snd-hdaAaron Plattner1-0/+2
Vendor ID 0x10de0051 is used by a yet-to-be-named GPU chip. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Daniel Dadap <ddadap@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16ALSA: hda - add Haswell HDMI codec idWang Xingchao1-0/+2
0x80862807 is HDMI id for Haswell HDA. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21ALSA: hda - Correct info print in HDMI non-intrinsic unsol eventTakashi Iwai1-1/+1
In the recent code, the value shown there is a tag number, and it's no longer same as the pin nid. Correct the message to avoid confusion. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21ALSA: hda - Don't rely on event tag for simple_hdmiTakashi Iwai1-1/+1
VIA codecs seem not returning the event tag in the unsolicited events, thus the current code relying on the tag value doesn't work. Since simple_hdmi stuff has only a single pin, we can use simply snd_hda_jack_set_dirty_all() to activate the pin-detection independently from the tag value. Tested-by: Annie Liu <AnnieLiu@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-21ALSA: hda - Remove loop from simple_hdmi*()Takashi Iwai1-42/+27
The simple_hdmi stuff is designed only for a single pin and a single converter (thus a single PCM stream), and no need for loops. Let's flatten the code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20ALSA: hda - Move one-time init codes from generic_hdmi_init()Takashi Iwai1-5/+17
The codes to initialize work struct or create a proc interface should be called only once and never although it's called many times through the init callback. Move that stuff into patch_generic_hdmi() so that it's called only once. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20ALSA: hda - Add missing snd_hda_jack_detect_enable() for simple_hdmi*()Takashi Iwai1-3/+5
Reported-by: Annie Liu <annieliu@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>