Re: [PATCH] platform/chrome: cros_ec_typec: Add support for setting USB mode via sysfs
From: Tzung-Bi Shih
Date: Thu Feb 20 2025 - 20:41:53 EST
On Thu, Feb 20, 2025 at 01:39:57PM +0000, Andrei Kuchynski wrote:
> On Tue, Feb 18, 2025 at 2:26 PM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote:
> >
> > On Mon, Feb 10, 2025 at 01:04:19PM +0000, Andrei Kuchynski wrote:
> > > +static int cros_typec_enter_usb_mode(struct typec_port *tc_port, enum usb_mode mode)
> > > +{
> > > + struct cros_typec_port *port = typec_get_drvdata(tc_port);
> > > + struct ec_params_typec_control req = {
> > > + .port = port->port_num,
> > > + .command = (mode == USB_MODE_USB4) ?
> > > + TYPEC_CONTROL_COMMAND_ENTER_MODE : TYPEC_CONTROL_COMMAND_EXIT_MODES,
> > > + .mode_to_enter = CROS_EC_ALTMODE_USB4
> >
> > The symbol `CROS_EC_ALTMODE_USB4` doesn't exist. On a related note, wouldn't
> > it always enter CROS_EC_ALTMODE_USB4 if the value is hard-coded here?
> >
>
> CROS_EC_ALTMODE_USB4 is defined in drivers/platform/chrome/cros_ec_typec.h.
I see. Overlooked that.