aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
AgeCommit message (Collapse)AuthorFilesLines
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>
2012-06-20ALSA: hda - Fix the pin nid assignment in patch_hdmi.cTakashi Iwai1-1/+1
This fixes the regression introduced by the commit d0b1252d for refactoring simple_hdmi*(). The pin NID wasn't assigned correctly. Reported-by: Annie Liu <annieliu@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15ALSA: hda - Enable unsol event for ATI and Nvidia HDMI codecs tooTakashi Iwai1-10/+5
ATI and Nvidia HDMI codecs have also the pin-detection capability, so let's enable the jack-detecion for them, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15ALSA: hda - Remove invalid init verbs for Nvidia 2ch codecsTakashi Iwai1-4/+19
Nvidia 2ch codecs have no NIDs greather than 0x05. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15ALSA: hda - Use common codes for ATI, Nvidia and VIA simple codecsTakashi Iwai1-126/+65
The code refactoring using the same helper functions for sharing the codes among ATI, Nvidia and VIA simple_hdmi* stuff. Except for that spec->pcm_playback is no longer pointer, the functionality doesn't change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15ALSA: hda - Merge ATI/VIA HDMI simple init functionsTakashi Iwai1-34/+22
Just a minor code cleanup to use the same function for both AMD and VIA simple_hdmi*(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15ALSA: hda - Add the support for VIA HDMI pin detectionTakashi Iwai1-0/+20
This patch adds the hotplug unsol event handling to simple_hdmi*(). It works on VIA VX900. If AMD or Nvidia chips support the pin-detection similarly, it can be added easily, too. Reported-by: Annie Liu <annieliu@viatech.com.cn> Tested-by: Annie Liu <annieliu@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11ALSA: hda - add support for HD-Audio CODECes of VIA HDMI GFX CardsAnnie Liu1-0/+64
This is patch supporting the CODECes of HD-Audio function of VIA GFX cards which support HDMI. For CODECes 0x9f80/0x9f81, which belong to VX900, since the hardware is not fully compliant to HD-Audio 1.3, simple_i*() is adopted temporarily. Signed-off-by: Annie Liu <annieliu@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-10ALSA: hda - Protect SPDIF-related stuff via spdif_mutexTakashi Iwai1-2/+2
Add the missing mutex protection or move into the protected part for SPDIF access codes for codecs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-10ALSA: hda - hide HDMI/ELD printks unless snd.debug=2Fengguang Wu1-5/+4
Also remove two warnings when CONFIG_SND_DEBUG is not set: sound/pci/hda/patch_hdmi.c: In function ‘hdmi_intrinsic_event’: sound/pci/hda/patch_hdmi.c:761:6: warning: unused variable ‘eldv’ [-Wunused-variable] sound/pci/hda/patch_hdmi.c:760:6: warning: unused variable ‘pd’ [-Wunused-variable] Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-23ALSA: hda - add id for Atom Cedar Trail HDMI codecWu Fengguang1-0/+2
[the order sorted by tiwai] Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-20ALSA: hda - Fix left-over merge issues in patch_hdmi.cTakashi Iwai1-3/+1
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-20Merge branch 'test/hda-jack' into topic/hdaTakashi Iwai1-17/+20
Conflicts: sound/pci/hda/patch_hdmi.c sound/pci/hda/patch_via.c
2011-12-01ALSA: hda - Integrate input-jack stuff into kctl-jackTakashi Iwai1-16/+6
Instead of managing input-jack stuff separately, call all stuff inside the kctl-jack creation, deletion and report. The caller no longer needs to care about input-jack. The better integration between input-jack and kctl-jack should be done in the upper layer in near future, but for now, it's implemented locally for more tests. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-26ALSA: hda - Increase the max number of coverters/pins in patch_hdmi.cTakashi Iwai1-10/+10
The new hardware tends to have more and more. As a temporary fix, just increase the number for now. For a long-term solution, we should assign the cvts/pins dynamically. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-22ALSA: hda - repoll ELD content for multiple timesWu Fengguang1-6/+10
Improve the one-shot ELD repoll to up to 6 retries. Up to now the 300ms looks sufficient for the test boxes. However I'm a bit worried about how well it can fit the wider user base. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Merge input-jack helpers to hda_jack.cTakashi Iwai1-1/+0
We can use the very same table in hda_jack.c for managing the list for input-jack elements, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - Manage unsol tags in hda_jack.cTakashi Iwai1-3/+10
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-0/+6
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-3/+3
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 - move eld->spk_alloc fixup to hdmi_update_eld()Wu Fengguang1-10/+0
It looks more natural and saves two lines of code. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - delayed ELD repollWu Fengguang1-7/+29
The Intel HDMI chips (ironlake at least) are found to have ~250ms delay between the ELD_Valid=1 hotplug event is send and the ELD buffer becomes actually readable. During the time the ELD buffer is mysteriously all 0. Fix it by scheduling a delayed work to re-read ELD buffer after 300ms. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16ALSA: hda - fix ELD memory leakWu Fengguang1-6/+5
memset(eld) clears eld->proc_entry which will leak the struct snd_info_entry when unloading module. Fix it by - memset only the fields before eld->eld_buffer - set eld->eld_valid to true _after_ all eld fields have been filled Cc: <stable@kernel.org> Cc: Pierre-louis Bossart <pierre-louis.bossart@intel.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-11-02ALSA: hda - Remove unused variablesTakashi Iwai1-4/+1
Just clean-up what GCC caught. Signed-off-by: Takashi Iwai <tiwai@suse.de>