usb: typec: Only use SVID for matching altmodes

Mode in struct typec_altmode is used to indicate the index of the
altmode on a port, partner or plug. It is used in enter mode VDMs but
doesn't make much sense for matching against altmode drivers or for
matching partner to port altmodes.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20241213153543.v5.1.Ie0d37646f18461234777d88b4c3e21faed92ed4f@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Abhishek Pandit-Subedi
2024-12-13 15:35:42 -08:00
committed by Greg Kroah-Hartman
parent 1ff24d40b3
commit 8541bf0239
6 changed files with 8 additions and 16 deletions

View File

@@ -237,7 +237,6 @@ int main(void)
DEVID(typec_device_id);
DEVID_FIELD(typec_device_id, svid);
DEVID_FIELD(typec_device_id, mode);
DEVID(tee_client_device_id);
DEVID_FIELD(tee_client_device_id, uuid);

View File

@@ -1221,17 +1221,12 @@ static void do_tbsvc_entry(struct module *mod, void *symval)
module_alias_printf(mod, true, "tbsvc:%s", alias);
}
/* Looks like: typec:idNmN */
/* Looks like: typec:idN */
static void do_typec_entry(struct module *mod, void *symval)
{
char alias[256] = {};
DEF_FIELD(symval, typec_device_id, svid);
DEF_FIELD(symval, typec_device_id, mode);
ADD(alias, "m", mode != TYPEC_ANY_MODE, mode);
module_alias_printf(mod, false, "typec:id%04X%s", svid, alias);
module_alias_printf(mod, false, "typec:id%04X", svid);
}
/* Looks like: tee:uuid */