Introducing a simple bus for the alternate modes. Bus allows binding drivers to the discovered alternate modes the partners support.
Showing the changes to scripts (2 of 14 files). Show all
Unified · Split
| @@ -221,5 +221,9 @@ int main(void) · 220 unmodified lines | ||
| 221 | 221 | DEVID_FIELD(tb_service_id, protocol_version); |
| 222 | 222 | DEVID_FIELD(tb_service_id, protocol_revision); |
| 223 | 223 | |
| 224 | + DEVID(typec_device_id); | |
| 225 | + DEVID_FIELD(typec_device_id, svid); | |
| 226 | + DEVID_FIELD(typec_device_id, mode); | |
| 227 | + | |
| 224 | 228 | return 0; |
| 225 | 229 | } |
| @@ -1352,6 +1352,19 @@ static int do_tbsvc_entry(const char *filename, void *symval, char *alias) · 1351 unmodified lines | ||
| 1352 | 1352 | } |
| 1353 | 1353 | ADD_TO_DEVTABLE("tbsvc", tb_service_id, do_tbsvc_entry); |
| 1354 | 1354 | |
| 1355 | +/* Looks like: typec:idNmN */ | |
| 1356 | +static 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 | +} | |
| 1366 | +ADD_TO_DEVTABLE("typec", typec_device_id, do_typec_entry); | |
| 1367 | + | |
| 1355 | 1368 | /* Does namelen bytes of name exactly match the symbol? */ |
| 1356 | 1369 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
| 1357 | 1370 | { |