Skip to contentSkip to conversation

ALSA: hda/hdmi - apply Valleyview fix-ups to Cherryview display codec

PATCH In review [email protected] 2 participants 3 messages Aug 18, 2014 – Aug 19, 2014 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/hdmi - apply Valleyview fix-ups to Cherryview display codec

From: Libin Yang <[email protected]>

Valleyview and Cherryview have the same behavior on display audio. So this patch defines is_valleyview_plus() to include codecs for both Valleyview and its successor Cherryview, and apply Valleyview fix-ups to Cherryview.

---
 sound/pci/hda/patch_hdmi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
sound/pci/hda/patch_hdmi.c +7 -5
index 36badba..99d7d7f 100644
@@ -50,6 +50,8 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
 #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec))
 
 #define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
+#define is_cherryview(codec) ((codec)->vendor_id == 0x80862883)
+#define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec))
 
 struct hdmi_spec_per_cvt {
 	hda_nid_t cvt_nid;
@@ -1459,7 +1461,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
 			    mux_idx);
 
 	/* configure unused pins to choose other converters */
-	if (is_haswell_plus(codec) || is_valleyview(codec))
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))
 		intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx);
 
 	snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid);
@@ -1598,7 +1600,8 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 		 *   and this can make HW reset converter selection on a pin.
 		 */
 		if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
-			if (is_haswell_plus(codec) || is_valleyview(codec)) {
+			if (is_haswell_plus(codec) ||
+				is_valleyview_plus(codec)) {
 				intel_verify_pin_cvt_connect(codec, per_pin);
 				intel_not_share_assigned_cvt(codec, pin_nid,
 							per_pin->mux_idx);
@@ -1779,7 +1782,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 	bool non_pcm;
 	int pinctl;
 
-	if (is_haswell_plus(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
 		/* Verify pin:cvt selections to avoid silent audio after S3.
 		 * After S3, the audio driver restores pin:cvt selections
 		 * but this can happen before gfx is ready and such selection
@@ -2330,9 +2333,8 @@ static int patch_generic_hdmi(struct hda_codec *codec)
 		intel_haswell_fixup_enable_dp12(codec);
 	}
 
-	if (is_haswell(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))
 		codec->depop_delay = 0;
-	}
 
 	if (hdmi_parse_codec(codec) < 0) {
 		codec->spec = NULL;
Signature · 1 line
1.9.1
#1 lore raw

At Mon, 18 Aug 2014 16:44:07 +0800,

Quoted 54 lines · [email protected] wrote:

From: Libin Yang <[email protected]>

Valleyview and Cherryview have the same behavior on display audio. So this patch defines is_valleyview_plus() to include codecs for both Valleyview and its successor Cherryview, and apply Valleyview fix-ups to Cherryview.

---
 sound/pci/hda/patch_hdmi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
sound/pci/hda/patch_hdmi.c +6 -3
index 36badba..99d7d7f 100644
@@ -50,6 +50,8 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
 #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec))
 
 #define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
+#define is_cherryview(codec) ((codec)->vendor_id == 0x80862883)
+#define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec))
 
 struct hdmi_spec_per_cvt {
 	hda_nid_t cvt_nid;
@@ -1459,7 +1461,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
 			    mux_idx);
 
 	/* configure unused pins to choose other converters */
-	if (is_haswell_plus(codec) || is_valleyview(codec))
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))
 		intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx);
 
 	snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid);
@@ -1598,7 +1600,8 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 		 *   and this can make HW reset converter selection on a pin.
 		 */
 		if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
-			if (is_haswell_plus(codec) || is_valleyview(codec)) {
+			if (is_haswell_plus(codec) ||
+				is_valleyview_plus(codec)) {
 				intel_verify_pin_cvt_connect(codec, per_pin);
 				intel_not_share_assigned_cvt(codec, pin_nid,
 							per_pin->mux_idx);
@@ -1779,7 +1782,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 	bool non_pcm;
 	int pinctl;
 
-	if (is_haswell_plus(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
 		/* Verify pin:cvt selections to avoid silent audio after S3.
 		 * After S3, the audio driver restores pin:cvt selections
 		 * but this can happen before gfx is ready and such selection

sound/pci/hda/patch_hdmi.c static int patch_generic_hdmi(struct hda_codec *codec) · line 2336

Quoted 5 lines
sound/pci/hda/patch_hdmi.c +1 -1
@@ -2330,9 +2333,8 @@ static int patch_generic_hdmi(struct hda_codec *codec)
 		intel_haswell_fixup_enable_dp12(codec);
 	}
 
-	if (is_haswell(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))

This hunk changes is_haswell() to is_haswell_plus() without explanation. If it's really needed, split the patch, one to fix is_haswell() call here, and another to replace is_valleyview() with is_valleyview_plus().

Fixing some bug is good, but silently fixing something else isn't :)

thanks,

Takashi

Quoted 8 lines
sound/pci/hda/patch_hdmi.c +0 -1
 		codec->depop_delay = 0;
-	}
 
 	if (hdmi_parse_codec(codec) < 0) {
 		codec->spec = NULL;
Signature · 1 line
1.9.1
#2 lore raw

Hi Takashi,

Quoted 87 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 18, 2014 5:04 PM
To: Yang, Libin
Cc: [email protected]; Lin, Mengdong
Subject: Re: [PATCH] ALSA: hda/hdmi - apply Valleyview fix-ups to Cherryview display codec

At Mon, 18 Aug 2014 16:44:07 +0800,

Quoted 6 lines · [email protected] wrote:

From: Libin Yang <[email protected]>

Valleyview and Cherryview have the same behavior on display audio. So this patch defines is_valleyview_plus() to include codecs for both Valleyview and its successor Cherryview, and apply Valleyview fix-ups to

Cherryview.

sound/pci/hda/patch_hdmi.c MODULE_PARM_DESC(static_hdmi_pcm, "Don't

Quoted 11 lines
---
 sound/pci/hda/patch_hdmi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
sound/pci/hda/patch_hdmi.c +0 -0
index 36badba..99d7d7f 100644
@@ -50,6 +50,8 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't

restrict

sound/pci/hda/patch_hdmi.c static int hdmi_pcm_open(struct

Quoted 11 lines
sound/pci/hda/patch_hdmi.c +3 -0
 PCM parameters per ELD info");  #define is_haswell_plus(codec)
 (is_haswell(codec) || is_broadwell(codec))
 
 #define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
+#define is_cherryview(codec) ((codec)->vendor_id == 0x80862883)
+#define is_valleyview_plus(codec) (is_valleyview(codec) ||
+is_cherryview(codec))
 
 struct hdmi_spec_per_cvt {
 	hda_nid_t cvt_nid;
@@ -1459,7 +1461,7 @@ static int hdmi_pcm_open(struct

hda_pcm_stream *hinfo,

sound/pci/hda/patch_hdmi.c static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,

Quoted 6 lines
sound/pci/hda/patch_hdmi.c +1 -1
 			    mux_idx);
 
 	/* configure unused pins to choose other converters */
-	if (is_haswell_plus(codec) || is_valleyview(codec))
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))
 		intel_not_share_assigned_cvt(codec, per_pin->pin_nid,

mux_idx);

sound/pci/hda/patch_hdmi.c static int hdmi_pcm_open(struct · line 1465

Quoted 3 lines
sound/pci/hda/patch_hdmi.c +0 -1
 	snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); @@
-1598,7 +1600,8 @@ static bool hdmi_present_sense(struct

hdmi_spec_per_pin *per_pin, int repoll)

sound/pci/hda/patch_hdmi.c static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)

Quoted 7 lines
sound/pci/hda/patch_hdmi.c +2 -1
 		 *   and this can make HW reset converter selection on a pin.
 		 */
 		if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
-			if (is_haswell_plus(codec) || is_valleyview(codec)) {
+			if (is_haswell_plus(codec) ||
+				is_valleyview_plus(codec)) {
 				intel_verify_pin_cvt_connect(codec,

per_pin);

Quoted 1 line

intel_not_share_assigned_cvt(codec,

pin_nid,

sound/pci/hda/patch_hdmi.c static int

Quoted 2 lines
sound/pci/hda/patch_hdmi.c +0 -0
 							per_pin->mux_idx);
@@ -1779,7 +1782,7 @@ static int

generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,

sound/pci/hda/patch_hdmi.c static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, · line 1788

Quoted 8 lines
sound/pci/hda/patch_hdmi.c +1 -1
 	bool non_pcm;
 	int pinctl;
 
-	if (is_haswell_plus(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
 		/* Verify pin:cvt selections to avoid silent audio after S3.
 		 * After S3, the audio driver restores pin:cvt selections
 		 * but this can happen before gfx is ready and such selection

@@

Quoted 1 line

-2330,9 +2333,8 @@ static int patch_generic_hdmi(struct hda_codec

*codec)

sound/pci/hda/patch_hdmi.c static int patch_generic_hdmi(struct hda_codec *codec) · line 2336

Quoted 5 lines
sound/pci/hda/patch_hdmi.c +1 -1
 		intel_haswell_fixup_enable_dp12(codec);
 	}
 
-	if (is_haswell(codec) || is_valleyview(codec)) {
+	if (is_haswell_plus(codec) || is_valleyview_plus(codec))

This hunk changes is_haswell() to is_haswell_plus() without explanation. If it's really needed, split the patch, one to fix
is_haswell() call here, and another to replace is_valleyview() with is_valleyview_plus().

Quoted 1 line

Fixing some bug is good, but silently fixing something else isn't :)

OK, I will split it into 2 patches. :)

Quoted 15 lines

thanks,

Takashi

Quoted 8 lines
sound/pci/hda/patch_hdmi.c +0 -2
 		codec->depop_delay = 0;
-	}
 
 	if (hdmi_parse_codec(codec) < 0) {
 		codec->spec = NULL;
--

1.9.1