* [PATCH 1/2] ALSA: hda - Remove unused variable
@ 2013-06-21 10:10 Wang Xingchao
2013-06-21 10:10 ` [PATCH 2/2 V1] ALSA: hda - Add cache connection info Wang Xingchao
0 siblings, 1 reply; 2+ messages in thread
From: Wang Xingchao @ 2013-06-21 10:10 UTC (permalink / raw)
To: tiwai; +Cc: mengdong.lin, alsa-devel, Wang Xingchao, xingchao.wang
Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
sound/pci/hda/patch_hdmi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 7803ddd..0f7a380 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1891,7 +1891,6 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
/* override pins connection list */
snd_printdd("hdmi: haswell: override pin connection 0x%x\n", nid);
- nconns = max(spec->num_cvts, 4);
snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids);
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2 V1] ALSA: hda - Add cache connection info
2013-06-21 10:10 [PATCH 1/2] ALSA: hda - Remove unused variable Wang Xingchao
@ 2013-06-21 10:10 ` Wang Xingchao
0 siblings, 0 replies; 2+ messages in thread
From: Wang Xingchao @ 2013-06-21 10:10 UTC (permalink / raw)
To: tiwai; +Cc: mengdong.lin, 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 choose connections from cache.
So add Cache connection info to avoid confuse.
Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
---
sound/pci/hda/hda_codec.c | 13 +++++++++++++
sound/pci/hda/hda_codec.h | 2 ++
sound/pci/hda/hda_proc.c | 13 ++++++++++++-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 55108b5..7517fd6 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -354,6 +354,19 @@ lookup_conn_list(struct hda_codec *codec, hda_nid_t nid)
return NULL;
}
+int lookup_cache_conn(struct hda_codec *codec,
+ hda_nid_t pin_nid, hda_nid_t *conn_list)
+{
+ struct hda_conn_list *p;
+
+ p = lookup_conn_list(codec, pin_nid);
+ if (p) {
+ memcpy(conn_list, p->conns, p->len * sizeof(hda_nid_t));
+ return p->len;
+ }
+ return 0;
+}
+
static int add_conn_list(struct hda_codec *codec, hda_nid_t nid, int len,
const hda_nid_t *list)
{
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index c93f902..145d184 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -963,6 +963,8 @@ snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t nid)
int snd_hda_get_num_raw_conns(struct hda_codec *codec, hda_nid_t nid);
int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
hda_nid_t *conn_list, int max_conns);
+int lookup_cache_conn(struct hda_codec *codec,
+ hda_nid_t pin_nid, hda_nid_t *conn_list);
int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
const hda_nid_t **listp);
int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums,
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 0fee8fa..644ac1e 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -504,6 +504,7 @@ static void print_conn_list(struct snd_info_buffer *buffer,
int conn_len)
{
int c, curr = -1;
+ hda_nid_t cache_conn[32];
if (conn_len > 1 &&
wid_type != AC_WID_AUD_MIX &&
@@ -511,7 +512,7 @@ static void print_conn_list(struct snd_info_buffer *buffer,
wid_type != AC_WID_POWER)
curr = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONNECT_SEL, 0);
- snd_iprintf(buffer, " Connection: %d\n", conn_len);
+ snd_iprintf(buffer, " Raw Connection: %d\n", conn_len);
if (conn_len > 0) {
snd_iprintf(buffer, " ");
for (c = 0; c < conn_len; c++) {
@@ -521,6 +522,16 @@ static void print_conn_list(struct snd_info_buffer *buffer,
}
snd_iprintf(buffer, "\n");
}
+
+ /* Get Cache connections info */
+ conn_len = lookup_cache_conn(codec, nid, cache_conn);
+ if (conn_len > 0) {
+ snd_iprintf(buffer, " Cache Connection: %d\n", conn_len);
+ snd_iprintf(buffer, " ");
+ for (c = 0; c < conn_len; c++)
+ snd_iprintf(buffer, " 0x%02x", cache_conn[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
end of thread, other threads:[~2013-06-21 6:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 10:10 [PATCH 1/2] ALSA: hda - Remove unused variable Wang Xingchao
2013-06-21 10:10 ` [PATCH 2/2 V1] ALSA: hda - Add cache connection info Wang Xingchao
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.