From: Mark Brown Date: Tue, 10 Dec 2019 13:27:14 +0000 (+0000) Subject: Merge branch 'for-5.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie... X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2acf6ce2c25fb71a56ad35fcb9a63c19b20a4f4e;p=linux.git Merge branch 'for-5.5' of https://git./linux/kernel/git/broonie/sound into asoc-5.6 --- 2acf6ce2c25fb71a56ad35fcb9a63c19b20a4f4e diff --cc sound/soc/codecs/max98090.c index be1fc8a4aee9f,e46b6ada13b1b..da23810f958e0 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@@ -2305,17 -2114,29 +2305,31 @@@ static void max98090_pll_work(struct ma dev_info_ratelimited(component->dev, "PLL unlocked\n"); + /* + * As the datasheet suggested, the maximum PLL lock time should be + * 7 msec. The workaround resets the codec softly by toggling SHDN + * off and on if PLL failed to lock for 10 msec. Notably, there is + * no suggested hold time for SHDN off. + */ + /* Toggle shutdown OFF then ON */ + mutex_lock(&component->card->dapm_mutex); snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, 0); - msleep(10); snd_soc_component_update_bits(component, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, M98090_SHDNN_MASK); + mutex_unlock(&component->card->dapm_mutex); - /* Give PLL time to lock */ - msleep(10); + for (i = 0; i < 10; ++i) { + /* Give PLL time to lock */ + usleep_range(1000, 1200); + + /* Check lock status */ + pll = snd_soc_component_read32( + component, M98090_REG_DEVICE_STATUS); + if (!(pll & M98090_ULK_MASK)) + break; + } } static void max98090_jack_work(struct work_struct *work) diff --cc sound/soc/soc-topology.c index e9b660f3116f2,b28613149b0cc..f8bd406c61989 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@@ -1935,11 -1933,13 +1935,13 @@@ static int soc_tplg_fe_link_create(stru ret = soc_tplg_dai_link_load(tplg, link, NULL); if (ret < 0) { dev_err(tplg->comp->dev, "ASoC: FE link loading failed\n"); - kfree(link->name); - kfree(link->stream_name); - kfree(link->cpus->dai_name); - kfree(link); - return ret; + goto err; + } + - ret = snd_soc_add_dai_link(tplg->comp->card, link); ++ ret = snd_soc_add_pcm_runtime(tplg->comp->card, link); + if (ret < 0) { + dev_err(tplg->comp->dev, "ASoC: adding FE link failed\n"); + goto err; } link->dobj.index = tplg->index;