diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-03-21 08:56:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-28 03:38:40 -0400 |
commit | e85015a3797f2665cc6f0339e6407adc00ac4245 (patch) | |
tree | 6838ecf0bd7b548003c0264d560a16c0570a6bcf /sound/pci/hda | |
parent | 4846a67eb5a1d7cac76e1b22f66e88a8cbbdff3f (diff) |
ALSA: hda - Use eld notifier for Intel SandyBridge and IvyBridge HDMI/DP
Intel SandyBridge and IvyBridge (CougarPoint and PantherPoint
platforms) have also the same digital port vs audio widget mapping
(from port B = NID 0x05 to port D = NID 0x07) as Haswell & co.
So, we can reuse the existing functions for HSW+ for these platforms
without changing there, but just by re-adding the on-demand i915
binding in HDMI codec driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 3481b43476dc..09eb26c5730c 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -157,6 +157,7 @@ struct hdmi_spec { | |||
157 | /* i915/powerwell (Haswell+/Valleyview+) specific */ | 157 | /* i915/powerwell (Haswell+/Valleyview+) specific */ |
158 | bool use_acomp_notifier; /* use i915 eld_notify callback for hotplug */ | 158 | bool use_acomp_notifier; /* use i915 eld_notify callback for hotplug */ |
159 | struct i915_audio_component_audio_ops i915_audio_ops; | 159 | struct i915_audio_component_audio_ops i915_audio_ops; |
160 | bool i915_bound; /* was i915 bound in this driver? */ | ||
160 | 161 | ||
161 | struct hdac_chmap chmap; | 162 | struct hdac_chmap chmap; |
162 | }; | 163 | }; |
@@ -2077,6 +2078,8 @@ static void generic_spec_free(struct hda_codec *codec) | |||
2077 | struct hdmi_spec *spec = codec->spec; | 2078 | struct hdmi_spec *spec = codec->spec; |
2078 | 2079 | ||
2079 | if (spec) { | 2080 | if (spec) { |
2081 | if (spec->i915_bound) | ||
2082 | snd_hdac_i915_exit(&codec->bus->core); | ||
2080 | hdmi_array_free(spec); | 2083 | hdmi_array_free(spec); |
2081 | kfree(spec); | 2084 | kfree(spec); |
2082 | codec->spec = NULL; | 2085 | codec->spec = NULL; |
@@ -2409,6 +2412,40 @@ static int patch_i915_byt_hdmi(struct hda_codec *codec) | |||
2409 | return 0; | 2412 | return 0; |
2410 | } | 2413 | } |
2411 | 2414 | ||
2415 | /* Intel SandyBridge and IvyBridge; with i915 eld notifier */ | ||
2416 | static int patch_i915_cpt_hdmi(struct hda_codec *codec) | ||
2417 | { | ||
2418 | struct hdmi_spec *spec; | ||
2419 | int err; | ||
2420 | |||
2421 | /* no i915 component should have been bound before this */ | ||
2422 | if (WARN_ON(codec->bus->core.audio_component)) | ||
2423 | return -EBUSY; | ||
2424 | |||
2425 | err = alloc_generic_hdmi(codec); | ||
2426 | if (err < 0) | ||
2427 | return err; | ||
2428 | spec = codec->spec; | ||
2429 | |||
2430 | /* Try to bind with i915 now */ | ||
2431 | err = snd_hdac_i915_init(&codec->bus->core); | ||
2432 | if (err < 0) | ||
2433 | goto error; | ||
2434 | spec->i915_bound = true; | ||
2435 | |||
2436 | err = hdmi_parse_codec(codec); | ||
2437 | if (err < 0) | ||
2438 | goto error; | ||
2439 | |||
2440 | generic_hdmi_init_per_pins(codec); | ||
2441 | register_i915_notifier(codec); | ||
2442 | return 0; | ||
2443 | |||
2444 | error: | ||
2445 | generic_spec_free(codec); | ||
2446 | return err; | ||
2447 | } | ||
2448 | |||
2412 | /* | 2449 | /* |
2413 | * Shared non-generic implementations | 2450 | * Shared non-generic implementations |
2414 | */ | 2451 | */ |
@@ -3582,8 +3619,8 @@ HDA_CODEC_ENTRY(0x80862801, "Bearlake HDMI", patch_generic_hdmi), | |||
3582 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), | 3619 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), |
3583 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), | 3620 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), |
3584 | HDA_CODEC_ENTRY(0x80862804, "IbexPeak HDMI", patch_generic_hdmi), | 3621 | HDA_CODEC_ENTRY(0x80862804, "IbexPeak HDMI", patch_generic_hdmi), |
3585 | HDA_CODEC_ENTRY(0x80862805, "CougarPoint HDMI", patch_generic_hdmi), | 3622 | HDA_CODEC_ENTRY(0x80862805, "CougarPoint HDMI", patch_i915_cpt_hdmi), |
3586 | HDA_CODEC_ENTRY(0x80862806, "PantherPoint HDMI", patch_generic_hdmi), | 3623 | HDA_CODEC_ENTRY(0x80862806, "PantherPoint HDMI", patch_i915_cpt_hdmi), |
3587 | HDA_CODEC_ENTRY(0x80862807, "Haswell HDMI", patch_i915_hsw_hdmi), | 3624 | HDA_CODEC_ENTRY(0x80862807, "Haswell HDMI", patch_i915_hsw_hdmi), |
3588 | HDA_CODEC_ENTRY(0x80862808, "Broadwell HDMI", patch_i915_hsw_hdmi), | 3625 | HDA_CODEC_ENTRY(0x80862808, "Broadwell HDMI", patch_i915_hsw_hdmi), |
3589 | HDA_CODEC_ENTRY(0x80862809, "Skylake HDMI", patch_i915_hsw_hdmi), | 3626 | HDA_CODEC_ENTRY(0x80862809, "Skylake HDMI", patch_i915_hsw_hdmi), |