Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add function-id parse and proc output

  • Loading branch information...
commit d44ee756b60992fecc68ad6c09755799b03dd7e4 1 parent 6d49232
@tiwai authored
View
24 configure.ac
@@ -270,5 +270,29 @@ if test "$HDA_CODEC_PIN_AMP_WORKAROUND" = "1"; then
AC_DEFINE(HDA_CODEC_PIN_AMP_WORKAROUND)
fi
+AC_MSG_CHECKING(for hda_codec.function_id)
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Iinclude"
+HDA_CODEC_FUNCTION_ID=
+AC_TRY_COMPILE([
+#include "hda-types.h"
+#include "hda-log.h"
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include "kernel/hda_codec.h"
+],[
+ struct hda_codec codec;
+ codec.function_id = 1;
+],
+ [AC_MSG_RESULT(yes); HDA_CODEC_FUNCTION_ID="1"],
+ [AC_MSG_RESULT(no)],
+ [AC_MSG_RESULT(unknown)]
+)
+CFLAGS=$ac_save_CFLAGS
+if test "$HDA_CODEC_FUNCTION_ID" = "1"; then
+ AC_DEFINE(HDA_CODEC_FUNCTION_ID)
+fi
+
AC_OUTPUT(Makefile kernel/Makefile include/Makefile)
View
7 hda-int.c
@@ -712,8 +712,11 @@ static int par_node_count(struct xhda_codec *codec, struct xhda_node *node,
static int par_function_type(struct xhda_codec *codec, struct xhda_node *node,
unsigned int cmd)
{
- if (node && node->nid == 0x01)
- return 0x01;
+ if (node && node->nid == 0x01) {
+ if (codec->function_id)
+ return codec->function_id;
+ return 0x01; /* FIXME */
+ }
return 0;
}
View
3  hda-parse.c
@@ -391,6 +391,9 @@ static int parse_root(const char *buffer)
if ((p = strmatch(buffer, "Address: "))) {
codec->addr = strtoul(p, NULL, 0);
+ } else if ((p = strmatch(buffer, "Function Id: "))) {
+ codec->function_id = strtoul(p, NULL, 0);
+ return 0;
} else if ((p = strmatch(buffer, "Vendor Id: "))) {
codec->vendor_id = strtoul(p, NULL, 0);
return 0;
View
7 hda_own_proc.c
@@ -581,8 +581,11 @@ static void print_codec_info(struct snd_info_entry *entry,
snd_iprintf(buffer, "Codec: %s\n", buf);
#endif
snd_iprintf(buffer, "Address: %d\n", codec->addr);
- snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
- snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);
+#ifdef HDA_CODEC_FUNCTION_ID
+ snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
+#endif
+ snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
+ snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
if (codec->mfg)
View
1  include/hda-types.h
@@ -75,6 +75,7 @@ struct xhda_value_cache {
struct xhda_codec {
unsigned int addr;
+ unsigned int function_id;
unsigned int vendor_id;
unsigned int subsystem_id;
unsigned int revision_id;
Please sign in to comment.
Something went wrong with that request. Please try again.