1. 21 Apr, 2023 3 commits
  2. 20 Apr, 2023 17 commits
  3. 19 Apr, 2023 2 commits
  4. 18 Apr, 2023 12 commits
  5. 17 Apr, 2023 6 commits
    • Mark Brown's avatar
      ASoC: cs35l56: Code improvements · 3a5e13eb
      Mark Brown authored
      Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
      
      Various code improvements. These remove redundant code and
      clean up less-than-optimal original implementations.
      3a5e13eb
    • Liliang Ye's avatar
      ASoC: fsl_mqs: move of_node_put() to the correct location · 1c348902
      Liliang Ye authored
      of_node_put() should have been done directly after
      mqs_priv->regmap = syscon_node_to_regmap(gpr_np);
      otherwise it creates a reference leak on the success path.
      
      To fix this, of_node_put() is moved to the correct location, and change
      all the gotos to direct returns.
      
      Fixes: a9d27367 ("ASoC: fsl_mqs: Fix error handling in probe")
      Signed-off-by: default avatarLiliang Ye <yll@hust.edu.cn>
      Reviewed-by: default avatarDan Carpenter <error27@gmail.com>
      Link: https://lore.kernel.org/r/20230403152647.17638-1-yll@hust.edu.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      1c348902
    • Mark Brown's avatar
      ASoC: cleanup mutex lock · 97c236e2
      Mark Brown authored
      Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      
      ASoC is using many type of mutex lock, but
      some of them has helper function, but some doesn't.
      Or, it has helper function, but is static.
      
      This patch-set adds helper function and use it.
      97c236e2
    • Kuninori Morimoto's avatar
      ASoC: add snd_soc_card_mutex_lock/unlock() · 0f3b8184
      Kuninori Morimoto authored
      ASoC need to use card->mutex with _INIT or _RUNTIME,
      but there is no helper function for it.
      
      This patch adds its helper function and use it.
      
      Because people might misunderstand that _init() is mutex initialization,
      this patch renames _INIT to _ROOT and adds new
      snd_soc_card_mutex_lock_root() for it.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87a5zlx3tw.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      0f3b8184
    • Kuninori Morimoto's avatar
      ASoC: expand snd_soc_dpcm_mutex_lock/unlock() · 38e42f6d
      Kuninori Morimoto authored
      soc-pcm.c has snd_soc_dpcm_mutex_lock/unlock(),
      but other files can't use it because it is static function.
      
      It requests snd_soc_pcm_runtime as parameter (A), but sometimes we
      want to use it by snd_soc_card (B).
      
      (A)	static inline void snd_soc_dpcm_mutex_lock(struct snd_soc_pcm_runtime *rtd)
      	{
      		mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
      	}			   ^^^^^^^^^
      
      (B)	mutex_lock_nested(&card->pcm_mutex, card->pcm_subclass);
      			   ^^^^
      
      We want to use it with both "rtd" and "card" for dapm lock/unlock.
      To enable it, this patch uses _Generic macro.
      
      This patch makes snd_soc_dpcm_mutex_{un}lock() global function, and use it on
      each files.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87bkk1x3ud.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      38e42f6d
    • Kuninori Morimoto's avatar
      ASoC: expand snd_soc_dapm_mutex_lock/unlock() · 4a778bdc
      Kuninori Morimoto authored
      soc.h has snd_soc_dapm_mutex_lock/unlock() definition and
      many drivers are using it, but soc-dapm.c is not.
      
      1st reason is snd_soc_dapm_mutex_lock/unlock() requests
      snd_soc_dapm_context pointer as parameter (A), but sometimes soc-dapm.c
      needs to use snd_soc_card (B).
      
      (A)	static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
      	{
      		mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
      	}			   ^^^^^^^^^^
      
      (B)	mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
      			   ^^^^
      
      2nd reason is it want to use SND_SOC_DAPM_CLASS_INIT for mutex_lock_nested(),
      but helper is using _RUNTIME (A).
      
      The conclusion is we want to use "dapm vs card" and "_RUNTIME vs _INIT"
      for dapm lock/unlock. To enable this selfish request, this patch uses
      _Generic macro. We can use snd_soc_dapm_mutex_lock/unlock() for both
      dapm and card case.
      
      	snd_soc_dapm_mutex_lock(dapm);	snd_soc_dapm_mutex_unlock(dapm);
      	snd_soc_dapm_mutex_lock(card);	snd_soc_dapm_mutex_unlock(card);
      
      Current soc-dapm.c is using both mutex_lock() and mutex_lock_nested().
      This patch handles mutex_lock() as mutex_lock_nested(..., 0),
      in other words, handles below as same.
      
      	mutex_lock(&card->dapm_mutex);
      	mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
      
      Because people might misunderstand that _init() is mutex initialization,
      this patch renames _INIT to _ROOT and adds new
      snd_soc_dapm_mutex_lock_root() for it.
      
      This patch also moves snd_soc_dapm_subclass definition from soc-dapm.h
      to soc.h to keep related code together.
      
      Because very complex soc.h vs soc-dapm.h relationship,
      it is difficult/impossible to define these helper into soc-dapm.h.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87cz4hx3v0.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      4a778bdc