Skip to contentSkip to conversation

usb: typec: ucsi: Support for DisplayPort alt mode

PATCH New Heikki Krogerus 1 participant 1 message Feb 6, 2019 USB

lore
Share & tools
lore
#0 lore raw

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

Hi Ajay,

Quoted 15 lines · Ajay Gupta
Quoted 10 lines
(quoted diff) +8 -0
+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-
Quoted 1 line

offset,

+pins);

If previous CAM is active at this point then we should exit before setting new CAM. Please add something like :

(quoted diff) +2 -0
+	if (!dp->override)
+		return 0;

Review

Quoted 10 lines
(quoted diff) +1 -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,