1. 22 Jun, 2020 3 commits
    • Kuninori Morimoto's avatar
      ASoC: pxa: rename to snd_soc_component_read() · 2f86f20b
      Kuninori Morimoto authored
      We need to use snd_soc_component_read()
      instead of     snd_soc_component_read32()
      
      This patch renames _read32() to _read()
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87pn9z4men.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      2f86f20b
    • Kuninori Morimoto's avatar
      ASoC: soc-component: use io_mutex correctly · e8712315
      Kuninori Morimoto authored
      component has io_mutex, but it had been used at
      snd_soc_component_update_bits_legacy() only which does read and write.
      
      	static int snd_soc_component_update_bits_legacy(...)
      	{
      		...
      =>		mutex_lock(&component->io_mutex);
      		...
      		old = snd_soc_component_read(...);
      		...
      		ret = snd_soc_component_write(...);
      		...
      =>		mutex_unlock(&component->io_mutex);
      		...
      	}
      
      It is pointless if it is not used with both read and write functions.
      This patch uses io_mutex correctly with read/write.
      Here, xxx_no_lock() is local functions.
      
      	static int snd_soc_component_read(...)
      	{
      		...
      =>		mutex_lock(&component->io_mutex);
      		val = soc_component_read_no_lock(...);
      =>		mutex_unlock(&component->io_mutex);
      		...
      	}
      
      	static int snd_soc_component_write(...)
      	{
      		...
      =>		mutex_lock(&component->io_mutex);
      		ret = soc_component_write_no_lock(...);
      =>		mutex_unlock(&component->io_mutex);
      		...
      	}
      
      	static int snd_soc_component_update_bits_legacy(...)
      	{
      		...
      =>		mutex_lock(&component->io_mutex);
      		...
      		old = soc_component_read_no_lock(...);
      		...
      		ret = soc_component_write_no_lock(...);
      		...
      =>		mutex_unlock(&component->io_mutex);
      		...
      	}
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87r1uf4mfa.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      e8712315
    • Kuninori Morimoto's avatar
      ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32() · cf6e26c7
      Kuninori Morimoto authored
      We had read/write function for Codec, Platform, etc,
      but these has been merged into snd_soc_component_read/write().
      
      Internally, it is using regmap or driver function.
      In read case, each styles are like below
      
      regmap
      	ret = regmap_read(..., reg, &val);
      
      driver function
      	val = xxx->read(..., reg);
      
      Because of this kind of different style, to keep same read style,
      when we merged each read function into snd_soc_component_read(),
      we created snd_soc_component_read32(), like below.
      commit 738b49ef ("ASoC: add snd_soc_component_read32")
      
      (1)	val = snd_soc_component_read32(component, reg);
      
      (2)	ret = snd_soc_component_read(component, reg, &val);
      
      Many drivers are using snd_soc_component_read32(), and
      some drivers are using snd_soc_component_read() today.
      
      In generally, we don't check read function successes,
      because, we will have many other issues at initial timing
      if read function didn't work.
      
      Now we can use soc_component_err() when error case.
      This means, it is easy to notice if error occurred.
      
      This patch aggressively merge snd_soc_component_read() and _read32(),
      and makes snd_soc_component_read/write() as generally style.
      
      This patch do
      	1) merge snd_soc_component_read() and snd_soc_component_read32()
      	2) it uses soc_component_err() when error case (easy to notice)
      	3) keeps read32 for now by #define
      	4) update snd_soc_component_read() for all drivers
      
      Because _read() user drivers are not too many, this patch changes
      all user drivers.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cf6e26c7
  2. 19 Jun, 2020 2 commits
  3. 18 Jun, 2020 1 commit
  4. 17 Jun, 2020 9 commits
  5. 16 Jun, 2020 1 commit
  6. 15 Jun, 2020 24 commits