[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 3 Mar 2017 11:35:29 +0800
From: Peter Chen <hzpeterchen@...il.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Oliver Neukum <oneukum@...e.com>, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, Roger Quadros <rogerq@...com>,
Jun Li <jun.li@....com>
Subject: Re: [PATCH v17 2/3] usb: USB Type-C connector class
On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote:
> +/* --------------------------------------- */
> +/* Driver callbacks to report role updates */
> +
> +/**
> + * typec_set_data_role - Report data role change
> + * @port: The USB Type-C Port where the role was changed
> + * @role: The new data role
> + *
> + * This routine is used by the port drivers to report data role changes.
> + */
> +void typec_set_data_role(struct typec_port *port, enum typec_data_role role)
> +{
> + if (port->data_role == role)
> + return;
> +
> + port->data_role = role;
> + sysfs_notify(&port->dev.kobj, NULL, "data_role");
> + kobject_uevent(&port->dev.kobj, KOBJ_CHANGE);
> +}
> +EXPORT_SYMBOL_GPL(typec_set_data_role);
> +
Hi Keikki,
Have you tested this interface with real dual-role controller/board?
What interface you use when you receive this event to handle
dual-role switch? I am wonder if a common dual-role class is
needed, then we can have a common user utility.
Eg, if "data_role" has changed, the udev can echo "data_role" to
/sys/class/usb-dual-role/role
Maybe we can enhance Roger's drd framework [1] to fulfill that.
[1] https://lwn.net/Articles/682531/
--
Best Regards,
Peter Chen
Powered by blists - more mailing lists