@@ -1755,6 +1755,9 @@ static int ucsi_init(struct ucsi *ucsi)
if (UCSI_CCI_CONNECTOR(cci))
ucsi_connector_change(ucsi, UCSI_CCI_CONNECTOR(cci));
+ if (ucsi->ops->ucsi_registered)
+ ucsi->ops->ucsi_registered(ucsi);
+
return 0;
err_unregister:
@@ -62,6 +62,7 @@ struct dentry;
* @update_altmodes: Squashes duplicate DP altmodes
* @update_connector: Update connector capabilities before registering
* @connector_status: Updates connector status, called holding connector lock
+ * @ucsi_registered: notify host driver when the UCSI interface is registered
*
* Read and write routines for UCSI interface. @sync_write must wait for the
* Command Completion Event from the PPM before returning, and @async_write must
@@ -78,6 +79,7 @@ struct ucsi_operations {
struct ucsi_altmode *updated);
void (*update_connector)(struct ucsi_connector *con);
void (*connector_status)(struct ucsi_connector *con);
+ void (*ucsi_registered)(struct ucsi *ucsi);
};
struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops);
As the registration of the UCSI device is performed from the scheduled worker, the glue driver isn't notified when the UCSI registration succeeds. The ucsi_glink driver needs this event to be able to manually register DisplayPort altmodes. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/usb/typec/ucsi/ucsi.c | 3 +++ drivers/usb/typec/ucsi/ucsi.h | 2 ++ 2 files changed, 5 insertions(+)