diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2015-09-29 04:26:10 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-10-20 04:14:42 -0400 |
commit | da23ac1e40ce844d1a9553906bdacce160af76f6 (patch) | |
tree | c31206e3057a14282a3cd134c7e4b74d6500639d /scripts/mod/file2alias.c | |
parent | 93ed8560e98afc486df94f5a6238c1f0894b38b8 (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.c | 17 |
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 | } |
1251 | ADD_TO_DEVTABLE("ulpi", ulpi_device_id, do_ulpi_entry); | 1251 | ADD_TO_DEVTABLE("ulpi", ulpi_device_id, do_ulpi_entry); |
1252 | 1252 | ||
1253 | /* Looks like: hdaudio:vNrNaN */ | ||
1254 | static 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 | } | ||
1268 | ADD_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? */ |
1254 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) | 1271 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
1255 | { | 1272 | { |