Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Reorder altmode registration

From: Andrei Kuchynski

Date: Tue Oct 20 2026 - 05:23:48 EST


On Thu, Oct 15, 2026 at 2:14 PM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote:
>
> On Thu, Oct 08, 2026 at 01:40:56PM +0000, Andrei Kuchynski wrote:
> > @@ -406,17 +406,6 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
> > struct typec_altmode_desc desc;
> > struct typec_altmode *amode;
> >
> > - /* All PD capable CrOS devices are assumed to support DP altmode. */
> > - memset(&desc, 0, sizeof(desc));
> > - desc.svid = USB_TYPEC_DP_SID;
> > - desc.mode = USB_TYPEC_DP_MODE;
> > - desc.vdo = DP_PORT_VDO;
> > - amode = cros_typec_register_displayport(port, &desc,
> > - typec->ap_driven_altmode);
> > - if (IS_ERR(amode))
> > - return PTR_ERR(amode);
> > - port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
> > -
> > /*
> > * Register TBT compatibility alt mode. The EC will not enter the mode
> > * if it doesn't support it and it will not enter automatically by
> > @@ -433,6 +422,17 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
> > port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
> > }
> >
> > + /* All PD capable CrOS devices are assumed to support DP altmode. */
> > + memset(&desc, 0, sizeof(desc));
> > + desc.svid = USB_TYPEC_DP_SID;
> > + desc.mode = USB_TYPEC_DP_MODE;
> > + desc.vdo = DP_PORT_VDO;
> > + amode = cros_typec_register_displayport(port, &desc,
> > + typec->ap_driven_altmode);
> > + if (IS_ERR(amode))
> > + return PTR_ERR(amode);
> > + port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
> > +
>
> It deserves a code comment to note that the registration order dictates
> the priorities.

Thanks for reviewing.
I will add a comment explaining the registration order priority in v3.

Thanks,
Andrei