linux-2.6-microblaze.git
4 years agoMerge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Wed, 4 Mar 2020 13:38:36 +0000 (13:38 +0000)]
Merge branch 'for-5.6' of https://git./linux/kernel/git/broonie/sound into asoc-5.7

4 years agoASoc: amd: acp3x: Add missing include <linux/io.h>
YueHaibing [Wed, 4 Mar 2020 08:40:57 +0000 (16:40 +0800)]
ASoc: amd: acp3x: Add missing include <linux/io.h>

gcc 7.4.0 build fails:

In file included from sound/soc/amd/acp3x-rt5682-max9836.c:20:0:
sound/soc/amd/raven/acp3x.h: In function rv_readl:
sound/soc/amd/raven/acp3x.h:113:9: error: implicit declaration of function readl; did you mean rv_readl? [-Werror=implicit-function-declaration]
  return readl(base_addr - ACP3x_PHY_BASE_ADDRESS);
         ^~~~~
         rv_readl
sound/soc/amd/raven/acp3x.h: In function rv_writel:
sound/soc/amd/raven/acp3x.h:118:2: error: implicit declaration of function writel; did you mean rv_writel? [-Werror=implicit-function-declaration]
  writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS);
  ^~~~~~
  rv_writel

Add <linux/io.h> to fix this.

Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Message-Id: <20200304084057.44764-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: Fix compile warning of argument type
Akshu Agrawal [Tue, 3 Mar 2020 09:04:37 +0000 (14:34 +0530)]
ASoC: amd: Fix compile warning of argument type

Fixes:
>> sound/soc//amd/acp3x-rt5682-max9836.c:341:23: warning: format '%d'
>> expects argument of type 'int', but argument 3 has type 'long int'
>> [-Wformat=]
      dev_err(&pdev->dev, "DMIC gpio failed err=%d\n",

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200303090444.95805-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: AMD RV RT5682 should depends on CROS_EC
Enric Balletbo i Serra [Tue, 3 Mar 2020 11:05:14 +0000 (12:05 +0100)]
ASoC: amd: AMD RV RT5682 should depends on CROS_EC

If SND_SOC_AMD_RV_RT5682_MACH=y, below kconfig and build errors can be seen:

 WARNING: unmet direct dependencies detected for SND_SOC_CROS_EC_CODEC
 WARNING: unmet direct dependencies detected for I2C_CROS_EC_TUNNEL

 ld: drivers/i2c/busses/i2c-cros-ec-tunnel.o: in function `ec_i2c_xfer':
 i2c-cros-ec-tunnel.c:(.text+0x2fc): undefined reference to `cros_ec_cmd_xfer_status'
 ld: sound/soc/codecs/cros_ec_codec.o: in function `wov_host_event':
 cros_ec_codec.c:(.text+0x4fb): undefined reference to `cros_ec_get_host_event'
 ld: sound/soc/codecs/cros_ec_codec.o: in function `send_ec_host_command':
 cros_ec_codec.c:(.text+0x831): undefined reference to `cros_ec_cmd_xfer_status'

This is because it will select SND_SOC_CROS_EC_CODEC and I2c_CROS_EC_TUNNEL but
both depends on CROS_EC.

Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200303110514.3267126-1-enric.balletbo@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Fix snd_sof_ipc_stream_posn()
Dan Carpenter [Tue, 3 Mar 2020 10:18:58 +0000 (13:18 +0300)]
ASoC: SOF: Fix snd_sof_ipc_stream_posn()

We're passing "&posn" instead of "posn" so it ends up corrupting
memory instead of doing something useful.

Fixes: 53e0c72d98ba ("ASoC: SOF: Add support for IPC IO between DSP and Host")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200303101858.ytehbrivocyp3cnf@kili.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1015: modify pre-divider for sysclk
Jack Yu [Tue, 3 Mar 2020 02:59:13 +0000 (10:59 +0800)]
ASoC: rt1015: modify pre-divider for sysclk

Modify pre-divider for system clock.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200303025913.24499-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Mon, 2 Mar 2020 14:39:08 +0000 (14:39 +0000)]
Merge branch 'for-5.6' of https://git./linux/kernel/git/broonie/sound into asoc-5.7

4 years agoMerge series "ASoC: SOF: updates for 5.7" from Pierre-Louis Bossart <pierre-louis...
Mark Brown [Mon, 2 Mar 2020 14:31:46 +0000 (14:31 +0000)]
Merge series "ASoC: SOF: updates for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

4 unrelated improvements grouped in one bundle.

Jaska Uimonen (1):
  ASoC: SOF: ipc: check ipc return value before data copy

Keyon Jie (2):
  ASoC: SOF: pcm: skip DMA buffer pre-allocation
  ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE
    done

Tomasz Lauda (1):
  ASoC: SOF: add core id to sof_ipc_comp

 include/sound/sof/topology.h     |  3 ++-
 include/uapi/sound/sof/abi.h     |  2 +-
 sound/soc/sof/intel/hda-loader.c |  6 ++++++
 sound/soc/sof/ipc.c              | 12 +++++++-----
 sound/soc/sof/pcm.c              |  6 ++----
 5 files changed, 18 insertions(+), 11 deletions(-)

base-commit: 6941b0b5f919e9839e8c25efaeb53854efee14e5
--
2.20.1

4 years agoASoC: rt1015: set snd_soc_dai_ops in rt1015_dai driver
YueHaibing [Mon, 2 Mar 2020 07:05:22 +0000 (15:05 +0800)]
ASoC: rt1015: set snd_soc_dai_ops in rt1015_dai driver

snd_soc_dai_driver should set ops in rt1015_dai driver.
Also make the two variable static to fix sparse warnings.

Fixes: df31007400c3 ("ASoC: rt1015: add rt1015 amplifier driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200302070522.48104-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoc: amd: Add DMIC switch capability to machine driver
Akshu Agrawal [Mon, 2 Mar 2020 08:24:36 +0000 (13:54 +0530)]
ASoc: amd: Add DMIC switch capability to machine driver

Switch between DMIC0 and DMIC1 based on recording device selected.
This is done by toggling the dmic select gpio.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200302082443.51587-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: use snd_sof_dsp_set_power_state() op
Ranjani Sridharan [Fri, 28 Feb 2020 23:42:25 +0000 (15:42 -0800)]
ASoC: SOF: Intel: hda: use snd_sof_dsp_set_power_state() op

Replace the calls to hda_dsp_set_power_state() with the
top-level SOF op snd_sof_set_power_state().
Along with this, modify the hda_dsp_resume() function to return
the value of snd_sof_set_power_state() directly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200228234225.6963-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: add core id to sof_ipc_comp
Tomasz Lauda [Fri, 28 Feb 2020 23:18:50 +0000 (17:18 -0600)]
ASoC: SOF: add core id to sof_ipc_comp

Adds core id to sof_ipc_comp. The intention of this change
is to inform FW on which core that particular component
should run. Right now core id is only passed when pipeline
is created, which is not flexible enough and doesn't allow
for FW to handle this the right way.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done
Keyon Jie [Fri, 28 Feb 2020 23:18:49 +0000 (17:18 -0600)]
ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done

Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the
interrupt and avoid the arrival of the confusing unexpected ipc.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: ipc: check ipc return value before data copy
Jaska Uimonen [Fri, 28 Feb 2020 23:18:48 +0000 (17:18 -0600)]
ASoC: SOF: ipc: check ipc return value before data copy

In tx_wait_done the ipc payload is copied before the DSP transaction
error code is checked. This might lead to corrupted data in kernel side
even though the error would be handled later. It is also pointless to
copy the data in case of error. So change the order of error check and
copy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: pcm: skip DMA buffer pre-allocation
Keyon Jie [Fri, 28 Feb 2020 23:18:47 +0000 (17:18 -0600)]
ASoC: SOF: pcm: skip DMA buffer pre-allocation

As discussion in ALSA https://patchwork.kernel.org/patch/11336023/, it
is suggested to skip DMA buffer pre-allocation with passing size=0 when
calling snd_pcm_set_managed_buffer(), to make the full buffer_bytes
range configured in topology file selectable from user space, here do
the corresponding change in SOF PCM driver to implement it.

This change doesn't have dependency to the change that Takashi will do
in the ALSA core by adding total_pcm_alloc_bytes limitation to the
struct snd_card, it passes tests both with or without Takashi's coming
change on SOF CML platform.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1015: add operation callback function for rt1015_dai[]
Jack Yu [Mon, 2 Mar 2020 01:54:24 +0000 (09:54 +0800)]
ASoC: rt1015: add operation callback function for rt1015_dai[]

Add operation callback function for rt1015_dai[].

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200302015424.9075-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: zte: zx-spdif: remove redundant dev_err message
tangbin [Thu, 27 Feb 2020 15:07:01 +0000 (23:07 +0800)]
ASoC: zte: zx-spdif: remove redundant dev_err message

devm_ioremap_resource has already contains error message, so remove
the redundant dev_err message

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200227150701.15652-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dapm: don't use rtd->cpu_dai on for_each_rtd_cpu_dai()
Kuninori Morimoto [Thu, 27 Feb 2020 01:47:02 +0000 (10:47 +0900)]
ASoC: soc-dapm: don't use rtd->cpu_dai on for_each_rtd_cpu_dai()

soc_dapm_stream_event() is using for_each_rtd_cpu_dais().
It should use "cpu_dai", instead of "rtd->cpu_dai".
This patch fixup it.

Fixes: commit de6214a33633d ("ASoC: Add multiple CPU DAI support in DAPM")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pne07qeh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: Silence warnings during deferred probe
Marek Szyprowski [Fri, 28 Feb 2020 10:11:20 +0000 (11:11 +0100)]
ASoC: samsung: Silence warnings during deferred probe

Don't confuse user with meaningless warning about the failure in getting
resources and registering card in case of deferred probe.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200228101120.28819-1-m.szyprowski@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: Make rt5682_clock_config static
YueHaibing [Fri, 28 Feb 2020 07:56:09 +0000 (15:56 +0800)]
ASoC: rt5682: Make rt5682_clock_config static

Fix sparse warning:

sound/soc/codecs/rt5682-sdw.c:163:5: warning:
 symbol 'rt5682_clock_config' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200228075609.38236-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1015: modify some structure to be static.
Jack Yu [Thu, 27 Feb 2020 02:06:37 +0000 (10:06 +0800)]
ASoC: rt1015: modify some structure to be static.

Modify rt1015_aif_dai_ops and rt1015_dai[] to be static.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200227020637.15135-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-component: tidyup snd_soc_pcm_component_sync_stop()
Kuninori Morimoto [Fri, 28 Feb 2020 01:48:35 +0000 (10:48 +0900)]
ASoC: soc-component: tidyup snd_soc_pcm_component_sync_stop()

commit 1e5ddb6ba73894 ("ASoC: component: Add sync_stop PCM ops")
added snd_soc_pcm_component_sync_stop(), but it is checking
ioctrl instead of sync_stop. This is bug.
This patch fixup it.

Fixes: commit 1e5ddb6ba73894 ("ASoC: component: Add sync_stop PCM ops")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/8736av7a8c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dapm: Correct DAPM handling of active widgets during shutdown
Charles Keepax [Fri, 28 Feb 2020 15:31:45 +0000 (15:31 +0000)]
ASoC: dapm: Correct DAPM handling of active widgets during shutdown

commit c2caa4da46a4 ("ASoC: Fix widget powerdown on shutdown") added a
set of the power state during snd_soc_dapm_shutdown to ensure the
widgets powered off. However, when commit 39eb5fd13dff
("ASoC: dapm: Delay w->power update until the changes are written")
added the new_power member of the widget structure, to differentiate
between the current power state and the target power state, it did not
update the shutdown to use the new_power member.

As new_power has not updated it will be left in the state set by the
last DAPM sequence, ie. 1 for active widgets. So as the DAPM sequence
for the shutdown proceeds it will turn the widgets on (despite them
already being on) rather than turning them off.

Fixes: 39eb5fd13dff ("ASoC: dapm: Delay w->power update until the changes are written")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200228153145.21013-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add Multi CPU DAI support
Mark Brown [Wed, 26 Feb 2020 18:14:19 +0000 (18:14 +0000)]
ASoC: Add Multi CPU DAI support

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

As discussed in [1], ASoC core supports multi codec DAIs
on a DAI link. However it does not do so for CPU DAIs.

So, add support for multi CPU DAIs on a DAI Link by adding
multi CPU DAI in Card instantiation, suspend and resume
functions, PCM ops, stream handling functions and DAPM.

[1]: https://www.spinics.net/lists/alsa-devel/msg71369.html

changes in v5:
- rebase to latest kernel base

Bard Liao (2):
  ASoC: Return error if the function does not support multi-cpu
  ASoC: pcm: check if cpu-dai supports a given stream

Shreyas NC (4):
  ASoC: Add initial support for multiple CPU DAIs
  ASoC: Add multiple CPU DAI support for PCM ops
  ASoC: Add dapm_add_valid_dai_widget helper
  ASoC: Add multiple CPU DAI support in DAPM

 include/sound/soc.h                   |  15 +
 sound/soc/soc-compress.c              |   5 +-
 sound/soc/soc-core.c                  | 168 +++++-----
 sound/soc/soc-dapm.c                  | 133 ++++----
 sound/soc/soc-generic-dmaengine-pcm.c |  18 +
 sound/soc/soc-pcm.c                   | 463 ++++++++++++++++++--------
 6 files changed, 531 insertions(+), 271 deletions(-)

--
2.17.1

4 years agoSoundWire: ASoC interfaces for multi-cpu dais and DisCo helpers
Mark Brown [Wed, 26 Feb 2020 18:14:18 +0000 (18:14 +0000)]
SoundWire: ASoC interfaces for multi-cpu dais and DisCo helpers

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The first two patches prepare the support of multi-cpu dais for
synchronized playback and capture. We remove an unused set of
prototypes and add a get_sdw_stream() callback prototype currently
missing (the implementation will come later as part of the
synchronized playback)

The last exposes macros used internally, so that they can be reused to
extract information from the _ADR 64-bit values in SOF platform
drivers and related machine drivers.

I think it's simpler if all these simple patches are merged through
the SoundWire tree. With the additional changes to remove the platform
drivers and the merge of interrupt handling, that will result in a
single immutable tag provided to Mark Brown.

Pierre-Louis Bossart (3):
  soundwire: cadence: remove useless prototypes
  ASoC: soc-dai: add get_sdw_stream() callback
  soundwire: add helper macros for devID fields

 drivers/soundwire/bus.c            | 21 +++++----------------
 drivers/soundwire/cadence_master.h |  8 --------
 include/linux/soundwire/sdw.h      | 23 +++++++++++++++++++++++
 include/sound/soc-dai.h            | 21 +++++++++++++++++++++
 4 files changed, 49 insertions(+), 24 deletions(-)

--
2.20.1

4 years agoASoC: tas2562: Add entries for the TAS2563 audio amplifier
Dan Murphy [Wed, 26 Feb 2020 13:03:04 +0000 (07:03 -0600)]
ASoC: tas2562: Add entries for the TAS2563 audio amplifier

The TAS2563 is register compatible with the TAS2562.  The main
difference is the TAS2563 has a programmable DSP to manage different
audio profiles.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200226130305.12043-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: Add TAS2563 compatible to the TAS2562 binding
Dan Murphy [Wed, 26 Feb 2020 13:03:03 +0000 (07:03 -0600)]
ASoC: dt-bindings: Add TAS2563 compatible to the TAS2562 binding

Add the Texas Instruments TAS2563 audio amplifier to the TAS262
binding.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
CC: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200226130305.12043-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: Allow I2S wake event after ACP is powerd On
Akshu Agrawal [Wed, 26 Feb 2020 10:47:44 +0000 (16:17 +0530)]
ASoC: amd: Allow I2S wake event after ACP is powerd On

ACP_PME_EN allows wake interrupt to be generated when I2S wake
feature is enabled. On turning ACP On, ACP_PME_EN gets cleared.
Setting the bit back ensures that wake event can be received
when ACP is On.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200226104746.208656-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: Revise the function name
Oder Chiou [Wed, 19 Feb 2020 10:28:58 +0000 (18:28 +0800)]
ASoC: rt5682: Revise the function name

This patch revises the function name.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200219102858.20166-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: Add the soundwire support
Oder Chiou [Wed, 19 Feb 2020 10:28:57 +0000 (18:28 +0800)]
ASoC: rt5682: Add the soundwire support

This patch adds the soundwire support for ALC5682.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200219102858.20166-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: Add machine driver for Raven based platform
Akshu Agrawal [Mon, 17 Feb 2020 05:05:01 +0000 (10:35 +0530)]
ASoC: amd: Add machine driver for Raven based platform

Add machine driver for Raven based platform using
RT5682 + MAX9836 + CROS_EC codecs

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200217050515.3847-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add get_sdw_stream() callback
Pierre-Louis Bossart [Tue, 25 Feb 2020 17:00:40 +0000 (11:00 -0600)]
ASoC: soc-dai: add get_sdw_stream() callback

We only have a set() operation, provide the dual get() operation to
retrieve the stream information.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200225170041.23644-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: pcm: check if cpu-dai supports a given stream
Bard Liao [Tue, 25 Feb 2020 13:39:17 +0000 (21:39 +0800)]
ASoC: pcm: check if cpu-dai supports a given stream

Now multi-cpu-dais are supported, we can skip cpi-dais which don't
support the current stream, following the example of multi-codec-dais.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200225133917.21314-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Return error if the function does not support multi-cpu
Bard Liao [Tue, 25 Feb 2020 13:39:16 +0000 (21:39 +0800)]
ASoC: Return error if the function does not support multi-cpu

Multi cpu is not supported by all functions yet. Add an error message
and return.

Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200225133917.21314-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add multiple CPU DAI support in DAPM
Shreyas NC [Tue, 25 Feb 2020 13:39:15 +0000 (21:39 +0800)]
ASoC: Add multiple CPU DAI support in DAPM

DAPM handles DAIs during soc_dapm_stream_event() and during addition
and creation of DAI widgets i.e., dapm_add_valid_dai_widget() and
dapm_connect_dai_link_widgets().

Extend these functions to handle multiple cpu dai.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200225133917.21314-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add dapm_add_valid_dai_widget helper
Shreyas NC [Tue, 25 Feb 2020 13:39:14 +0000 (21:39 +0800)]
ASoC: Add dapm_add_valid_dai_widget helper

Adding a helper to connect widget for a specific cpu and codec dai
The helper will help dapm_connect_dai_link_widgets() to reduce indents.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200225133917.21314-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add multiple CPU DAI support for PCM ops
Shreyas NC [Tue, 25 Feb 2020 13:39:13 +0000 (21:39 +0800)]
ASoC: Add multiple CPU DAI support for PCM ops

Add support in PCM operations to invoke multiple cpu dais as we do
for multiple codec dais. Also the symmetry calculations are updated to
reflect multiple cpu dais.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200225133917.21314-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add initial support for multiple CPU DAIs
Shreyas NC [Tue, 25 Feb 2020 13:39:12 +0000 (21:39 +0800)]
ASoC: Add initial support for multiple CPU DAIs

ASoC core supports multiple codec DAIs but supports only a CPU DAI.
To support multiple cpu DAIs, add cpu_dai and num_cpu_dai in
snd_soc_dai_link and snd_soc_pcm_runtime structures similar to
support for codec_dai. This is intended as a preparatory patch to
eventually support the unification of the Codec and CPU DAI.

Inline with multiple codec DAI approach, add support to allocate,
init, bind and probe multiple cpu_dai on init if driver specifies
that. Also add support to loop over multiple cpu_dai during
suspend and resume.

This is intended as a preparatory patch to eventually unify the CPU
and Codec DAI into DAI components.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Link: https://lore.kernel.org/r/20200225133917.21314-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tas2562: Fix sample rate error message
Dan Murphy [Wed, 26 Feb 2020 13:03:05 +0000 (07:03 -0600)]
ASoC: tas2562: Fix sample rate error message

Fix error message for setting the sample rate.  It says bitwidth but
should say sample rate.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200226130305.12043-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: mrfld: fix incorrect check on p->sink
Colin Ian King [Tue, 19 Nov 2019 11:36:40 +0000 (11:36 +0000)]
ASoC: Intel: mrfld: fix incorrect check on p->sink

The check on p->sink looks bogus, I believe it should be p->source
since the following code blocks are related to p->source. Fix
this by replacing p->sink with p->source.

Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Copy-paste error")
Link: https://lore.kernel.org/r/20191119113640.166940-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Mon, 24 Feb 2020 22:26:06 +0000 (22:26 +0000)]
Merge branch 'for-5.6' of https://git./linux/kernel/git/broonie/sound into asoc-5.7

4 years agoASoC: soc-pcm cleanup step4
Mark Brown [Mon, 24 Feb 2020 21:48:25 +0000 (21:48 +0000)]
ASoC: soc-pcm cleanup step4

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are soc-pcm cleanup step4.

[01/13] - [06/13] are posted but not yet accepted patches.
To avoid conflict, I merged these into step4.
These patches are already received Reviewed-by from Pierre-Louis.

Subject: [PATCH 0/6] ASoC: use for_each_rtd_codec_dai() macro
Date: Thu, 13 Feb 2020 13:08:07 +0900

Kuninori Morimoto (13):
   1) ASoC: soundwaire: qcom: use for_each_rtd_codec_dai() macro
   2) ASoC: qcom: sdm845: use for_each_rtd_codec_dai() macro
   3) ASoC: qcom: apq8016_sbc: use for_each_rtd_codec_dai() macro
   4) ASoC: intel: cml_rt1011_rt5682: use for_each_rtd_codec_dai() macro
   5) ASoC: intel: kbl_da7219_max98927: use for_each_rtd_codec_dai() macro
   6) ASoC: mediatek: mt8183-da7219-max98357: use for_each_rtd_codec_dai() macro
   7) ASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()
   8) ASoC: soc-pcm: cleanup soc_pcm_apply_msb()
   9) ASoC: soc-pcm: add snd_soc_dai_get_widget()
  10) ASoC: soc-pcm: merge dpcm_run_new/old_update() into dpcm_fe_runtime_update()
  11) ASoC: soc-pcm: move dpcm_path_put() to soc-pcm.c
  12) ASoC: soc-pcm: move CONFIG_DEBUG_FS functions to top side
  13) ASoC: soc-pcm: add dpcm_create/remove_debugfs_state()

 drivers/soundwire/qcom.c                      |   7 +-
 include/sound/soc-dai.h                       |  15 +
 include/sound/soc-dapm.h                      |   1 +
 include/sound/soc-dpcm.h                      |   7 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   3 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |   8 +-
 sound/soc/intel/skylake/skl-pcm.c             |  10 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |   8 +-
 sound/soc/qcom/apq8016_sbc.c                  |   7 +-
 sound/soc/qcom/sdm845.c                       |  20 +-
 sound/soc/soc-dai.c                           |   7 +-
 sound/soc/soc-dapm.c                          |  20 +-
 sound/soc/soc-pcm.c                           | 462 ++++++++----------
 13 files changed, 266 insertions(+), 309 deletions(-)

--
2.17.1

Thank you for your help !!
Best regards
---
Kuninori Morimoto

4 years agoASoC: soc-pcm: fix state tracking error in snd_soc_component_open/close()
Kai Vehmanen [Thu, 20 Feb 2020 09:49:55 +0000 (11:49 +0200)]
ASoC: soc-pcm: fix state tracking error in snd_soc_component_open/close()

ASoC component open/close and snd_soc_component_module_get/put are called
independently for each component-substream pair, so the logic added in
commit dd03907bf129 ("ASoC: soc-pcm: call snd_soc_component_open/close()
once") was not sufficient and led to PCM playback and module unload errors.

Implement handling of failures directly in soc_pcm_components_open(),
so that any successfully opened components are closed upon error with
other components. This allows to clean up error handling in
soc_pcm_open() without adding more state tracking.

Fixes: dd03907bf129 ("ASoC: soc-pcm: call snd_soc_component_open/close() once")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200220094955.16968-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: add dpcm_create/remove_debugfs_state()
Kuninori Morimoto [Wed, 19 Feb 2020 06:57:06 +0000 (15:57 +0900)]
ASoC: soc-pcm: add dpcm_create/remove_debugfs_state()

soc-pcm.c has implementation which depends on CONFIG_DEBUG_FS.
But, we don't want to have random #ifdef.
This patch adds dpcm_create/remove_debugfs_state() and care it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e0jjc9b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: move CONFIG_DEBUG_FS functions to top side
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:57 +0000 (15:56 +0900)]
ASoC: soc-pcm: move CONFIG_DEBUG_FS functions to top side

This is prepare for CONFIG_DEBUG_FS cleanup

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878skzjc9k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: move dpcm_path_put() to soc-pcm.c
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:52 +0000 (15:56 +0900)]
ASoC: soc-pcm: move dpcm_path_put() to soc-pcm.c

dpcm_path_put() (A) is calling kfree(*list).
The freed list is created by dapm_widget_list_create() (B) which is called
from snd_soc_dapm_dai_get_connected_widgets() (C) which is called from
dpcm_path_get() (D).

(B) dapm_widget_list_create(**list, ...)
{
...
=> *list = kzalloc();
...
}

(C) snd_soc_dapm_dai_get_connected_widgets(..., **list, ...)
{
...
dapm_widget_list_create(list, ...);
...
}

(D) dpcm_path_get(..., **list)
{
...
snd_soc_dapm_dai_get_connected_widgets(..., list, ...);
...
}

(A) dpcm_path_put(**list)
{
=> kfree(*list);
}

This kind of unbalance code is very difficult to read/understand.
To avoid this issue, this patch adds each missing paired function
dapm_widget_list_free()         for dapm_widget_list_create() (B), and
snd_soc_dapm_dai_free_widgets() for snd_soc_dapm_dai_get_connected_widgets() (C).

This patch uses these, and moves dpcm_path_put() next to dpcm_path_get().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a75fjc9q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: merge dpcm_run_new/old_update() into dpcm_fe_runtime_update()
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:46 +0000 (15:56 +0900)]
ASoC: soc-pcm: merge dpcm_run_new/old_update() into dpcm_fe_runtime_update()

soc-pcm has dpcm_run_new/old_update(), but these are used from
dpcm_fe_runtime_update() only, and are very verbose functions.
This patch disassembles these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blpvjc9v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: add snd_soc_dai_get_widget()
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:41 +0000 (15:56 +0900)]
ASoC: soc-pcm: add snd_soc_dai_get_widget()

soc-pcm.c has dai_get_widget(), but it can be more generic.
This patch renames it to snd_soc_dai_get_widget(), and use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d0abjca1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: cleanup soc_pcm_apply_msb()
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:36 +0000 (15:56 +0900)]
ASoC: soc-pcm: cleanup soc_pcm_apply_msb()

soc_pcm_apply_msb() apply msb for CPU/Codec,
but, it has duplicate code. The difference is only
SNDRV_PCM_STREAM_PLAYBACK and SNDRV_PCM_STEAM_CAPTURE.

It is very verbose and duplicate code.
This patch simplify code by using snd_soc_dai_get_pcm_stream().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeurjca6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:30 +0000 (15:56 +0900)]
ASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()

DAI driver has playback/capture stream.
OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE.
Because of this kind of implementation,
ALSA SoC needs to have many verbose code.

To solve this issue, this patch adds snd_soc_dai_get_pcm_stream() macro
to get playback/capture stream pointer from stream.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftf7jcab.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Fix available clock counter incrementation
Amadeusz Sławiński [Mon, 24 Feb 2020 12:52:02 +0000 (07:52 -0500)]
ASoC: Intel: Skylake: Fix available clock counter incrementation

Incrementation of avail_clk_cnt was incorrectly moved to error path. Put
it back to success path.

Fixes: 6ee927f2f01466 ('ASoC: Intel: Skylake: Fix NULL ptr dereference when unloading clk dev')
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200224125202.13784-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm/soc-compress: don't use snd_soc_dapm_stream_stop()
Kuninori Morimoto [Fri, 21 Feb 2020 01:25:18 +0000 (10:25 +0900)]
ASoC: soc-pcm/soc-compress: don't use snd_soc_dapm_stream_stop()

commit b0edff42360ab4 ("ASoC: soc-pcm/soc-compress: use
snd_soc_dapm_stream_stop() for SND_SOC_DAPM_STREAM_STOP")
uses snd_soc_dapm_stream_stop() for soc_compr_free_fe()
and dpcm_fe_dai_shutdown() because it didn't care about pmdown_time.
But, it didn't need to care.
This patch rollback to original code.
Some system will wait unneeded timed-out without this patch.
Special Thanks for reporting to Chris Gorman.
...
intel_sst_acpi 808622A8:00: Wait timed-out condition:0x0, msg_id:0x1 fw_state 0x3
intel_sst_acpi 808622A8:00: fw returned err -16
sst-mfld-platform sst-mfld-platform: ASoC: PRE_PMD: pcm0_in event failed: -16
...

Fixes: commit b0edff42360ab4 ("ASoC: soc-pcm/soc-compress: use snd_soc_dapm_stream_stop() for SND_SOC_DAPM_STREAM_STOP")
Reported-by: Chris Gorman <chrisjohgorman@gmail.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfowspeb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: aiu: fix semicolon.cocci warnings
kbuild test robot [Sat, 22 Feb 2020 17:01:54 +0000 (01:01 +0800)]
ASoC: meson: aiu: fix semicolon.cocci warnings

sound/soc/meson/aiu-encoder-i2s.c:129:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Fixes: 3e25c44598aa ("ASoC: meson: aiu: add support for the Meson8 and Meson8b SoC families")
Signed-off-by: kbuild test robot <lkp@intel.com>
CC: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20200222170154.GA119396@e50d7db646c3
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Fix SND_SOC_ALL_CODECS imply ac97 fallout
Geert Uytterhoeven [Mon, 24 Feb 2020 11:25:37 +0000 (12:25 +0100)]
ASoC: Fix SND_SOC_ALL_CODECS imply ac97 fallout

On i386 randconfig:

    sound/soc/codecs/wm9705.o: In function `wm9705_soc_resume':
    wm9705.c:(.text+0x128): undefined reference to `snd_ac97_reset'
    sound/soc/codecs/wm9712.o: In function `wm9712_soc_resume':
    wm9712.c:(.text+0x2d1): undefined reference to `snd_ac97_reset'
    sound/soc/codecs/wm9713.o: In function `wm9713_soc_resume':
    wm9713.c:(.text+0x820): undefined reference to `snd_ac97_reset'

Fix this by adding the missing dependencies on SND_SOC_AC97_BUS.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20200224112537.14483-1-geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Add decimation filter support
Dan Murphy [Fri, 21 Feb 2020 18:13:58 +0000 (12:13 -0600)]
ASoC: tlv320adcx140: Add decimation filter support

Add decimation filter selection support.
Per Section 8.3.6.7 the Digital Decimation Filter is selectable between
a Linear Phase, Low Latency, and Ultra Low Latency filer.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200221181358.22526-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Add DRE and AGC support
Dan Murphy [Fri, 21 Feb 2020 18:13:57 +0000 (12:13 -0600)]
ASoC: tlv320adcx140: Add DRE and AGC support

The TLV320ADCx140 parts support Dynamic Range Enhancer (DRE) as defined
in Section 8.3.2 of the data sheets.

The DRE achieves a complete-channel dynamic range as high as 120 dB.
At a system level, the DRE scheme enables far-field, high-fidelity recording
of audio signals in very quiet environments and low-distortion recording in
loud environments.

There are 2 enables for DRE.  The first is a global setting that enables
the DRE engine in the device and the other enable is per channel.  If
the DRE is enabled globally then either DRE or AGC can be used per each
configured channel.  If global DRE is disabled then even setting the DRE
enable bit in the channel config register will have no effect.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200221181358.22526-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: axg-card: add toacodec support
Jerome Brunet [Fri, 21 Feb 2020 15:36:07 +0000 (16:36 +0100)]
ASoC: meson: axg-card: add toacodec support

Make sure the axg audio card driver recognise the dai_link as a
codec-to-codec link if the cpu dai is the internal dac glue.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200221153607.1585499-4-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: g12a: add internal DAC glue driver
Jerome Brunet [Fri, 21 Feb 2020 15:36:06 +0000 (16:36 +0100)]
ASoC: meson: g12a: add internal DAC glue driver

Add support for the internal audio DAC glue found on the Amlogic g12a
and sm1 SoC families. This allows to connect the TDM outputs of the SoC
to the internal t9015 audio DAC.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200221153607.1585499-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: g12a: add toacodec dt-binding documentation
Jerome Brunet [Fri, 21 Feb 2020 15:36:05 +0000 (16:36 +0100)]
ASoC: meson: g12a: add toacodec dt-binding documentation

Add the DT bindings and documentation of the internal audio DAC glue found
on Amlogic g12a and sm1 SoC families

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200221153607.1585499-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tas2562: Add support for digital volume control
Dan Murphy [Fri, 21 Feb 2020 12:41:51 +0000 (06:41 -0600)]
ASoC: tas2562: Add support for digital volume control

Add support for digital volume control.  There is no dedicated register
for volume control but instead there are 4.  The values of the registers
are determined with exponential floating point math.
So a table was created with register values for 2dB step increments
from -110dB to 0dB.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200221124151.8774-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun8i-codec: Remove unused dev from codec struct
Samuel Holland [Mon, 17 Feb 2020 06:42:20 +0000 (00:42 -0600)]
ASoC: sun8i-codec: Remove unused dev from codec struct

This field is not used anywhere in the driver, so remove it.

Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200217064250.15516-5-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: aiu: add support for the Meson8 and Meson8b SoC families
Martin Blumenstingl [Thu, 20 Feb 2020 20:57:11 +0000 (21:57 +0100)]
ASoC: meson: aiu: add support for the Meson8 and Meson8b SoC families

The AIU audio controller on the Meson8 and Meson8b SoC families is
compatible with the one found in the later GXBB family. Add compatible
strings for these two older SoC families so the driver can be loaded for
them.

Instead of using the I2S divider from the AIU_CLK_CTRL_MORE register we
need to use the I2S divider from the AIU_CLK_CTRL register. This older
register is less flexible because it only supports four divider settings
(1, 2, 4, 8) compared to the AIU_CLK_CTRL_MORE register (which supports
dividers in the range 0..64).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200220205711.77953-4-martin.blumenstingl@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: aiu: introduce a struct for platform specific information
Martin Blumenstingl [Thu, 20 Feb 2020 20:57:10 +0000 (21:57 +0100)]
ASoC: meson: aiu: introduce a struct for platform specific information

Introduce a struct aiu_platform_data to make the driver aware of
platform specific information. Convert the existing check for the
internal stereo audio codec (only available on GXL) to this new struct.
Support for the 32-bit SoCs will need this as well because the
AIU_CLK_CTRL_MORE register doesn't have the I2S divider bits (and we
need to use the I2S divider from AIU_CLK_CTRL instead).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200220205711.77953-3-martin.blumenstingl@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: aiu: Document Meson8 and Meson8b support in the dt-bindings
Martin Blumenstingl [Thu, 20 Feb 2020 20:57:09 +0000 (21:57 +0100)]
ASoC: meson: aiu: Document Meson8 and Meson8b support in the dt-bindings

The AIU audio output controller on the Meson8 and Meson8b SoC families
is compatible with the one found in the GXBB family. Document the
compatible string for these two older SoCs.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200220205711.77953-2-martin.blumenstingl@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: g12a: add tohdmitx reset
Jerome Brunet [Fri, 21 Feb 2020 12:11:46 +0000 (13:11 +0100)]
ASoC: meson: g12a: add tohdmitx reset

Reset the g12a hdmi codec glue on probe. This ensure a sane startup state.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200221121146.1498427-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family
Dan Murphy [Thu, 20 Feb 2020 21:07:59 +0000 (15:07 -0600)]
ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family

Add the tlv320adcx140 codec driver family.

The TLV320ADCx140 is a Burr-Brownâ„¢ highperformance, audio analog-to-digital
converter (ADC) that supports simultaneous sampling of up to four analog
channels or eight digital channels for the pulse density modulation (PDM)
microphone input. The device supports line and microphone inputs, and
allows for both single-ended and differential input configurations.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200220210759.31466-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: Add TLV320ADCx140 dt bindings
Dan Murphy [Thu, 20 Feb 2020 21:07:58 +0000 (15:07 -0600)]
dt-bindings: sound: Add TLV320ADCx140 dt bindings

Add dt bindings for the TLV320ADCx140 Burr-Brown ADC.
The initial support is for the following:

TLV320ADC3140 - http://www.ti.com/lit/gpn/tlv320adc3140
TLV320ADC5140 - http://www.ti.com/lit/gpn/tlv320adc5140
TLV320ADC6140 - http://www.ti.com/lit/gpn/tlv320adc6140

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200220210759.31466-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: pcm512x: Fix unbalanced regulator enable call in probe error path
Matthias Reichl [Thu, 20 Feb 2020 20:29:56 +0000 (21:29 +0100)]
ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path

When we get a clock error during probe we have to call
regulator_bulk_disable before bailing out, otherwise we trigger
a warning in regulator_put.

Fix this by using "goto err" like in the error cases above.

Fixes: 5a3af1293194d ("ASoC: pcm512x: Add PCM512x driver")
Signed-off-by: Matthias Reichl <hias@horus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200220202956.29233-1-hias@horus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: allow operation without i915 gfx
Kai Vehmanen [Thu, 20 Feb 2020 17:10:28 +0000 (19:10 +0200)]
ASoC: SOF: Intel: hda: allow operation without i915 gfx

Add support to configure the HDA controller with an external HDA
codec even if iDisp codec in i915 is not available.

This can happen for multiple reasons:
 - internal graphics is disabled on the system
 - i915 driver is not enabled in kernel or it fails to init
 - i915 codec reports error in HDA codec probe
 - HDA codec driver probe fails

Address all these scenarios, but keep using the existing topology.
In case failures occur, HDMI PCM nodes are created, but they will
report error if application tries to use them. No ALSA mixer controls
are created. If the external HDA codec init fails as well, SOF probe
will return error as before.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206085
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1163677
BugLink: https://github.com/thesofproject/linux/issues/1658
Link: https://lore.kernel.org/r/20200220171028.22023-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel/skl/hda - add no-HDMI cases to generic HDA driver
Kai Vehmanen [Thu, 20 Feb 2020 17:10:27 +0000 (19:10 +0200)]
ASoC: intel/skl/hda - add no-HDMI cases to generic HDA driver

Extend the generic HDA driver to support systems where iDisp/HDMI
audio codecs are disabled for some reason. Switch codecs to
SoC dummy in the affected DAI links. This allows to reuse
existing topologies for this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206085
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1163677
BugLink: https://github.com/thesofproject/linux/issues/1658
Link: https://lore.kernel.org/r/20200220171028.22023-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: Update dependencies for Arizona machine drivers
Charles Keepax [Thu, 20 Feb 2020 12:56:54 +0000 (12:56 +0000)]
ASoC: samsung: Update dependencies for Arizona machine drivers

Currently it is possible to get the following bad config:

WARNING: unmet direct dependencies detected for SND_SOC_WM5110
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MFD_WM5110 [=n]

commit ea00d95200d0 ("ASoC: Use imply for SND_SOC_ALL_CODECS")
commit d8dd3f92a6ba ("ASoC: Fix SND_SOC_ALL_CODECS imply misc fallout")

After these two patches the machine drivers still selects the
SND_SOC_WM5110 symbol which doesn't take account of the dependency
added on the MFD_WM5110 symbol, fix this by also adding a dependency on
MFD_WM5110 itself.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200220125654.7064-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dpcm: remove confusing trace in dpcm_get_be()
Jerome Brunet [Wed, 19 Feb 2020 11:50:48 +0000 (12:50 +0100)]
ASoC: dpcm: remove confusing trace in dpcm_get_be()

Now that dpcm_get_be() is used in dpcm_end_walk_at_be(), it is not a error
if this function does not find a BE for the provided widget. Remove the
related dev_err() trace which is confusing since things might be working
as expected.

When called from dpcm_add_paths(), it is an error if dpcm_get_be() fails to
find a BE for the provided widget. The necessary error trace is already
done in this case.

Fixes: 027a48387183 ("ASoC: soc-pcm: use dpcm_get_be() at dpcm_end_walk_at_be()")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200219115048.934678-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: fix for_rtd_codec_dai_rollback() macro
Pierre-Louis Bossart [Wed, 19 Feb 2020 22:21:30 +0000 (16:21 -0600)]
ASoC: soc-core: fix for_rtd_codec_dai_rollback() macro

The use of parentheses to protect the argument is fine for (i)++ but
not for (--i).

Fixes: 83f94a2e293d61 ("ASoC: soc-core: add snd_soc_close_delayed_work()")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200219222130.29933-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: stm32: convert i2s to json-schema
Olivier Moysan [Fri, 7 Feb 2020 12:03:45 +0000 (13:03 +0100)]
ASoC: dt-bindings: stm32: convert i2s to json-schema

Convert the STM32 I2S bindings to DT schema format using json-schema.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200207120345.24672-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: add t9015 internal DAC driver
Jerome Brunet [Wed, 19 Feb 2020 17:35:03 +0000 (18:35 +0100)]
ASoC: meson: add t9015 internal DAC driver

Add the codec driver of the internal DAC found on Amlogic gxl, g12a and
sm1 family.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200219173503.1112561-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: add t9015 internal codec binding documentation
Jerome Brunet [Wed, 19 Feb 2020 17:35:02 +0000 (18:35 +0100)]
ASoC: meson: add t9015 internal codec binding documentation

Add the DT binding documention of the internal DAC found in the Amlogic
gxl, g12a and sm1 SoC family.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200219173503.1112561-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: topology: Fix memleak in soc_tplg_manifest_load()
Dragos Tarcatu [Fri, 7 Feb 2020 18:53:25 +0000 (20:53 +0200)]
ASoC: topology: Fix memleak in soc_tplg_manifest_load()

In case of ABI version mismatch, _manifest needs to be freed as
it is just a copy of the original topology manifest. However, if
a driver manifest handler is defined, that would get executed and
the cleanup is never reached. Fix that by getting the return status
of manifest() instead of returning directly.

Fixes: 583958fa2e52 ("ASoC: topology: Make manifest backward compatible from ABI v4")
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Link: https://lore.kernel.org/r/20200207185325.22320-3-dragos_tarcatu@mentor.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: topology: Fix memleak in soc_tplg_link_elems_load()
Dragos Tarcatu [Fri, 7 Feb 2020 18:53:24 +0000 (20:53 +0200)]
ASoC: topology: Fix memleak in soc_tplg_link_elems_load()

If soc_tplg_link_config() fails, _link needs to be freed in case of
topology ABI version mismatch. However the current code is returning
directly and ends up leaking memory in this case.
This patch fixes that.

Fixes: 593d9e52f9bb ("ASoC: topology: Add support to configure existing physical DAI links")
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Link: https://lore.kernel.org/r/20200207185325.22320-2-dragos_tarcatu@mentor.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rockchip: Make RK3328 GPIO_MUTE control explicit
Robin Murphy [Tue, 18 Feb 2020 21:31:59 +0000 (21:31 +0000)]
ASoC: rockchip: Make RK3328 GPIO_MUTE control explicit

The RK3328 reference design uses an external line driver IC as a buffer
on the analog codec output, enabled by the GPIO_MUTE pin, and such a
configuration is currently assumed in the codec driver's direct poking
of GRF_SOC_CON10 to control the GPIO_MUTE output value. However, some
boards wire up analog audio yet use that pin for some other purpose, so
that assumption doesn't always hold. Update this functionality to rely
on an explicit GPIO descriptor, such that it can be managed at the
board level.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/5bc383ed1832f0f5d1dcb3c97ad92fd68e5217e3.1581376744.git.robin.murphy@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: Make RK3328 codec GPIO explicit
Robin Murphy [Tue, 18 Feb 2020 21:31:58 +0000 (21:31 +0000)]
ASoC: dt-bindings: Make RK3328 codec GPIO explicit

Existing RK3328 codec drivers have overloaded the GRF phandle to assume
implicit control of the limited-function GPIO_MUTE pin, which is usually
used to enable an external audio line driver IC. Since this pin has a
proper binding of its own (see gpio/rockchip,rk3328-grf-gpio.txt), make
a GPIO explicit in the codec binding too. This will help avoid ambiguity
on boards that use that pin for some other purpose.

(and while touching the example, enforce the "don't include status" rule)

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/5f7a399dea8a9dedef57f6f99f0f6ab1c1fdc56a.1581376744.git.robin.murphy@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: mt8183-da7219-max98357: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:25 +0000 (15:56 +0900)]
ASoC: mediatek: mt8183-da7219-max98357: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87h7znjcag.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: kbl_da7219_max98927: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:20 +0000 (15:56 +0900)]
ASoC: intel: kbl_da7219_max98927: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87imk3jcal.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: cml_rt1011_rt5682: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:15 +0000 (15:56 +0900)]
ASoC: intel: cml_rt1011_rt5682: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87k14jjcaq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: apq8016_sbc: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:09 +0000 (15:56 +0900)]
ASoC: qcom: apq8016_sbc: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87lfozjcaw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: sdm845: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:56:01 +0000 (15:56 +0900)]
ASoC: qcom: sdm845: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87mu9fjcb4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soundwaire: qcom: use for_each_rtd_codec_dai() macro
Kuninori Morimoto [Wed, 19 Feb 2020 06:55:53 +0000 (15:55 +0900)]
ASoC: soundwaire: qcom: use for_each_rtd_codec_dai() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87o8tvjcbc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tas2562: Add support for ISENSE and VSENSE
Dan Murphy [Wed, 19 Feb 2020 13:46:22 +0000 (07:46 -0600)]
ASoC: tas2562: Add support for ISENSE and VSENSE

Add additional support for ISENSE and VSENSE feature for the TAS2562.
This feature monitors the output to the loud speaker attempts to
eliminate IR drop errors due to packaging.

This feature is defined in Section 8.4.5 IV Sense of the data sheet.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200219134622.22066-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: mt8183-da7219: use SND_SOC_DAPM_PINCTRL in TDM out
Tzung-Bi Shih [Wed, 19 Feb 2020 09:38:39 +0000 (17:38 +0800)]
ASoC: mediatek: mt8183-da7219: use SND_SOC_DAPM_PINCTRL in TDM out

Uses SND_SOC_DAPM_PINCTRL in TDM out to simplify code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200219170951.2.I7ed16ef57d9e0bcafc37e766142f68cbad5b54c6@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dapm: select sleep_state when initializing PINCTRL widget
Tzung-Bi Shih [Wed, 19 Feb 2020 09:38:38 +0000 (17:38 +0800)]
ASoC: dapm: select sleep_state when initializing PINCTRL widget

Selects sleep_state when initializing PINCTRL widget.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200219170951.1.I61f6559a37a6a40a6fde0737cb16100fb17c0480@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fix card registration regression.
Jerome Brunet [Wed, 19 Feb 2020 10:25:26 +0000 (11:25 +0100)]
ASoC: fix card registration regression.

This reverts commit b2354e4009a773c00054b964d937e1b81cb92078.

This change might have been desirable to ensure the uniqueness of
the component name. It would have helped to better support linux
devices which register multiple components, something is which more
common than initially thought.

However, some card driver are directly using dev_name() to fill the
component names of the dai_link which is a problem if want to change
the way ASoC generates the component names.

Until we figure out the appropriate way to deal with this, revert the
change and keep the names as they were. There might be a couple of warning
related to debugfs (which were already present before the change) but it
is still better than breaking working audio cards.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20200219102526.692126-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: MT6660 update to 1.0.8_G
Jeff Chang [Wed, 19 Feb 2020 09:04:24 +0000 (17:04 +0800)]
ASoC: MT6660 update to 1.0.8_G

1. add mt6660_component_settign for Component INIT Setting

Signed-off-by: Jeff Chang <jeff_chang@richtek.com>
Link: https://lore.kernel.org/r/1582103064-25088-1-git-send-email-richtek.jeff.chang@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output
Takashi Iwai [Tue, 18 Feb 2020 11:17:37 +0000 (12:17 +0100)]
ASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output

dpcm_show_state() invokes multiple snprintf() calls to concatenate
formatted strings on the fixed size buffer.  The usage of snprintf()
is supposed for avoiding the buffer overflow, but it doesn't work as
expected because snprintf() doesn't return the actual output size but
the size to be written.

Fix this bug by replacing all snprintf() calls with scnprintf()
calls.

Fixes: f86dcef87b77 ("ASoC: dpcm: Add debugFS support for DPCM")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200218111737.14193-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: skl: Fix possible buffer overflow in debug outputs
Takashi Iwai [Tue, 18 Feb 2020 11:17:36 +0000 (12:17 +0100)]
ASoC: intel: skl: Fix possible buffer overflow in debug outputs

The debugfs output of intel skl driver writes strings with multiple
snprintf() calls with the fixed size.  This was supposed to avoid the
buffer overflow but actually it still would, because snprintf()
returns the expected size to be output, not the actual output size.

Fix it by replacing snprintf() calls with scnprintf().

Fixes: d14700a01f91 ("ASoC: Intel: Skylake: Debugfs facility to dump module config")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200218111737.14193-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: skl: Fix pin debug prints
Takashi Iwai [Tue, 18 Feb 2020 11:17:35 +0000 (12:17 +0100)]
ASoC: intel: skl: Fix pin debug prints

skl_print_pins() loops over all given pins but it overwrites the text
at the very same position while increasing the returned length.
Fix this to show the all pin contents properly.

Fixes: d14700a01f91 ("ASoC: Intel: Skylake: Debugfs facility to dump module config")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200218111737.14193-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoALSA: usx2y: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:51 +0000 (17:28 +0900)]
ALSA: usx2y: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sgj9aa8e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sof: sof-audio: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:47 +0000 (17:28 +0900)]
ASoC: sof: sof-audio: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87tv3paa8i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: lpass-platform: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:44 +0000 (17:28 +0900)]
ASoC: qcom: lpass-platform: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9o5aa8m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl: fsl_asrc_dma: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:40 +0000 (17:28 +0900)]
ASoC: fsl: fsl_asrc_dma: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87wo8laa8p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dwc: dwc-i2s: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:36 +0000 (17:28 +0900)]
ASoC: dwc: dwc-i2s: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87y2t1aa8t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-generic-dmaengine-pcm: use for_each_pcm_streams() macro
Kuninori Morimoto [Mon, 17 Feb 2020 08:28:32 +0000 (17:28 +0900)]
ASoC: soc-generic-dmaengine-pcm: use for_each_pcm_streams() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87zhdhaa8x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>