summaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2015-09-29 04:26:10 -0400
committerTakashi Iwai <tiwai@suse.de>2015-10-20 04:14:42 -0400
commitda23ac1e40ce844d1a9553906bdacce160af76f6 (patch)
treec31206e3057a14282a3cd134c7e4b74d6500639d /scripts/mod/file2alias.c
parent93ed8560e98afc486df94f5a6238c1f0894b38b8 (diff)
ALSA: hda - Add hduadio support to DEVTABLE
For generating modalias entries automatically, move the definition of struct hda_device_id to linux/mod_devicetable.h and add the handling of this record in file2alias helper. The new modalias is represented with combination of vendor id, device id, and api version as "hdaudio:vNrNaN". This patch itself doesn't convert the existing modaliases. Since they were added manually, this patch won't give any regression by itself at this point. [Modified the modalias format to adapt the api_version field, and drop invalid ANY_ID definition by tiwai] Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Tested-by: Subhransu S Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5f2088209132..fc51d4bff3f8 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1250,6 +1250,23 @@ static int do_ulpi_entry(const char *filename, void *symval,
1250} 1250}
1251ADD_TO_DEVTABLE("ulpi", ulpi_device_id, do_ulpi_entry); 1251ADD_TO_DEVTABLE("ulpi", ulpi_device_id, do_ulpi_entry);
1252 1252
1253/* Looks like: hdaudio:vNrNaN */
1254static int do_hda_entry(const char *filename, void *symval, char *alias)
1255{
1256 DEF_FIELD(symval, hda_device_id, vendor_id);
1257 DEF_FIELD(symval, hda_device_id, rev_id);
1258 DEF_FIELD(symval, hda_device_id, api_version);
1259
1260 strcpy(alias, "hdaudio:");
1261 ADD(alias, "v", vendor_id != 0, vendor_id);
1262 ADD(alias, "r", rev_id != 0, rev_id);
1263 ADD(alias, "a", api_version != 0, api_version);
1264
1265 add_wildcard(alias);
1266 return 1;
1267}
1268ADD_TO_DEVTABLE("hdaudio", hda_device_id, do_hda_entry);
1269
1253/* Does namelen bytes of name exactly match the symbol? */ 1270/* Does namelen bytes of name exactly match the symbol? */
1254static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1271static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1255{ 1272{