All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - Add In-driver connection info
@ 2013-06-25  3:41 Wang Xingchao
  2013-06-25  6:14 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Xingchao @ 2013-06-25  3:41 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, Wang Xingchao, xingchao.wang

Pin's connection list may change dynamically with hot-plug event
on Intel Haswell chip. Users would see connections be "0" in codec#.
when play audio on this pin, software driver choose converter from cache
connections. So add "In-driver connection" info to avoid confuse when
raw connections are different with cache connection.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
 sound/pci/hda/hda_proc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 0fee8fa..9760f00 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer *buffer,
 			    int conn_len)
 {
 	int c, curr = -1;
+	const hda_nid_t *list;
+	int cache_len;
 
 	if (conn_len > 1 &&
 	    wid_type != AC_WID_AUD_MIX &&
@@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer *buffer,
 		}
 		snd_iprintf(buffer, "\n");
 	}
+
+	/* Get Cache connections info */
+	cache_len = snd_hda_get_conn_list(codec, nid, &list);
+	if (cache_len != conn_len
+			|| memcmp(list, conn, conn_len)) {
+		snd_iprintf(buffer, "  In-driver Connection: %d\n", cache_len);
+		if (cache_len > 0) {
+			snd_iprintf(buffer, "    ");
+			for (c = 0; c < cache_len; c++)
+				snd_iprintf(buffer, " 0x%02x", list[c]);
+			snd_iprintf(buffer, "\n");
+		}
+	}
 }
 
 static void print_gpio(struct snd_info_buffer *buffer,
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: hda - Add In-driver connection info
  2013-06-25  3:41 [PATCH] ALSA: hda - Add In-driver connection info Wang Xingchao
@ 2013-06-25  6:14 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2013-06-25  6:14 UTC (permalink / raw)
  To: Wang Xingchao; +Cc: alsa-devel, xingchao.wang

At Mon, 24 Jun 2013 23:41:23 -0400,
Wang Xingchao wrote:
> 
> Pin's connection list may change dynamically with hot-plug event
> on Intel Haswell chip. Users would see connections be "0" in codec#.
> when play audio on this pin, software driver choose converter from cache
> connections. So add "In-driver connection" info to avoid confuse when
> raw connections are different with cache connection.
> 
> Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>

Thanks, applied now.


Takashi

> ---
>  sound/pci/hda/hda_proc.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
> index 0fee8fa..9760f00 100644
> --- a/sound/pci/hda/hda_proc.c
> +++ b/sound/pci/hda/hda_proc.c
> @@ -504,6 +504,8 @@ static void print_conn_list(struct snd_info_buffer *buffer,
>  			    int conn_len)
>  {
>  	int c, curr = -1;
> +	const hda_nid_t *list;
> +	int cache_len;
>  
>  	if (conn_len > 1 &&
>  	    wid_type != AC_WID_AUD_MIX &&
> @@ -521,6 +523,19 @@ static void print_conn_list(struct snd_info_buffer *buffer,
>  		}
>  		snd_iprintf(buffer, "\n");
>  	}
> +
> +	/* Get Cache connections info */
> +	cache_len = snd_hda_get_conn_list(codec, nid, &list);
> +	if (cache_len != conn_len
> +			|| memcmp(list, conn, conn_len)) {
> +		snd_iprintf(buffer, "  In-driver Connection: %d\n", cache_len);
> +		if (cache_len > 0) {
> +			snd_iprintf(buffer, "    ");
> +			for (c = 0; c < cache_len; c++)
> +				snd_iprintf(buffer, " 0x%02x", list[c]);
> +			snd_iprintf(buffer, "\n");
> +		}
> +	}
>  }
>  
>  static void print_gpio(struct snd_info_buffer *buffer,
> -- 
> 1.8.1.2
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-25  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  3:41 [PATCH] ALSA: hda - Add In-driver connection info Wang Xingchao
2013-06-25  6:14 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.