Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1592875
| From | Peter Chen <hzpeterchen@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v17 2/3] usb: USB Type-C connector class |
| Date | 2017-03-06 02:20 +0100 |
| Message-ID | <thPtE-oe-3@gated-at.bofh.it> (permalink) |
| References | <tdjC2-3LX-17@gated-at.bofh.it> <tdjC2-3LX-25@gated-at.bofh.it> <tgOzD-5ms-7@gated-at.bofh.it> <tgWGT-2zu-33@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Mar 03, 2017 at 04:31:33PM +0200, Heikki Krogerus wrote:
> Hi Peter,
>
> On Fri, Mar 03, 2017 at 11:35:29AM +0800, Peter Chen wrote:
> > 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?
>
> Yes. Our boards are mostly USB dual-role capable.
>
> > 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
>
> No. If the partner executes successfully for example DR_Swap message,
> the kernel has to take care everything that is needed for the role to
> be what ever was negotiated on its own. User space can't be involved
> with that.
>
Would you give me an example how kernel handle this? How type-C event
triggers role switch?
--
Best Regards,
Peter Chen
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v17 2/3] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-03-03 15:50 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Peter Chen <hzpeterchen@gmail.com> - 2017-03-06 02:20 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-03-06 14:30 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-03-07 11:50 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Guenter Roeck <linux@roeck-us.net> - 2017-03-08 05:10 +0100
RE: [PATCH v17 2/3] usb: USB Type-C connector class Peter Chen <peter.chen@nxp.com> - 2017-03-08 08:00 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Guenter Roeck <linux@roeck-us.net> - 2017-03-08 15:50 +0100
Re: [PATCH v17 2/3] usb: USB Type-C connector class Peter Chen <hzpeterchen@gmail.com> - 2017-03-09 03:10 +0100
RE: [PATCH v17 2/3] usb: USB Type-C connector class Peter Chen <peter.chen@nxp.com> - 2017-03-07 14:10 +0100
csiph-web