ALSA: hda - not choose assigned converters for unused pins of Valleyview
PATCH v2 1/1 ALSA: hda - not choose assigned converters for unused pins of Valleyview
From: Mengdong Lin <[email protected]>
For Valleyview display codec, if an unused pin chooses an assgined converter selected by a used pin, playback on the unused pin can also give sound to the output device of the used pin. It's because data flows from the same convertor to the display port of the used pin. This issue is same as Haswell.
So this patch avoids using assinged convertors for unused pins. The related function haswell_config_cvts() is renamed for code reuse.
sound/pci/hda/patch_hdmi.c +4 -3
@@ -45,6 +45,7 @@ module_param(static_hdmi_pcm, bool, 0644);MODULE_PARM_DESC (static_hdmi_pcm,"Don't restrict PCM parameters per ELD info" );#define is_haswell (codec) ((codec)->vendor_id == 0x80862807) +#define is_valleyview (codec) ((codec)->vendor_id == 0x80862882)struct hdmi_spec_per_cvt {hda_nid_t cvt_nid;
@@ -1148,7 +1149,7 @@ static int hdmi_choose_cvt(struct hda_codec *codec,return 0 ; } -static void haswell_config_cvts (struct hda_codec *codec, +static void not_share_assigned_cvt (struct hda_codec *codec,hda_nid_t pin_nid,int mux_idx) {struct hdmi_spec *spec = codec->spec;
@@ -1226,8 +1227,8 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, mux_idx);/* configure unused pins to choose other converters */ -if (is_haswell (codec)) -haswell_config_cvts (codec, per_pin->pin_nid, mux_idx); +if (is_haswell (codec) ||is_valleyview (codec)) +not_share_assigned_cvt (codec, per_pin->pin_nid, mux_idx);snd_hda_spdif_ctls_assign (codec, pin_idx, per_cvt->cvt_nid);
Signature · 1 line
1.8.1.2
Hi Takashi,
The function name should be "not_share_assigned_cvt".
The original function name "not_share_unassigned_cvt" gives the opposite meaning.
Would you please revert v1 patch?
I'm sorry to cause the unnecessary work.
Regards
Mengdong
Quoted 56 lines
-----Original Message-----
From: Lin, Mengdong
Sent: Friday, November 01, 2013 11:23 AM
To: [email protected]; [email protected]
Cc: Lin, Mengdong
Subject: [PATCH v2] ALSA: hda - not choose assigned converters for unused pins of ValleyviewFrom: Mengdong Lin <[email protected]>
For Valleyview display codec, if an unused pin chooses an assgined converter selected by a used pin, playback on the unused pin can also give sound to the output device of the used pin. It's because data flows from the same convertor to the display port of the used pin. This issue is same as Haswell.
So this patch avoids using assinged convertors for unused pins. The related function
haswell_config_cvts()is renamed for code reuse.Signed-off-by Mengdong Lin <[email protected]>sound/pci/hda/patch_hdmi.c index renamed from sound/pci/hda/patch_hdmi.c +0
-0e332db8..5487a56 100644
sound/pci/hda/patch_hdmi.c +0
-0@@ -45,6 +45,7 @@ module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");#define
is_haswell(codec)((codec)->vendor_id ==0x80862807)sound/pci/hda/patch_hdmi.c +4
-4+#define is_valleyview (codec) ((codec)->vendor_id == 0x80862882)struct hdmi_spec_per_cvt {hda_nid_t cvt_nid;@@ -1148,7 +1149,7 @@ static int hdmi_choose_cvt(struct hda_codec *codec,return 0 ; } -static void haswell_config_cvts (struct hda_codec *codec, +static void not_share_assigned_cvt (struct hda_codec *codec,hda_nid_t pin_nid,int mux_idx) {struct hdmi_spec *spec = codec->spec;@@ -1226,8 +1227,8 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, mux_idx);/* configure unused pins to choose other converters */ -if (is_haswell (codec)) -haswell_config_cvts (codec, per_pin->pin_nid, mux_idx); +if (is_haswell (codec) ||is_valleyview (codec)) +not_share_assigned_cvt (codec, per_pin->pin_nid, mux_idx);snd_hda_spdif_ctls_assign (codec, pin_idx, per_cvt->cvt_nid); --1.8.1.2