RE: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Avoid setting usb role during disconnect

From: Shaikh, Azhar
Date: Wed Aug 05 2020 - 15:23:09 EST


Hi Prashant,


> -----Original Message-----
> From: Prashant Malani <pmalani@xxxxxxxxxxxx>
> Sent: Thursday, July 30, 2020 4:25 PM
> To: Shaikh, Azhar <azhar.shaikh@xxxxxxxxx>
> Cc: bleung@xxxxxxxxxxxx; enric.balletbo@xxxxxxxxxxxxx;
> groeck@xxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> heikki.krogerus@xxxxxxxxxxxxxxx; Patel, Utkarsh H
> <utkarsh.h.patel@xxxxxxxxx>; Bowman, Casey G
> <casey.g.bowman@xxxxxxxxx>; Mani, Rajmohan
> <rajmohan.mani@xxxxxxxxx>
> Subject: Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Avoid setting
> usb role during disconnect
>
> Hey Azhar,
>
> On Thu, Jul 30, 2020 at 11:06:12PM +0000, Shaikh, Azhar wrote:
> > Hi Prashant,
> > >
> > > Since this was the last switch being configured, please maintain the
> > > same order and add this at the end of the function, after the if-else if
> block.
> > >
> >
> > Please correct if my understanding is not correct here:
> > Set the orientation , set the role, then configure the mux. Shouldn't this be
> the order?
>
> Is this documented anywhere? Kindly provide the links to that if so. I wasn't
> aware of any ordering requirements (but I may be missing something).

The configuration of the connector should always happen in the order defined in the
USB Type-C specification. Check ch. 2.3 (USB Type-C Spec R2.0). So that will basically give you:

1. orientation
2. role(s)
3. the rest.

Also I see in USB Type-C Port Manager driver the above mentioned sequence being followed
https://elixir.bootlin.com/linux/latest/source/drivers/usb/typec/tcpm/tcpm.c#L664


>
> Please keep in mind that each of these switches (orientation, data-role,
> mode-switch, or what is referred to here as "mux") can theoretically be
> different switches, controlled independently by distinct drivers and
> hardware.
>
> We should not change what ordering is already present unless there is a
> requirement to do so. The existing ordering was orientation switch, "mux" or
> role switch, then the data-role switch, so let us stick to that.
>
> Best regards,
>
> >
> >
> > > Best regards,
> > >
> > > -Prashant

Regards,
Azhar