diff options
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index acbfbe087ee8..3a2d4a5a1714 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1775,6 +1775,16 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) | |||
1775 | return non_pcm; | 1775 | return non_pcm; |
1776 | } | 1776 | } |
1777 | 1777 | ||
1778 | /* There is a fixed mapping between audio pin node and display port | ||
1779 | * on current Intel platforms: | ||
1780 | * Pin Widget 5 - PORT B (port = 1 in i915 driver) | ||
1781 | * Pin Widget 6 - PORT C (port = 2 in i915 driver) | ||
1782 | * Pin Widget 7 - PORT D (port = 3 in i915 driver) | ||
1783 | */ | ||
1784 | static int intel_pin2port(hda_nid_t pin_nid) | ||
1785 | { | ||
1786 | return pin_nid - 4; | ||
1787 | } | ||
1778 | 1788 | ||
1779 | /* | 1789 | /* |
1780 | * HDMI callbacks | 1790 | * HDMI callbacks |
@@ -1791,6 +1801,8 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1791 | int pin_idx = hinfo_to_pin_index(codec, hinfo); | 1801 | int pin_idx = hinfo_to_pin_index(codec, hinfo); |
1792 | struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); | 1802 | struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); |
1793 | hda_nid_t pin_nid = per_pin->pin_nid; | 1803 | hda_nid_t pin_nid = per_pin->pin_nid; |
1804 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1805 | struct i915_audio_component *acomp = codec->bus->core.audio_component; | ||
1794 | bool non_pcm; | 1806 | bool non_pcm; |
1795 | int pinctl; | 1807 | int pinctl; |
1796 | 1808 | ||
@@ -1807,6 +1819,13 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1807 | intel_not_share_assigned_cvt(codec, pin_nid, per_pin->mux_idx); | 1819 | intel_not_share_assigned_cvt(codec, pin_nid, per_pin->mux_idx); |
1808 | } | 1820 | } |
1809 | 1821 | ||
1822 | /* Call sync_audio_rate to set the N/CTS/M manually if necessary */ | ||
1823 | /* Todo: add DP1.2 MST audio support later */ | ||
1824 | if (acomp && acomp->ops && acomp->ops->sync_audio_rate) | ||
1825 | acomp->ops->sync_audio_rate(acomp->dev, | ||
1826 | intel_pin2port(pin_nid), | ||
1827 | runtime->rate); | ||
1828 | |||
1810 | non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); | 1829 | non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); |
1811 | mutex_lock(&per_pin->lock); | 1830 | mutex_lock(&per_pin->lock); |
1812 | per_pin->channels = substream->runtime->channels; | 1831 | per_pin->channels = substream->runtime->channels; |