uint32_t format, rate;
struct gbaudio_module_info *module;
struct gbaudio_data_connection *data;
+ struct gb_bundle *bundle;
struct gbaudio_codec_info *codec = dev_get_drvdata(dai->dev);
mutex_lock(&codec->lock);
return -EINVAL;
}
+ bundle = to_gb_bundle(module->dev);
+ ret = gb_pm_runtime_get_sync(bundle);
+ if (ret) {
+ mutex_unlock(&codec->lock);
+ return ret;
+ }
+
ret = gb_audio_apbridgea_set_config(data->connection, 0,
AUDIO_APBRIDGEA_PCM_FMT_16,
AUDIO_APBRIDGEA_PCM_RATE_48000,
mutex_unlock(&codec->lock);
return ret;
}
+
+ gb_pm_runtime_put_noidle(bundle);
+
codec->stream[substream->stream].state = GBAUDIO_CODEC_HWPARAMS;
codec->stream[substream->stream].format = format;
codec->stream[substream->stream].rate = rate;
int ret;
struct gbaudio_module_info *module;
struct gbaudio_data_connection *data;
+ struct gb_bundle *bundle;
struct gbaudio_codec_info *codec = dev_get_drvdata(dai->dev);
mutex_lock(&codec->lock);
return -ENODEV;
}
+ bundle = to_gb_bundle(module->dev);
+ ret = gb_pm_runtime_get_sync(bundle);
+ if (ret) {
+ mutex_unlock(&codec->lock);
+ return ret;
+ }
+
switch (substream->stream) {
case SNDRV_PCM_STREAM_PLAYBACK:
ret = gb_audio_apbridgea_set_tx_data_size(data->connection, 0,
return ret;
}
+ gb_pm_runtime_put_noidle(bundle);
+
codec->stream[substream->stream].state = GBAUDIO_CODEC_PREPARE;
mutex_unlock(&codec->lock);
return 0;
int ret;
struct gbaudio_data_connection *data;
struct gbaudio_module_info *module;
+ struct gb_bundle *bundle;
struct gbaudio_codec_info *codec = dev_get_drvdata(dai->dev);
return -ENODEV;
}
+ bundle = to_gb_bundle(module->dev);
+ ret = gb_pm_runtime_get_sync(bundle);
+ if (ret) {
+ mutex_unlock(&codec->lock);
+ return ret;
+ }
+
if (!mute && !stream) {/* start playback */
ret = gb_audio_apbridgea_prepare_tx(data->connection,
0);
module->name, mute ? "Mute" : "Unmute",
stream ? "Capture" : "Playback", ret);
+ gb_pm_runtime_put_noidle(bundle);
mutex_unlock(&codec->lock);
return ret;
}