Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-28 Thread Heikki Krogerus
On Thu, Apr 27, 2017 at 11:10:55AM -0700, Guenter Roeck wrote: > On Thu, Apr 27, 2017 at 11:50:12AM +0530, Rajaram R wrote: > > On Tue, Apr 25, 2017 at 7:40 PM, Guenter Roeck wrote: > > > On 04/25/2017 01:26 AM, Rajaram R wrote: > > >> > > >> On Mon, Apr 24, 2017 at 11:20 PM,

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-27 Thread Guenter Roeck
On Thu, Apr 27, 2017 at 11:50:12AM +0530, Rajaram R wrote: > On Tue, Apr 25, 2017 at 7:40 PM, Guenter Roeck wrote: > > On 04/25/2017 01:26 AM, Rajaram R wrote: > >> > >> On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan > >> wrote: > >>> > >>> On

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-27 Thread Rajaram R
On Tue, Apr 25, 2017 at 7:40 PM, Guenter Roeck wrote: > On 04/25/2017 01:26 AM, Rajaram R wrote: >> >> On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan >> wrote: >>> >>> On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R >>>

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-25 Thread Guenter Roeck
On 04/25/2017 01:26 AM, Rajaram R wrote: On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan wrote: On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R wrote: On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: On Fri, Apr

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-25 Thread Rajaram R
On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan wrote: > On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R > wrote: >> On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: >>> On Fri, Apr 21, 2017 at 07:57:52PM +0530,

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-24 Thread Badhri Jagan Sridharan
On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R wrote: > On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: >> On Fri, Apr 21, 2017 at 07:57:52PM +0530, Rajaram R wrote: >>> On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan >>>

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-22 Thread Rajaram R
On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: > On Fri, Apr 21, 2017 at 07:57:52PM +0530, Rajaram R wrote: >> On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan >> wrote: >> > Thanks for the responses :) >> > >> > So seems like we have a plan.

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Guenter Roeck
On Fri, Apr 21, 2017 at 07:57:52PM +0530, Rajaram R wrote: > On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan > wrote: > > Thanks for the responses :) > > > > So seems like we have a plan. > > > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > > and

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Rajaram R
On Fri, Apr 21, 2017 at 1:16 AM, Badhri Jagan Sridharan wrote: > Thanks for the responses :) > > So seems like we have a plan. > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > and pd_revision for both the port and the partner will be removed in >

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Guenter Roeck
On 04/21/2017 05:12 AM, Heikki Krogerus wrote: Hi, On Thu, Apr 20, 2017 at 12:46:59PM -0700, Badhri Jagan Sridharan wrote: Thanks for the responses :) So seems like we have a plan. In Type-C connector class the checks for TYPEC_PWR_MODE_PD and pd_revision for both the port and the partner

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Heikki Krogerus
Hi, On Thu, Apr 20, 2017 at 12:46:59PM -0700, Badhri Jagan Sridharan wrote: > Thanks for the responses :) > > So seems like we have a plan. > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > and pd_revision for both the port and the partner will be removed in > power_role_store

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-20 Thread Badhri Jagan Sridharan
Thanks for the responses :) So seems like we have a plan. In Type-C connector class the checks for TYPEC_PWR_MODE_PD and pd_revision for both the port and the partner will be removed in power_role_store and the data_role_store and will be delegated to the low level drivers. TCPM code will issue

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-20 Thread Heikki Krogerus
On Wed, Apr 19, 2017 at 10:22:47AM -0700, Badhri Jagan Sridharan wrote: > On Wed, Apr 19, 2017 at 8:14 AM, Guenter Roeck wrote: > > On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > >> On Wed, Apr 19, 2017 at 4:23 AM, Heikki Krogerus > >>

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-20 Thread Heikki Krogerus
Hi, On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > >> What is the expected behavior when the userspace changes the > >> preferred_role node when the port is in connected state ? > >> > >> 1. the state machine re-resolves the port roles right away based on > >> the new

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Guenter Roeck
On Wed, Apr 19, 2017 at 10:22:47AM -0700, Badhri Jagan Sridharan wrote: > On Wed, Apr 19, 2017 at 8:14 AM, Guenter Roeck wrote: > > On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > >> On Wed, Apr 19, 2017 at 4:23 AM, Heikki Krogerus > >>

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Badhri Jagan Sridharan
On Wed, Apr 19, 2017 at 8:14 AM, Guenter Roeck wrote: > On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: >> On Wed, Apr 19, 2017 at 4:23 AM, Heikki Krogerus >> wrote: >> > Hi, >> > >> > On Tue, Apr 18, 2017 at 11:52:33AM

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Guenter Roeck
On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > On Wed, Apr 19, 2017 at 4:23 AM, Heikki Krogerus > wrote: > > Hi, > > > > On Tue, Apr 18, 2017 at 11:52:33AM -0700, Badhri Jagan Sridharan wrote: > >> Hi Heikki, > >> > >> I have a question

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Badhri Jagan Sridharan
On Wed, Apr 19, 2017 at 4:23 AM, Heikki Krogerus wrote: > Hi, > > On Tue, Apr 18, 2017 at 11:52:33AM -0700, Badhri Jagan Sridharan wrote: >> Hi Heikki, >> >> I have a question regarding the preferred_role node. >> >> +What:

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Heikki Krogerus
Hi, On Tue, Apr 18, 2017 at 11:52:33AM -0700, Badhri Jagan Sridharan wrote: > Hi Heikki, > > I have a question regarding the preferred_role node. > > +What: /sys/class/typec//preferred_role > +Date: March 2017 > +Contact: Heikki Krogerus

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-18 Thread Badhri Jagan Sridharan
Hi Heikki, I have a question regarding the preferred_role node. +What: /sys/class/typec//preferred_role +Date: March 2017 +Contact: Heikki Krogerus +Description: + The user space can notify the driver about the preferred

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-10 Thread Guenter Roeck
On 03/10/2017 02:22 PM, Mats Karrman wrote: On 2017-03-08 14:58, Heikki Krogerus wrote: On Tue, Mar 07, 2017 at 11:30:54PM +0100, Mats Karrman wrote: If I read Heikki's original suggestion I understand it like the DP driver would be responsible for AM specific USB PD/VDM communication. But

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-10 Thread Mats Karrman
On 2017-03-08 14:58, Heikki Krogerus wrote: On Tue, Mar 07, 2017 at 11:30:54PM +0100, Mats Karrman wrote: If I read Heikki's original suggestion I understand it like the DP driver would be responsible for AM specific USB PD/VDM communication. But wouldn't that lead to a lot of code

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Peter Chen
On Wed, Mar 08, 2017 at 06:44:47AM -0800, Guenter Roeck wrote: > On 03/07/2017 10:50 PM, Peter Chen wrote: > > > You mean type-C trigger an ACPI event, and this ACPI event can notify > related USB controller driver doing role switch? > >>> > >>>No (firmware programs the dual-role

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Guenter Roeck
On 03/07/2017 10:50 PM, Peter Chen wrote: You mean type-C trigger an ACPI event, and this ACPI event can notify related USB controller driver doing role switch? No (firmware programs the dual-role hw/registers), but never mind. That could be the case. If it is correct, there is a notifier

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Heikki Krogerus
On Tue, Mar 07, 2017 at 11:30:54PM +0100, Mats Karrman wrote: > > > So, both the DP controller and the USB PD phy are I2C devices, and now I > > > have to make them both > > > attach to the AM bus as well? > > The DP controller would provide the driver and the USB PD phy > > (actually, the typec

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
>>> You mean type-C trigger an ACPI event, and this ACPI event can notify >>> related USB controller driver doing role switch? >> >> No (firmware programs the dual-role hw/registers), but never mind. >> That could be the case. >> >>> If it is correct, there is a notifier between type-C and USB

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Guenter Roeck
On 03/07/2017 02:30 PM, Mats Karrman wrote: [ ... ] I'm still struggling to catch up on what you guys have been up to during the last year or so :-) and came across some patches of Guenter from last October: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1243527.html What

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Guenter Roeck
On 03/07/2017 12:57 AM, Heikki Krogerus wrote: On Tue, Mar 07, 2017 at 01:36:29AM +, Peter Chen wrote: On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: What interface you use when you receive this event to handle dual-role switch? I am wonder if a common dual-role class is

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Mats Karrman
On 2017-03-06 14:14, Heikki Krogerus wrote: Hi Mats, On Fri, Mar 03, 2017 at 08:27:08PM +0100, Mats Karrman wrote: My system is a bit different. It's an i.MX6 SoC with the typec phy and DP controller connected directly to the SoC and it's using DTB/OF. Is this "DP controller" a controller

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Heikki Krogerus
On Tue, Mar 07, 2017 at 01:36:29AM +, Peter Chen wrote: > >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: > >> > > 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

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Peter Chen
> >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: >> > > 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

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Heikki Krogerus
Hi Peter, On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: > > > 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

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Heikki Krogerus
Hi Mats, On Fri, Mar 03, 2017 at 08:27:08PM +0100, Mats Karrman wrote: > On 2017-03-03 13:59, Heikki Krogerus wrote: > > > On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: > > > > > How would something like that sound to you guys? > > Complicated... Need to marinate on that

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Oliver Neukum
Am Freitag, den 03.03.2017, 20:27 +0100 schrieb Mats Karrman: > On 2017-03-03 13:59, Heikki Krogerus wrote: > > > > > On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: > > > > > > > How would something like that sound to you guys? > > Complicated... Need to marinate on that

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 06:36:50AM -0800, Guenter Roeck wrote: > On 03/02/2017 08:52 PM, Peter Chen wrote: > >On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > >>On 03/02/2017 07:35 PM, Peter Chen wrote: > >>>On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > +/*

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
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

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Guenter Roeck
On 03/03/2017 04:59 AM, Heikki Krogerus wrote: Hi, On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: On 2017-03-03 04:13, Guenter Roeck wrote: On 03/02/2017 07:22 AM, Mats Karrman wrote: Looking forward, one thing I have run into is how to connect the typec driver with a

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Mats Karrman
On 2017-03-03 13:59, Heikki Krogerus wrote: On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: How would something like that sound to you guys? Complicated... Need to marinate on that for a while ;) My system is a bit different. It's an i.MX6 SoC with the typec phy and DP

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Guenter Roeck
On 03/02/2017 11:29 PM, Mats Karrman wrote: On 2017-03-03 04:13, Guenter Roeck wrote: On 03/02/2017 07:22 AM, Mats Karrman wrote: Looking forward, one thing I have run into is how to connect the typec driver with a driver for an alternate mode. E.g. the DisplayPort Alternate Mode

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Heikki Krogerus
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

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Guenter Roeck
On 03/02/2017 08:52 PM, Peter Chen wrote: On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: On 03/02/2017 07:35 PM, Peter Chen wrote: On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: +/* --- */ +/* Driver callbacks to report

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Heikki Krogerus
Hi, On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: > On 2017-03-03 04:13, Guenter Roeck wrote: > > > On 03/02/2017 07:22 AM, Mats Karrman wrote: > > > > > > Looking forward, one thing I have run into is how to connect the typec > > > driver with a > > > driver for an

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Enric Balletbo Serra
2017-03-03 8:29 GMT+01:00 Mats Karrman : > On 2017-03-03 04:13, Guenter Roeck wrote: > >> On 03/02/2017 07:22 AM, Mats Karrman wrote: >>> >>> >>> Looking forward, one thing I have run into is how to connect the typec >>> driver with a >>> driver for an alternate mode.

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Mats Karrman
On 2017-03-03 04:13, Guenter Roeck wrote: On 03/02/2017 07:22 AM, Mats Karrman wrote: Looking forward, one thing I have run into is how to connect the typec driver with a driver for an alternate mode. E.g. the DisplayPort Alternate Mode specification includes the HPD (hot plug) and

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Guenter Roeck
On 03/02/2017 07:35 PM, 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

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Peter Chen
On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > On 03/02/2017 07:35 PM, Peter Chen wrote: > >On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > >>+/* --- */ > >>+/* Driver callbacks to report role updates */ > >>+ > >>+/** > >>+

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Peter Chen
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:

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Guenter Roeck
On 03/02/2017 07:22 AM, Mats Karrman wrote: Hi Heikki, Good to see things are happening with Type-C! On 2017-02-21 15:24, Heikki Krogerus wrote: ... +When connected, the partner will be presented also as its own device under +/sys/class/typec/. The parent of the partner device will always be

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-02 Thread Mats Karrman
Hi Heikki, Good to see things are happening with Type-C! On 2017-02-21 15:24, Heikki Krogerus wrote: ... +When connected, the partner will be presented also as its own device under +/sys/class/typec/. The parent of the partner device will always be the port it +is attached to. The partner

[PATCH v17 2/3] usb: USB Type-C connector class

2017-02-21 Thread Heikki Krogerus
The purpose of USB Type-C connector class is to provide unified interface for the user space to get the status and basic information about USB Type-C connectors on a system, control over data role swapping, and when the port supports USB Power Delivery, also control over power role swapping and