diff options
author | Prashant Malani <pmalani@chromium.org> | 2020-11-16 23:11:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-18 14:55:46 +0300 |
commit | a0ccdc4a77a1b36b682ae60361879eca0a0f88d6 (patch) | |
tree | 87efac4589cad63f175e81b86171b315b9f7756b /include/linux/usb | |
parent | 8a5ca78f603977d6b9b2d7dcb3b1b6ef601d3cc7 (diff) | |
download | linux-a0ccdc4a77a1b36b682ae60361879eca0a0f88d6.tar.xz |
usb: typec: Add number of altmodes partner attr
Add a user-visible attribute for the number of alternate modes available
in a partner. This allows userspace to determine whether there are any
remaining alternate modes left to be registered by the kernel driver. It
can begin executing any policy state machine after all available
alternate modes have been registered with the connector class framework.
This value is set to "-1" initially, signifying that a valid number of
alternate modes haven't been set for the partner.
Also add a sysfs file which exposes this attribute. The file remains
hidden as long as the attribute value is -1.
Cc: Benson Leung <bleung@chromium.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201116201150.2919178-3-pmalani@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/typec.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h index 6be558045942..bc6b1a71cb8a 100644 --- a/include/linux/usb/typec.h +++ b/include/linux/usb/typec.h @@ -126,6 +126,7 @@ struct typec_altmode_desc { enum typec_port_data roles; }; +int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmodes); struct typec_altmode *typec_partner_register_altmode(struct typec_partner *partner, const struct typec_altmode_desc *desc); |