diff options
author | David Henningsson <david.henningsson@canonical.com> | 2013-07-19 11:43:55 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-07-19 11:49:55 +0200 |
commit | 3063962a3b61f8337c3a07b041879ba568e11718 (patch) | |
tree | ddc3efc696790c02698779836646f5e0843c91b3 | |
parent | 0cfe1a023ac4802837dde593797367c2a9945098 (diff) | |
download | hda-emu-3063962a3b61f8337c3a07b041879ba568e11718.tar.gz |
Allow Realtek codecs to access node 0x51
There is sometimes a secret node 0x51 on Realtek codecs, controlling
an equally secret DSP.
At least make sure the automated test suite doesn't fail when trying
to access this secret node.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | hda-int.c | 6 | ||||
-rw-r--r-- | hda-spec.c | 13 | ||||
-rw-r--r-- | include/hda-types.h | 1 |
3 files changed, 20 insertions, 0 deletions
@@ -1125,6 +1125,12 @@ int hda_cmd(struct xhda_codec *codec, unsigned int cmd) unsigned int nid = (cmd >> 20) & 0x7f; unsigned int verb = (cmd >> 8) & 0xfff; + if (codec->extended_cmd) { + int r = codec->extended_cmd(codec, cmd); + if (r != -ENXIO) + return r; + } + tbl = find_matching_verb(codec, verb); if (!tbl) return -ENXIO; @@ -354,6 +354,16 @@ static struct verb_ext_list extensions[] = { { } }; +static int realtek_dsp_cmd(struct xhda_codec *codec, unsigned int cmd) +{ + unsigned int nid = (cmd >> 20) & 0x7f; + if (nid != 0x51) + return -ENXIO; + /* There might be a secret DSP connected to node 0x51 */ + codec->rc = 0; + return 0; +} + /* * fixups */ @@ -466,4 +476,7 @@ void add_codec_extensions(struct xhda_codec *codec) else if (!strcmp(codec->parsed_name, "Realtek ALC661")) hda_set_proc_coef(codec, 0x20, 0x00, 0x8020); + if (!strncmp(codec->parsed_name, "Realtek", strlen("Realtek"))) + codec->extended_cmd = realtek_dsp_cmd; + } diff --git a/include/hda-types.h b/include/hda-types.h index fac5084..fe6b31f 100644 --- a/include/hda-types.h +++ b/include/hda-types.h @@ -114,6 +114,7 @@ struct xhda_codec { unsigned int rc; struct xhda_verb_table *extended_verbs; struct xhda_verb_table *extended_parameters; + int (*extended_cmd) (struct xhda_codec *codec, unsigned int cmd); struct xhda_value_cache *value_cache; unsigned short pci_vendor, pci_device; unsigned short pci_subvendor, pci_subdevice; |