Re: [PATCH v2 3/7] usb: typec: Auto enter control for alternate modes

From: Heikki Krogerus
Date: Thu Oct 31 2024 - 10:33:18 EST


On Wed, Oct 30, 2024 at 02:28:34PM -0700, Abhishek Pandit-Subedi wrote:
> Add controls for whether an alternate mode is automatically entered when
> a partner connects. The auto_enter control is only available on ports
> and applies immediately after a partner connects. The default behavior
> is to enable auto enter and drivers must explicitly disable it.
>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@xxxxxxxxxxxx>
> ---
>
> (no changes since v1)
>
> Documentation/ABI/testing/sysfs-bus-typec | 9 +++++++
> drivers/usb/typec/altmodes/displayport.c | 6 +++--
> drivers/usb/typec/altmodes/thunderbolt.c | 3 ++-
> drivers/usb/typec/class.c | 31 +++++++++++++++++++++++
> include/linux/usb/typec.h | 2 ++
> include/linux/usb/typec_altmode.h | 2 ++
> 6 files changed, 50 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-typec b/Documentation/ABI/testing/sysfs-bus-typec
> index 205d9c91e2e1..f09d05727b82 100644
> --- a/Documentation/ABI/testing/sysfs-bus-typec
> +++ b/Documentation/ABI/testing/sysfs-bus-typec
> @@ -12,6 +12,15 @@ Description:
>
> Valid values are boolean.
>
> +What: /sys/bus/typec/devices/.../auto_enter
> +Date: September 2024
> +Contact: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> +Description:
> + Controls whether a mode will be automatically entered when a partner is
> + connected.
> +
> + This field is only valid and displayed on a port. Valid values are boolean.

So, why can't this be controlled with the "active" property of the
port altmode instead? That's why it's there.

Sorry if I missed something in v1 related to this question.

thanks,

--
heikki