Commit graph

1013528 commits

Author SHA1 Message Date
Rafał Miłecki
11480dbfe1
ASoC: wm8750: convert to the json-schema
This helps validating DTS files.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210512205926.780-1-zajec5@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:19:07 +01:00
Yang Yingliang
375904e393
ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup()
After calling clk_prepare_enable(), clk_disable_unprepare() need
be called when calling clk_set_rate() failed.

Fixes: 0bf750f4cb ("ASoC: hisilicon: Add hi6210 i2s audio driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210518044514.607010-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:32 +01:00
YueHaibing
5a3f869c5b
ASoC: soc-core: use DEVICE_ATTR_RO macro
Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20210514081100.16196-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:31 +01:00
Yang Yingliang
d14eece945
ASoC: rk3328: fix missing clk_disable_unprepare() on error in rk3328_platform_probe()
Fix the missing clk_disable_unprepare() before return
from rk3328_platform_probe() in the error handling case.

Fixes: c32759035a ("ASoC: rockchip: support ACODEC for rk3328")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210518075847.1116983-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:30 +01:00
Jaska Uimonen
d29d41e28e
ASoC: topology: Add support for multiple kcontrol types to a widget
Current dapm widget has a single variable to describe its kcontrol's
type. As there can be many kcontrols in one widget it is inherently
presumed that the types are the same.

Lately there has been use cases where different types of kcontrols would
be needed for a single widget. Thus add pointer to dapm widget to hold
an array for different kcontrol types and modify the kcontrol creation
to operate in a loop based on individual kcontrol type.

Change control creation and deletion to use individual kcontrol types in
SOF driver. This is done in the same patch for not breaking bisect. SOF
driver is also currently the only one using the dapm widget
kcontrol_type.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210507070246.404446-1-jaska.uimonen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-14 16:31:15 +01:00
Zou Wei
a75e5cdf4d
ASoC: intel/boards: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Link: https://lore.kernel.org/r/1620791647-16024-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-14 13:25:01 +01:00
Mark Brown
98c69fcc9f
Merge series "ASoC: SOF/Intel: fix and remove Sparse warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
We updated our SOF CI settings last week (see below) to use more options
for Sparse, and sure enough it detected one nasty single-character bug
in one of my previous patches, along with more trivial issues with
string/integer sizes and signed/unsigned confusions.

export ARCH=x86_64
export CF="-Wsparse-error -Wsparse-all -Wno-bitwise-pointer -Wno-pointer-arith -Wno-typesign -Wnoshadow"
make -k sound/soc/sof/ C=2
make -k sound/soc/intel/common/ C=2
make -k sound/soc/intel/boards/ C=2
make -k drivers/soundwire/ C=2

Pierre-Louis Bossart (9):
  ASoC: SOF: Intel: hda: fix index used in inner loop
  ASoC: Intel: sof_rt5682: shrink platform_id names below 20 characters
  ASoC: Intel: sof_cs42l42: shrink platform id below 20 characters
  ASoC: Intel: bxt_da7219_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: glk_rt5682_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: kbl_da7219_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: sof_da7219_max98373: shrink platform_id below 20
    characters
  ASoC: Intel: sof_sdw: fix signed/unsigned warning
  ASoC: Intel: soc-acpi: add ull suffix for SoundWire _ADR values

 sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 +++---
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  4 +-
 sound/soc/intel/boards/kbl_da7219_max98357a.c |  4 +-
 sound/soc/intel/boards/sof_cs42l42.c          |  2 +-
 sound/soc/intel/boards/sof_da7219_max98373.c  |  8 ++--
 sound/soc/intel/boards/sof_rt5682.c           | 20 +++++-----
 sound/soc/intel/boards/sof_sdw.c              |  2 +-
 .../intel/common/soc-acpi-intel-adl-match.c   | 28 +++++++-------
 .../intel/common/soc-acpi-intel-bxt-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-cml-match.c   | 22 +++++------
 .../intel/common/soc-acpi-intel-cnl-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-glk-match.c   |  6 +--
 .../intel/common/soc-acpi-intel-icl-match.c   | 12 +++---
 .../intel/common/soc-acpi-intel-jsl-match.c   |  6 +--
 .../intel/common/soc-acpi-intel-kbl-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   | 38 +++++++++----------
 sound/soc/sof/intel/hda.c                     |  2 +-
 17 files changed, 86 insertions(+), 86 deletions(-)

--
2.25.1
2021-05-12 16:22:59 +01:00
Vitaly Rodionov
c9f2e3c3dd
ASoC: cs42l42: make HSBIAS_SENSE_EN optional
HSBIAS_SENSE_EN configures HSBIAS output current sense through
the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce
the potential pop noise during the headset plug out slowly. But on some
platforms ESD voltage will affect it causing test to fail, especially
with CTIA headset type. For different hardware setups, a designer might
want to tweak default behavior.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511145220.125760-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:53 +01:00
Nathan Chancellor
9b7493468f
ASoC: q6dsp: Undo buggy warning fix
This reverts commit 5f1b95d08d.

The warnings that commit 5f1b95d08d ("ASoC: q6dsp: q6afe: remove
unneeded dead-store initialization") was trying to fix were already
fixed in commit 12900bacb4 ("ASoC: qcom: q6afe: remove useless
assignments"). With both commits in the tree, port_id is uninitialized,
as pointed out by clang:

sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is
uninitialized when used here [-Wuninitialized]
        stop->port_id = port_id;
                        ^~~~~~~
sound/soc/qcom/qdsp6/q6afe.c:1186:13: note: initialize the variable
'port_id' to silence this warning
        int port_id;
                   ^
                    = 0
1 warning generated.

Bring back the initialization so that everything works as intended.

Fixes: 5f1b95d08d ("ASoC: q6dsp: q6afe: remove unneeded dead-store initialization")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210511190306.2418917-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:52 +01:00
Simon Trimmer
7fe0b0981a
ASoC: wm2200: remove include of wmfw.h
We want all wm_adsp clients to use the wm_adsp.h header as they
shouldn't need to include internal sub-headers.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511171514.270219-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:52 +01:00
Simon Trimmer
130dbe04d4
ASoC: wm_adsp: mark more data structures with the const qualifier
The callback structures and memory region type table can be marked as
const as they will not change during use.

Fix checkpatch warning against wm_adsp_find_region function by moving
const keyword to form the 'static const struct' pattern.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511171459.270169-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:51 +01:00
Pierre-Louis Bossart
24e46fb811
ASoC: Intel: bxt_da7219_max98357a: shrink platform_id below 20 characters
Sparse throwns the following warnings:

sound/soc/intel/boards/bxt_da7219_max98357a.c:843:19: error: too long
initializer-string for array of char(no space for nul char)

sound/soc/intel/boards/bxt_da7219_max98357a.c:844:19: error: too long
initializer-string for array of char(no space for nul char)

sound/soc/intel/boards/bxt_da7219_max98357a.c:845:19: error: too long
initializer-string for array of char(no space for nul char)

Fix by using the 'mx' acronyn for Maxim

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210511213707.32958-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:49 +01:00
Pierre-Louis Bossart
48a7e6e5b2
ASoC: Intel: sof_cs42l42: shrink platform id below 20 characters
The platform_id is too long and is flagged by a sparse warning:

sound/soc/intel/boards/sof_cs42l42.c:483:25: error: too long
initializer-string for array of char(no space for nul char)

fix by using the 'mx' acronym for Maxim

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210511213707.32958-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:48 +01:00
Pierre-Louis Bossart
ad839121dd
ASoC: SOF: Intel: hda: fix index used in inner loop
With more warnings than the default, Sparse throws the following
warning:

sound/soc/sof/intel/hda.c:1127:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1128:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1129:48: error: self-comparison always
evaluates to true

This looks like an obvious error, with a likely copy-pasted line
leading to the use of the wrong index in an inner loop. One of the
worst single-character bugs in a long time.

This problem was not detected in our tests since in practice SoundWire
platforms only have identical devices per link and the index mistake
did not change the results.

Fixes: 6f5d506d7ff1dq ('ASoC: SOF: Intel: SoundWire: refine ACPI match')
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210511213707.32958-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:47 +01:00
Charles Keepax
4ac9b48adf
ASoC: cs42l52: Minor tidy up of error paths
Fixup a needlessly initialised variable and an unchecked return
value.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511101051.17726-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-11 15:42:44 +01:00
Charles Keepax
fd4e6baa62
ASoC: cs4265: Minor tidy up of error paths
Fixup a needlessly initialised variable and an unchecked return value.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511101051.17726-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-11 15:42:43 +01:00
Charles Keepax
634a4be0f9
ASoC: cs35l36: Remove unneeded variable initialisation
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511101051.17726-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-11 15:42:42 +01:00
Mark Brown
ae062a711a
Merge series "PinePhone BT audio bringup" from Samuel Holland <samuel@sholland.org>:
This series uses the additional DAIs added to the sun8i-codec driver to
add hardware routing for BT SCO (headset) audio on the PinePhone.

The BT audio connection is represented by the "dummy" bt-sco codec. The
connection to the Quectel EG-25G modem via AIF2 works as well, but I do
not include it here because there is no appropriate codec driver in
tree. We have been using an out-of-tree "dummy" codec driver for the
modem similar to bt-sco, and I'm not sure if such a driver would be
desired upstream.

Changes from v2:
  - Also accept #sound-dai-cells in the binding. Since dt-core.yaml
    already sets the type of this property, it is not possible to use
    oneOf, nor make a specific value deprecated.

Changes from v1:
  - Fixed DT binding example to follow new binding

Arnaud Ferraris (1):
  arm64: dts: allwinner: pinephone: Set audio card name

Samuel Holland (6):
  ASoC: dt-bindings: sun8i-codec: Increase #sound-dai-cells
  ARM: dts: sun8i-a33: Allow using multiple codec DAIs
  arm64: dts: allwinner: a64: Allow using multiple codec DAIs
  arm64: dts: allwinner: a64: Add pinmux nodes for AIF2/AIF3
  arm64: dts: allwinner: a64: Allow multiple DAI links
  arm64: dts: allwinner: pinephone: Add support for Bluetooth audio

 .../sound/allwinner,sun8i-a33-codec.yaml      |  8 +++-
 arch/arm/boot/dts/sun8i-a33.dtsi              |  4 +-
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   | 25 +++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 37 ++++++++++++++-----
 4 files changed, 60 insertions(+), 14 deletions(-)

--
2.26.3
2021-05-11 09:06:03 +01:00
Mark Brown
b8ded8af30
Merge series "Tidy up device ID reading on legacy Cirrus parts" from Charles Keepax <ckeepax@opensource.cirrus.com>:
Pierre requested I have a look at some cppcheck warnings in the cs42l42
driver, since it is reassigning the ret variable without ever checking
the result.  Looking a bit more broadly this happens in quite a few
legacy Cirrus parts, as they all use the same process to read the ID,
factor out a small helper so they can all share the same code. Whilst
in there fix up a couple of other trivial error path issues as well.

Thanks,
Charles

Charles Keepax (10):
  ASoC: cirrus: Add helper function for reading the device ID
  ASoC: cs35l32: Minor error paths fixups
  ASoC: cs35l33: Minor error paths fixups
  ASoC: cs35l34:  Minor error paths fixups
  ASoC: cs35l35:  Minor error paths fixups
  ASoC: cs35l35: Correct errata handling
  ASoC: cs42l42:  Minor error paths fixups
  ASoC: cs42l73:  Minor error paths fixups
  ASoC: cs43130:  Minor error paths fixups
  ASoC: cs53l30:  Minor error paths fixups

 sound/soc/codecs/cirrus_legacy.h | 21 +++++++++++++++++++++
 sound/soc/codecs/cs35l32.c       | 34 ++++++++++++++++++----------------
 sound/soc/codecs/cs35l33.c       | 15 +++++++++------
 sound/soc/codecs/cs35l34.c       | 39 ++++++++++++++++++++++-----------------
 sound/soc/codecs/cs35l35.c       | 21 ++++++++++-----------
 sound/soc/codecs/cs35l35.h       |  1 +
 sound/soc/codecs/cs42l42.c       | 18 ++++++++----------
 sound/soc/codecs/cs42l73.c       | 30 +++++++++++++++++-------------
 sound/soc/codecs/cs43130.c       | 31 +++++++++++++++++++------------
 sound/soc/codecs/cs53l30.c       | 22 +++++++++++-----------
 10 files changed, 136 insertions(+), 96 deletions(-)
 create mode 100644 sound/soc/codecs/cirrus_legacy.h

--
2.11.0
2021-05-11 09:06:01 +01:00
Mark Brown
3b8fb1f770
Merge series "ASoC: cppcheck fixes of the week" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While running some checks on a rebased branch, I realized I missed a
couple of trivial cases on newer code.

Pierre-Louis Bossart (4):
  ASoC: codecs: mt6359-accdet: remove useless initialization
  ASoc: codecs: mt6359: remove useless initializations
  ASoC: codecs: rt1019: clarify expression
  ASoC: fsl: imx-pcm-rpmsg: remove useless initialization

 sound/soc/codecs/mt6359-accdet.c | 2 +-
 sound/soc/codecs/mt6359.c        | 2 +-
 sound/soc/codecs/rt1019.c        | 4 ++--
 sound/soc/fsl/imx-pcm-rpmsg.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

--
2.25.1
2021-05-11 09:06:00 +01:00
Mark Brown
b748ad3804
Merge series "ASoC: SOF: Intel: split Baytrail and Merrifield" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
We've had recurring randconfig issues with the two platforms relying
on ACPI and PCI. I think it's time to split the two and introduce a
common 'atom' module, so that dependencies are better handled.

I chose not to add a Fixes tag since the changes are rather invasive,
and the randconfig issues only happen in non-functional cases.

There should be no functional changes with this patchset, only code
moved and renamed.

Pierre-Louis Bossart (2):
  ASoC: SOF: Intel: byt: prepare split between Baytrail and Merrifield
  ASoC: SOF: Intel: move common ATOM stuff to module

 sound/soc/sof/intel/Makefile  |   5 +-
 sound/soc/sof/intel/atom.c    | 463 ++++++++++++++++++++
 sound/soc/sof/intel/atom.h    |  74 ++++
 sound/soc/sof/intel/byt.c     | 768 ++++------------------------------
 sound/soc/sof/intel/pci-tng.c | 171 +++++++-
 5 files changed, 783 insertions(+), 698 deletions(-)
 create mode 100644 sound/soc/sof/intel/atom.c
 create mode 100644 sound/soc/sof/intel/atom.h

--
2.25.1
2021-05-11 09:05:59 +01:00
Mark Brown
93c964af77
Merge series "ASoC: Intel: machine driver updates for 5.14" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Some of the patches in this series for TigerLake and AlderLake
SoundWire/Bluetooth support were missed in a previous submission,
resend them as is, and add new patches for the CS42L42 machine driver.

Brent Lu (3):
  ASoC: Intel: maxim-common: support max98357a
  ASoC: Intel: add sof-cs42l42 machine driver
  ASoC: Intel: sof_rt5682: code refactor for max98357a

Libin Yang (1):
  ASoC: Intel: sof_sdw: add SOF_RT715_DAI_ID_FIX for AlderLake

Pierre-Louis Bossart (4):
  ASoC: Intel: sof_sdw: add mutual exclusion between PCH DMIC and RT715
  ASoC: Intel: boards: handle hda-dsp-common as a module
  ASoC: Intel: boards: create sof-maxim-common module
  ASoC: Intel: boards: remove .nonatomic for BE dailinks

Vamshi Krishna Gopal (2):
  ASoC: Intel: soc-acpi: add entries for i2s machines in ADL match table
  ASoC: Intel: boards: add support for adl boards in sof-rt5682

Yong Zhi (3):
  ASoC: Intel: Boards: tgl_max98373: Add BT offload support
  ASoC: Intel: sof_sdw: add support for Bluetooth offload
  ASoC: Intel: sof_rt5682: Enable Bluetooth offload on tgl and adl

 sound/soc/intel/boards/Kconfig                |  36 +-
 sound/soc/intel/boards/Makefile               |  30 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |   1 +
 sound/soc/intel/boards/bxt_rt298.c            |   1 +
 sound/soc/intel/boards/bytcht_cx2072x.c       |   1 -
 sound/soc/intel/boards/bytcht_da7213.c        |   1 -
 sound/soc/intel/boards/bytcht_es8316.c        |   1 -
 sound/soc/intel/boards/bytcht_nocodec.c       |   1 -
 sound/soc/intel/boards/bytcr_rt5640.c         |   1 -
 sound/soc/intel/boards/bytcr_rt5651.c         |   1 -
 sound/soc/intel/boards/bytcr_wm5102.c         |   1 -
 sound/soc/intel/boards/cht_bsw_rt5645.c       |   1 -
 sound/soc/intel/boards/cht_bsw_rt5672.c       |   1 -
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   1 +
 sound/soc/intel/boards/ehl_rt5660.c           |   2 +-
 sound/soc/intel/boards/glk_rt5682_max98357a.c |   1 +
 sound/soc/intel/boards/hda_dsp_common.c       |   5 +
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |   1 +
 sound/soc/intel/boards/sof_cs42l42.c          | 509 ++++++++++++++++++
 sound/soc/intel/boards/sof_da7219_max98373.c  |   1 +
 sound/soc/intel/boards/sof_maxim_common.c     |  84 ++-
 sound/soc/intel/boards/sof_maxim_common.h     |  14 +-
 sound/soc/intel/boards/sof_pcm512x.c          |   2 +-
 sound/soc/intel/boards/sof_rt5682.c           | 119 +++-
 sound/soc/intel/boards/sof_sdw.c              |  55 +-
 sound/soc/intel/boards/sof_sdw_common.h       |   8 +
 sound/soc/intel/boards/sof_sdw_max98373.c     |   4 +-
 sound/soc/intel/boards/sof_wm8804.c           |   1 -
 .../intel/common/soc-acpi-intel-adl-match.c   |  26 +
 .../intel/common/soc-acpi-intel-glk-match.c   |  10 +
 30 files changed, 861 insertions(+), 59 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_cs42l42.c

--
2.25.1
2021-05-11 09:05:58 +01:00
Charles Keepax
4fc81bc88a
ASoC: cs53l30: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:55 +01:00
Charles Keepax
e2bb1077ce
ASoC: cs43130: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-10-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:54 +01:00
Charles Keepax
26495252fe
ASoC: cs42l73: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:53 +01:00
Charles Keepax
0a0eb567e1
ASoC: cs42l42: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:52 +01:00
Charles Keepax
1a46b7b82d
ASoC: cs35l35: Correct errata handling
Currently the check of errata_chk will always evaluate to false since
the values tested don't come under the mask used. A shift of the field
is missing, add this. Also there is an error in the values tested, they
don't match the comment and the value 0x3 is not a valid value for the
field in question. Update the value to match the comment.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:51 +01:00
Charles Keepax
60ba916d87
ASoC: cs35l35: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:50 +01:00
Charles Keepax
8cb9b00163
ASoC: cs35l34: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:49 +01:00
Charles Keepax
77908dbecd
ASoC: cs35l33: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:48 +01:00
Charles Keepax
283160f141
ASoC: cs35l32: Minor error paths fixups
Correct some unchecked re-allocations of ret whilst reading the device
ID and ensure the hardware state is returned to off on the error
paths.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:47 +01:00
Charles Keepax
c8b198ed31
ASoC: cirrus: Add helper function for reading the device ID
Many of the older Cirrus devices share very similar code for reading the
device ID, and frequently this code is generating cppcheck warnings such
as:

sound/soc/codecs/cs42l42.c:1886:6: style: Variable 'ret' is reassigned
a value before the old one has been used. [redundantAssignment]
 ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_CD, &reg);

Add a small helper function that older Cirrus devices can use to read
the device ID, which should help correct these issues.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210510131357.17170-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:27:46 +01:00
Derek Fang
b63ecaea97
ASoC: rt1019: Add non_legacy_dai_naming config
Register the codec dai name as 'rt1019-aif' by adding
non_legacy_dai_naming configuration.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210503031732.22035-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:11 +01:00
Vitaly Rodionov
66df9477bd
ASoC: cs42l42: Add support for ACPI table match entry
Adding support for ACPI-based systems.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210426155303.853236-3-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:10 +01:00
Richard Fitzgerald
ab78322a0d
ASoC: cs42l42: Use device_property API instead of of_property
Use the device_property APIs so that the code will work on devicetree
and ACPI systems.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210426155303.853236-2-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:09 +01:00
Lucas Tanure
c26a5289e8
ASoC: cs42l42: Add support for set_jack calls
Replace the internal jack creation by set_jack call, so users can map
buttons in their machine driver
Also only enable jack detection IRQ after set_jack call

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210426155303.853236-1-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:08 +01:00
Stephen Boyd
87b42abae9
ASoC: rt5682: Implement remove callback
Let's implement a remove callback for this driver that's similar to the
shutdown hook, but also disables the regulators before they're put by
devm code.

Cc: Jairaj Arava <jairaj.arava@intel.com>
Cc: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Cc: Shuming Fan <shumingf@realtek.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210508075151.1626903-2-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:07 +01:00
Stephen Boyd
47bcb1c710
ASoC: rt5682: Disable irq on shutdown
We cancel the work queues, and reset the device on shutdown, but the irq
isn't disabled so the work queues could be queued again. Let's disable
the irq during shutdown so that we don't have to worry about this device
trying to do anything anymore. This fixes a problem seen where the i2c
bus is shutdown at reboot but this device irq still comes in and tries
to make another i2c transaction when the bus doesn't work.

Cc: Jairaj Arava <jairaj.arava@intel.com>
Cc: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Cc: Shuming Fan <shumingf@realtek.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Fixes: 45a2702ce1 ("ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210508075151.1626903-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:06 +01:00
Tom Rix
58f01c7fc8
ASoC: codecs: lpass-wsa-macro: handle unexpected input
Static analysis reports this problem

lpass-wsa-macro.c:1732:6: warning: Array subscript is undefined
        if (wsa->ec_hq[ec_tx]) {
            ^~~~~~~~~~~~~~~~~

The happens because 'ec_tx' is never initialized and there is
no default in switch statement that sets ec_tx.  Add a default
case that returns an error before the array is accessed.

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210430142117.3272772-1-trix@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:06 +01:00
Jiapeng Chong
1d122dd3b1
ASoC: rt286: Remove redundant assignment to d_len_code
Variable d_len_code is set to zero, but this value is never read as
it is overwritten or not used later on, hence it is a redundant
assignment and can be removed.

Clean up the following clang-analyzer warning:

sound/soc/codecs/rt286.c:728:2: warning: Value stored to 'd_len_code' is
never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1620298735-31708-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:05 +01:00
H. Nikolaus Schaller
16f2a3cdaa
ASoC: jz4740-i2s: fix function name
This driver is not related to I2C protocol.

s/_i2c_/_i2s_/

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/56f9c8518870263698b00d10de4821d2dc8932be.1619960935.git.hns@goldelico.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 17:06:04 +01:00
Wan Jiabing
223875a6fb
ASoC: fsl_xcvr: Remove unneeded semicolon
Fix the following coccicheck warning:

./sound/soc/fsl/fsl_xcvr.c:739:2-3: Unneeded semicolon

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20210506022452.5762-1-wanjiabing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:39 +01:00
Shengjiu Wang
a387040ab4
ASoC: imx-pcm-rpmsg: Fix warning of incorrect type in assignment
The format in rpmsg is defained as unsigned char, there is warning
when convert snd_pcm_format_t to it.

sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse: warning: incorrect type in assignment (different base types)
sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse:    expected unsigned char format
sound/soc/fsl/imx-pcm-rpmsg.c:164:43: sparse:    got restricted snd_pcm_format_t [usertype]
sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse: warning: incorrect type in assignment (different base types)
sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse:    expected unsigned char format
sound/soc/fsl/imx-pcm-rpmsg.c:167:43: sparse:    got restricted snd_pcm_format_t [usertype]

Refine the unused RPMSG_DSD_U16_LE and RPMSG_DSD_U32_LE for these
case to fix this sparse warning.

Fixes: 3c00eceb2a ("ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1620268240-1005-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:38 +01:00
Wan Jiabing
f758b9ef9a
ASoC: codecs: lpass-rx-macro: Remove unneeded semicolon
Fix the following coccicheck warning:

./sound/soc/codecs/lpass-rx-macro.c:2631:2-3: Unneeded semicolon

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20210506021005.4897-1-wanjiabing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:37 +01:00
Tang Bin
37c881cd18
ASoc: Fix unused define in jz4740-i2s.h
Delete unused define of JZ4740_I2S_BIT_CLK, because it is unused
in any files.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210506131833.27420-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:36 +01:00
Yang Li
5f1b95d08d
ASoC: q6dsp: q6afe: remove unneeded dead-store initialization
Variables 'wait' and 'port_id' are being initialized, however the
values are never read and updated later on, hence the redundant
initializations can be removed.

Cleans up clang warnings:
sound/soc/qcom/qdsp6/q6afe.c:933:21: warning: Value stored to 'wait'
during its initialization is never read
sound/soc/qcom/qdsp6/q6afe.c:1186:6: warning: Value stored to 'port_id'
during its initialization is never read

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1619345553-29781-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:35 +01:00
Zhen Lei
85c966dc97
ASoC: mediatek: mt8192: Delete a redundant condition branch
The statement of the "if (afe_priv->mtkaif_protocol == MTKAIF_PROTOCOL_2)"
branch is the same as the "else" branch. Delete it to simplify code.

No functional change.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210510083640.3368-1-thunder.leizhen@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:33 +01:00
Jiapeng Chong
2fa74b31bb
ASoC: amd: renoir: Remove redundant assignment to pdm_ctrl and pdm_enable and pdm_dma_enable
Variable pdm_ctrl and pdm_enable and pdm_dma_enable are set to '0x00',
but they are overwritten later on, so these are redundant assignments
that can be removed.

Clean up the following clang-analyzer warning:

sound/soc/amd/renoir/acp3x-pdm-dma.c:148:2: warning: Value stored to
'pdm_dma_enable' is never read [clang-analyzer-deadcode.DeadStores].

sound/soc/amd/renoir/acp3x-pdm-dma.c:147:2: warning: Value stored to
'pdm_enable' is never read [clang-analyzer-deadcode.DeadStores].

sound/soc/amd/renoir/acp3x-pdm-dma.c:80:2: warning: Value stored to
'pdm_ctrl' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1620298590-29749-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:32 +01:00
Viorel Suman
604e517844
ASoC: fsl_spdif: add support for enabling raw capture mode
Since i.MX8MM SPDIF interface is able to capture raw data.
Add support in SPDIF driver for this functionality.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1619425444-8666-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:31 +01:00
Pierre-Louis Bossart
cccc16dc17
ASoC: fsl: imx-pcm-rpmsg: remove useless initialization
cppcheck warning:

assigned a value that is never used. [unreadVariable]
 int written_num = 0;
                 ^

sound/soc/fsl/imx-pcm-rpmsg.c:547:18: style: Variable 'written_num' is
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210426214701.235106-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:05:30 +01:00