Commit 2ede5546 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Greg Kroah-Hartman

usb: typec: ucsi: Remove the old API

The drivers now only use the new API, so removing the old one.
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: default avatarAjay Gupta <ajayg@nvidia.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20191104142435.29960-15-heikki.krogerus@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e32fd989
......@@ -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;
......@@ -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;
}
/*
......@@ -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)
......
......@@ -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),
......
This diff is collapsed.
......@@ -398,54 +398,13 @@ struct ucsi_connector_status {
/* -------------------------------------------------------------------------- */
struct ucsi;
struct ucsi_data {
u16 version;
u16 reserved;
union {
u32 raw_cci;
struct ucsi_cci cci;
};
struct ucsi_control ctrl;
u32 message_in[4];
u32 message_out[4];
} __packed;
/*
* struct ucsi_ppm - Interface to UCSI Platform Policy Manager
* @data: memory location to the UCSI data structures
* @cmd: UCSI command execution routine
* @sync: Refresh UCSI mailbox (the data structures)
*/
struct ucsi_ppm {
struct ucsi_data *data;
int (*cmd)(struct ucsi_ppm *, struct ucsi_control *);
int (*sync)(struct ucsi_ppm *);
};
struct ucsi *ucsi_register_ppm(struct device *dev, struct ucsi_ppm *ppm);
void ucsi_unregister_ppm(struct ucsi *ucsi);
void ucsi_notify(struct ucsi *ucsi);
/* -------------------------------------------------------------------------- */
enum ucsi_status {
UCSI_IDLE = 0,
UCSI_BUSY,
UCSI_ERROR,
};
struct ucsi {
u16 version;
struct device *dev;
struct ucsi_ppm *ppm;
struct driver_data *driver_data;
const struct ucsi_operations *ops;
enum ucsi_status status;
struct completion complete;
struct ucsi_capability cap;
struct ucsi_connector *connector;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment