Loading drivers/usb/typec/ucsi/ucsi.c +10 −5 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ int ucsi_resume(struct ucsi *ucsi) u64 command; /* Restore UCSI notification enable mask after system resume */ command = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; return ucsi_send_command(ucsi, command, NULL, 0); } Loading Loading @@ -589,6 +589,11 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num) { struct ucsi_connector *con = &ucsi->connector[num - 1]; if (!(ucsi->ntfy & UCSI_ENABLE_NTFY_CONNECTOR_CHANGE)) { dev_dbg(ucsi->dev, "Bogus connetor change event\n"); return; } if (!test_and_set_bit(EVENT_PENDING, &ucsi->flags)) schedule_work(&con->work); } Loading Loading @@ -656,7 +661,7 @@ static int ucsi_role_cmd(struct ucsi_connector *con, u64 command) ucsi_reset_ppm(con->ucsi); mutex_unlock(&con->ucsi->ppm_lock); c = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; c = UCSI_SET_NOTIFICATION_ENABLE | con->ucsi->ntfy; ucsi_send_command(con->ucsi, c, NULL, 0); ucsi_reset_connector(con, true); Loading Loading @@ -890,8 +895,8 @@ int ucsi_init(struct ucsi *ucsi) } /* Enable basic notifications */ command = UCSI_SET_NOTIFICATION_ENABLE; command |= UCSI_ENABLE_NTFY_CMD_COMPLETE | UCSI_ENABLE_NTFY_ERROR; ucsi->ntfy = UCSI_ENABLE_NTFY_CMD_COMPLETE | UCSI_ENABLE_NTFY_ERROR; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; ret = ucsi_run_command(ucsi, command, NULL, 0); if (ret < 0) goto err_reset; Loading Loading @@ -923,7 +928,7 @@ int ucsi_init(struct ucsi *ucsi) } /* Enable all notifications */ command = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; ret = ucsi_run_command(ucsi, command, NULL, 0); if (ret < 0) goto err_unregister; Loading drivers/usb/typec/ucsi/ucsi.h +3 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,9 @@ struct ucsi { /* PPM Communication lock */ struct mutex ppm_lock; /* The latest "Notification Enable" bits (SET_NOTIFICATION_ENABLE) */ u64 ntfy; /* PPM communication flags */ unsigned long flags; #define EVENT_PENDING 0 Loading Loading
drivers/usb/typec/ucsi/ucsi.c +10 −5 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ int ucsi_resume(struct ucsi *ucsi) u64 command; /* Restore UCSI notification enable mask after system resume */ command = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; return ucsi_send_command(ucsi, command, NULL, 0); } Loading Loading @@ -589,6 +589,11 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num) { struct ucsi_connector *con = &ucsi->connector[num - 1]; if (!(ucsi->ntfy & UCSI_ENABLE_NTFY_CONNECTOR_CHANGE)) { dev_dbg(ucsi->dev, "Bogus connetor change event\n"); return; } if (!test_and_set_bit(EVENT_PENDING, &ucsi->flags)) schedule_work(&con->work); } Loading Loading @@ -656,7 +661,7 @@ static int ucsi_role_cmd(struct ucsi_connector *con, u64 command) ucsi_reset_ppm(con->ucsi); mutex_unlock(&con->ucsi->ppm_lock); c = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; c = UCSI_SET_NOTIFICATION_ENABLE | con->ucsi->ntfy; ucsi_send_command(con->ucsi, c, NULL, 0); ucsi_reset_connector(con, true); Loading Loading @@ -890,8 +895,8 @@ int ucsi_init(struct ucsi *ucsi) } /* Enable basic notifications */ command = UCSI_SET_NOTIFICATION_ENABLE; command |= UCSI_ENABLE_NTFY_CMD_COMPLETE | UCSI_ENABLE_NTFY_ERROR; ucsi->ntfy = UCSI_ENABLE_NTFY_CMD_COMPLETE | UCSI_ENABLE_NTFY_ERROR; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; ret = ucsi_run_command(ucsi, command, NULL, 0); if (ret < 0) goto err_reset; Loading Loading @@ -923,7 +928,7 @@ int ucsi_init(struct ucsi *ucsi) } /* Enable all notifications */ command = UCSI_SET_NOTIFICATION_ENABLE | UCSI_ENABLE_NTFY_ALL; command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy; ret = ucsi_run_command(ucsi, command, NULL, 0); if (ret < 0) goto err_unregister; Loading
drivers/usb/typec/ucsi/ucsi.h +3 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,9 @@ struct ucsi { /* PPM Communication lock */ struct mutex ppm_lock; /* The latest "Notification Enable" bits (SET_NOTIFICATION_ENABLE) */ u64 ntfy; /* PPM communication flags */ unsigned long flags; #define EVENT_PENDING 0 Loading