aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-06-27 11:19:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-02 11:42:36 -0400
commit8a37d87d72f0c69f837229c04d2fcd7117ea57e7 (patch)
tree43cf3111a964678d08fe6638e4459e1c2db50b55 /scripts/mod/file2alias.c
parent4ab8c18d4d67321cc7b660559de17511d4fc0237 (diff)
usb: typec: Bus type for alternate modes
Introducing a simple bus for the alternate modes. Bus allows binding drivers to the discovered alternate modes the partners support. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 52fd54a8fe39..7be43697ff84 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1352,6 +1352,19 @@ static int do_tbsvc_entry(const char *filename, void *symval, char *alias)
1352} 1352}
1353ADD_TO_DEVTABLE("tbsvc", tb_service_id, do_tbsvc_entry); 1353ADD_TO_DEVTABLE("tbsvc", tb_service_id, do_tbsvc_entry);
1354 1354
1355/* Looks like: typec:idNmN */
1356static int do_typec_entry(const char *filename, void *symval, char *alias)
1357{
1358 DEF_FIELD(symval, typec_device_id, svid);
1359 DEF_FIELD(symval, typec_device_id, mode);
1360
1361 sprintf(alias, "typec:id%04X", svid);
1362 ADD(alias, "m", mode != TYPEC_ANY_MODE, mode);
1363
1364 return 1;
1365}
1366ADD_TO_DEVTABLE("typec", typec_device_id, do_typec_entry);
1367
1355/* Does namelen bytes of name exactly match the symbol? */ 1368/* Does namelen bytes of name exactly match the symbol? */
1356static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1369static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1357{ 1370{