linux/sound/pci
Stephen Warren 5d44f927a5 ALSA: HDA: Unify HDMI hotplug handling.
This change unifies the initial handling of a pin's state with the code to
update a pin's state after a hotplug (unsolicited response) event. The
initial probing, and all updates, are now routed through hdmi_present_sense.

The stored PD and ELDV status is now always derived from GetPinSense verb
execution, and not from the data in the unsolicited response. This means:

a) The WAR for NVIDIA codec's UR.PD values ("old_pin_detect") can be
   removed, since this only affected the no-longer-used unsolicited
   response payload.

b) In turn, this means that most NVIDIA codecs can simply use
   patch_generic_hdmi instead of having a custom variant just to set
   old_pin_detect.

c) When PD && ELDV becomes true, no extra verbs are executed, because the
   GetPinSense that was previously executed by snd_hdmi_get_eld (really,
   hdmi_eld_valid) has simply moved into hdmi_present_sense.

d) When PD && ELDV becomes false, there is a single extra GetPinSense verb
   executed for codecs where old_pin_detect wasn't set, i.e. some NVIDIA,
   and all ATI/AMD and Intel codecs. I doubt this will be a performance
   issue.

The new unified code in hdmi_present_sense also ensures that eld->eld_valid
is not set unless eld->monitor_present is also set. This protects against
potential invalid combinations of PD and ELDV received from HW, and
transitively from a graphics driver.

Also, print the derived PD/ELDV bits from hdmi_present_sense so the kernel
log always displays the actual state stored, which will differ from the
values in the unsolicited response for NVIDIA HW where old_pin_detect was
previously set.

Finally, a couple of small tweaks originally by Takashi:

* Clear the ELD content to zero before reading it, so that if it's not
  read (i.e. when !(PD && ELDV)) it's in a known state.

* Don't show ELD fields in /proc ELD files when the ELD isn't valid.

The only possibility I can see for regression here is a codec where the
GetPinSense verb returns incorrect data. However, we're already exposed
to that, since that data is used (a) from hdmi_add_pin to set up the
initial pin state, and (b) within snd_hda_input_jack_report to query
a pin's presence value. As such, I don't believe any HW has bugs here.

Includes-changes-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-25 07:31:32 +02:00
..
ac97 ALSA: azt3328: hook up new emulated AC97 on AC97 patch side 2011-02-19 16:03:08 +01:00
ali5451
asihpi Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00
au88x0 Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00
aw2 ALSA: aw2-alsa.c: use pci_ids.h defines and fix checkpatch.pl noise 2010-05-25 08:39:28 +02:00
ca0106 Fix common misspellings 2011-03-31 11:26:23 -03:00
cs46xx ALSA: cs46xx memory management fixes for cs46xx_dsp_spos_create() 2010-11-01 10:26:23 +01:00
cs5535audio PCI: make pci_restore_state return void 2010-12-23 12:53:09 -08:00
ctxfi Fix common misspellings 2011-03-31 11:26:23 -03:00
echoaudio ALSA: echoaudio: check kmalloc() result 2010-07-19 17:59:04 +02:00
emu10k1 Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00
hda ALSA: HDA: Unify HDMI hotplug handling. 2011-05-25 07:31:32 +02:00
ice1712 Fix common misspellings 2011-03-31 11:26:23 -03:00
korg1212
lola ALSA: lola - fix lola build 2011-05-04 19:55:13 +02:00
lx6464es ALSA: lx6464es - make 1 bit signed bitfield unsigned 2010-11-01 10:28:35 +01:00
mixart Fix common misspellings 2011-03-31 11:26:23 -03:00
nm256
oxygen ALSA: oxygen: fix output routing on Xonar DG 2011-01-31 12:00:02 +01:00
pcxhr Fix common misspellings 2011-03-31 11:26:23 -03:00
riptide ALSA: riptide - Fix detection / load of firmware files 2010-08-16 08:08:48 +02:00
rme9652 Fix common misspellings 2011-03-31 11:26:23 -03:00
trident fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
vx222
ymfpci ALSA: ymfpci: use enum control info helper 2011-01-10 16:47:03 +01:00
ad1889.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ad1889.h
ak4531_codec.c
als300.c
als4000.c ALSA: als4000: Fix potentially invalid DMA mode setup 2010-08-04 23:18:33 +02:00
atiixp_modem.c ALSA: atiixp - Fix wrong time-out checks during ac-link reset 2011-03-11 15:45:32 +01:00
atiixp.c ALSA: atiixp - Fix wrong time-out checks during ac-link reset 2011-03-11 15:45:32 +01:00
azt3328.c Fix common misspellings 2011-03-31 11:26:23 -03:00
azt3328.h
bt87x.c ALSA: bt87x: use enum control info helper 2011-01-10 16:46:56 +01:00
cmipci.c Fix common misspellings 2011-03-31 11:26:23 -03:00
cs4281.c ALSA: info - Check file position validity in common layer 2010-04-13 12:01:14 +02:00
cs5530.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ens1370.c ALSA: ens1371: fix Creative Ectiva support 2011-03-30 08:57:27 +02:00
ens1371.c
es1938.c
es1968.c ALSA: tea575x: use better card and bus names 2011-05-13 19:43:24 +02:00
fm801.c ALSA: fm801: clean-up radio-related Kconfig 2011-05-15 11:43:31 +02:00
intel8x0.c Fix common misspellings 2011-03-31 11:26:23 -03:00
intel8x0m.c Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00
Kconfig Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00
maestro3.c ALSA: maestro3: Clear interrupts before enabling them 2010-05-08 11:51:13 +02:00
Makefile ALSA: Add the driver for Digigram Lola PCI-e boards 2011-05-03 16:31:05 +02:00
rme32.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rme96.c Fix common misspellings 2011-03-31 11:26:23 -03:00
sis7019.c Fix common misspellings 2011-03-31 11:26:23 -03:00
sis7019.h
sonicvibes.c
via82xx_modem.c
via82xx.c ALSA: via82xx: allow changing the initial DXS volume 2010-07-12 17:25:27 +02:00