Re: [PATCH 5/5] usb: typec: ucsi: Support for DisplayPort alt mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ajay,

On Tue, Feb 05, 2019 at 07:24:49PM +0000, Ajay Gupta wrote:
> > +static int ucsi_displayport_configure(struct ucsi_dp *dp) {
> > +	u32 pins = DP_CONF_GET_PIN_ASSIGN(dp->data.conf);
> > +	struct ucsi_control ctrl;
> > +
> > +	if (!dp->override)
> > +		return 0;
> > +
> > +	ctrl.raw_cmd = UCSI_CMD_SET_NEW_CAM(dp->con->num, 1, dp-
> > >offset,
> > +pins);
> If previous CAM is active at this point then we should exit before setting new
> CAM. Please add something like :
> 
> +	if (!dp->override)
> +		return 0;
> 
>         UCSI_CMD_GET_CURRENT_CAM(ctrl, dp->con->num);
>         ret = ucsi_send_command(dp->con->ucsi, &ctrl, &cur, sizeof(cur));
>         while ((cur != 0xff) && (cur != dp->offset)) {
>                 ctrl.raw_cmd = UCSI_CMD_SET_NEW_CAM(dp->con->num, 0, cur, 0);
>                 ret = ucsi_send_command(dp->con->ucsi, &ctrl, NULL, 0);
>                 UCSI_CMD_GET_CURRENT_CAM(ctrl, dp->con->num);
>                 ret = ucsi_send_command(dp->con->ucsi, &ctrl, &cur, sizeof(cur));
>         }
> +	ctrl.raw_cmd = UCSI_CMD_SET_NEW_CAM(dp->con->num, 1, dp-

I'll take a look at this before preparing the next version.


thanks,

-- 
heikki



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux