Re: [PATCH v5 3/7] platform/chrome: cros_typec_switch: Set EC retimer

From: Prashant Malani
Date: Tue Aug 16 2022 - 17:45:25 EST


On Mon, Aug 15, 2022 at 10:11 PM Tzung-Bi Shih <tzungbi@xxxxxxxxxx> wrote:
>
> On Mon, Aug 15, 2022 at 06:34:21AM +0000, Prashant Malani wrote:
> > +static int cros_typec_cmd_mux_set(struct cros_typec_switch_data *sdata, int port_num, u8 index,
> > + u8 state)
> > +{
> > + struct typec_usb_mux_set params = {
> > + .mux_index = index,
> > + .mux_flags = state,
> > + };
> > +
> > + struct ec_params_typec_control req = {
> > + .port = port_num,
> > + .command = TYPEC_CONTROL_COMMAND_USB_MUX_SET,
> > + .mux_params = params,
> > + };
>
> Would it be better to avoid the memory copy by making `params` inline?
>
> E.g.:
> struct ec_params_typec_control req = {
> ...
> .mux_params = {
> ...
> },
> ...

Done.

>
> > +/*
> > + * The Chrome EC treats both mode-switches and retimers as "muxes" for the purposes of the
>
> To be consistent to the series, I guess you would like to use ChromeOS
> instead of Chrome?
Fixed in v6.

>