diff --git a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c index 09218c37..ea66adad 100644 --- a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c +++ b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c @@ -624,3 +624,12 @@ FAIL: return err; } EXPORT_SYMBOL_COMMS(tsec_comms_set_init_cb); + +void tsec_comms_clear_init_cb(void) +{ + tsec_plat_acquire_comms_mutex(); + s_callbacks[RM_GSP_UNIT_INIT].cb_func = NULL; + s_callbacks[RM_GSP_UNIT_INIT].cb_ctx = NULL; + tsec_plat_release_comms_mutex(); +} +EXPORT_SYMBOL_COMMS(tsec_comms_clear_init_cb); diff --git a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.h b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.h index c273c42e..9d2bc997 100644 --- a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.h +++ b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.h @@ -61,6 +61,16 @@ void tsec_comms_drain_msg(bool invoke_cb); */ int tsec_comms_set_init_cb(callback_func_t cb_func, void *cb_ctx); +/* @brief: Clear callback for init message + * + * usage: When DisplayRM is unloaded it would call this API to + * clear the init callback it previousy set. + * + * params[in]: NONE + * params[out]: NONE + */ +void tsec_comms_clear_init_cb(void); + /* @brief: Send the command upon receiving it by putting it into the * tsec queue. Also sets appropriate callback to be called when * response arrives.