Commit graph

932809 commits

Author SHA1 Message Date
Tzung-Bi Shih 3d62ef4280
ASoC: dapm: declare missing structure prototypes
To fix compilation warnings:

- struct 'snd_soc_pcm_runtime' declared inside parameter list will not
  be visible outside of this definition or declaration
- struct 'soc_enum' declared inside parameter list will not be visible
  outside of this definition or declaration

Declares the missing structure prototypes.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200625153543.85039-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 19:21:01 +01:00
Tzung-Bi Shih 10e834099d
ASoC: core: move definition of enum snd_soc_bias_level
To fix compilation error:

- error: field 'XXX' has incomplete type

Moves definition of enum snd_soc_bias_level from soc.h to soc-dapm.h.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200625153543.85039-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 19:21:00 +01:00
Dan Murphy 6f81e520b2
ASoC: tas2562: Fix shut-down gpio property
Fix the shut-down gpio property to be shut-down-gpio and fix the
example.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 16:21:43 +01:00
Dan Murphy c8294da2ed
ASoC: tas2562: Fix format issue for extra space before a comma
Fix the issue found that there is an extra space before a comma in the
volume control.

Fixes: bf726b1c86 ("ASoC: tas2562: Add support for digital volume control")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-4-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 16:21:42 +01:00
Dan Murphy bc07b54459
ASoC: tas2562: Update shutdown GPIO property
Update the shutdown GPIO property to be shutdown from shut-down.

Fixes: c173dba44c ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 16:21:41 +01:00
Shengjiu Wang 3b3372fa65
ASoC: bindings: fsl-asoc-card: Add compatible string for wm8524
In order to support wm8524 codec with fsl-asoc-card machine
driver, add compatible string "fsl,imx-audio-wm8524".

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1592895167-30483-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24 16:15:06 +01:00
Shengjiu Wang 3cd9902674
ASoC: fsl-asoc-card: Add WM8524 support
WM8524 only supports playback mode, and only works at
slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1592895167-30483-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24 16:15:05 +01:00
Mark Brown c3d89fd7a8
Merge series "ASoC: add dailink .exit() callback" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While looking at reboot issues and module load/unload tests, I found
out some resources allocated in the dailink .init() callback are not
properly released - there is no existing mechanism in the soc-core to
do so.

The addition of a dailink .exit() callback seems to be the simplest
solution overall. It can be argued that the existing machine platform
device .remove() callback can also perform the necessary cleanups,
however as shown in the last two examples this might require a loop to
identify components whereas the dailink .exit() already has all the
necessary information to revert the actions done in the .init() step.

Changes since RFC:
Better commit messages and explanations
rt5682 cases with snd_soc_component_set_jack() called in the .exit()

Fred Oh (2):
  ASoC: intel: sof_rt5682: move disabling jack to dai link's exit()
  ASoC: intel: cml_rt1011_rt5682: disable jack in dailink .exit()

Pierre-Louis Bossart (3):
  ASoC: soc-link: introduce exit() callback
  ASoC: Intel: bdw-rt5677: fix module load/unload issues
  ASoC: Intel: kbl-rt5660: use .exit() dailink callback to release gpiod

 include/sound/soc-link.h                   |  1 +
 include/sound/soc.h                        |  3 +++
 sound/soc/intel/boards/bdw-rt5677.c        | 18 ++++++++++++++--
 sound/soc/intel/boards/cml_rt1011_rt5682.c |  8 ++++++++
 sound/soc/intel/boards/kbl_rt5660.c        | 17 +++++++++++++--
 sound/soc/intel/boards/sof_rt5682.c        | 24 ++++++++--------------
 sound/soc/soc-core.c                       |  3 +++
 sound/soc/soc-link.c                       |  6 ++++++
 8 files changed, 60 insertions(+), 20 deletions(-)

base-commit: 39853b1438
--
2.20.1
2020-06-23 12:54:12 +01:00
Fred Oh ee8a41cd30
ASoC: rt1011: fix KASAN out-of-bounds bug in find_next_bit()
KASAN throws the following warning in rt1011.c:
[ 170.777603] BUG: KASAN: stack-out-of-bounds in _find_next_bit.constprop.0+0x3e/0xf0

find_next_bit() relies on unsigned long pointer arguments, but this driver
uses a type cast that generates the KASAN warning. Replace find_next_bit()
and find_last_bit() with __ffs() and __fls() to pass the value and avoid
casting pointers to make the warning go away.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622151348.28063-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:11 +01:00
Tzung-Bi Shih b1647f9f4f
ASoC: mediatek: mt8183-da7219: set playback and capture constraints
Sets playback and capture constraints to S16_LE, stereo, 48kHz.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200623055130.159718-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:10 +01:00
Shengjiu Wang 5748f4eb01
ASoC: fsl_easrc: Fix uninitialized scalar variable in fsl_easrc_set_ctx_format
The "ret" in fsl_easrc_set_ctx_format is not initialized, then
the unknown value maybe returned by this function.

Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1592816611-16297-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:09 +01:00
Fred Oh 4fcc922cb3
ASoC: intel: cml_rt1011_rt5682: disable jack in dailink .exit()
When removing the machine driver, the rt5682 jack handler will oops if jack
detection is not disabled. The jack can be disabled in the dai link's exit().

This is symmetrical change as jack is enabled in init().

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622154241.29053-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:41 +01:00
Fred Oh b0c96fc1ab
ASoC: intel: sof_rt5682: move disabling jack to dai link's exit()
Move disabling jack from platform driver's remove() to dai link's exit().
This is symmetrical change as jack is enabled in init().

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622154241.29053-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:40 +01:00
Pierre-Louis Bossart e56054e753
ASoC: Intel: kbl-rt5660: use .exit() dailink callback to release gpiod
The gpiod handling is inspired from the bdw-rt5677 code. Apply same
fix to avoid reference count issue while removing modules for
consistency.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:39 +01:00
Pierre-Louis Bossart bcb43fdae1
ASoC: Intel: bdw-rt5677: fix module load/unload issues
The mainline code currently prevents modules from being removed.

The BE dailink .init() function calls devm_gpiod_get() using the codec
component device as argument. When the machine driver is removed, the
references to the gpiod are not released, and it's not possible to
remove the codec driver module - which is the only entity which could
free the gpiod.

This conceptual deadlock can be avoided by invoking gpiod_get() in the
.init() callback, and calling gpiod_put() in the exit() callback.

Tested on SAMUS Chromebook with SOF driver.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:38 +01:00
Pierre-Louis Bossart 21a00fb337
ASoC: soc-link: introduce exit() callback
Some machine drivers allocate or request resources with
snd_soc_link_init() phase of the card probe. These resources need to
be properly released when removing a card, and this patch suggests a
dual exit() callback.

The exit() is invoked in soc_remove_pcm_runtime(), which is not
completely symmetric with the init() invoked in soc_init_pcm_runtime().

Alternate solutions were considered, e.g. adding a .remove() callback
for the platform driver, but that's not symmetrical at all and would
be difficult to handle if there are more than one dailink implementing
an .init(). We looked also into using .remove_dai_link() callback, but
that would also be imbalanced.

Note that because of the error handling in snd_soc_bind_card(), which
jumps to probe_end, there is no way to guarantee the exit() is invoked
with resources allocated in the init(). Prior to releasing those
resources, implementations of the exit() callback shall check the
resources are valid.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:37 +01:00
Mark Brown 39853b1438
Merge series "ASoC: merge snd_soc_component_read() and snd_soc_component_read32()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Because we can use "read" function which is using
"regmap" or "driver", current ALSA SoC drivers are using both
	snd_soc_component_read()    // for regmap
	snd_soc_component_read32()  // for driver callback
These are similar but needs different parameter.

This patch aggressively merge snd_soc_component_read() and _read32(),
and makes snd_soc_component_read/write() as generally style.

New read doesn't return error if it failed,
thus, it can't keep compatibility,
but assuming it is not a big problem.
Because 1) it will indicate error message,
2) it can do nothing anyway if it fails "read".

[02/16] patch is not directly connected to read function merging,
but need to be apply after [01/16].

Kuninori Morimoto (16):
  ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()
  ASoC: soc-component: use io_mutex correctly
  ASoC: pxa: rename to snd_soc_component_read()
  ASoC: atmel: rename to snd_soc_component_read()
  ASoC: codecs: rename to snd_soc_component_read()
  ASoC: codecs: wcd*: rename to snd_soc_component_read()
  ASoC: codecs: tlv*: rename to snd_soc_component_read()
  ASoC: codecs: max*: rename to snd_soc_component_read()
  ASoC: codecs: msm*: rename to snd_soc_component_read()
  ASoC: codecs: alc*: rename to snd_soc_component_read()
  ASoC: codecs: wm*: rename to snd_soc_component_read()
  ASoC: codecs: rt*: rename to snd_soc_component_read()
  ASoC: codecs: da*: rename to snd_soc_component_read()
  ASoC: codecs: cs*: rename to snd_soc_component_read()
  ASoC: codecs: ak*: rename to snd_soc_component_read()
  ASoC: remove snd_soc_component_read32()

 include/sound/soc-component.h          |  4 +-
 sound/soc/atmel/atmel-pdmic.c          |  4 +-
 sound/soc/codecs/88pm860x-codec.c      | 14 ++---
 sound/soc/codecs/ab8500-codec.c        |  8 +--
 sound/soc/codecs/ad1980.c              |  4 +-
 sound/soc/codecs/ak4458.c              |  2 +-
 sound/soc/codecs/ak4535.c              |  4 +-
 sound/soc/codecs/ak4613.c              |  4 +-
 sound/soc/codecs/ak4671.c              |  8 +--
 sound/soc/codecs/alc5623.c             |  6 +-
 sound/soc/codecs/alc5632.c             |  6 +-
 sound/soc/codecs/arizona.c             | 18 +++---
 sound/soc/codecs/cs4270.c              | 10 +--
 sound/soc/codecs/cs42l42.c             |  2 +-
 sound/soc/codecs/cs42l51.c             |  8 +--
 sound/soc/codecs/cs42l73.c             |  4 +-
 sound/soc/codecs/cs47l35.c             | 10 +--
 sound/soc/codecs/cs47l85.c             | 10 +--
 sound/soc/codecs/da7210.c              | 24 ++++----
 sound/soc/codecs/da7213.c              | 24 ++++----
 sound/soc/codecs/da7218.c              | 34 +++++------
 sound/soc/codecs/da7219-aad.c          | 16 ++---
 sound/soc/codecs/da7219.c              | 20 +++---
 sound/soc/codecs/da732x.c              | 18 +++---
 sound/soc/codecs/da9055.c              | 14 ++---
 sound/soc/codecs/inno_rk3036.c         |  6 +-
 sound/soc/codecs/madera.c              | 49 +++------------
 sound/soc/codecs/max98088.c            | 12 ++--
 sound/soc/codecs/max98090.c            | 20 +++---
 sound/soc/codecs/max98095.c            | 16 ++---
 sound/soc/codecs/max9850.c             |  2 +-
 sound/soc/codecs/msm8916-wcd-analog.c  | 14 ++---
 sound/soc/codecs/msm8916-wcd-digital.c | 16 ++---
 sound/soc/codecs/nau8822.c             |  6 +-
 sound/soc/codecs/rt1305.c              |  2 +-
 sound/soc/codecs/rt298.c               |  2 +-
 sound/soc/codecs/rt5616.c              |  2 +-
 sound/soc/codecs/rt5631.c              | 32 +++++-----
 sound/soc/codecs/rt5640.c              | 10 +--
 sound/soc/codecs/rt5645.c              | 16 ++---
 sound/soc/codecs/rt5651.c              |  6 +-
 sound/soc/codecs/rt5659.c              | 14 ++---
 sound/soc/codecs/rt5660.c              |  2 +-
 sound/soc/codecs/rt5663.c              | 34 +++++------
 sound/soc/codecs/rt5665.c              | 16 ++---
 sound/soc/codecs/rt5668.c              | 16 ++---
 sound/soc/codecs/rt5670.c              | 18 +++---
 sound/soc/codecs/rt5682-i2c.c          |  2 +-
 sound/soc/codecs/rt5682.c              | 19 +++---
 sound/soc/codecs/sgtl5000.c            | 16 ++---
 sound/soc/codecs/sta32x.c              |  4 +-
 sound/soc/codecs/tas2552.c             |  4 +-
 sound/soc/codecs/tas5720.c             |  4 +-
 sound/soc/codecs/tda7419.c             |  9 +--
 sound/soc/codecs/tlv320aic23.c         | 14 ++---
 sound/soc/codecs/tlv320aic26.c         |  4 +-
 sound/soc/codecs/tlv320aic32x4.c       | 16 ++---
 sound/soc/codecs/tlv320aic3x.c         | 14 ++---
 sound/soc/codecs/tscs42xx.c            |  4 +-
 sound/soc/codecs/tscs454.c             | 24 ++------
 sound/soc/codecs/wcd-clsh-v2.c         |  2 +-
 sound/soc/codecs/wcd9335.c             | 48 +++++++--------
 sound/soc/codecs/wcd934x.c             | 52 ++++++++--------
 sound/soc/codecs/wm2200.c              |  4 +-
 sound/soc/codecs/wm5100.c              | 18 +++---
 sound/soc/codecs/wm5110.c              |  6 +-
 sound/soc/codecs/wm8350.c              | 32 +++++-----
 sound/soc/codecs/wm8400.c              | 50 +++++++--------
 sound/soc/codecs/wm8510.c              | 28 ++++-----
 sound/soc/codecs/wm8523.c              |  6 +-
 sound/soc/codecs/wm8580.c              | 12 ++--
 sound/soc/codecs/wm8711.c              |  8 +--
 sound/soc/codecs/wm8728.c              | 10 +--
 sound/soc/codecs/wm8731.c              |  6 +-
 sound/soc/codecs/wm8750.c              |  8 +--
 sound/soc/codecs/wm8753.c              | 42 ++++++-------
 sound/soc/codecs/wm8770.c              |  2 +-
 sound/soc/codecs/wm8776.c              |  2 +-
 sound/soc/codecs/wm8804.c              |  2 +-
 sound/soc/codecs/wm8900.c              | 22 +++----
 sound/soc/codecs/wm8903.c              | 20 +++---
 sound/soc/codecs/wm8904.c              | 16 ++---
 sound/soc/codecs/wm8940.c              | 32 +++++-----
 sound/soc/codecs/wm8955.c              |  2 +-
 sound/soc/codecs/wm8958-dsp2.c         | 18 +++---
 sound/soc/codecs/wm8960.c              | 20 +++---
 sound/soc/codecs/wm8961.c              | 58 +++++++++---------
 sound/soc/codecs/wm8962.c              | 31 +++++-----
 sound/soc/codecs/wm8971.c              |  8 +--
 sound/soc/codecs/wm8974.c              | 24 ++++----
 sound/soc/codecs/wm8978.c              | 12 ++--
 sound/soc/codecs/wm8983.c              |  8 +--
 sound/soc/codecs/wm8985.c              |  8 +--
 sound/soc/codecs/wm8988.c              | 12 ++--
 sound/soc/codecs/wm8990.c              | 18 +++---
 sound/soc/codecs/wm8991.c              | 38 ++++++------
 sound/soc/codecs/wm8993.c              | 28 ++++-----
 sound/soc/codecs/wm8994.c              | 60 +++++++++---------
 sound/soc/codecs/wm8995.c              | 16 ++---
 sound/soc/codecs/wm8996.c              | 30 ++++-----
 sound/soc/codecs/wm8998.c              |  8 +--
 sound/soc/codecs/wm9081.c              | 36 +++++------
 sound/soc/codecs/wm9090.c              |  4 +-
 sound/soc/codecs/wm9713.c              |  2 +-
 sound/soc/codecs/wm_hubs.c             | 30 ++++-----
 sound/soc/fsl/fsl_audmix.c             | 10 +--
 sound/soc/fsl/fsl_easrc.c              |  5 +-
 sound/soc/meson/aiu-encoder-i2s.c      |  3 +-
 sound/soc/meson/aiu-fifo-i2s.c         |  3 +-
 sound/soc/meson/aiu-fifo.c             |  3 +-
 sound/soc/pxa/mioa701_wm9713.c         |  8 +--
 sound/soc/soc-ac97.c                   |  7 +--
 sound/soc/soc-component.c              | 84 ++++++++++++++------------
 sound/soc/soc-dapm.c                   | 31 ++++------
 sound/soc/soc-ops.c                    | 43 +++----------
 115 files changed, 854 insertions(+), 963 deletions(-)

--
2.25.1
2020-06-22 15:36:06 +01:00
Vlad Karpovich d6fea46e08
ASoC: wm_adsp: Add controls for calibration and diagnostic FW
Exposed additional mixer controls to select calibration or diagnostic
firmware.

'Calibration' --> chip-dsp<id>-spk-cali.wmfw (.bin)
'Diagnostic'  --> chip-dsp<id>-spk-diag.wmfw (.bin)

Signed-off-by: Vlad Karpovich <Vlad.Karpovich@cirrus.com>
Signed-off-by: David Rhodes <david.rhodes@cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200619212651.2739-1-david.rhodes@cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:36:05 +01:00
Kuninori Morimoto 5b554b0a29
ASoC: remove snd_soc_component_read32()
No driver is using snd_soc_component_read32() anymore.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877dw74mbv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:50 +01:00
Kuninori Morimoto 8a6fc33ba6
ASoC: codecs: ak*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878sgn4mc0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:49 +01:00
Kuninori Morimoto a11f8a1c33
ASoC: codecs: cs*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a7134mc4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:48 +01:00
Kuninori Morimoto 2925b58209
ASoC: codecs: da*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/87bllj4mc8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:47 +01:00
Kuninori Morimoto 467a2553dd
ASoC: codecs: rt*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:46 +01:00
Kuninori Morimoto 6d75dfc3e8
ASoC: codecs: wm*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeqf4mcl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:45 +01:00
Kuninori Morimoto e896c1ed67
ASoC: codecs: alc*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftav4md9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:44 +01:00
Kuninori Morimoto a6f80d99b9
ASoC: codecs: msm*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7vb4mdf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:43 +01:00
Kuninori Morimoto 1227f601ba
ASoC: codecs: max*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87imfr4mdl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:43 +01:00
Kuninori Morimoto e348cf5434
ASoC: codecs: tlv*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k1074mds.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:42 +01:00
Kuninori Morimoto eaf2767cad
ASoC: codecs: wcd*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/87lfkn4mdy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:41 +01:00
Kuninori Morimoto 981abdfe99
ASoC: codecs: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mu534me5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:40 +01:00
Kuninori Morimoto f0daed1a49
ASoC: atmel: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8pj4mef.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:39 +01:00
Kuninori Morimoto 2f86f20baf
ASoC: pxa: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn9z4men.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:38 +01:00
Kuninori Morimoto e8712315c4
ASoC: soc-component: use io_mutex correctly
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1uf4mfa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:37 +01:00
Kuninori Morimoto cf6e26c71b
ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()
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 738b49efe6 ("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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:36 +01:00
John Stultz 3bd057c821
ASoC: qcom: Kconfig: Tweak dependencies on SND_SOC_SDM845
CROS_EC isn't strictly required for audio to work
on other SDM845 platforms (like the Dragonboard 845c).

So lets remove the dependency and select the related
CROS_EC options via imply.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Rohit kumar <rohitkr@codeaurora.org>
Cc: Patrick Lai <plai@codeaurora.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200619031407.116140-1-john.stultz@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-19 12:07:01 +01:00
Shengjiu Wang 9cb2b3796e
ASoC: fsl_spdif: Add pm runtime function
Add pm runtime support and move clock handling there.
Close the clocks at suspend to reduce the power consumption.

fsl_spdif_suspend is replaced by pm_runtime_force_suspend.
fsl_spdif_resume is replaced by pm_runtime_force_resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/579c0d71e976f34f23f40daa9f1aa06c4baca2f1.1592552389.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-19 12:07:00 +01:00
Ravulapati Vishnu vardhan rao 3499f9ad5d
ASoC: amd: Removing unnecessary instance initialization
In trigger we already get the selected instance details
from runtime->private_data.So, removing the local
initialization which may corrupt the instance selected
details and this leads to corrupt data.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20200618072624.27047-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-18 13:14:25 +01:00
Pierre-Louis Bossart a5f610c0fa
ASoC: Intel: broadwell: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bdw <codec_name>" pattern for all Broadwell
machine drivers. The sof- prefix is added by the core. A generic "SOF"
driver name is used, and UCMv2 will detect the configuration for this
driver by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:32 +01:00
Pierre-Louis Bossart 7bfbddfc98
ASoC: Intel: cht*: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bytcht <codec_name>" pattern for all cht* machine
drivers. The sof- prefix is added by the core. A generic "SOF" driver
name is used, and UCMv2 will detect the configuration for this driver
by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:31 +01:00
Pierre-Louis Bossart b4ecd58b01
ASoC: Intel: byt*: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bytcht <codec_name>" pattern for all byt* machine
drivers. The sof- prefix is added by the core. A generic "SOF" driver
name is used, and UCMv2 will detect the configuration for this driver
by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:30 +01:00
Jerome Brunet e50186e1da
ASoC: meson: imply acodec glue on axg sound card
When axg card driver support is enabled, lets enable the related
internal DAC glue by default.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200617155047.1187256-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 17:34:59 +01:00
Shengjiu Wang f61b9273c3
ASoC: fsl_spdif: Add support for imx6sx platform
The one difference on imx6sx platform is that the root clock
is shared with ASRC module, so we add a new flags
"shared_root_clock" which means the root clock is not independent,
then we will not do the clk_set_rate and clk_round_rate to avoid
impact ASRC module usage.

As add a new flags, we include the soc specific data struct.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/7a343edd5f8487abad248a0b862f45fd95067751.1592376770.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:06 +01:00
Shengjiu Wang 632108afda
ASoC: bindings: fsl_spdif: Add new compatible string for imx6sx
Add new compatible string "fsl,imx6sx-spdif" in the binding document.
And add compatible string "fsl,vf610-spdif" which was missed before.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/feda3bb02296455d43aeebb7575918d9b28e1a3f.1592376770.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:05 +01:00
Shengjiu Wang 039652a5b9
ASoC: fsl-asoc-card: Add MQS support
The MQS codec isn't an i2c device, so use of_find_device_by_node
to get platform device pointer.

Because MQS only support playback, then add a new audio map.

And there maybe "model" property or no "audio-routing" property in
devicetree, so add some enhancement for these two property.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/918505decb7f757f12c38059c590984f28d2f3a4.1592369271.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:04 +01:00
Shengjiu Wang 56d6663d41
ASoC: bindings: fsl-asoc-card: Add compatible string for MQS
Add compatible string "fsl,imx-audio-mqs" for MQS, and move
"audio-routing" property to be optional for MQS doesn't need
such property.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/2185a3ec866bc59f82d93b73d1a732a896fd8f48.1592369271.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:03 +01:00
Qiushi Wu deca195383
ASoC: tegra: Fix reference count leaks.
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200613204422.24484-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:02 +01:00
Jack Yu 668b1508cf
ASoC: rt1015: Flush DAC data before playback.
Flush DAC data before playback.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200616023644.4523-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-16 12:39:33 +01:00
Mark Brown 1cdd255a58
Merge series "ASoC: fsl_easrc: Fix several warnings" from Shengjiu Wang <shengjiu.wang@nxp.com>:
Fix several warnings with "make W=1"

Shengjiu Wang (3):
  ASoC: fsl_easrc: Fix -Wmissing-prototypes warning
  ASoC: fsl_easrc: Fix -Wunused-but-set-variable
  ASoC: fsl_easrc: Fix "Function parameter not described" warnings

 sound/soc/fsl/fsl_easrc.c | 42 +++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 24 deletions(-)

--
2.21.0
2020-06-15 21:43:55 +01:00
Mark Brown d8bc1b052e
Merge series "ASoC: Intel: Add KeemBay ASoC platform driver" from Sia Jee Heng <jee.heng.sia@intel.com>:
The below series of patches support the KeemBay ASoC platform driver.
The platform driver initialize the i2s to capture and playback the
pcm data on the ARM. The i2s is running in polling mode.

There is no DSP in the KeemBay SoC. Users are rely on the Gstreamer plugin
to perform Audio preprocessing.

Audio graph card is used to connect the platform driver with the
tlv320aic3204 codec.

Change History:
v5:
- Remove OF dependency from Kconfig as OF is shifted to audio graph card.

v4:
- Reduce if-otology at the tx/rx function.
- Fix indentation.
- specify .rate directly

v3:
- Adjusted header format.
- Use Audio graph card instead of custom sound card.
- Use if-else instead of conditional operator.
- Enabled .set_fmt to configure master clock.

v2:
- Corrected I2S naming for DT binding.

v1:
- Initial version.

Sia Jee Heng (3):
  ASoC: Intel: Add KeemBay platform driver
  ASoC: Intel: Add makefiles and kconfig changes for KeemBay
  dt-bindings: sound: Add documentation for KeemBay i2s

 .../bindings/sound/intel,keembay-i2s.yaml          |  68 +++
 sound/soc/intel/Kconfig                            |   7 +
 sound/soc/intel/Makefile                           |   1 +
 sound/soc/intel/keembay/Makefile                   |   4 +
 sound/soc/intel/keembay/kmb_platform.c             | 654 +++++++++++++++++++++
 sound/soc/intel/keembay/kmb_platform.h             | 145 +++++
 6 files changed, 879 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml
 create mode 100644 sound/soc/intel/keembay/Makefile
 create mode 100644 sound/soc/intel/keembay/kmb_platform.c
 create mode 100644 sound/soc/intel/keembay/kmb_platform.h

--
1.9.1
2020-06-15 21:43:54 +01:00
Mark Brown 674b928986
Merge series "ASoC: improve core dmesg logs and verbosity" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Try to both reduce useless verbosity and keep useful error reports.

Pierre-Louis Bossart (3):
  ASoC: soc-core: reduce verbosity of BE override message
  ASoC: soc-pcm: improve error messages in soc_pcm_new()
  ASoC: soc-pcm/compress: reduce verbosity on mapping ok messages

 sound/soc/soc-compress.c |  4 ++--
 sound/soc/soc-core.c     |  4 ++--
 sound/soc/soc-pcm.c      | 13 +++++++------
 3 files changed, 11 insertions(+), 10 deletions(-)

--
2.20.1
2020-06-15 20:58:46 +01:00