Commit graph

1029405 commits

Author SHA1 Message Date
Kuninori Morimoto
bce00560a2
ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name()
This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:3203:22: style: The scope of the variable 'component_of_node' can be reduced. [variableScope]
 struct device_node *component_of_node;
                     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v94tyl6t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-29 15:35:40 +01:00
Kuninori Morimoto
cdb76568b0
ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()
This patch cleanups below cppcheck warning.

 const char *vendor, *product, *product_version, *board;
                                ^

sound/soc/soc-core.c:1721:33: style: The scope of the variable 'product_version' can be reduced. [variableScope]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnp9yl6y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-29 15:35:39 +01:00
Tang Bin
14db5499d5
ASoC: bcm: cygnus-pcm: Fix unused assignment about 'rc'
Delete unused initialized value of 'rc', because it will
be assigned by the function devm_request_irq().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210728124411.3168-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-28 16:39:28 +01:00
Colin Ian King
0f6b04adb5
ASoC: Intel: Fix spelling contraction "cant" -> "can't"
There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20210728103602.171817-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-28 16:39:27 +01:00
Mark Brown
6b809c19d4
Merge series "ASoC: soc-pcm: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-pcm.

Kuninori Morimoto (5):
  ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb()
  ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close()
  ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture()
  ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active()
  ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan()

 sound/soc/soc-pcm.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

--
2.25.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto
2021-07-27 16:14:20 +01:00
Dan Carpenter
37108ef45a
ASoC: amd: fix an IS_ERR() vs NULL bug in probe
The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.

Fixes: e550339ee6 ("ASoC: amd: add vangogh i2s controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210727081756.GA19121@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:53 +01:00
Shuming Fan
89d751d8f9
ASoC: rt5682: enable SAR ADC power saving mode during suspend
The SAR ADC power saving mode could reduce power consumption on MICVDD rail.
Therefore, this patch saves power consumption during suspend state if the headset was connected.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210727084846.9867-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:52 +01:00
Kuninori Morimoto
9bdc573d84
ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan()
This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:1624:30: style: The scope of the variable 'codec_stream' can be reduced. [variableScope]
  struct snd_soc_pcm_stream *codec_stream;
                             ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8aozf28.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:50 +01:00
Kuninori Morimoto
7931df9bf0
ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active()
This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:1305:30: style: The scope of the variable 'widget' can be reduced. [variableScope]
 struct snd_soc_dapm_widget *widget;
                             ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmv4zf2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:47 +01:00
Kuninori Morimoto
940a1f4357
ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture()
This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:2578:22: style: The scope of the variable 'codec_dai' can be reduced. [variableScope]
 struct snd_soc_dai *codec_dai;
                     ^
sound/soc/soc-pcm.c:2580:6: style: The scope of the variable 'stream' can be reduced. [variableScope]
 int stream;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1fkzf2g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:46 +01:00
Kuninori Morimoto
33be10b563
ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close()
This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:631:9: style: The scope of the variable 'r' can be reduced. [variableScope]
 int i, r, ret = 0;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg00zf2l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:45 +01:00
Kuninori Morimoto
2bc3e1f21b
ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb()
This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:446:29: style: The scope of the variable 'pcm_codec' can be reduced. [variableScope]
 struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu;
                            ^
sound/soc/soc-pcm.c:446:41: style: The scope of the variable 'pcm_cpu' can be reduced. [variableScope]
 struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu;
                                        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tukgzf2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-27 13:14:44 +01:00
Jack Yu
bc1c8e4eee
ASoC: rt1015: Remove unnecessary flush work on rt1015 driver
Remove workqueue of flush work in rt1015 driver since we don't need it
after internal discussion, and there is no impact on performance
without this workqueue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/3ef458a6ad754589b96d6a94abda1e55@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-26 18:57:19 +01:00
Mario Limonciello
718693352d
ASoC: amd: Use dev_probe_err helper
Replace the pattern of check for err to match -EPROBE_DEFER and only
output errors to use the dev_err_probe helper instead.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-23 14:52:50 +01:00
Mario Limonciello
af7dc6f194
ASoC: amd: Don't show messages about deferred probing by default
Nearly every boot with a Lenovo P14s is showing
acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517

This isn't useful to a user, especially as probing will run again.
Use the dev_err_probe helper to hide the deferrerd probing messages.

CC: markpearson@lenovo.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-23 14:52:49 +01:00
Vijendar Mukunda
08413fca62
ASoC: amd: enable vangogh acp5x driver build
Vangogh ACP5x drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:44 +01:00
Vijendar Mukunda
361414dc1f
ASoC: amd: add vangogh i2s dma driver pm ops
Add Vangogh i2s dma driver pm ops

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-12-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:43 +01:00
Vijendar Mukunda
b0a37ac678
ASoC: amd: add vangogh pci driver pm ops
Add Vangogh acp pci driver pm ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:42 +01:00
Vijendar Mukunda
b80556addd
ASoC: amd: add vangogh i2s dai driver ops
Add Vangogh i2s dai driver ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:41 +01:00
Vijendar Mukunda
e550339ee6
ASoC: amd: add vangogh i2s controller driver
Add Vangogh I2S controller driver to support two I2S controller
instances.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:39 +01:00
Vijendar Mukunda
cab396d8b2
ASoC: amd: add ACP5x pcm dma driver ops
This patch adds ACP5x PCM driver DMA operations.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:38 +01:00
Vijendar Mukunda
fc2c8067c7
ASoC: amd: irq handler changes for ACP5x PCM dma driver
Whenever audio data equal to the I2S FIFO watermark level are
produced/consumed, interrupt is generated.
Acknowledge the interrupt.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:37 +01:00
Vijendar Mukunda
77f61444e4
ASoC: amd: add ACP5x PCM platform driver
PCM platform driver binds to the platform device created by
ACP5x PCI device. PCM driver registers ALSA DMA components
with ASoC framework.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:36 +01:00
Vijendar Mukunda
603f2dedcc
ASoC: amd: create acp5x platform devices
ACP5.x IP has multiple I2S controllers and DMA controller.
Create platform devices for I2S HS controller instance, I2S SP controller
instance and DMA controller.
Pass PCI resources like MMIO, irq to these platform devices.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:35 +01:00
Vijendar Mukunda
5d9ee88a10
ASoc: amd: add acp5x init/de-init functions
Add Vangogh ACP PCI driver init/deinit functions.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:34 +01:00
Vijendar Mukunda
4a7151c968
ASoC: amd: add Vangogh ACP PCI driver
ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:33 +01:00
Vijendar Mukunda
7bf060d0d5
ASoC: amd: add Vangogh ACP5x IP register header
Add register header for ACP5x IP in Vangogh platform.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-22 12:45:32 +01:00
Pierre-Louis Bossart
1bd80ff2cf
ASOC: Intel: sof_sdw: add quirk for Intel 'Bishop County' NUC M15
The same quirk is used for LAPBC510 and LAPBC710 skews who use the
same audio design, with an RT711 headset codec using JD1 mode and one
RT1308 amplifier, along with 4 DMICs.

BugLink: https://github.com/thesofproject/linux/issues/3049
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210719233248.557923-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-20 13:35:11 +01:00
Peter Ujfalusi
cfc9d37ab7
ASoC: ti: j721e-evm: Convert the audio domain IDs to enum
Convert the J721E_AUDIO_DOMAIN_* from defines to enum to make it possible
to extend the number of domains in the future.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210717122820.1467-4-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-19 16:01:45 +01:00
Srinivas Kandagatla
d9dbe1f9ae
ASoC: codecs: wcd938x: remove unused port-map reference
port_map field was added prior to adding static port map support in soundwire.
This makes port_map array in struct wcd938x_sdw_priv redundant and unused,
so remove this.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210716105612.5284-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-16 13:55:33 +01:00
Colin Ian King
622d9ac3d9
ASoC: codecs: lpass-rx-macro: clean up for-loop indentation in switch statement
The for-loop is not indented enough and needs one more level
of indentation. Add in the indentation across the block of code.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210709152424.460446-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-15 17:24:47 +01:00
Mark Brown
eb14ecca76
Merge series "soundwire/ASoC: add mockup codec support" from Bard Liao <yung-chuan.liao@linux.intel.com>:
Adding mockup SoundWire codec is useful to debug driver/topology changes
without having any actual device connected.

Bard Liao (2):
  soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA
  soundwire: stream: don't program mockup device ports

Pierre-Louis Bossart (8):
  ASoC: codecs: add SoundWire mockup device support
  ASoC: soc-acpi: cnl: add table for SoundWire mockup devices
  ASoC: soc-acpi: tgl: add table for SoundWire mockup devices
  ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
  soundwire: add flag to ignore all command/control for mockup devices
  soundwire: bus: squelch error returned by mockup devices
  soundwire: cadence: add debugfs interface for PDI loopbacks
  soundwire: cadence: override PDI configurations to create loopback

 drivers/soundwire/bus.c                       |  10 +-
 drivers/soundwire/cadence_master.c            | 174 ++++++++--
 drivers/soundwire/cadence_master.h            |   3 +
 drivers/soundwire/stream.c                    |   5 +-
 include/linux/soundwire/sdw.h                 |   3 +
 sound/soc/codecs/Kconfig                      |  18 +
 sound/soc/codecs/Makefile                     |   2 +
 sound/soc/codecs/sdw-mockup.c                 | 312 ++++++++++++++++++
 sound/soc/intel/boards/Kconfig                |   1 +
 sound/soc/intel/boards/sof_sdw.c              |  41 +++
 sound/soc/intel/common/Makefile               |   3 +-
 .../intel/common/soc-acpi-intel-cnl-match.c   |  15 +
 .../common/soc-acpi-intel-sdw-mockup-match.c  | 166 ++++++++++
 .../common/soc-acpi-intel-sdw-mockup-match.h  |  17 +
 .../intel/common/soc-acpi-intel-tgl-match.c   |  23 ++
 15 files changed, 754 insertions(+), 39 deletions(-)
 create mode 100644 sound/soc/codecs/sdw-mockup.c
 create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.c
 create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.h

base-commit: e73f0f0ee7

--
2.17.1
2021-07-14 18:29:58 +01:00
Pierre-Louis Bossart
0ccac3bcf3
ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
Add support for SoundWire mockup devices. The configurations assume the
same topology as the CML SoundWire devices and can be used to test the
SOF firmware on a development board (RVP, UpExtreme) without any
hardware connected.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 18:02:07 +01:00
Pierre-Louis Bossart
3025d398c4
ASoC: soc-acpi: tgl: add table for SoundWire mockup devices
Follow the same idea as for CNL/UpExtreme and add mockup test
first. They will only be selected if the SSDT is modified to add such
mockup devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 18:02:07 +01:00
Pierre-Louis Bossart
2694cda7a4
ASoC: soc-acpi: cnl: add table for SoundWire mockup devices
Add support for two configurations with SoundWire mockup devices that
emulate the two CometLake configurations with one and two amps. This
patch helps test the SOF firmware on an UpExtreme board without any
hardware connected, e.g. by doing a loopback of the playback stream on
capture streams.

The mapping of the partIDs is as follows:

0xAAAA: generic full-duplex codec (not currently used)
0xAA55: headset codec (mock-up of RT711/RT5682) - full-duplex
0x55AA: amplifier (mock-up of RT1308/RT1316/Maxim 98373) - playback
with IV sense feedback
0x5555: mic codec (mock-up of RT715) - capture-only

The tables are added in a separate file to allow for mockup codecs to be
added on other platforms, but the mapping to specific topologies
remains platform-specific.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 18:02:06 +01:00
Pierre-Louis Bossart
81d3d3d0bf
ASoC: codecs: add SoundWire mockup device support
To test the host controller and bus management code, it is currently
required to have a physical SoundWire peripheral attached to the
bus. To help with pre-silicon or early hardware enablement, it would
be very useful to have a SoundWire 'mockup' device that is exposed in
platform firmware but does not drive any signal on the bus.

This is different to the existing ASoC 'dummy' codec uses for I2S/TDM,
the SoundWire spec makes it clear that a device that is not attached
to the bus is not permitted to interact with the bus, be it for
command/control or data.

This patch exposes a 'mockup' device, with a minimalist driver, with 4
partID values reserved by Intel for such test configurations. The
mockup device exposes one full-duplex DAI based on 2 ports (DP1 for
playback and DP8 for capture). The capture data port is just virtual,
such a mockup device is prevented by the SoundWire specification from
presenting any data generated by a Source port without being Attached.

All the callbacks exposed by the SoundWire Slave interface are
populated, even if they just return immediately. This is intentional
to describe what a minimal codec driver should do and implement and
help new codec vendors provide support for their devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 18:02:05 +01:00
jairaj arava
f28fbe57e8
ASoC: Intel: sof_sdw: update quirk for jack detection in ADL RVP
ADL RVP uses different circuits for jack detection, hence
adding external resister 100k mode.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: jairaj arava <jairaj.arava@intel.com>
Signed-off-by: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:40 +01:00
Bard Liao
8e6c00f1fd
ASoC: Intel: sof_sdw: include rt711.h for RT711 JD mode
We don't need to redefine enum rt711_jd_src.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:39 +01:00
Bard Liao
368fa526e6
ASoC: Intel: sof_sdw: extends SOF_RT711_JDSRC to 4 bits
commit 683b0df26c ("ASoC: rt711: add two jack detection modes")
added two jack detection modes. Rt711 has 4 JD modes now.
Reserve 4 bits in case rt711 adds more JD modes in the future.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:38 +01:00
Brent Lu
542d7050da
ASoC: Intel: sof_rt5682: code refactor for max98360a
Refactor the machine driver by using the common code in maxim-common
module to support max98360a.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:37 +01:00
Brent Lu
7d1bf46cb2
ASoC: Intel: sof_cs42l42: add support for jsl_cs4242_mx98360a
This patch adds driver data for jsl_cs4242_mx98360a which supports two
max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec on
SSP0 running on JSL platform.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:36 +01:00
Brent Lu
07acee589f
ASoC: Intel: maxim-common: support max98360a
Move max98360a code to this common module so it could be shared
between multiple SOF machine drivers. MAX98357A and MAX98360A are
sharing same codec driver so here we also share some function and
structures.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:35 +01:00
Brent Lu
3cb97cf3a6
ASoC: Intel: sof_cs42l42: support arbitrary DAI link sequence
Currently there are two types of DAI Link sequences defined in
topology files, one starts from speaker link and the other starts from
headphone link.

Type 1: SPK - HP - DMIC - HDMI
Type 2: HP - DMIC - HDMI - SPK

Here we add a macro SOF_CS42L42_DAILINK to define the DAI Link
sequence in quirk and refactor the sof_card_dai_links_create()
function to support arbitrary DAI Link sequence.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-14 13:30:34 +01:00
Mark Brown
eb82bae1a0
Merge series "ASoC: ti: davinci-mcasp: Fix the DIT mode and OMAP4 support" from Peter Ujfalusi <peter.ujfalusi@gmail.com>:
Hi,

Changes since v1:
- Do not calculat that we allow one serializer in DIT mode, just set the
  max_active_serializers to 1.
  Reported-by: kernel test robot <lkp@intel.com>

it has been on my todo list for several years to support McASP on OMAP4 devices.
For Galaxy Nexus we had an omap-mcasp driver (which was mostly a stripped down
davinci-mcasp driver) to support what was needed on that specific phone + it's
dock for S/PDIF (48KHz, 16bit, stereo).

Not many (if any) device available to test the DIT mode of McASP.
I have used BeagleBone White (McASP1 AXR3 can be routed to a pin) to get the
S/PDIF mode working then PandaES for OMAP4 support (on PandaES the gpio_121 is
not used and the signal is routed to expansion J6 pin14).

In theory the McASP in OMAP5 should be working after this series, but the OMAP5
TRM is not public and I do not have one to check the addresses and see if there
is a way to test it on omap5-uevm.

Mark, Tony:
The ASoC and dts patches can go via separate tree I felt that it is better if
they are together, at least initially.

Nikolaus: fyi, this might be useful for Pyra?

Regards,
Péter
---
Peter Ujfalusi (5):
  ASoC: ti: davinci-mcasp: Fix DIT mode support
  ASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4
  ASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP
  ARM: dts: omap4-l4-abe: Correct sidle modes for McASP
  ARM: dts: omap4-l4-abe: Add McASP configuration

 .../bindings/sound/davinci-mcasp-audio.txt    |   1 +
 arch/arm/boot/dts/omap4-l4-abe.dtsi           |  39 ++--
 include/linux/platform_data/davinci_asp.h     |   1 +
 sound/soc/ti/Kconfig                          |   1 +
 sound/soc/ti/davinci-mcasp.c                  | 176 +++++++++++++++---
 5 files changed, 175 insertions(+), 43 deletions(-)

--
2.32.0
2021-07-12 11:30:32 +01:00
Mark Brown
f537ab5fc7
Merge series "Fix unbalanced pm_runtime_enable in error handle" from Zhang Qilong <zhangqilong3@huawei.com>:
This two patches fixed the unbalanced PM disable depth. It could
avoid pm_runtime implementation complains when removing and probing
again the driver.

Zhang Qilong (2):
  ASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in
    mt8192_afe_pcm_dev_probe
  ASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in
    mt8183_afe_pcm_dev_probe

 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 43 ++++++++++++++--------
 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 27 +++++++++-----
 2 files changed, 44 insertions(+), 26 deletions(-)

--
2.31.1
2021-07-12 11:30:31 +01:00
Mark Brown
b8deadf3d9
Merge series "ASoC: Intel: machine driver corrections" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
The first fix solves an underflow in SoundWire platforms using the
max98373 amplifier, the rest of the patches are minor corrections in
machine drivers.

The fix should be queued for the 5.14 cycle, the rest should be
harmless but can be deferred for 5.15 if it's too late already.

Brent Lu (2):
  ASoC: SOF: add a helper to get topology configured bclk
  ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency

Gongjun Song (1):
  ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP

Rander Wang (1):
  ASoC: Intel: boards: fix xrun issue on platform with max98373

 include/sound/sof.h                           |  1 +
 sound/soc/intel/boards/sof_cs42l42.c          |  8 +-
 sound/soc/intel/boards/sof_sdw_max98373.c     | 81 ++++++++++++-------
 .../intel/common/soc-acpi-intel-tgl-match.c   | 15 ++++
 sound/soc/sof/sof-audio.c                     | 42 ++++++++--
 5 files changed, 111 insertions(+), 36 deletions(-)

--
2.25.1
2021-07-12 11:30:30 +01:00
Gu Shengxian
f7c4fe9cff
ASoC: amd: fix spelling mistakes
Fix some spelling mistakes as follows:
descritor ==> descriptor
descriptore ==> descriptor
contiguos ==> contiguous
initiailize ==> initialize
descriptiors ==> descriptor

Signed-off-by: Gu Shengxian <gushengxian@yulong.com>
Link: https://lore.kernel.org/r/20210706064207.672491-1-gushengxian507419@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:40 +01:00
Marek Vasut
3694f996be
ASoC: tlv320aic32x4: Fix TAS2505/TAS2521 channel count
The TAS2505/TAS2521 does support up to two channels, LEFT and RIGHT,
which are being alternated on the audio data bus by Word Clock, WCLK.
This is documented in TI slau472 2.7.1 Digital Audio Interface. Note
that both the LEFT and RIGHT channels are only used for audio INPUT,
while only the LEFT channel is used for audio OUTPUT.

Fixes: b4525b6196 ("ASoC: tlv320aic32x4: add support for TAS2505")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Claudius Heine <ch@denx.de>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210708091229.56443-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:39 +01:00
Tang Bin
8620c40002
ASoC: fsl_xcvr: Omit superfluous error message in fsl_xcvr_probe()
In the function fsl_xcvr__probe(), when get irq failed,
the function platform_get_irq() logs an error message, so remove
redundant message here.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210624104505.13680-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:38 +01:00
Wolfram Sang
d5bb69dc54
ASoC: sh: rcar: dma: : use proper DMAENGINE API for termination
dmaengine_terminate_all() is deprecated in favor of explicitly saying if
it should be sync or async. Here, we want dmaengine_terminate_sync()
because there is no other synchronization code in the driver to handle
an async case.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20210623100545.3926-1-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:38 +01:00