linux-2.6-microblaze.git
4 years agoASoC: bindings: fsl-asoc-card: add compatible string for TLV320AIC32x4 codec
Matthias Schiffer [Fri, 21 Aug 2020 07:11:52 +0000 (09:11 +0200)]
ASoC: bindings: fsl-asoc-card: add compatible string for TLV320AIC32x4 codec

The TLV320AIC32x4 is commonly used on TQ-Systems starterkit mainboards
for i.MX-based SoMs (i.MX6Q/DL, i.MX6UL, i.MX7) and LS1021A.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200821071153.7317-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: add build support for SoundWire
Pierre-Louis Bossart [Wed, 19 Aug 2020 12:44:29 +0000 (20:44 +0800)]
ASoC: SOF: Intel: add build support for SoundWire

Select SoundWire capabilities on newer Intel platforms, starting with
CannonLake/CoffeeLake/CometLake.

As done for HDaudio, the SoundWire link is an opt-in capability. We
explicitly test for ACPI to avoid warnings on unmet dependencies on
the SoundWire side.

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/20200819124429.3785-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Add mediatek codec mt6359 driver" from Jiaxin Yu <jiaxin.yu@mediatek...
Mark Brown [Thu, 20 Aug 2020 19:30:34 +0000 (20:30 +0100)]
Merge series "Add mediatek codec mt6359 driver" from Jiaxin Yu <jiaxin.yu@mediatek.com>:

Add mediatek codec (MT6359) driver

MT6359 support playback and capture feature.

On downlink path, it includes three DACs for handset, headset,
and lineout path. On unlink path, it includeds three ADCs for
main mic, second mic, 3rd mic, and headset mic.

By scenario, select *_MUX widget to create damp path.
And by select mic_type_mux to choose DMIC/AMIC/....

For example, select these MUX widget to create headset path
(1) DAC In Mux --> "Normal Path"
(2) HP Mux --> "Audio Playback"

v6 changes:
1. Remove the compatible string in mt6359codec because MFD should be registering the platform device.

v5 changes:
1. Don't need to unregister the component whic is already relegated to devm.
2. patchwork link:
https://patchwork.kernel.org/cover/11716387/
https://patchwork.kernel.org/patch/11717757/
https://patchwork.kernel.org/patch/11716491/

v4 changes:
1. Add a remove() function to undo regulator_enable().
2. Removed unnecessary logs.
3. patchwork link:
https://patchwork.kernel.org/cover/11715553/
https://patchwork.kernel.org/patch/11716015/
https://patchwork.kernel.org/patch/11715557/

v3 changes:
1. patchwork link:
https://patchwork.kernel.org/cover/11714291/
https://patchwork.kernel.org/patch/11714295/
https://patchwork.kernel.org/patch/11714339/

v2 changes:
1. patchwork link:
https://patchwork.kernel.org/cover/11706935/
https://patchwork.kernel.org/patch/11708865/
https://patchwork.kernel.org/patch/11706937/

v1 changes:
1.lkml link:
https://lkml.org/lkml/2020/3/5/1257

Jiaxin Yu (2):
  ASoC: mediatek: mt6359: add codec driver
  dt-bindings: mediatek: mt6359: add codec document

 .../devicetree/bindings/sound/mt6359.yaml     |   61 +
 sound/soc/codecs/Kconfig                      |    8 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/mt6359.c                     | 2753 +++++++++++++++++
 sound/soc/codecs/mt6359.h                     | 2640 ++++++++++++++++
 5 files changed, 5464 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt6359.yaml
 create mode 100644 sound/soc/codecs/mt6359.c
 create mode 100644 sound/soc/codecs/mt6359.h

--
2.18.0

4 years agoASoC: qcom: add missing out of memory check on drvdata->clks allocation
Colin Ian King [Wed, 19 Aug 2020 16:01:03 +0000 (17:01 +0100)]
ASoC: qcom: add missing out of memory check on drvdata->clks allocation

Currently drvdata->clks is not being checked for an allocation failure,
leading to potential null pointer dereferencing. Fix this by adding a
check and returning -ENOMEM if an error occurred.

Fixes: 1220f6a76e77 ("ASoC: qcom: Add common array to initialize soc based core clocks")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Rohit kumar <rohitkr@codeaurora.org>
Addresses-Coverity: ("Dereference null return value")
Link: https://lore.kernel.org/r/20200819160103.164893-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: import SOUNDWIRE_INIT namespace
Pierre-Louis Bossart [Wed, 19 Aug 2020 12:44:04 +0000 (20:44 +0800)]
ASoC: SOF: Intel: hda: import SOUNDWIRE_INIT namespace

Make sure the SoundWire driver can be loaded

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/20200819124404.3734-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: mediatek: mt6359: add codec document
Jiaxin Yu [Thu, 20 Aug 2020 08:51:33 +0000 (16:51 +0800)]
dt-bindings: mediatek: mt6359: add codec document

This patch adds MediaTek MT6359 codec document.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1597913493-10747-3-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: mt6359: add codec driver
Jiaxin Yu [Thu, 20 Aug 2020 08:51:32 +0000 (16:51 +0800)]
ASoC: mediatek: mt6359: add codec driver

Add the mt6359 codec driver.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/1597913493-10747-2-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge tag 'samsung-platdrv-boards' into asoc-5.10
Mark Brown [Wed, 19 Aug 2020 19:17:55 +0000 (20:17 +0100)]
Merge tag 'samsung-platdrv-boards' into asoc-5.10

ASoC: Convert Samsung drivers to platform drivers

4 years agoASoC: sun8i-codec: Hook up component probe function
Samuel Holland [Wed, 19 Aug 2020 03:40:38 +0000 (22:40 -0500)]
ASoC: sun8i-codec: Hook up component probe function

Due to a mistake made while reordering patches, commit 90cac932976e
("ASoC: sun8i-codec: Fix DAPM to match the hardware topology") added
the sun8i_codec_component_probe function without referencing it from
the component definition. Add the reference so the probe function gets
called as expected.

Fixes: 90cac932976e ("ASoC: sun8i-codec: Fix DAPM to match the hardware topology")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200819034038.46418-1-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS
Arnd Bergmann [Thu, 6 Aug 2020 18:20:44 +0000 (20:20 +0200)]
ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS

The constant requires indirectly including a machine header file,
but it's not actually used any more since commit 87b132bc0315 ("ASoC:
samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API"), so
remove it completely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-27-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: rx1950: turn into platform driver
Arnd Bergmann [Thu, 6 Aug 2020 18:20:43 +0000 (20:20 +0200)]
ASoC: samsung: rx1950: turn into platform driver

Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-26-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: neo1973: turn into platform driver
Arnd Bergmann [Thu, 6 Aug 2020 18:20:42 +0000 (20:20 +0200)]
ASoC: samsung: neo1973: turn into platform driver

Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-25-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: samsung: h1940: turn into platform driver
Arnd Bergmann [Thu, 6 Aug 2020 18:20:41 +0000 (20:20 +0200)]
ASoC: samsung: h1940: turn into platform driver

Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-24-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Convert NXP spdif to json-schema
Anson Huang [Tue, 18 Aug 2020 01:06:11 +0000 (09:06 +0800)]
ASoC: Convert NXP spdif to json-schema

Convert the NXP SPDIF binding to DT schema format using json-schema.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1597712771-32433-1-git-send-email-Anson.Huang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: rt*-sdw: use SDW_SLAVE_ENTRY_EXT
Pierre-Louis Bossart [Tue, 18 Aug 2020 14:14:35 +0000 (22:14 +0800)]
ASoC: codecs: rt*-sdw: use SDW_SLAVE_ENTRY_EXT

Add version and class information explicitly to prepare for support
for new devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200818141435.29205-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rockchip-spdif: add description for rk3308
Johan Jonker [Tue, 18 Aug 2020 14:37:26 +0000 (16:37 +0200)]
ASoC: rockchip-spdif: add description for rk3308

A test with the command below shows that the compatible string

"rockchip,rk3308-spdif", "rockchip,rk3328-spdif"

is already in use, but is not added to a document.
The current fallback string "rockchip,rk3328-spdif" points to a data
set enum RK_SPDIF_RK3366 in rockchip_spdif.c that is not used both
in the mainline as in the manufacturer kernel.
(Of the enum only RK_SPDIF_RK3288 is used.)
So if the properties don't change we might as well use the first SoC
in line as fallback string and add the description for rk3308 as:

"rockchip,rk3308-spdif", "rockchip,rk3066-spdif"

make ARCH=arm64 dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/sound/rockchip-spdif.yaml

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20200818143727.5882-1-jbx6244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm_adsp: Update naming in error handling
Charles Keepax [Tue, 18 Aug 2020 16:01:26 +0000 (17:01 +0100)]
ASoC: wm_adsp: Update naming in error handling

It seems the datasheet has never used the word slave for this error
status bit and has always used the term address error. So update the
driver to match the datasheets and also in the process align a bit
better with avoiding the use of such words where possible.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200818160126.4852-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: qdsp6: add gapless compressed audio support" from Srinivas Kandag...
Mark Brown [Tue, 18 Aug 2020 13:53:03 +0000 (14:53 +0100)]
Merge series "ASoC: qdsp6: add gapless compressed audio support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds gapless compressed audio support on q6asm.
Gapless on q6asm is implemented using 2 streams in a single q6asm session.

First few patches such as stream id per each command, gapless flags
and silence meta data are for preparedness for adding gapless support.
Last patch implements copy callback to allow finer control over buffer offsets,
specially in partial drain cases.

This patchset is tested on RB3 aka DB845c platform.

This patchset as it is will support gapless however QDSP can also
support switching decoders on a single stream. Patches to support such feature
are send in different patchset which involves adding generic interfaces.

Thanks,
srini

Changes since v2:(mostly suggested by Pierre)
- removed unnessary kernel style comments,
- moved TIMESTAMP flag to respective patch.
- move preparatory code from gapless support patch to new one.
- fix subject prefix of one patch.
- add comments to clarify valid stream_ids

Srinivas Kandagatla (10):
  ASoC: q6asm: rename misleading session id variable
  ASoC: q6asm: make commands specific to streams
  ASoC: q6asm: use flags directly from q6asm-dai
  ASoC: q6asm: add length to write command token
  ASoC: q6asm: add support to remove intial and trailing silence
  ASoC: q6asm: add support to gapless flag in q6asm open
  ASoC: q6asm-dai: add next track metadata support
  ASoC: q6asm-dai: prepare set params to accept profile change
  ASoC: q6asm-dai: add gapless support
  ASoC: q6asm-dai: add support to copy callback

 sound/soc/qcom/qdsp6/q6asm-dai.c | 414 +++++++++++++++++++++++--------
 sound/soc/qcom/qdsp6/q6asm.c     | 169 +++++++++----
 sound/soc/qcom/qdsp6/q6asm.h     |  49 ++--
 3 files changed, 469 insertions(+), 163 deletions(-)

--
2.21.0

4 years agoMerge series "ASoC: Intel: fix cppcheck warnings" from Pierre-Louis Bossart <pierre...
Mark Brown [Tue, 18 Aug 2020 13:53:02 +0000 (14:53 +0100)]
Merge series "ASoC: Intel: fix cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset tries to reduce the number of warnings on those drivers,
so that cppcheck can become a viable tool to detect issues (currently
hundreds of reports).

Most of the problems are related to unnecessary/redundant variable
assignments, prototypes and one nice logical mistake resulting in an
always-true condition.

Pierre-Louis Bossart (21):
  ASoC: Intel: Atom: sst-atom-controls: remove redundant assignments
  ASoC: Intel: Atom: compress: remove redundant assignment
  ASoC: Intel: Atom: platform-pcm: remove redundant assignment
  ASoC: Intel: Atom: sst: remove useless NULL assignment
  ASoC: Intel: Atom: remove redundant initialization
  ASoC: Intel: Atom: sst_pvt: remove redundant initialization
  ASoC: Intel: Atom: platform-pcm: fix redundant return
  ASoC: Intel: Atom: remove useless assignment
  ASoC: Intel: Atom: sst_loader: remove always-true condition
  ASoC: Intel: Atom: sst_pvt: simplify return handling
  ASoC: Intel: Atom: (cosmetic) align parameters
  ASoC: Intel: Baytrail: (cosmetic) align function parameters
  ASoC: Intel: common: (cosmetic) align function parameters
  ASoC: Intel: haswell: (cosmetic) align function parameters
  ASoC: Intel: haswell-ipc: remove redundant assignments
  ASoC: Intel: Skylake: skl-nhlt: remove redundant initialization
  ASoC: Intel: Skylake: cldma: remove redundant initialization
  ASoC: Intel: Skylake: sst-utils: remove redundant assignment
  ASoC: Intel: Skylake: skl-topology: remove redundant assignments
  ASoC: Intel: Skylake: skl-topology: remove redundant assignment
  ASoC: Intel: Skylake: (cosmetic) align function parameters

 sound/soc/intel/atom/sst-atom-controls.c      |  4 +--
 .../intel/atom/sst-mfld-platform-compress.c   |  3 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  4 +--
 sound/soc/intel/atom/sst-mfld-platform.h      |  4 +--
 sound/soc/intel/atom/sst/sst.c                |  5 ++-
 sound/soc/intel/atom/sst/sst.h                | 34 +++++++++----------
 sound/soc/intel/atom/sst/sst_loader.c         |  3 +-
 sound/soc/intel/atom/sst/sst_pvt.c            |  4 +--
 sound/soc/intel/baytrail/sst-baytrail-ipc.h   |  3 +-
 sound/soc/intel/common/sst-dsp-priv.h         |  2 +-
 sound/soc/intel/common/sst-dsp.h              | 15 ++++----
 sound/soc/intel/haswell/sst-haswell-ipc.c     |  4 +--
 sound/soc/intel/haswell/sst-haswell-ipc.h     |  2 +-
 sound/soc/intel/skylake/cnl-sst-dsp.h         |  4 +--
 sound/soc/intel/skylake/skl-nhlt.c            |  2 +-
 sound/soc/intel/skylake/skl-sst-cldma.c       |  2 +-
 sound/soc/intel/skylake/skl-sst-ipc.h         | 16 ++++-----
 sound/soc/intel/skylake/skl-sst-utils.c       |  2 +-
 sound/soc/intel/skylake/skl-topology.c        |  8 ++---
 sound/soc/intel/skylake/skl-topology.h        |  8 ++---
 sound/soc/intel/skylake/skl.h                 |  2 +-
 21 files changed, 63 insertions(+), 68 deletions(-)

--
2.25.1

4 years agoMerge series "ASoC: da7219: Reorganise device/codec level probe/remove" from Adam...
Mark Brown [Tue, 18 Aug 2020 13:53:01 +0000 (14:53 +0100)]
Merge series "ASoC: da7219: Reorganise device/codec level probe/remove" from Adam Thomson <Adam.Thomson.Opensource@diasemi.com>:

This patch set reorganises and fixes device and codec level probe/remove
handling within the driver, to allow clean probe and remove at the codec level.

This set relates to an issue raised by Yong Zhi where a codec level re-probe
would fail due to clks still being registered from the previous instantiation.
In addition some improvements around regulator handling and soft reset have
also been included.

Adam Thomson (3):
  ASoC: da7219: Move required devm_* allocations to device level code
  ASoC: da7219: Move soft reset handling to codec level probe
  ASoC: da7219: Fix clock handling around codec level probe

 sound/soc/codecs/da7219-aad.c |  85 +++++---
 sound/soc/codecs/da7219-aad.h |   3 +
 sound/soc/codecs/da7219.c     | 493 +++++++++++++++++++++++-------------------
 sound/soc/codecs/da7219.h     |   1 +
 4 files changed, 328 insertions(+), 254 deletions(-)

--
1.9.1

4 years agoMerge series "refine and clean code for synchronous mode" from Shengjiu Wang <shengji...
Mark Brown [Tue, 18 Aug 2020 13:52:59 +0000 (14:52 +0100)]
Merge series "refine and clean code for synchronous mode" from Shengjiu Wang <shengjiu.wang@nxp.com>:

refine and clean code for synchronous mode

Shengjiu Wang (3):
  ASoC: fsl_sai: Refine enable/disable TE/RE sequence in trigger()
  ASoC: fsl_sai: Drop TMR/RMR settings for synchronous mode
  ASoC: fsl_sai: Replace synchronous check with fsl_sai_dir_is_synced

changes in v3:
- Add reviewed-by Nicolin
- refine the commit log.
- Add one more patch #3

changes in v2:
- Split the commit
- refine the sequence in trigger stop

 sound/soc/fsl/fsl_sai.c | 173 +++++++++++++++++++++++-----------------
 1 file changed, 102 insertions(+), 71 deletions(-)

--
2.27.0

4 years agoMerge series "ASoC: qcom: Add support for SC7180 lpass variant" from Rohit kumar...
Mark Brown [Tue, 18 Aug 2020 13:52:57 +0000 (14:52 +0100)]
Merge series "ASoC: qcom: Add support for SC7180 lpass variant" from Rohit kumar <rohitkr@codeaurora.org>:

This patch chain add audio support for SC7180 soc by doing the required
modification in existing common lpass-cpu/lpass-platform driver.
This also fixes some concurrency issue.

This patch series is already tested by Srinivas on Dragon Board 410c.
Changes since v5:
        - Fixed remove api in lpass-sc7180.c
        - Addressed comments by Rob in yaml Documentation.

Ajit Pandey (4):
  ASoC: qcom: Add common array to initialize soc based core clocks
  ASoC: qcom: lpass-platform: Replace card->dev with component->dev
  include: dt-bindings: sound: Add sc7180-lpass bindings header
  ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio

Rohit kumar (8):
  ASoC: qcom: lpass-cpu: Move ahbix clk to platform specific function
  ASoC: qcom: lpass-platform: fix memory leak
  ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers
  ASoC: qcom: lpass-cpu: fix concurrency issue
  dt-bindings: sound: lpass-cpu: Add sc7180 lpass cpu node
  ASoC: qcom: lpass-cpu: Use platform_get_resource
  ASoC: qcom: lpass-platform: Use platform_get_irq
  dt-bindings: sound: lpass-cpu: Move to yaml format

 .../devicetree/bindings/sound/qcom,lpass-cpu.txt   |  79 --------
 .../devicetree/bindings/sound/qcom,lpass-cpu.yaml  | 189 ++++++++++++++++++
 include/dt-bindings/sound/sc7180-lpass.h           |  10 +
 sound/soc/qcom/Kconfig                             |   5 +
 sound/soc/qcom/Makefile                            |   2 +
 sound/soc/qcom/lpass-apq8016.c                     |  86 ++++++--
 sound/soc/qcom/lpass-cpu.c                         | 204 ++++++++++---------
 sound/soc/qcom/lpass-ipq806x.c                     |  67 +++++++
 sound/soc/qcom/lpass-lpaif-reg.h                   | 157 ++++++++-------
 sound/soc/qcom/lpass-platform.c                    | 155 +++++++++++----
 sound/soc/qcom/lpass-sc7180.c                      | 216 +++++++++++++++++++++
 sound/soc/qcom/lpass.h                             |  63 +++++-
 12 files changed, 934 insertions(+), 299 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-cpu.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
 create mode 100644 include/dt-bindings/sound/sc7180-lpass.h
 create mode 100644 sound/soc/qcom/lpass-sc7180.c

--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

4 years agoMerge series "Codec workaround" from Michael Sit Wei Hong <michael.wei.hong.sit@intel...
Mark Brown [Tue, 18 Aug 2020 13:52:56 +0000 (14:52 +0100)]
Merge series "Codec workaround" from Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>:

This patch series enables some features on the tlv3204 codec and also fixes some issues faced while testing

v2: Fixed the build error from snd_soc_component_read32
v1: initial ASoC: codec: tlv3204: Codec workaround series

Michael Sit Wei Hong (3):
  ASoC: codec: tlv3204: Enable 24 bit audio support
  ASoC: codec: tlv3204: Increased maximum supported channels
  ASoC: codec: tlv3204: Moving GPIO reset and add ADC reset

 sound/soc/codecs/tlv320aic32x4.c | 60 +++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 16 deletions(-)

--
2.17.1

4 years agoMerge series "ASoC: sun50i-codec-analog: Cleanup and power management" from Samuel...
Mark Brown [Tue, 18 Aug 2020 13:52:55 +0000 (14:52 +0100)]
Merge series "ASoC: sun50i-codec-analog: Cleanup and power management" from Samuel Holland <samuel@sholland.org>:

This series performs some minor cleanup on the driver for the analog
codec in the Allwinner A64, and hooks up the existing mute switches to
DAPM widgets, in order to provide improved power management.

Changes since v1:
  - Collected Acked-by/Reviewed-by tags
  - Used SOC_MIXER_NAMED_CTL_ARRAY to avoid naming a widget "Earpiece"

Samuel Holland (8):
  ASoC: sun50i-codec-analog: Fix duplicate use of ADC enable bits
  ASoC: sun50i-codec-analog: Gate the amplifier clock during suspend
  ASoC: sun50i-codec-analog: Group and sort mixer routes
  ASoC: sun50i-codec-analog: Make headphone routes stereo
  ASoC: sun50i-codec-analog: Enable DAPM for headphone switch
  ASoC: sun50i-codec-analog: Make line out routes stereo
  ASoC: sun50i-codec-analog: Enable DAPM for line out switch
  ASoC: sun50i-codec-analog: Enable DAPM for earpiece switch

 sound/soc/sunxi/sun50i-codec-analog.c | 176 ++++++++++++++++----------
 1 file changed, 111 insertions(+), 65 deletions(-)

--
2.26.2

4 years agoMerge series "This patch series is to enable multiple features on the Keembay Platfor...
Mark Brown [Tue, 18 Aug 2020 13:52:53 +0000 (14:52 +0100)]
Merge series "This patch series is to enable multiple features on the Keembay Platform" from Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>:

v2: Change channel-max device tree property to use new compatible string
v1: Initial patch series

Michael Sit Wei Hong (2):
  ASoC: Intel: KMB: Enable TDM audio capture
  dt-bindings: sound: intel,keembay-i2s: Add new compatible string

 .../bindings/sound/intel,keembay-i2s.yaml     |   1 +
 sound/soc/intel/keembay/kmb_platform.c        | 145 +++++++++++++-----
 2 files changed, 109 insertions(+), 37 deletions(-)

--
2.17.1

4 years agoMerge series "Allwinner A64 digital audio codec fixes" from Samuel Holland <samuel...
Mark Brown [Tue, 18 Aug 2020 13:52:52 +0000 (14:52 +0100)]
Merge series "Allwinner A64 digital audio codec fixes" from Samuel Holland <samuel@sholland.org>:

This series fixes a couple of issues with the digital audio codec in the
Allwinner A64 SoC:
  1) Left/right channels were swapped when playing/recording audio
  2) DAPM topology was wrong, breaking some kcontrols

This is the minimum set of changes necessary to fix these issues in a
backward-compatible way. For that reason, some DAPM widgets still have
incorrect or confusing names; those and other issues will be fixed in
later patch sets.

Samuel Holland (7):
  ASoC: dt-bindings: Add a new compatible for the A64 codec
  ASoC: sun8i-codec: Fix DAPM to match the hardware topology
  ASoC: sun8i-codec: Add missing mixer routes
  ASoC: sun8i-codec: Add a quirk for LRCK inversion
  ARM: dts: sun8i: a33: Update codec widget names
  arm64: dts: allwinner: a64: Update codec widget names
  arm64: dts: allwinner: a64: Update the audio codec compatible

 .../sound/allwinner,sun8i-a33-codec.yaml      |   6 +-
 arch/arm/boot/dts/sun8i-a33-olinuxino.dts     |   4 +-
 arch/arm/boot/dts/sun8i-a33.dtsi              |   4 +-
 .../dts/allwinner/sun50i-a64-bananapi-m64.dts |   8 +-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts |   8 +-
 .../boot/dts/allwinner/sun50i-a64-pine64.dts  |   8 +-
 .../dts/allwinner/sun50i-a64-pinebook.dts     |   8 +-
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   |   8 +-
 .../boot/dts/allwinner/sun50i-a64-pinetab.dts |   8 +-
 .../allwinner/sun50i-a64-sopine-baseboard.dts |   8 +-
 .../boot/dts/allwinner/sun50i-a64-teres-i.dts |   8 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |  11 +-
 sound/soc/sunxi/sun8i-codec.c                 | 137 ++++++++++++++----
 13 files changed, 155 insertions(+), 71 deletions(-)

--
2.26.2

4 years agoMerge series "ASoC: rt5682: Use clk APIs better" from Stephen Boyd <swboyd@chromium...
Mark Brown [Tue, 18 Aug 2020 13:52:50 +0000 (14:52 +0100)]
Merge series "ASoC: rt5682: Use clk APIs better" from Stephen Boyd <swboyd@chromium.org>:

This patch series drops a printk message down to dev_dbg() because it
was noisy and then migrates this driver to use clk_hw based APIs instead
of clk based APIs because this device is a clk provider, not a clk
consumer. I've only lightly tested the last two patches but I don't have
all combinations of clks for this device.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Shuming Fan <shumingf@realtek.com>
Stephen Boyd (3):
  ASoC: rt5682: Use dev_dbg() in rt5682_clk_check()
  ASoC: rt5682: Drop usage of __clk_get_name()
  ASoC: rt5682: Use clk_hw based APIs for registration

 sound/soc/codecs/rt5682.c | 73 ++++++++++++---------------------------
 sound/soc/codecs/rt5682.h |  2 --
 2 files changed, 23 insertions(+), 52 deletions(-)

Based on the last patch to this driver in linux-next.

base-commit: 6301adf942a31bed65e026a554e5bd55d9e731e1
--
Sent by a computer, using git, on the internet

4 years agoMerge series "ASoC: SOF/Intel: fix cppcheck warnings" from Pierre-Louis Bossart ...
Mark Brown [Tue, 18 Aug 2020 13:52:49 +0000 (14:52 +0100)]
Merge series "ASoC: SOF/Intel: fix cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

A small set of fixes to reduce the number of warnings.

Pierre-Louis Bossart (5):
  ASOC: SOF: Intel: hda-codec: move unused label to correct position
  ASoC: SOF: Intel: hda-codec: move variable used conditionally
  ASoC: Intel: rename shadowed variable for all broadwell boards
  ASoC: Intel: bytcht_cx2072x: simplify return handling
  ASoC: Intel: sof_sdw: clarify operator precedence

 sound/soc/intel/boards/bdw-rt5650.c     | 10 +++++-----
 sound/soc/intel/boards/bdw-rt5677.c     |  8 ++++----
 sound/soc/intel/boards/broadwell.c      |  8 ++++----
 sound/soc/intel/boards/bytcht_cx2072x.c |  2 +-
 sound/soc/intel/boards/sof_sdw.c        |  2 +-
 sound/soc/sof/intel/hda-codec.c         |  7 ++++++-
 6 files changed, 21 insertions(+), 16 deletions(-)

--
2.25.1

4 years agodt-bindings: tas2562: Add device specification links
Dan Murphy [Mon, 17 Aug 2020 17:21:51 +0000 (12:21 -0500)]
dt-bindings: tas2562: Add device specification links

Add device specification links for the TAS2562 and TAS2563.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200817172151.26564-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: tas2562: Remove tas2562 text file
Dan Murphy [Mon, 17 Aug 2020 17:21:50 +0000 (12:21 -0500)]
dt-bindings: tas2562: Remove tas2562 text file

Remove the tas2562 text file as the tas2562.yaml is now available.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200817172151.26564-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rate
Shengjiu Wang [Mon, 10 Aug 2020 08:11:43 +0000 (16:11 +0800)]
ASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rate

On some platform(.e.g. i.MX8QM MEK), the "extal" clock is different
with the mclk of codec, then the clock rate is also different.
So it is better to get clock rate of "extal" rate by clk_get_rate,
don't reuse the clock rate of mclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1597047103-6863-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: add a dedicated menuconfig
Srinivas Kandagatla [Tue, 11 Aug 2020 10:58:18 +0000 (11:58 +0100)]
ASoC: qcom: add a dedicated menuconfig

Currently list of Qualcomm drivers is growing, so put them in to a
proper menu so that it does not mix up with other ASOC configs in menuconfig.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811105818.7890-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8962: Export DAC/ADC monomix switches
Sebastian Krzyszkowiak [Sun, 16 Aug 2020 01:23:34 +0000 (03:23 +0200)]
ASoC: wm8962: Export DAC/ADC monomix switches

This allows solutions like ALSA UCM to utilize hardware mono downmix
for cases where mono output to a single speaker is desired only in
specific situations (like on a mobile phone).

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/3662154.EqNIRYjrc8@pliszka
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agosound: remove duplicate "the the" phrase in Kconfig text
Colin Ian King [Mon, 17 Aug 2020 22:47:06 +0000 (23:47 +0100)]
sound: remove duplicate "the the" phrase in Kconfig text

There are a couple of occurrences of "the the" in the Kconfig
text. Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/20200817224706.6139-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: delete repeated words in comments
Randy Dunlap [Sat, 8 Aug 2020 01:21:56 +0000 (18:21 -0700)]
ASoC: SOF: delete repeated words in comments

Drop the repeated words {that, the} in comments.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200808012156.10827-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: wm0010: use DECLARE_COMPLETION_ONSTACK() macro
Pierre-Louis Bossart [Thu, 13 Aug 2020 17:54:42 +0000 (12:54 -0500)]
ASoC: codecs: wm0010: use DECLARE_COMPLETION_ONSTACK() macro

Follow recommendation in Documentation/scheduler/completion.rst and
use macro to declare local 'struct completion'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200813175442.59067-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: Use snd_soc_of_parse_aux_devs()
Stephan Gerhold [Sat, 1 Aug 2020 10:02:57 +0000 (12:02 +0200)]
ASoC: meson: Use snd_soc_of_parse_aux_devs()

Use the new common snd_soc_of_parse_aux_devs() helper function
to parse auxiliary devices from the device tree. The new helper
is just a copy of meson_card_add_aux_devices() so there is no
functional change.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200801100257.22658-3-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: simple-card: Use snd_soc_of_parse_aux_devs()
Stephan Gerhold [Sat, 1 Aug 2020 10:02:56 +0000 (12:02 +0200)]
ASoC: simple-card: Use snd_soc_of_parse_aux_devs()

Use the new common snd_soc_of_parse_aux_devs() helper function
to parse auxiliary devices from the device tree. The code is slightly
different but the binding that is parsed is exactly the same.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200801100257.22658-2-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: core: Add common helper to parse aux devs from device tree
Stephan Gerhold [Sat, 1 Aug 2020 10:02:55 +0000 (12:02 +0200)]
ASoC: core: Add common helper to parse aux devs from device tree

simple-card.c and meson-card-utils.c use pretty much the same
helper function to parse auxiliary devices from the device tree.

Make it easier for other drivers to parse these from the device tree
as well by adding a shared helper function to soc-core.c.

snd_soc_of_parse_aux_devs() is pretty much a copy of
meson_card_add_aux_devices() from meson-card-utils.c
with two minor changes:

  - Make property name configurable as parameter
  - Change dev_err() message slightly for consistency with other
    error messages in soc-core.c

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200801100257.22658-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ak4458: Add regulator support
Shengjiu Wang [Fri, 14 Aug 2020 09:32:41 +0000 (17:32 +0800)]
ASoC: ak4458: Add regulator support

"AVDD" is for analog power supply,  "DVDD" is for digital power
supply, they can improve the power management.

As the regulator is enabled in pm runtime resume, which is
behind the component driver probe, so accessing registers in
component driver probe will fail. Fix this issue by enabling
regcache_cache_only after pm_runtime_enable.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1597397561-2426-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: ak4458: Add power supply property
Shengjiu Wang [Fri, 14 Aug 2020 09:32:40 +0000 (17:32 +0800)]
ASoC: dt-bindings: ak4458: Add power supply property

AVDD-supply is for Analog power supply
DVDD-supply is for Digital power supply

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1597397561-2426-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: hdac_hdmi: support 'ELD' mixer
Brent Lu [Tue, 18 Aug 2020 00:44:13 +0000 (08:44 +0800)]
ASoC: hdac_hdmi: support 'ELD' mixer

Add an binary mixer 'ELD' to each HDMI PCM device so user space
could read the ELD data of external HDMI display.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20200818004413.12852-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agosound/soc/intel: Fix spelling mistake "cant" --> "can't"
Youling Tang [Thu, 13 Aug 2020 06:12:37 +0000 (14:12 +0800)]
sound/soc/intel: Fix spelling mistake "cant" --> "can't"

There is some spelling mistakes in a dev_err message. Fix it.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Link: https://lore.kernel.org/r/1597299157-32221-1-git-send-email-tangyouling@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: delete repeated words in comments
Randy Dunlap [Sat, 8 Aug 2020 01:21:43 +0000 (18:21 -0700)]
ASoC: codecs: delete repeated words in comments

Drop the repeated words {start, it, the} in comments.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200808012143.10777-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: various vendors: delete repeated words in comments
Randy Dunlap [Sat, 8 Aug 2020 01:22:09 +0000 (18:22 -0700)]
ASoC: various vendors: delete repeated words in comments

Drop the repeated words {related, we, is, the} in comments.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200808012209.10880-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: (cosmetic) align function parameters
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:47 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: (cosmetic) align function parameters

Fix cppcheck warnings and align headers with code.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: skl-topology: remove redundant assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:46 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: skl-topology: remove redundant assignment

Fix cppcheck warning:

sound/soc/intel/skylake/skl-topology.c:2879:29: style: Variable
'block_size' is assigned a value that is never used. [unreadVariable]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: skl-topology: remove redundant assignments
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:45 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: skl-topology: remove redundant assignments

Cppcheck complains about possible NULL pointer dereferences but the
assignments are actually not needed before walking through lists.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: sst-utils: remove redundant assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:44 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: sst-utils: remove redundant assignment

Fix cppcheck warning:

sound/soc/intel/skylake/skl-sst-utils.c:240:10: style: Variable 'ret'
is assigned a value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: cldma: remove redundant initialization
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:43 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: cldma: remove redundant initialization

Fix cppcheck warning:

sound/soc/intel/skylake/skl-sst-cldma.c:248:10: style: Variable 'ret'
is assigned a value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: skl-nhlt: remove redundant initialization
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:42 +0000 (15:01 -0500)]
ASoC: Intel: Skylake: skl-nhlt: remove redundant initialization

Fix cppcheck warning:

sound/soc/intel/skylake/skl-nhlt.c:203:21: style: Variable 'rate' is
assigned a value that is never used. [unreadVariable]
 unsigned long rate = 0;
                    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: haswell-ipc: remove redundant assignments
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:41 +0000 (15:01 -0500)]
ASoC: Intel: haswell-ipc: remove redundant assignments

Fix cppcheck warnings:

sound/soc/intel/haswell/sst-haswell-ipc.c:430:8: style: Variable 'i'
is assigned a value that is never used. [unreadVariable]

sound/soc/intel/haswell/sst-haswell-ipc.c:1792:8: style: Variable 'id'
is assigned a value that is never used. [unreadVariable]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: haswell: (cosmetic) align function parameters
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:40 +0000 (15:01 -0500)]
ASoC: Intel: haswell: (cosmetic) align function parameters

Fix cppcheck warning:

sound/soc/intel/haswell/sst-haswell-ipc.c:963:8: style:inconclusive:
Function 'sst_hsw_stream_new' argument 3 names different: declaration
'get_write_position' definition
'notify_position'. [funcArgNamesDifferent]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: common: (cosmetic) align function parameters
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:39 +0000 (15:01 -0500)]
ASoC: Intel: common: (cosmetic) align function parameters

Fix cppcheck style warnings, align headers and code and remove useless
prototypes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Baytrail: (cosmetic) align function parameters
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:38 +0000 (15:01 -0500)]
ASoC: Intel: Baytrail: (cosmetic) align function parameters

Fix cppcheck warning:

sound/soc/intel/baytrail/sst-baytrail-ipc.c:339:8: style:inconclusive:
Function 'sst_byt_stream_new' argument 3 names different: declaration
'get_write_position' definition
'notify_position'. [funcArgNamesDifferent]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: (cosmetic) align parameters
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:37 +0000 (15:01 -0500)]
ASoC: Intel: Atom: (cosmetic) align parameters

Fix cppcheck warnings and use same function parameters in headers and
C code.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: sst_pvt: simplify return handling
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:36 +0000 (15:01 -0500)]
ASoC: Intel: Atom: sst_pvt: simplify return handling

Fix cppcheck warning:

sound/soc/intel/atom/sst/sst_pvt.c:201:9: warning: Identical condition
and return expression 'retval', return value is always 0
[identicalConditionAfterEarlyExit]
 return retval;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: sst_loader: remove always-true condition
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:35 +0000 (15:01 -0500)]
ASoC: Intel: Atom: sst_loader: remove always-true condition

Fix cppcheck warning:

sound/soc/intel/atom/sst/sst_loader.c:401:43: style: Redundant
condition: If 'EXPR == 4', the comparison 'EXPR != 3' is always
true. [redundantCondition]

 if (sst_drv_ctx->sst_state !=  SST_RESET ||
                                          ^

In this case, if sst_state == SST_SHUTDOWN then the first test is
already true. 2014 bug, yay.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: remove useless assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:34 +0000 (15:01 -0500)]
ASoC: Intel: Atom: remove useless assignment

Fix cppcheck warning:

sound/soc/intel/atom/sst/sst.c:52:20: style: Variable 'size' is
assigned a value that is never used. [unreadVariable]
 unsigned int size = 0;
                   ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: platform-pcm: fix redundant return
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:33 +0000 (15:01 -0500)]
ASoC: Intel: Atom: platform-pcm: fix redundant return

Fix cppcheck warning

 return ret_val;
        ^
sound/soc/intel/atom/sst-mfld-platform-pcm.c:384:6: note: If condition 'ret_val' is true, the function will return/exit
 if (ret_val)
     ^
sound/soc/intel/atom/sst-mfld-platform-pcm.c:387:9: note: Returning identical expression 'ret_val'
 return ret_val;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: sst_pvt: remove redundant initialization
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:32 +0000 (15:01 -0500)]
ASoC: Intel: Atom: sst_pvt: remove redundant initialization

Fix cppcheck warning:

sound/soc/intel/atom/sst/sst_pvt.c:201:9: warning: Identical condition
and return expression 'retval', return value is always 0
[identicalConditionAfterEarlyExit]
 return retval;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: remove redundant initialization
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:31 +0000 (15:01 -0500)]
ASoC: Intel: Atom: remove redundant initialization

Fix cppcheck warnings:

sound/soc/intel/atom/sst/sst.c:427:13: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
 int i, ret = 0;
            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: sst: remove useless NULL assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:30 +0000 (15:01 -0500)]
ASoC: Intel: Atom: sst: remove useless NULL assignment

Fix cppcheck warnings:

sound/soc/intel/atom/sst/sst.c:373:2: warning: Assignment of function
parameter has no effect outside the function. Did you forget
dereferencing it? [uselessAssignmentPtrArg]
 ctx = NULL;
 ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: platform-pcm: remove redundant assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:29 +0000 (15:01 -0500)]
ASoC: Intel: Atom: platform-pcm: remove redundant assignment

fix cppcheck warning:

sound/soc/intel/atom/sst-mfld-platform-pcm.c:387:9: warning: Identical
condition and return expression 'ret_val', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret_val;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: compress: remove redundant assignment
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:28 +0000 (15:01 -0500)]
ASoC: Intel: Atom: compress: remove redundant assignment

Fix cppcheck warning:

sound/soc/intel/atom/sst-mfld-platform-compress.c:46:14: style:
Variable 'ret_val' is assigned a value that is never
used. [unreadVariable]
 int ret_val = 0;
             ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Atom: sst-atom-controls: remove redundant assignments
Pierre-Louis Bossart [Thu, 13 Aug 2020 20:01:27 +0000 (15:01 -0500)]
ASoC: Intel: Atom: sst-atom-controls: remove redundant assignments

cppcheck complains of a possible NULL pointer dereference but setting
a pointer before using list_for_each_entry() is not useful.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813200147.61990-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: da7219: Fix clock handling around codec level probe
Adam Thomson [Tue, 11 Aug 2020 16:57:25 +0000 (17:57 +0100)]
ASoC: da7219: Fix clock handling around codec level probe

Previously the driver would use devm_* related functions at
the codec level probe() to allocate clock resources for MCLK
and the DAI clocks exposed by the device. This caused issues
when registering clocks on a re-probe (no device level
remove/prove involved) as the devm_* resources were never
freed up so the clocks were still registered from the previous
codec level probe().

This commit updates the clock handling for MCLK usage and DAI
clock provision to fix this discrepancy and allow the codec level
probe/remove functionality to operate as intended.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/b92c461baeed27a6cd92e59e36a55c2547218683.1597164865.git.Adam.Thomson.Opensource@diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: da7219: Move soft reset handling to codec level probe
Adam Thomson [Tue, 11 Aug 2020 16:57:24 +0000 (17:57 +0100)]
ASoC: da7219: Move soft reset handling to codec level probe

As part of the reorganisation of the device level and codec
level probe functionlity, the soft reset handling should really
reside at the codec level and after the instantiation of supplies.
This commit makes the relevant changes to support this change of
scope including the remove of devm_* functions being called for
regulator instantiation at the codec level.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/f7603a4855647429b754ce76f887ec441622015c.1597164865.git.Adam.Thomson.Opensource@diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: da7219: Move required devm_* allocations to device level code
Adam Thomson [Tue, 11 Aug 2020 16:57:23 +0000 (17:57 +0100)]
ASoC: da7219: Move required devm_* allocations to device level code

In preparation for cleanup of device level and codec level probe
funcitonality, all necessary devm_* allocations and fw retrieval
functions are moved to the I2C probe level code.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/7a9a2ead6e37820a6025c0a62dc45952d5032ab7.1597164865.git.Adam.Thomson.Opensource@diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm-dai: add support to copy callback
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:06 +0000 (10:38 +0100)]
ASoC: q6asm-dai: add support to copy callback

During gapless playback, its possible for previous track to
end at unaligned boundary, starting next track on the same
boundary can lead to unaligned address exception in dsp.

So implement copy callback for finer control on the buffer offsets.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-11-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm-dai: add gapless support
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:05 +0000 (10:38 +0100)]
ASoC: q6asm-dai: add gapless support

Add support to gapless playback by implementing metadata,
next_track, drain and partial drain support.

Gapless on Q6ASM is implemented by opening 2 streams in a single
q6asm stream and toggling them on next track.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm-dai: prepare set params to accept profile change
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:04 +0000 (10:38 +0100)]
ASoC: q6asm-dai: prepare set params to accept profile change

rearrange code so that it will be easy to change the codec
profile at runtime. This means moving exiting set_params
to an internal wrapper which can be called when codec
profile changes.

This is also preparing the code for easy to use in gapless cases.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm-dai: add next track metadata support
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:03 +0000 (10:38 +0100)]
ASoC: q6asm-dai: add next track metadata support

This patch adds support to metadata required to do a gapless playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: add support to gapless flag in q6asm open
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:02 +0000 (10:38 +0100)]
ASoC: q6asm: add support to gapless flag in q6asm open

This patch adds support to gapless flag to q6asm_open_write().

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: add support to remove intial and trailing silence
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:01 +0000 (10:38 +0100)]
ASoC: q6asm: add support to remove intial and trailing silence

This patch adds support to ASM_DATA_CMD_REMOVE_INITIAL_SILENCE
and ASM_DATA_CMD_REMOVE_TRAILING_SILENCE q6asm command to support
compressed metadata for gapless playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: add length to write command token
Srinivas Kandagatla [Mon, 27 Jul 2020 09:38:00 +0000 (10:38 +0100)]
ASoC: q6asm: add length to write command token

Add length to write command packet token so that we can track exactly
how many bytes are consumed by DSP in the command reply.

This is useful in some use-cases where the end of the file/stream
is not aligned with period size.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: use flags directly from q6asm-dai
Srinivas Kandagatla [Mon, 27 Jul 2020 09:37:59 +0000 (10:37 +0100)]
ASoC: q6asm: use flags directly from q6asm-dai

use flags set by q6asm-dais directly!

This will be useful gapless case where write needs a special flag to indicate
that last buffer.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: make commands specific to streams
Srinivas Kandagatla [Mon, 27 Jul 2020 09:37:58 +0000 (10:37 +0100)]
ASoC: q6asm: make commands specific to streams

Each ASM session can have multiple streams attached to it,
current design was to allow only one static stream id 1 per each session.
However for use-case like gapless, we would need 2 streams to open per session.

This patch converts all the q6asm apis to take stream id as argument
to allow multiple streams to open on a single session, This is useful
for gapless playback cases.

Now the dai driver can specify which stream id for each command.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: q6asm: rename misleading session id variable
Srinivas Kandagatla [Mon, 27 Jul 2020 09:37:57 +0000 (10:37 +0100)]
ASoC: q6asm: rename misleading session id variable

Each q6asm session can have multiple streams, mixing usage of these
names in variable are bit misleading to reader, so rename them accordingly.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200727093806.17089-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: intel, keembay-i2s: Add new compatible string
Michael Sit Wei Hong [Tue, 11 Aug 2020 04:18:36 +0000 (12:18 +0800)]
dt-bindings: sound: intel, keembay-i2s: Add new compatible string

Add a new compatible string that configures the interface to the
desired format.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200811041836.999-3-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: KMB: Enable TDM audio capture
Michael Sit Wei Hong [Tue, 11 Aug 2020 04:18:35 +0000 (12:18 +0800)]
ASoC: Intel: KMB: Enable TDM audio capture

Enable I2S TDM audio capture for Intel Keem Bay platform.
The I2S TDM will support 4 channel and 8 channel audio capture only.
4 channel and 8 channel audio capture operates only in slave mode.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200811041836.999-2-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codec: tlv3204: Moving GPIO reset and add ADC reset
Michael Sit Wei Hong [Wed, 12 Aug 2020 09:46:31 +0000 (17:46 +0800)]
ASoC: codec: tlv3204: Moving GPIO reset and add ADC reset

Moving GPIO reset to a later stage and before clock registration to
ensure that the host system and codec clocks are in sync. If the host
register clock values prior to gpio reset, the last configured codec clock
is registered to the host. The codec then gets gpio resetted setting the
codec clocks to their default value, causing a mismatch. Host system will
skip clock setting thinking the codec clocks are already at the requested
rate.

ADC reset is added to ensure the next audio capture does not have
undesired artifacts. It is probably related to the original code
where the probe function resets the ADC prior to 1st record.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200812094631.4698-4-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codec: tlv3204: Increased maximum supported channels
Michael Sit Wei Hong [Wed, 12 Aug 2020 09:46:30 +0000 (17:46 +0800)]
ASoC: codec: tlv3204: Increased maximum supported channels

Increased maximum supported channel to 8 channels for audio capture
running in TDM mode.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200812094631.4698-3-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codec: tlv3204: Enable 24 bit audio support
Michael Sit Wei Hong [Wed, 12 Aug 2020 09:46:29 +0000 (17:46 +0800)]
ASoC: codec: tlv3204: Enable 24 bit audio support

Enable 24 bit in 32 bit container audio support.
Using the params_physical_width to differentiate
24 bit in 32 bit container and 24 bit in 24 bit container modes.
Use the sample rate, bit depth and channel parameters to
calculate the bit clock needed.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200812094631.4698-2-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Enable DAPM for earpiece switch
Samuel Holland [Sun, 26 Jul 2020 02:53:34 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Enable DAPM for earpiece switch

By including the earpiece mute switch in the DAPM graph, both the
earpiece amplifier and the Mixer/DAC inputs can be powered off when
the earpiece is muted.

While the widget is really just a simple switch, it is represented
as a "mixer with named controls" to avoid including the widget name
in the kcontrol name. Otherwise, it is not possible to give the widget
an accurate, descriptive name without changing the kcontrol name
seen by userspace (which should be stable).

The mute switch is between the source selection and the amplifier,
as per the diagram in the SoC manual.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200726025334.59931-9-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Enable DAPM for line out switch
Samuel Holland [Sun, 26 Jul 2020 02:53:33 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Enable DAPM for line out switch

By including the line out mute switch in the DAPM graph, the
Mixer/DAC inputs can be powered off when the line output is muted.

The line outputs have an unusual routing scheme. The left side mute
switch is between the source selection and the amplifier, as usual.
The right side source selection comes *after* its amplifier (and
after the left side amplifier), and its mute switch controls
whichever source is currently selected. This matches the diagram in
the SoC manual.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-8-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Make line out routes stereo
Samuel Holland [Sun, 26 Jul 2020 02:53:32 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Make line out routes stereo

This matches the hardware more accurately, and is necessary for
including the (stereo) line out mute switch in the DAPM graph.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-7-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Enable DAPM for headphone switch
Samuel Holland [Sun, 26 Jul 2020 02:53:31 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Enable DAPM for headphone switch

By including the headphone mute switch to the DAPM graph, both the
headphone amplifier and the Mixer/DAC inputs can be powered off when
the headphones are muted.

The mute switch is between the source selection and the amplifier,
as per the diagram in the SoC manual.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-6-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Make headphone routes stereo
Samuel Holland [Sun, 26 Jul 2020 02:53:30 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Make headphone routes stereo

This matches the hardware more accurately, and is necessary for
including the (stereo) headphone mute switch in the DAPM graph.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-5-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Group and sort mixer routes
Samuel Holland [Sun, 26 Jul 2020 02:53:29 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Group and sort mixer routes

Sort the controls in the same order as the bits in the register. Then
group the routes by sink, and sort them in the same order as the
controls. This makes it much easier to verify that all mixer inputs are
accounted for.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-4-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Gate the amplifier clock during suspend
Samuel Holland [Sun, 26 Jul 2020 02:53:28 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Gate the amplifier clock during suspend

The clock must be running for the zero-crossing mute functionality.
However, it must be gated for VDD-SYS to be turned off during system
suspend. Disable it in the suspend callback, after everything has
already been muted, to avoid pops when muting/unmuting outputs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-3-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun50i-codec-analog: Fix duplicate use of ADC enable bits
Samuel Holland [Sun, 26 Jul 2020 02:53:27 +0000 (21:53 -0500)]
ASoC: sun50i-codec-analog: Fix duplicate use of ADC enable bits

The same enable bits are currently used for both the "Left/Right ADC"
and the "Left/Right ADC Mixer" widgets. This happens to work in practice
because the widgets are always enabled/disabled at the same time, but
each register bit should only be associated with a single widget.

To keep symmetry with the DAC widgets, keep the bits on the ADC widgets,
and remove them from the ADC Mixer widgets.

Fixes: 42371f327df0 ("ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls")
Reported-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-2-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: bytcht_cx2072x: simplify return handling
Pierre-Louis Bossart [Thu, 13 Aug 2020 17:58:38 +0000 (12:58 -0500)]
ASoC: Intel: bytcht_cx2072x: simplify return handling

Fix cppcheck warning:

sound/soc/intel/boards/bytcht_cx2072x.c:102:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813175839.59422-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: rename shadowed variable for all broadwell boards
Pierre-Louis Bossart [Thu, 13 Aug 2020 17:58:37 +0000 (12:58 -0500)]
ASoC: Intel: rename shadowed variable for all broadwell boards

Fix cppcheck warnings:

sound/soc/intel/boards/bdw-rt5650.c:91:23: style: Local variable
'channels' shadows outer variable [shadowVariable]

sound/soc/intel/boards/bdw-rt5677.c:144:23: style: Local variable
'channels' shadows outer variable [shadowVariable]

sound/soc/intel/boards/broadwell.c:91:23: style: Local variable
'channels' shadows outer variable [shadowVariable]

This was fixed earlier in other machine drivers but keeps coming back
with copy/paste.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813175839.59422-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda-codec: move variable used conditionally
Pierre-Louis Bossart [Thu, 13 Aug 2020 17:58:36 +0000 (12:58 -0500)]
ASoC: SOF: Intel: hda-codec: move variable used conditionally

Cppcheck reports the following warning:

sound/soc/sof/intel/hda-codec.c:122:20: style: Unused variable: codec
[unusedVariable]
 struct hda_codec *codec;
                   ^

Move declaration inside a conditionally-compiled block.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813175839.59422-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASOC: SOF: Intel: hda-codec: move unused label to correct position
Pierre-Louis Bossart [Thu, 13 Aug 2020 17:58:35 +0000 (12:58 -0500)]
ASOC: SOF: Intel: hda-codec: move unused label to correct position

Cppcheck reports the following warning:

sound/soc/sof/intel/hda-codec.c:191:1: style: Label 'error' is not
used. [unusedLabel]

This label is indeed only used conditionally, move it where it's
actually used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813175839.59422-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun8i-codec: Add a quirk for LRCK inversion
Samuel Holland [Sun, 26 Jul 2020 01:25:54 +0000 (20:25 -0500)]
ASoC: sun8i-codec: Add a quirk for LRCK inversion

On the A64, as tested using the PinePhone, the current code causes the
left/right channels to be swapped during I2S playback from the CPU on
AIF1, and breaks DSP_A communication with the modem on AIF2. Both of
these are fixed when LRCK is no longer inverted.

Trusting that the comment in the code is correct, the existing behavior
is kept for the A33.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200726012557.38282-5-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun8i-codec: Add missing mixer routes
Samuel Holland [Sun, 26 Jul 2020 01:25:53 +0000 (20:25 -0500)]
ASoC: sun8i-codec: Add missing mixer routes

The sun8i-codec driver provides ALSA controls for enabling/disabling
each of the inputs to the AIF1 Slot 0 and DAC mixers. For two of these
inputs (ADC->DAC and AIF1 DA0->AIF1 AD0), the audio source is
implemented, so the mixer inputs can be used.

However, because the DAPM routes are missing, these mixer inputs only
work when both the source and the mixer happen to be part of other
active audio paths. Adding the appropriate routes makes these ALSA
controls function all of the time.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200726012557.38282-4-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sun8i-codec: Fix DAPM to match the hardware topology
Samuel Holland [Sun, 26 Jul 2020 01:25:52 +0000 (20:25 -0500)]
ASoC: sun8i-codec: Fix DAPM to match the hardware topology

The A33/A64 digital codec has 4 physical inputs and 4 physical outputs:
3 AIFs/DAIs and one ADC/DAC pair. Internal routing is accomplished by
a 4-channel mixer connected to each output.

The analog and digital sides of the ADC/DAC are in separate ASoC
components, so card-level DAPM routes (provided in the device tree) are
necessary to connect them together. Currently, these routes are wrong.

For AIF1 Playback, the correct topology is:

         ||<<============ sun8i-codec ===========>>||
         ||                                        ||
 CPU DAI -> AIF1 DA0 -> DAC Mixer -> DAC (digital) -> DAC (analog)
         ||                                        ||

but the driver and device trees currently describe:

         ||                                        ||
 CPU DAI -> AIF1 DA0 -------------------------------> DAC (analog)
         ||     \--> DAC Mixer -> ??? [dead end]   ||

For AIF1 Capture, there is an additional problem, because the Mixer
route is backward. The topology should be:

              ||                                             ||
 ADC (analog) -> ADC (digital) -> AIF1 AD0 Mixer -> AIF1 AD0 -> CPU DAI
              ||                                             ||

but the driver and device trees currently describe:

              ||                                             ||
 ADC (analog) -> AIF1 AD0 ------------------------------------> CPU DAI
              ||     \--> ADC Mixer -> ??? [dead end]        ||

The ADC/DAC are only powered because AIF1 AD0 (capture) has supply
routes from the ADC, and AIF1 DA0 (playback) has supply routes from the
DAC. However, neither set of supply routes matches the hardware
topology. Audio can be routed among AIF1/2/3 without using the ADC or
DAC at all; and audio can be routed from the ADC to the DAC without
using any AIFs (via the "ADC Digital DAC Playback Switch"). Because the
DAPM routes are wrong, both of these use cases are currently broken.

This commit adds the necessary widgets and routes to represent the real
hardware topology, with functionality equivalent to the current driver.

For the existing "allwinner,sun8i-a33-codec" compatible, widgets with
the old names are kept as wrappers around the new widgets, so existing
device trees will continue to work. For "allwinner,sun50i-a64-codec",
the old widgets can be omitted, because no device trees yet use that
compatible.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200726012557.38282-3-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: Add a new compatible for the A64 codec
Samuel Holland [Sun, 26 Jul 2020 01:25:51 +0000 (20:25 -0500)]
ASoC: dt-bindings: Add a new compatible for the A64 codec

The audio codecs in the A33 and A64 are both integrated variants of the
X-Powers AC100 codec. However, there are some differences between them
that merit having a separate compatible:
 - The A64 has a second DRC block, not present in the AC100 or A33.
 - The A33 has some extra muxing options for AIF1/2/3 in the
   AIF3_SGP_CTRL register, which are not present in the AC100 or A64.
 - The A33 is missing registers providing jack detection functionality.
 - The A33 is claimed to invert LRCK, but this is not seen on A64.

Since the driver will continue to work on the A64 using the A33
compatible, albeit without jack detection functionality and with
possibly inverted channels, as it does now, allow the A33 compatible
to be used as a fallback.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200726012557.38282-2-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>