return 0;
}
-static int cs35l56_wait_dsp_ready(struct cs35l56_private *cs35l56)
+static void cs35l56_wait_dsp_ready(struct cs35l56_private *cs35l56)
{
- int ret;
-
- if (!cs35l56->fw_patched) {
- /* block until firmware download completes */
- ret = wait_for_completion_timeout(&cs35l56->dsp_ready_completion,
- msecs_to_jiffies(25000));
- if (!ret) {
- dev_err(cs35l56->dev, "dsp_ready_completion timeout\n");
- return -ETIMEDOUT;
- }
- }
-
- return 0;
+ /* Wait for patching to complete */
+ flush_work(&cs35l56->dsp_work);
}
static int cs35l56_dspwait_get_volsw(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
- int ret = cs35l56_wait_dsp_ready(cs35l56);
-
- if (ret)
- return ret;
+ cs35l56_wait_dsp_ready(cs35l56);
return snd_soc_get_volsw(kcontrol, ucontrol);
}
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
- int ret = cs35l56_wait_dsp_ready(cs35l56);
-
- if (ret)
- return ret;
+ cs35l56_wait_dsp_ready(cs35l56);
return snd_soc_put_volsw(kcontrol, ucontrol);
}
int ret = 0;
if (!cs35l56->init_done)
- goto complete;
+ return;
cs35l56->dsp.part = devm_kasprintf(cs35l56->dev, GFP_KERNEL, "cs35l56%s-%02x",
cs35l56->secured ? "s" : "", cs35l56->rev);
if (!cs35l56->dsp.part)
- goto complete;
+ return;
pm_runtime_get_sync(cs35l56->dev);
sdw_write_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_MASK_1,
CS35L56_SDW_INT_MASK_CODEC_IRQ);
}
-
-complete:
- complete_all(&cs35l56->dsp_ready_completion);
}
static int cs35l56_component_probe(struct snd_soc_component *component)
enum snd_soc_bias_level level)
{
struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
- int ret = 0;
switch (level) {
case SND_SOC_BIAS_STANDBY:
* BIAS_OFF to BIAS_STANDBY
*/
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF)
- ret = cs35l56_wait_dsp_ready(cs35l56);
+ cs35l56_wait_dsp_ready(cs35l56);
break;
default:
break;
}
- return ret;
+ return 0;
}
static const struct snd_soc_component_driver soc_component_dev_cs35l56 = {
return ret;
cs35l56->fw_patched = false;
- init_completion(&cs35l56->dsp_ready_completion);
queue_work(cs35l56->dsp_wq, &cs35l56->dsp_work);
/*
return -ENOMEM;
INIT_WORK(&cs35l56->dsp_work, cs35l56_dsp_work);
- init_completion(&cs35l56->dsp_ready_completion);
dsp = &cs35l56->dsp;
dsp->part = "cs35l56";