if (!pb_state && !cap_state)
return;
+ dev_dbg(gbcodec->dev, "%s: removed, cleanup APBridge\n", module->name);
if (pb_state == GBAUDIO_CODEC_START) {
/* cleanup PB path, only APBridge specific */
data = find_data(module, gbcodec->stream[0].dai_name);
__func__);
return;
}
- ret = gb_audio_apbridgea_stop_tx(data->connection, 0);
- if (ret)
- return;
- ret = gb_audio_apbridgea_shutdown_tx(data->connection, 0);
- if (ret)
- return;
+
+ if (list_is_singular(&gbcodec->module_list)) {
+ ret = gb_audio_apbridgea_stop_tx(data->connection, 0);
+ if (ret)
+ return;
+ ret = gb_audio_apbridgea_shutdown_tx(data->connection,
+ 0);
+ if (ret)
+ return;
+ }
i2s_port = 0; /* fixed for now */
cportid = data->connection->hd_cport_id;
ret = gb_audio_apbridgea_unregister_cport(data->connection,
__func__);
return;
}
- ret = gb_audio_apbridgea_stop_rx(data->connection, 0);
- if (ret)
- return;
- ret = gb_audio_apbridgea_shutdown_rx(data->connection, 0);
- if (ret)
- return;
+ if (list_is_singular(&gbcodec->module_list)) {
+ ret = gb_audio_apbridgea_stop_rx(data->connection, 0);
+ if (ret)
+ return;
+ ret = gb_audio_apbridgea_shutdown_rx(data->connection,
+ 0);
+ if (ret)
+ return;
+ }
i2s_port = 0; /* fixed for now */
cportid = data->connection->hd_cport_id;
ret = gb_audio_apbridgea_unregister_cport(data->connection,
dev_dbg(codec->dev, "Process Unregister %s module\n", module->name);
mutex_lock(&module->lock);
- if (list_is_last(&module->list, &gbcodec->module_list)) {
- dev_dbg(codec->dev, "Last module removed, cleanup APBridge\n");
- gbaudio_codec_cleanup(module);
- }
+ gbaudio_codec_cleanup(module);
module->is_connected = 0;
if (module->dapm_routes) {