Skip to content

Commit

Permalink
usb: typec: ucsi: Remove the old API
Browse files Browse the repository at this point in the history
The drivers now only use the new API, so removing the old one.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20191104142435.29960-15-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Heikki Krogerus authored and Greg Kroah-Hartman committed Nov 4, 2019
1 parent e32fd98 commit 2ede554
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 385 deletions.
24 changes: 11 additions & 13 deletions drivers/usb/typec/ucsi/displayport.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct ucsi_dp {
static int ucsi_displayport_enter(struct typec_altmode *alt)
{
struct ucsi_dp *dp = typec_altmode_get_drvdata(alt);
struct ucsi *ucsi = dp->con->ucsi;
struct ucsi_control ctrl;
u8 cur = 0;
int ret;
Expand All @@ -59,25 +60,21 @@ static int ucsi_displayport_enter(struct typec_altmode *alt)

dev_warn(&p->dev,
"firmware doesn't support alternate mode overriding\n");
mutex_unlock(&dp->con->lock);
return -EOPNOTSUPP;
ret = -EOPNOTSUPP;
goto err_unlock;
}

UCSI_CMD_GET_CURRENT_CAM(ctrl, dp->con->num);
ret = ucsi_send_command(dp->con->ucsi, &ctrl, &cur, sizeof(cur));
ret = ucsi_send_command(ucsi, command, &cur, sizeof(cur));
if (ret < 0) {
if (dp->con->ucsi->ppm->data->version > 0x0100) {
mutex_unlock(&dp->con->lock);
return ret;
}
if (ucsi->version > 0x0100)
goto err_unlock;
cur = 0xff;
}

if (cur != 0xff) {
mutex_unlock(&dp->con->lock);
if (dp->con->port_altmode[cur] == alt)
return 0;
return -EBUSY;
ret = dp->con->port_altmode[cur] == alt ? 0 : -EBUSY;
goto err_unlock;
}

/*
Expand All @@ -94,10 +91,11 @@ static int ucsi_displayport_enter(struct typec_altmode *alt)
dp->vdo_size = 1;

schedule_work(&dp->work);

ret = 0;
err_unlock:
mutex_unlock(&dp->con->lock);

return 0;
return ret;
}

static int ucsi_displayport_exit(struct typec_altmode *alt)
Expand Down
17 changes: 0 additions & 17 deletions drivers/usb/typec/ucsi/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,6 @@ DEFINE_EVENT(ucsi_log_command, ucsi_reset_ppm,
TP_ARGS(ctrl, ret)
);

DECLARE_EVENT_CLASS(ucsi_log_cci,
TP_PROTO(u32 cci),
TP_ARGS(cci),
TP_STRUCT__entry(
__field(u32, cci)
),
TP_fast_assign(
__entry->cci = cci;
),
TP_printk("CCI=%08x %s", __entry->cci, ucsi_cci_str(__entry->cci))
);

DEFINE_EVENT(ucsi_log_cci, ucsi_notify,
TP_PROTO(u32 cci),
TP_ARGS(cci)
);

DECLARE_EVENT_CLASS(ucsi_log_connector_status,
TP_PROTO(int port, struct ucsi_connector_status *status),
TP_ARGS(port, status),
Expand Down
Loading

0 comments on commit 2ede554

Please sign in to comment.