platform/kernel/linux-starfive.git
2 years agoASoC: mediatek: mt8195: add mt8195-mt6359-rt1011-rt5682 bindings document
Trevor Wu [Wed, 20 Oct 2021 07:14:28 +0000 (15:14 +0800)]
ASoC: mediatek: mt8195: add mt8195-mt6359-rt1011-rt5682 bindings document

This patch adds document for mt8195 board with mt6359, rt1011 and rt5682

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211020071428.14297-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: add machine driver with mt6359, rt1011 and rt5682
Trevor Wu [Wed, 20 Oct 2021 07:14:27 +0000 (15:14 +0800)]
ASoC: mediatek: mt8195: add machine driver with mt6359, rt1011 and rt5682

This patch adds support for mt8195 board with mt6359, rt1011 and rt5682.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211020071428.14297-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: tfa989x: Add support for tfa9897 RCV bit
Vincent Knecht [Sun, 24 Oct 2021 08:58:38 +0000 (10:58 +0200)]
ASoC: codecs: tfa989x: Add support for tfa9897 RCV bit

TFA9897 has an internal 'rcv' switch so that it can manage both
loudspeaker and earpiece modes with the same physical speaker.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211024085840.1536438-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: select CONFIG_SND_SOC_ACPI
Arnd Bergmann [Fri, 29 Oct 2021 11:36:57 +0000 (13:36 +0200)]
ASoC: amd: acp: select CONFIG_SND_SOC_ACPI

The acp-platform driver now needs the ACPI helpers:

ld.lld: error: undefined symbol: snd_soc_acpi_find_machine
>>> referenced by acp-platform.c
>>>               soc/amd/acp/acp-platform.o:(acp_machine_select) in archive sound/built-in.a

ld.lld: error: undefined symbol: snd_soc_acpi_codec_list
>>> referenced by acp-renoir.c
>>>               soc/amd/acp/acp-renoir.o:(snd_soc_acpi_amd_acp_machines) in archive sound/built-in.a

Other drivers using this interface, select SND_SOC_ACPI, so do the
same thing here.

Fixes: e646b51f5dd5 ("ASoC: amd: acp: Add callback for machine driver on ACP")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211029113714.966823-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge series "ASoC: cs42l42: Fix definition and handling of jack switch invert" from...
Mark Brown [Fri, 29 Oct 2021 13:51:28 +0000 (14:51 +0100)]
Merge series "ASoC: cs42l42: Fix definition and handling of jack switch invert" from Richard Fitzgerald <rf@opensource.cirrus.com>:

Summary: The driver applied the opposite of the DT setting to the
wrong register bit.

The jack plug detect hardware in cs42l42 is somewhat confusing,
compounded by an unclear description in the datasheet. This is most
likely the reason that the driver implemented a DT property for the
wrong register bit, that had the opposite effect of what was
described in the binding.

Changing the meaning of the property values isn't feasible; the
driver dates from 2016 and the risk of breaking out-of-tree configs
is too high (the property is also available to ACPI systems).

So the fix is to make the binding doc match the actual behaviour and
then fix the driver to apply it to the correct register bit.

As a bonus, patch #3 converts the binding to yaml.

Richard Fitzgerald (3):
  ASoC: dt-bindings: cs42l42: Correct description of ts-inv
  ASoC: cs42l42: Correct configuring of switch inversion from ts-inv
  ASoC: dt-bindings: cs42l42: Convert binding to yaml

 .../devicetree/bindings/sound/cirrus,cs42l42.yaml  | 225 +++++++++++++++++++++
 .../devicetree/bindings/sound/cs42l42.txt          | 114 -----------
 MAINTAINERS                                        |   1 +
 sound/soc/codecs/cs42l42.c                         |   9 +-
 4 files changed, 230 insertions(+), 119 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l42.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/cs42l42.txt

--
2.11.0

2 years agoASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec
Brent Lu [Thu, 28 Oct 2021 14:09:09 +0000 (22:09 +0800)]
ASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec

Detect the codec variant in probe function and update DAI link
accordingly. Also add an new entry in enumeration table for machine
driver enumeration.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211028140909.496022-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fix unmet dependencies on GPIOLIB for SND_SOC_RT1015P
Julian Braha [Fri, 29 Oct 2021 00:12:25 +0000 (20:12 -0400)]
ASoC: fix unmet dependencies on GPIOLIB for SND_SOC_RT1015P

When SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8183_DA7219_MAX98357A, or
SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A is selected,
and GPIOLIB is not selected, Kbuild gives the following
warnings, respectively:

WARNING: unmet direct dependencies detected for SND_SOC_DMIC
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8192_MT6359_RT1015_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8192 [=y] && MTK_PMIC_WRAP [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8192_MT6359_RT1015_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8192 [=y] && MTK_PMIC_WRAP [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8183_DA7219_MAX98357A [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8183 [=y] && I2C [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8183 [=y]

This is because these config options select SND_SOC_RT1015P
without selecting or depending on GPIOLIB, despite
SND_SOC_RT1015P depending on GPIOLIB.

These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20211029001225.27218-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: es8316: add support for ESSX8336 ACPI _HID
Pierre-Louis Bossart [Fri, 29 Oct 2021 01:11:09 +0000 (09:11 +0800)]
ASoC: es8316: add support for ESSX8336 ACPI _HID

The same codec seems to have different personalities. ESSX8316 was
used for Baytrail/CherryTrail, ESSX8336 seems to be used for AppoloLake,
GeminiLake, JasperLake and TigerLake devices.

BugLink: https://github.com/thesofproject/linux/issues/2955
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>-e
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211029011109.23633-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs42l42: Correct configuring of switch inversion from ts-inv
Richard Fitzgerald [Thu, 28 Oct 2021 14:09:01 +0000 (15:09 +0100)]
ASoC: cs42l42: Correct configuring of switch inversion from ts-inv

The setting from the cirrus,ts-inv property should be applied to the
TIP_SENSE_INV bit, as this is the one that actually affects the jack
detect block. The TS_INV bit only swaps the meaning of the PLUG and
UNPLUG interrupts and should always be 1 for the interrupts to have
the normal meaning.

Due to some misunderstanding the driver had been implemented to
configure the TS_INV bit based on the jack switch polarity. This made
the interrupts behave the correct way around, but left the jack detect
block, button detect and analogue circuits always interpreting an open
switch as unplugged.

The signal chain inside the codec is:

SENSE pin -> TIP_SENSE_INV -> TS_INV -> (invert) -> interrupts
                  |
                  v
             Jack detect,
          button detect and
            analog control

As the TIP_SENSE_INV already performs the necessary inversion the
TS_INV bit never needs to change. It must always be 1 to yield the
expected interrupt behaviour.

Some extra confusion has arisen because of the additional invert in the
interrupt path, meaning that a value applied to the TS_INV bit produces
the opposite effect of applying it to the TIP_SENSE_INV bit. The ts-inv
property has therefore always had the opposite effect to what might be
expected (0 = inverted, 1 = not inverted). To maintain the meaning of
the ts-inv property it must be inverted when applied to TIP_SENSE_INV.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec")
Link: https://lore.kernel.org/r/20211028140902.11786-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: cs42l42: Correct description of ts-inv
Richard Fitzgerald [Thu, 28 Oct 2021 14:09:00 +0000 (15:09 +0100)]
ASoC: dt-bindings: cs42l42: Correct description of ts-inv

This swaps the descriptions of the 0 and 1 values to match
what the driver actually does with this property.

The background here is somewhat confusing. The codec has two
invert bits for the tip sense. The DT property should have been
for the TIP_SENSE_INV bit, which is the one that controls the
detect block. Due to some misunderstanding of the hardware the
driver actually implemented setting of the TS_INV bit, which is
only for swapping the sense of the interrupt bits. The description
was taken from the datasheet and refers to TIP_SENSE_INV but
unfortunately TS_INV has a different purpose and the net effect
of changing it is the reverse of what was intended (this is not
clearly described in the datasheet). So the ts-inv settings have
always done the exact opposite of what the description said.

Given the age of the driver, it's too late now to swap the meanings
of the values, so the description is changed to match the behaviour.
They have been annotated with the terminology used in the datasheet
to avoid the confusion of which one corresponds to what the datasheet
calls "inverted tip sense".

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: da16c5579353 ("ASoC: cs42l42: Add devicetree bindings for CS42L42")
Link: https://lore.kernel.org/r/20211028140902.11786-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: Fix clang -Wimplicit-fallthrough
Nathan Chancellor [Wed, 27 Oct 2021 19:08:23 +0000 (12:08 -0700)]
ASoC: qdsp6: audioreach: Fix clang -Wimplicit-fallthrough

Clang warns:

sound/soc/qcom/qdsp6/topology.c:465:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
                default:
                ^
sound/soc/qcom/qdsp6/topology.c:465:3: note: insert 'break;' to avoid fall-through
                default:
                ^
                break;
1 warning generated.

Clang is a little more pedantic than GCC, which permits implicit
fallthroughs to cases that contain just break or return. Clang's version
is more in line with the kernel's own stance in deprecated.rst, which
states that all switch/case blocks must end in either break,
fallthrough, continue, goto, or return. Add the missing break to fix
the warning.

Link: https://github.com/ClangBuiltLinux/linux/issues/1495
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20211027190823.4057382-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fix unmet dependencies on GPIOLIB for SND_SOC_DMIC
Julian Braha [Wed, 27 Oct 2021 18:48:35 +0000 (14:48 -0400)]
ASoC: fix unmet dependencies on GPIOLIB for SND_SOC_DMIC

When SND_SOC_AMD_RENOIR_MACH or SND_SOC_AMD_RV_RT5682_MACH
are selected, and GPIOLIB is not selected, Kbuild gives
the following warnings, respectively:

WARNING: unmet direct dependencies detected for SND_SOC_DMIC
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_AMD_RENOIR_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_RENOIR [=y]

and

WARNING: unmet direct dependencies detected for SND_SOC_MAX98357A
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_AMD_RV_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP3x [=y] && I2C [=y] && CROS_EC [=y]

This is because SND_SOC_DMIC and SND_SOC_MAX98357A are
selected by SND_SOC_AMD_RV_RT5682_MACH and SND_SOC_AMD_RENOIR_MACH,
respectively. However, neither of the selectors depend on or select GPIOLIB,
despite their selectees depending on GPIOLIB.

These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://lore.kernel.org/r/20211027184835.112916-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: fix Kconfig dependencies
Arnd Bergmann [Wed, 27 Oct 2021 08:23:46 +0000 (10:23 +0200)]
ASoC: amd: acp: fix Kconfig dependencies

The CONFIG_SND_SOC_AMD_MACH_COMMON has some dependencies that
are not checked by the symbols that select it:

WARNING: unmet direct dependencies detected for SND_SOC_AMD_MACH_COMMON
  Depends on [n]: SOUND [=y] && !UML && SND [=m] && SND_SOC [=m] && X86 && PCI [=y] && I2C [=n]
  Selected by [m]:
  - SND_SOC_AMD_LEGACY_MACH [=m] && SOUND [=y] && !UML && SND [=m] && SND_SOC [=m]
  - SND_SOC_AMD_SOF_MACH [=m] && SOUND [=y] && !UML && SND [=m] && SND_SOC [=m]

WARNING: unmet direct dependencies detected for SND_SOC_AMD_MACH_COMMON
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && X86 && PCI [=n] && I2C [=m]
  Selected by [m]:
  - SND_SOC_AMD_LEGACY_MACH [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m]

Make this more consistent by adding the same checks everywhere.

Fixes: 9d8a7be88b33 ("ASoC: amd: acp: Add legacy sound card support for Chrome audio")
Fixes: 9f84940f5004 ("ASoC: amd: acp: Add SOF audio support on Chrome board")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211027082359.52248-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge series "Make genaral and simple for new sof machine driver" from David Lin...
Mark Brown [Wed, 27 Oct 2021 14:57:29 +0000 (15:57 +0100)]
Merge series "Make genaral and simple for new sof machine driver" from David Lin <CTLIN0@nuvoton.com>:

The series of features will make general and simple for new sof machine driver.

David Lin (2):
  ASoC: nau8825: add set_jack coponment support
  ASoC: nau8825: add clock management for power saving

 sound/soc/codecs/nau8825.c | 48 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

2 years agoMerge series "ASoC: minor cleanup of warnings" from Pierre-Louis Bossart <pierre...
Mark Brown [Wed, 27 Oct 2021 14:57:28 +0000 (15:57 +0100)]
Merge series "ASoC: minor cleanup of warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Sparse, make W=1 and cppcheck all report minor warnings.

The only functional change is in patch7 where the error code is now
returned to the caller.

Pierre-Louis Bossart (8):
  ASoC: topology: handle endianness warning
  ASoC: rt5682s: use 'static' qualifier
  ASoC: nau8821: fix kernel-doc
  ASoC: nau8821: clarify out-of-bounds check
  ASoC: mediatek: remove unnecessary initialization
  ASoC: mediatek: mt8195: rename shadowed array
  ASoC: mediatek: mt8195: fix return value
  ASoC: rockchip: i2s_tdm: improve return value handling

 sound/soc/codecs/nau8821.c                  | 6 ++++--
 sound/soc/codecs/rt5682s.c                  | 6 +++---
 sound/soc/mediatek/common/mtk-afe-fe-dai.c  | 2 +-
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c  | 4 ++--
 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 2 +-
 sound/soc/rockchip/rockchip_i2s_tdm.c       | 2 +-
 sound/soc/soc-topology.c                    | 2 +-
 7 files changed, 13 insertions(+), 11 deletions(-)

--
2.25.1

2 years agoASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock
AngeloGioacchino Del Regno [Tue, 26 Oct 2021 08:10:30 +0000 (10:10 +0200)]
ASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock

The mclk clock is optional, but it's currently using devm_clk_get:
simplify the handling by using devm_clk_get_optional instead.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211026081030.422481-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: soc-acpi: add entry for ESSX8336 on JSL
Pierre-Louis Bossart [Wed, 27 Oct 2021 02:33:11 +0000 (10:33 +0800)]
ASoC: Intel: soc-acpi: add entry for ESSX8336 on JSL

We have configurations for this codec on APL, GLK and TGL, somehow the
information that some designs rely on JasperLake was not shared.

BugLink: https://github.com/thesofproject/linux/issues/3210
Fixes: 790049fb6623 ('ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on ES8336 codec')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027023311.25005-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Fix return value check in acp_machine_select()
Yang Yingliang [Wed, 27 Oct 2021 06:52:28 +0000 (14:52 +0800)]
ASoC: amd: acp: Fix return value check in acp_machine_select()

In case of error, platform_device_register_data() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e646b51f5dd5 ("ASoC: amd: acp: Add callback for machine driver on ACP")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211027065228.833825-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: max98520: add max98520 audio amplifier driver
George Song [Wed, 27 Oct 2021 00:14:31 +0000 (09:14 +0900)]
ASoC: max98520: add max98520 audio amplifier driver

add max98520 audio amplifier driver

Signed-off-by: George Song <george.song@maximintegrated.com>
Link: https://lore.kernel.org/r/20211027001431.363-2-george.song@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: max98520: add initial bindings
George Song [Wed, 27 Oct 2021 00:14:30 +0000 (09:14 +0900)]
ASoC: dt-bindings: max98520: add initial bindings

add initial bindings for max98520 audio amplifier

Signed-off-by: George Song <george.song@maximintegrated.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211027001431.363-1-george.song@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: i2s_tdm: improve return value handling
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:33 +0000 (13:59 -0500)]
ASoC: rockchip: i2s_tdm: improve return value handling

cppcheck reports the following warning:

sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]

 return ret;
        ^
sound/soc/rockchip/rockchip_i2s_tdm.c:594:6: note: If condition 'ret'
is true, the function will return/exit
 if (ret)
     ^
sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: note: Returning identical
expression 'ret'

 return ret;
        ^

While the code is not wrong, it's clearer to return 0 directly.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: fix return value
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:32 +0000 (13:59 -0500)]
ASoC: mediatek: mt8195: fix return value

cppcheck reports the following warning:

sound/soc/mediatek/mt8195/mt8195-dai-etdm.c:1299:10: style: Variable
'ret' is assigned a value that is never used. [unreadVariable]
 int ret = 0;
         ^

The suggested change aligns the implementation of
mt8195_afe_disable_etdm() with mt8195_afe_enable_etdm() - same
negative return value upon error.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: mt8195: rename shadowed array
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:31 +0000 (13:59 -0500)]
ASoC: mediatek: mt8195: rename shadowed array

cppcheck warning:

Checking sound/soc/mediatek/mt8195/mt8195-afe-pcm.c ...
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2884:35: style: Local
variable 'irq_data' shadows outer variable [shadowVariable]
  struct mtk_base_irq_data const *irq_data;
                                  ^
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2235:39: note: Shadowed declaration
static const struct mtk_base_irq_data irq_data[MT8195_AFE_IRQ_NUM] = {
                                      ^
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2884:35: note: Shadow variable
  struct mtk_base_irq_data const *irq_data;
                                  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: mediatek: remove unnecessary initialization
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:30 +0000 (13:59 -0500)]
ASoC: mediatek: remove unnecessary initialization

Cppcheck warning:

sound/soc/mediatek/common/mtk-afe-fe-dai.c:353:8: style: Variable 'i'
is assigned a value that is never used. [unreadVariable]
 int i = 0;
       ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: nau8821: clarify out-of-bounds check
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:29 +0000 (13:59 -0500)]
ASoC: nau8821: clarify out-of-bounds check

cppcheck reports a false positive

sound/soc/codecs/nau8821.c:390:17: error: Array 'dmic_speed_sel[4]'
accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds]

  dmic_speed_sel[i].param, dmic_speed_sel[i].val);
                ^
sound/soc/codecs/nau8821.c:378:2: note: After for loop, i has value 4
 for (i = 0 ; i < 4 ; i++)
 ^
sound/soc/codecs/nau8821.c:390:17: note: Array index out of bounds
  dmic_speed_sel[i].param, dmic_speed_sel[i].val);
                ^

While the code is not incorrect, we can deal with the out-of-bounds
check in a clearer way that makes static analysis happy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: nau8821: fix kernel-doc
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:28 +0000 (13:59 -0500)]
ASoC: nau8821: fix kernel-doc

make W=1 reports warnings:

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'component' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'pll_id' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member
'source' not described in 'nau8821_set_fll'

sound/soc/codecs/nau8821.c:1192: warning: Excess function parameter
'codec' description in 'nau8821_set_fll'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rt5682s: use 'static' qualifier
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:27 +0000 (13:59 -0500)]
ASoC: rt5682s: use 'static' qualifier

Sparse reports the following warnings:

sound/soc/codecs/rt5682s.c:44:12: error: symbol 'rt5682s_supply_names'
was not declared. Should it be static?

sound/soc/codecs/rt5682s.c:74:26: error: symbol 'rt5682s_reg' was not
declared. Should it be static?

sound/soc/codecs/rt5682s.c:2841:30: error: symbol
'rt5682s_aif1_dai_ops' was not declared. Should it be static?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: topology: handle endianness warning
Pierre-Louis Bossart [Mon, 25 Oct 2021 18:59:26 +0000 (13:59 -0500)]
ASoC: topology: handle endianness warning

Sparse reports the following warning:

sound/soc/soc-topology.c:1488:26: error: restricted __le32 degrades to
integer

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge series "ASoC: cs42l42: Fixes to power-down" from Richard Fitzgerald <rf@opensou...
Mark Brown [Tue, 26 Oct 2021 19:00:42 +0000 (20:00 +0100)]
Merge series "ASoC: cs42l42: Fixes to power-down" from Richard Fitzgerald <rf@opensource.cirrus.com>:

Driver probe and remove were inconsistent in what they did to power-down
and neither did all steps. In addition to that, neither function
prevented the interrupt handler from running during and after power-down.

Richard Fitzgerald (2):
  ASoC: cs42l42: Reset and power-down on remove() and failed probe()
  ASoC: cs42l42: free_irq() before powering-down on probe() fail

 sound/soc/codecs/cs42l42.c | 43 +++++++++++++++++++++++++++++++------------
 1 file changed, 31 insertions(+), 12 deletions(-)

--
2.11.0

2 years agoMerge series "Update Lpass digital codec macro drivers" from Srinivasa Rao Mandadapu...
Mark Brown [Tue, 26 Oct 2021 19:00:40 +0000 (20:00 +0100)]
Merge series "Update Lpass digital codec macro drivers" from Srinivasa Rao Mandadapu <srivasam@codeaurora.org>:

This patch set is to add support for lpass sc7280 based targets.
Upadate compatible name and change of bulk clock voting to optional
clock voting in digital codecs va, rx, tx macro drivers.

Changes Since V3:
    -- Removed fixes tag.
    -- Change signedoff by sequence.
Changes Since V2:
    -- Add Tx macro deafults for lpass sc7280
Changes Since V1:
    -- Removed individual clock voting and used bulk clock optional.
    -- Removed volatile changes and fixed default values.
    -- Typo errors.
Srinivasa Rao Mandadapu (5):
  ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for
    sc7280
  ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital
    codecs
  ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
  ASoC: codecs: tx-macro: Update tx default values
  ASoC: codecs: Change bulk clock voting to optional voting in digital
    codecs

 .../bindings/sound/qcom,lpass-rx-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-tx-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-va-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-wsa-macro.yaml       |  4 +++-
 sound/soc/codecs/lpass-rx-macro.c                  |  3 ++-
 sound/soc/codecs/lpass-tx-macro.c                  | 25 +++++++++++++++++++---
 sound/soc/codecs/lpass-va-macro.c                  |  3 ++-
 sound/soc/codecs/lpass-wsa-macro.c                 |  1 +
 8 files changed, 39 insertions(+), 9 deletions(-)

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

2 years agoMerge series "ASoC: qcom: Add AudioReach support" from Srinivas Kandagatla <srinivas...
Mark Brown [Tue, 26 Oct 2021 19:00:39 +0000 (20:00 +0100)]
Merge series "ASoC: qcom: Add AudioReach support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

Hi Mark,

This version is a respin of v10 fixing a build error in 12/17 patch.

QCOM SoC relevant non-audio patches in this series has been merged into
the Qualcomm drivers-for-5.16 tree, as this series depends those patches
an immutable tag is available at:
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/20210927135559.738-6-srinivas.kandagatla@linaro.org

This patchset adds ASoC driver support to configure signal processing
framework ("AudioReach") which is integral part of Qualcomm next
generation audio SDK and will be deployed on upcoming Qualcomm chipsets.
It makes use of ASoC Topology to load graphs on to the DSP which is then
managed by APM (Audio Processing Manager) service to prepare/start/stop.

Here is simplified high-level block diagram of AudioReach:

 ___________________________________________________________
|                 CPU (Application Processor)               |
|  +---------+          +---------+         +----------+    |
|  |  q6apm  |          |  q6apm  |         |  q6apm   |    |
|  |   dais  | <------> |         | <-----> |lpass-dais|    |
|  +---------+          +---------+         +----------+    |
|                            ^  ^                           |
|                            |  |           +---------+     |
|  +---------+               v  +---------->|topology |     |
|  | q6prm   |          +---------+         |         |     |
|  |         |<-------->|   GPR   |         +---------+     |
|  +---------+          +---------+                         |
|       ^                    ^                              |
|       |                    |                              |
|  +----------+              |                              |
|  |   q6prm  |              |                              |
|  |lpass-clks|              |                              |
|  +----------+              |                              |
|____________________________|______________________________|
                             |
                             | RPMSG (IPC over GLINK)
 ____________________________|______________________________
|                            |                              |
|    +-----------------------+                              |
|    |                       |                              |
|    v                       v              q6 (Audio DSP)  |
|+-----+    +----------------------------------+            |
|| PRM |    | APM (Audio Processing Manager)   |            |
|+-----+    |  . Graph Management              |            |
|           |  . Command Handing               |            |
|           |  . Event Management              |            |
|           |  ...                             |            |
|           +----------------------------------+            |
|                            ^                              |
|____________________________|______________________________|
                             |
                             |   LPASS AIF
 ____________________________|______________________________
|                            |            Audio I/O         |
|                            v                              |
|    +--------------------------------------------------+   |
|    |                Audio devices                     |   |
|    | CODEC | HDMI-TX | PCM  | SLIMBUS | I2S |MI2S |...|   |
|    |                                                  |   |
|    +--------------------------------------------------+   |
|___________________________________________________________|

AudioReach has constructs of sub-graph, container and modules.
Each sub-graph can have N containers and each Container can have N Modules
and connections between them can be linear or non-linear.
An audio function can be realized with one or many connected
sub-graphs. There are also control/event paths between modules that can
be wired up while building graph to achieve various control mechanism
between modules. These concepts of Sub-Graph, Containers and Modules
are represented in ASoC topology.

Here is simple I2S graph with a Write Shared Memory and a
Volume control module within a single Subgraph (1) with one Container (1)
and 5 modules.

  ____________________________________________________________
 |                        Sub-Graph [1]                       |
 |  _______________________________________________________   |
 | |                       Container [1]                   |  |
 | | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]-> [I2S-EP]|  |
 | |_______________________________________________________|  |
 |____________________________________________________________|

For now this graph is split into two subgraphs to achieve dpcm like below:
 ________________________________________________    _________________
|                Sub-Graph [1]                   |  |  Sub-Graph [2]  |
|  ____________________________________________  |  |  _____________  |
| |              Container [1]                 | |  | |Container [2]| |
| | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]| |  | |   [I2S-EP]  | |
| |____________________________________________| |  | |_____________| |
|________________________________________________|  |_________________|

                                                      _________________
                                                    |  Sub-Graph [3]  |
                                                    |  _____________  |
                                                    | |Container [3]| |
                                                    | |  [DMA-EP]   | |
                                                    | |_____________| |
                                                    |_________________|

This patchset adds very minimal support for AudioReach which includes
supporting sub-graphs containing CODEC DMA ports and simple PCM
Decoder/Encoder and Logger Modules. Additional capabilities will
be built over time to expose features offered by AudioReach.

This patchset is Tested on SM8250 SoC based Qualcomm Robotics Platform RB5
and SM9250 MTP with WSA881X Smart Speaker Amplifiers, DMICs connected via
VA Macro and WCD938x Codec connected via TX and RX Macro and HDMI audio
via I2S.

First 10 Patches are mostly reorganization existing Old QDSP Audio
Framework code and bindings so that we could reuse them on AudioReach.

ASoC topology graphs for DragonBoard RB5 and SM8250 MTP are available at
https://git.linaro.org/people/srinivas.kandagatla/audioreach-topology.git/
and Qualcomm AudioReach DSP headers are available at:
https://source.codeaurora.org/quic/la/platform/vendor/opensource/arspf-headers

Note: There is one false positive warning in this patchset:
audioreach.c:80:45: warning: array of flexible structures

Thanks,
srini

Changes since v10:
- fix build error during arm64 defconfig build reported by Mark in 12/17 patch
for audioreach_tplg_init symbol

Srinivas Kandagatla (17):
  ASoC: dt-bindings: move LPASS dai related bindings out of q6afe
  ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe
  ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h
  ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file
  ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file
  ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible
  ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible
  ASoC: dt-bindings: add q6apm digital audio stream bindings
  ASoC: qdsp6: audioreach: add basic pkt alloc support
  ASoC: qdsp6: audioreach: add q6apm support
  ASoC: qdsp6: audioreach: add module configuration command helpers
  ASoC: qdsp6: audioreach: add Kconfig and Makefile
  ASoC: qdsp6: audioreach: add topology support
  ASoC: qdsp6: audioreach: add q6apm-dai support
  ASoC: qdsp6: audioreach: add q6apm lpass dai support
  ASoC: qdsp6: audioreach: add q6prm support
  ASoC: qdsp6: audioreach: add support for q6prm-clocks

 .../devicetree/bindings/sound/qcom,q6afe.txt  |  181 ---
 .../bindings/sound/qcom,q6apm-dai.yaml        |   53 +
 .../sound/qcom,q6dsp-lpass-clocks.yaml        |   77 ++
 .../sound/qcom,q6dsp-lpass-ports.yaml         |  205 +++
 include/dt-bindings/sound/qcom,q6afe.h        |  203 +--
 .../sound/qcom,q6dsp-lpass-ports.h            |  208 +++
 include/uapi/sound/snd_ar_tokens.h            |  208 +++
 sound/soc/qcom/Kconfig                        |   22 +
 sound/soc/qcom/qdsp6/Makefile                 |   11 +-
 sound/soc/qcom/qdsp6/audioreach.c             | 1130 +++++++++++++++++
 sound/soc/qcom/qdsp6/audioreach.h             |  726 +++++++++++
 sound/soc/qcom/qdsp6/q6afe-clocks.c           |  187 +--
 sound/soc/qcom/qdsp6/q6afe-dai.c              |  687 +---------
 sound/soc/qcom/qdsp6/q6apm-dai.c              |  416 ++++++
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c       |  260 ++++
 sound/soc/qcom/qdsp6/q6apm.c                  |  822 ++++++++++++
 sound/soc/qcom/qdsp6/q6apm.h                  |  152 +++
 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c     |  186 +++
 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h     |   30 +
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c      |  627 +++++++++
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h      |   22 +
 sound/soc/qcom/qdsp6/q6prm-clocks.c           |   85 ++
 sound/soc/qcom/qdsp6/q6prm.c                  |  202 +++
 sound/soc/qcom/qdsp6/q6prm.h                  |   78 ++
 sound/soc/qcom/qdsp6/topology.c               | 1113 ++++++++++++++++
 25 files changed, 6664 insertions(+), 1227 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml
 create mode 100644 include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
 create mode 100644 include/uapi/sound/snd_ar_tokens.h
 create mode 100644 sound/soc/qcom/qdsp6/audioreach.c
 create mode 100644 sound/soc/qcom/qdsp6/audioreach.h
 create mode 100644 sound/soc/qcom/qdsp6/q6apm-dai.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6apm.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h
 create mode 100644 sound/soc/qcom/qdsp6/q6prm-clocks.c
 create mode 100644 sound/soc/qcom/qdsp6/q6prm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6prm.h
 create mode 100644 sound/soc/qcom/qdsp6/topology.c

--
2.21.0

2 years agoASoC: amd: acp: SND_SOC_AMD_ACP_COMMON should depend on X86 && PCI
Geert Uytterhoeven [Tue, 26 Oct 2021 15:11:23 +0000 (17:11 +0200)]
ASoC: amd: acp: SND_SOC_AMD_ACP_COMMON should depend on X86 && PCI

All configuration symbols for AMD Audio ACP conponents depend on X86 &&
PCI, except for SND_SOC_AMD_ACP_COMMON.  Add a dependency on X86 && PCI
to SND_SOC_AMD_ACP_COMMON, to prevent asking the user about AMD Audio
ACP support when configuring a kernel without X86 or PCI support.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/30fcedce513186bf89f1f2655b665298250fdc66.1635260849.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: SND_SOC_AMD_{LEGACY_MACH,SOF_MACH} should depend on X86 && PCI &...
Geert Uytterhoeven [Tue, 26 Oct 2021 15:11:22 +0000 (17:11 +0200)]
ASoC: amd: acp: SND_SOC_AMD_{LEGACY_MACH,SOF_MACH} should depend on X86 && PCI && I2C

If not all of CONFIG_X86, CONFIG_PCI, and CONFIG_I2C are set:

    WARNING: unmet direct dependencies detected for SND_SOC_AMD_MACH_COMMON
      Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && X86 && PCI [=y] && I2C [=y]
      Selected by [y]:
      - SND_SOC_AMD_LEGACY_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y]
      - SND_SOC_AMD_SOF_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y]

As SND_SOC_AMD_MACH_COMMON depends on X86 && PCI && I2C, all symbols
selecting it should depend on X86 && PCI && I2C, too.

Fixes: 9d8a7be88b3365e4 ("ASoC: amd: acp: Add legacy sound card support for Chrome audio")
Fixes: 9f84940f5004e1d2 ("ASoC: amd: acp: Add SOF audio support on Chrome board")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/dfb03bd33117e26f3f04ce227bb28095109b3d80.1635260849.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Wrap AMD Audio ACP components in SND_SOC_AMD_ACP_COMMON
Geert Uytterhoeven [Tue, 26 Oct 2021 15:11:21 +0000 (17:11 +0200)]
ASoC: amd: acp: Wrap AMD Audio ACP components in SND_SOC_AMD_ACP_COMMON

The build only descends into sound/soc/amd/acp/ if
CONFIG_SND_SOC_AMD_ACP_COMMON=y.  Hence all later config symbols should
depend on SND_SOC_AMD_ACP_COMMON, to prevent asking the user about
config symbols for driver code that won't be build anyway.

Fixes: 623621a9f9e1a2f4 ("ASoC: amd: Add common framework to support I2S on ACP SOC")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/53d1d63bed1865293e6f5085ead21cdbb068fb15.1635260849.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs42l42: free_irq() before powering-down on probe() fail
Richard Fitzgerald [Tue, 26 Oct 2021 12:57:22 +0000 (13:57 +0100)]
ASoC: cs42l42: free_irq() before powering-down on probe() fail

Relying on devm to free the irq handler on probe failure leaves a
small window of opportunity for an interrupt to become pending and
then the handler to run after the chip has been reset and powered
off.

For safety cs42l42_probe() should free the irq in the error path.
As the irq is now disabled by the driver in probe() and remove()
there is no point allocating it as a devres-managed item, so
convert to plain non-devres.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211026125722.10220-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs42l42: Reset and power-down on remove() and failed probe()
Richard Fitzgerald [Tue, 26 Oct 2021 12:57:21 +0000 (13:57 +0100)]
ASoC: cs42l42: Reset and power-down on remove() and failed probe()

Driver remove() should assert RESET and disable the supplies.

probe() fail was disabling supplies but it didn't assert reset or
put the codec into a power-down state.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211026125722.10220-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add support for q6prm-clocks
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:55 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add support for q6prm-clocks

Add q6prm clocks using existing qdsp6-audio-clock driver

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-18-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add q6prm support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:54 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add q6prm support

Add support to q6prm (Proxy Resource Manager) module used for clock resources

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-17-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add q6apm lpass dai support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:53 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add q6apm lpass dai support

Add support to Audio port dais on LPASS Audio IP using
existing common q6dsp-lpass-ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-16-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add q6apm-dai support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:52 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add q6apm-dai support

Add support to pcm dais in Audio Process Manager.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-15-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add topology support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:51 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add topology support

Add ASoC topology support in audioreach

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-14-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add Kconfig and Makefile
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:50 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add Kconfig and Makefile

Now that all the code for audioreach and q6apm are in at this point to be
able to compile, start adding Kconfig and Makefile changes.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-13-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add module configuration command helpers
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:49 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add module configuration command helpers

Audioreach module configuration helpers, which will be used by
the q6apm-dai driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-12-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add q6apm support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:48 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add q6apm support

Add support to q6apm (Audio Process Manager) component which is
core Audioreach service running in the DSP.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-11-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: audioreach: add basic pkt alloc support
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:47 +0000 (12:16 +0100)]
ASoC: qdsp6: audioreach: add basic pkt alloc support

Add basic helper functions for AudioReach.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: add q6apm digital audio stream bindings
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:46 +0000 (12:16 +0100)]
ASoC: dt-bindings: add q6apm digital audio stream bindings

On AudioReach audio Framework, Audio Streams (PCM/Compressed) are managed by
Q6APM(Audio Process Manager) service. This patch adds bindings for this DAIs
exposed by the DSP.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:45 +0000 (12:16 +0100)]
ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible

On AudioReach audio Framework access to LPASS ports is via Q6PRM
(Proxy Resource Manager) service, so add a dedicated lpass-clock compatible
string for this.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:44 +0000 (12:16 +0100)]
ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible

on AudioReach audio Framework access to LPASS ports is via
Q6APM(Audio Process Manager) service, so add a dedicated compatible
string for this.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: q6afe-clocks: move audio-clocks to common file
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:43 +0000 (12:16 +0100)]
ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file

Move common parts of  q6afe-clocks to q6dsp-lpass-clocks so that we could
reuse most of the driver for new Q6DSP audio frameworks.

This is to make the code reuseable for new Q6DSP AudioReach framework.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qdsp6: q6afe-dai: move lpass audio ports to common file
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:42 +0000 (12:16 +0100)]
ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file

Various Q6DSP frameworks will use LPASS Audio IP, so move all the hardware
specific details to a common file so that they could be reused across
multiple Q6DSP frameworks.

In this case all the audio ports definitions can be moved to a common file
to be able to reuse across multiple Q6DSP frameworks.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211026111655.1702-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:41 +0000 (12:16 +0100)]
ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h

move all LPASS audio ports defines from q6afe.h to q6dsp-lpass-ports.h
as these belong to LPASS IP.
Also this move helps in reusing this header across multiple audio
frameworks on Qualcomm Audio DSP.

This patch is split out of the dt-bindings patch to enable easy review.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: move LPASS clocks related bindings out of q6afe
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:40 +0000 (12:16 +0100)]
ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe

q6afe (Audio Front End) is one of the DSP service that handles both
LPASS (Low Power Audio SubSystem) Audio ports and LPASS clocks.
As LPASS is a hardwware IP and commonly used by Qualcomm Audio DSP.
In order to allow  multiple DSP frameworks to use these bindings
its best to move it out from the dsp specific bindings.

For compatibility reasons and not breaking which is already working
we still maintain same compatible string "qcom,q6afe-clocks"

Also as part of this change convert these LPASS clocks related bindings
into yaml format.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: move LPASS dai related bindings out of q6afe
Srinivas Kandagatla [Tue, 26 Oct 2021 11:16:39 +0000 (12:16 +0100)]
ASoC: dt-bindings: move LPASS dai related bindings out of q6afe

q6afe (Audio Front End) is one of the DSP service that handles both
LPASS (Low Power Audio SubSystem) Audio ports and LPASS clocks.
As LPASS is a hardwware IP and commonly used by Qualcomm Audio DSP.
In order to allow  multiple DSP frameworks to use these bindings
its best to move it out from the dsp specific bindings.

For compatibility reasons and not breaking which is already working
we still maintain same compatible string "qcom,q6afe-dais"

Also as part of this change convert these LPASS dai related bindings
into yaml format.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211026111655.1702-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge tag '20210927135559.738-6-srinivas.kandagatla@linaro.org' of https://git.kernel...
Mark Brown [Tue, 26 Oct 2021 12:49:20 +0000 (13:49 +0100)]
Merge tag '20210927135559.738-6-srinivas.kandagatla@linaro.org' of https://git./linux/kernel/git/qcom/linux into v11_20211026_srinivas_kandagatla_asoc_qcom_add_audioreach_support for audioreach support

v5.15-rc1 + 20210927135559.738-[23456]-srinivas.kandagatla@linaro.org

This immutable branch is based on v5.15-rc1 and contains the following
patches extending the existig APR driver to also implement GPR:
20210927135559.738-2-srinivas.kandagatla@linaro.org
20210927135559.738-3-srinivas.kandagatla@linaro.org
20210927135559.738-4-srinivas.kandagatla@linaro.org
20210927135559.738-5-srinivas.kandagatla@linaro.org
20210927135559.738-6-srinivas.kandagatla@linaro.org

2 years agoASoC: codecs: Change bulk clock voting to optional voting in digital codecs
Srinivasa Rao Mandadapu [Tue, 26 Oct 2021 07:43:08 +0000 (13:13 +0530)]
ASoC: codecs: Change bulk clock voting to optional voting in digital codecs

Change bulk clock frequency voting to optional bulk voting in va, rx and tx macros
to accommodate both ADSP and ADSP bypass based lpass architectures.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1635234188-7746-6-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: tx-macro: Update tx default values
Srinivasa Rao Mandadapu [Tue, 26 Oct 2021 07:43:07 +0000 (13:13 +0530)]
ASoC: codecs: tx-macro: Update tx default values

Update mic control register default values to hardware reset values
lpass sc7280.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1635234188-7746-5-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: tx-macro: Enable tx top soundwire mic clock
Srinivasa Rao Mandadapu [Tue, 26 Oct 2021 07:43:06 +0000 (13:13 +0530)]
ASoC: codecs: tx-macro: Enable tx top soundwire mic clock

Enable tx path soundwire mic0 and mic1 clock.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1635234188-7746-4-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital codecs
Srinivasa Rao Mandadapu [Tue, 26 Oct 2021 07:43:05 +0000 (13:13 +0530)]
ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital codecs

Update compatible names in va, wsa, rx and tx macro codes for lpass sc7280

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1635234188-7746-3-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for sc7280
Srinivasa Rao Mandadapu [Tue, 26 Oct 2021 07:43:04 +0000 (13:13 +0530)]
ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for sc7280

Add compatible names for sc7280 based targets in digital codec drivers
va,wsa,rx and tx.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1635234188-7746-2-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: nau8825: add clock management for power saving
David Lin [Mon, 25 Oct 2021 11:38:58 +0000 (19:38 +0800)]
ASoC: nau8825: add clock management for power saving

Adjust dapm widget to manage clock from power event for power saving.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/20211025113857.3860951-3-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: nau8825: add set_jack coponment support
David Lin [Mon, 25 Oct 2021 11:38:57 +0000 (19:38 +0800)]
ASoC: nau8825: add set_jack coponment support

Use set_jack ops to set jack for new machine drivers. Meanwhile,
the old machine drivers can still call previous export function
"nau8825_enable_jack_detect".

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/20211025113857.3860951-2-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: topology: Fix stub for snd_soc_tplg_component_remove()
Mark Brown [Mon, 25 Oct 2021 15:48:44 +0000 (16:48 +0100)]
ASoC: topology: Fix stub for snd_soc_tplg_component_remove()

When removing the index argument from snd_soc_topology_component_remove()
commit a5b8f71c5477f (ASoC: topology: Remove multistep topology loading)
forgot to update the stub for !SND_SOC_TOPOLOGY use, causing build failures
for anything that tries to make use of it.

Fixes: a5b8f71c5477f (ASoC: topology: Remove multistep topology loading)
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211025154844.2342120-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: common: Respect status = "disabled" on DAI link nodes
Stephan Gerhold [Mon, 25 Oct 2021 10:55:03 +0000 (12:55 +0200)]
ASoC: qcom: common: Respect status = "disabled" on DAI link nodes

At the moment, the DAI link nodes in the device tree always have to be
specified completely in each device tree. However, the available
interfaces (e.g. Primary/Secondary/Tertiary/Quaternary MI2S) are common
for all devices of a SoC, so the majority of the definitions can be
placed in a common device tree include to reduce boilerplate.

Make it possible to define such stubs in device tree includes by
respecting the "status" property for the DAI link nodes. This is
a trivial change that just requires switching to the _available_
OF functions that check the "status" property additionally.

This allows defining a stub like:

sound_dai_quaternary: dai-link-quaternary {
link-name = "Quaternary MI2S";
status = "disabled"; /* Needs extra codec configuration */
cpu {
sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
};
platform {
sound-dai = <&q6routing>;
};
};

where the codec would be filled in by the device-specific device tree.

For existing device trees this change does not make any difference.
A missing "status" property is treated like status = "okay".

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211025105503.49444-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: lpass: add binding headers for digital codecs
Srinivasa Rao Mandadapu [Fri, 8 Oct 2021 05:21:31 +0000 (10:51 +0530)]
ASoC: dt-bindings: lpass: add binding headers for digital codecs

Add header defining for lpass internal digital codecs rx,tx and va
dai node id's.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1633670491-27432-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge series "ASoC: wm8962: Conversion to json-schema and fix" from Geert Uytterhoeve...
Mark Brown [Mon, 25 Oct 2021 16:37:51 +0000 (17:37 +0100)]
Merge series "ASoC: wm8962: Conversion to json-schema and fix" from Geert Uytterhoeven <geert+renesas@glider.be>:

Hi all,

This patch series converts the Wolfson WM8962 Device Tree binding
documentation to json-schema, after fixing an issue in the imx8mn-beacon
DTS file.

Thanks for your comments!

Geert Uytterhoeven (2):
  arm64: dts: imx: imx8mn-beacon: Drop undocumented clock-names
    reference
  ASoC: dt-bindings: wlf,wm8962: Convert to json-schema

 .../devicetree/bindings/sound/wlf,wm8962.yaml | 118 ++++++++++++++++++
 .../devicetree/bindings/sound/wm8962.txt      |  43 -------
 .../freescale/imx8mn-beacon-baseboard.dtsi    |   1 -
 3 files changed, 118 insertions(+), 44 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/wlf,wm8962.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/wm8962.txt

--
2.25.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

2 years agoASoC: dt-bindings: wlf,wm8962: Convert to json-schema
Geert Uytterhoeven [Mon, 18 Oct 2021 13:59:03 +0000 (15:59 +0200)]
ASoC: dt-bindings: wlf,wm8962: Convert to json-schema

Convert the Wolfson WM8962 Ultra-Low Power Stereo CODEC Device Tree
binding documentation to json-schema.

Add missing *-supply and port properties.
Update the example.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/b0868d2f62fd57499c79d96298e99e5f9e4fbc76.1634565154.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs42l42: Prevent NULL pointer deref in interrupt handler
Richard Fitzgerald [Mon, 25 Oct 2021 11:22:58 +0000 (12:22 +0100)]
ASoC: cs42l42: Prevent NULL pointer deref in interrupt handler

The interrupt handling code was getting the struct device* from a
struct snd_soc_component* stored in struct cs42l42_private. If the
interrupt was asserted before ASoC calls component_probe() the
snd_soc_component* will be NULL.

The stored snd_soc_component* is not actually used for anything other
than indirectly getting the struct device*. Remove it, and store the
struct device* in struct cs42l42_private.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211025112258.9282-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: wm8962: Convert to devm_clk_get_optional()
Geert Uytterhoeven [Mon, 18 Oct 2021 14:01:11 +0000 (16:01 +0200)]
ASoC: wm8962: Convert to devm_clk_get_optional()

Use the existing devm_clk_get_optional() helper instead of building a
similar construct on top of devm_clk_get() that fails to handle all
errors but -EPROBE_DEFER.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/c2a8a1a628804a4439732d02847e25c227083690.1634565564.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fix unmet dependency on GPIOLIB for SND_SOC_MAX98357A
Julian Braha [Mon, 25 Oct 2021 01:06:15 +0000 (21:06 -0400)]
ASoC: fix unmet dependency on GPIOLIB for SND_SOC_MAX98357A

When SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH is selected,
and GPIOLIB is not selected, Kbuild gives the
following warnings:

WARNING: unmet direct dependencies detected for SND_SOC_MAX98357A
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_INTEL_DA7219_MAX98357A_GENERIC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y]

WARNING: unmet direct dependencies detected for SND_SOC_DMIC
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_INTEL_DA7219_MAX98357A_GENERIC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y]

WARNING: unmet direct dependencies detected for SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] && SND_SOC_INTEL_KBL [=y] && I2C [=y] && ACPI [=y] && (MFD_INTEL_LPSS [=y] || COMPILE_TEST [=n])

This is because SND_SOC_DMIC and SND_SOC_MAX98357A are
selected by SND_SOC_INTEL_DA7219_MAX98357A_GENERIC, which
is also selected by SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH.
However, the selectors do not depend on or select GPIOLIB,
despite SND_SOC_DMIC and SND_SOC_MAX98357A depending on GPIOLIB.

These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://lore.kernel.org/r/20211025010615.10070-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs35l41: Make cs35l41_remove() return void
Uwe Kleine-König [Wed, 20 Oct 2021 13:24:16 +0000 (15:24 +0200)]
ASoC: cs35l41: Make cs35l41_remove() return void

Up to now cs35l41_remove() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211020132416.30288-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoc: wm8900: Drop empty spi_driver remove callback
Uwe Kleine-König [Wed, 20 Oct 2021 12:57:26 +0000 (14:57 +0200)]
ASoc: wm8900: Drop empty spi_driver remove callback

A driver with a remove callback that just returns 0 behaves identically
to a driver with no remove callback at all. So simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211020125726.22946-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: tegra: Set default card name for Trimslice
Dmitry Osipenko [Sun, 24 Oct 2021 19:28:53 +0000 (22:28 +0300)]
ASoC: tegra: Set default card name for Trimslice

The default card name for Trimslice device should be "tegra-trimslice".
It got lost by accident during unification of machine sound drivers,
fix it.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f56039 ("ASoC: tegra: Unify ASoC machine drivers")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211024192853.21957-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: tegra: Restore AC97 support
Dmitry Osipenko [Sun, 24 Oct 2021 19:28:52 +0000 (22:28 +0300)]
ASoC: tegra: Restore AC97 support

The device-tree of AC97 codecs need to be parsed differently from I2S
codecs, plus codec device may need to be created. This was missed by the
patch that unified machine drivers into a single driver, fix it. It should
restore audio on Toradex Colibri board.

Cc: <stable@vger.kernel.org>
Fixes: cc8f70f56039 ("ASoC: tegra: Unify ASoC machine drivers")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211024192853.21957-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoc: wm8731: Drop empty spi_driver remove callback
Uwe Kleine-König [Wed, 20 Oct 2021 12:58:03 +0000 (14:58 +0200)]
ASoc: wm8731: Drop empty spi_driver remove callback

A driver with a remove callback that just returns 0 behaves identically
to a driver with no remove callback at all. So simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211020125803.23117-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: doc: update codec example code
John Keeping [Sun, 24 Oct 2021 15:17:31 +0000 (16:17 +0100)]
ASoC: doc: update codec example code

As the codec API has evolved the documentation has not kept up and still
uses old fields that have been removed.  Update the examples to
represent the current API.

Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20211024151731.360638-1-john@metanate.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add acp_machine struct for renoir platform.
Ajit Kumar Pandey [Mon, 25 Oct 2021 07:48:00 +0000 (13:18 +0530)]
ASoC: amd: acp: Add acp_machine struct for renoir platform.

Add acpi_mach struct for renoir platform to select machine driver
based on codec and amp ACPI id.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211025074808.471333-1-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge series "ASoC: Add common modules support for ACP hw block" from Ajit Kumar...
Mark Brown [Sat, 23 Oct 2021 16:30:02 +0000 (17:30 +0100)]
Merge series "ASoC: Add common modules support for ACP hw block" from Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>:

changes since v3:
- rebase and fixes merge conflict.
- Fixed kernel autobot warning.

Ajit Kumar Pandey (8):
  ASoC: amd: Add common framework to support I2S on ACP SOC
  ASoC: amd: acp: Add I2S support on Renoir platform
  ASoC: amd: acp: Add callback for machine driver on ACP
  ASoC: amd: acp: Add generic machine driver support for ACP cards
  ASoC: amd: acp: Add legacy sound card support for Chrome audio
  ASoC: amd: acp: Add SOF audio support on Chrome board
  ASoC: amd: acp: Add support for Maxim amplifier codec
  ASoC: amd: acp: Add support for RT5682-VS codec

 sound/soc/amd/Kconfig                |   2 +
 sound/soc/amd/Makefile               |   1 +
 sound/soc/amd/acp/Kconfig            |  51 +++
 sound/soc/amd/acp/Makefile           |  26 ++
 sound/soc/amd/acp/acp-i2s.c          | 340 +++++++++++++++
 sound/soc/amd/acp/acp-legacy-mach.c  | 104 +++++
 sound/soc/amd/acp/acp-mach-common.c  | 600 +++++++++++++++++++++++++++
 sound/soc/amd/acp/acp-mach.h         |  57 +++
 sound/soc/amd/acp/acp-platform.c     | 315 ++++++++++++++
 sound/soc/amd/acp/acp-renoir.c       | 144 +++++++
 sound/soc/amd/acp/acp-sof-mach.c     | 131 ++++++
 sound/soc/amd/acp/amd.h              | 146 +++++++
 sound/soc/amd/acp/chip_offset_byte.h |  76 ++++
 13 files changed, 1993 insertions(+)
 create mode 100644 sound/soc/amd/acp/Kconfig
 create mode 100644 sound/soc/amd/acp/Makefile
 create mode 100644 sound/soc/amd/acp/acp-i2s.c
 create mode 100644 sound/soc/amd/acp/acp-legacy-mach.c
 create mode 100644 sound/soc/amd/acp/acp-mach-common.c
 create mode 100644 sound/soc/amd/acp/acp-mach.h
 create mode 100644 sound/soc/amd/acp/acp-platform.c
 create mode 100644 sound/soc/amd/acp/acp-renoir.c
 create mode 100644 sound/soc/amd/acp/acp-sof-mach.c
 create mode 100644 sound/soc/amd/acp/amd.h
 create mode 100644 sound/soc/amd/acp/chip_offset_byte.h

--
2.25.1

2 years agoMerge series "Add Yellow Carp platform ASoC driver" from Vijendar Mukunda <Vijendar...
Mark Brown [Sat, 23 Oct 2021 16:29:20 +0000 (17:29 +0100)]
Merge series "Add Yellow Carp platform ASoC driver" from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

Yellow Carp platform is new APU series based on acp6.x design.
This patch set adds an ASoC driver for the ACP (Audio CoProcessor)
block on AMD Yellow Carp APU with DMIC endpoint support.

changes since v1:
  - fixed SPDX commenting style in acp6x pci driver.
  - fixed Copyright commenting style in acp6x pci driver,
    pdm dma driver and machine driver files.
  - fixed local variable check logic in acp6x_power_on() function.
  - fixed Kconfig indentation issue
  - removed irq_flag local variable in irq handler.
  - add dmi info check in machine driver probe

Vijendar Mukunda (13):
  ASoC: amd: add Yellow Carp ACP6x IP register header
  ASoC: amd: add Yellow Carp ACP PCI driver
  ASoC: amd: add acp6x init/de-init functions
  ASoC: amd: add platform devices for acp6x pdm driver and dmic driver
  ASoC: amd: add acp6x pdm platform driver
  ASoC: amd: add acp6x irq handler
  ASoC: amd: add acp6x pdm driver dma ops
  ASoC: amd: add acp6x pci driver pm ops
  ASoC: amd: add acp6x pdm driver pm ops
  ASoC: amd: enable Yellow carp acp6x drivers build
  ASoC: amd: create platform device for acp6x machine driver
  ASoC: amd: add YC machine driver using dmic
  ASoC: amd: enable Yellow Carp platform machine driver build

 sound/soc/amd/Kconfig                     |  21 +
 sound/soc/amd/Makefile                    |   1 +
 sound/soc/amd/yc/Makefile                 |   9 +
 sound/soc/amd/yc/acp6x-mach.c             | 194 ++++++++++
 sound/soc/amd/yc/acp6x-pdm-dma.c          | 448 ++++++++++++++++++++++
 sound/soc/amd/yc/acp6x.h                  | 107 ++++++
 sound/soc/amd/yc/acp6x_chip_offset_byte.h | 444 +++++++++++++++++++++
 sound/soc/amd/yc/pci-acp6x.c              | 338 ++++++++++++++++
 8 files changed, 1562 insertions(+)
 create mode 100644 sound/soc/amd/yc/Makefile
 create mode 100644 sound/soc/amd/yc/acp6x-mach.c
 create mode 100644 sound/soc/amd/yc/acp6x-pdm-dma.c
 create mode 100644 sound/soc/amd/yc/acp6x.h
 create mode 100644 sound/soc/amd/yc/acp6x_chip_offset_byte.h
 create mode 100644 sound/soc/amd/yc/pci-acp6x.c

--
2.25.1

2 years agoMerge series "ASoC: meson: axg: fix TDM channel order sync" from Jerome Brunet <jbrun...
Mark Brown [Sat, 23 Oct 2021 13:32:19 +0000 (14:32 +0100)]
Merge series "ASoC: meson: axg: fix TDM channel order sync" from Jerome Brunet <jbrunet@baylibre.com>:

On the Amlogic AXG series, the TODDR FIFO may get out of sync with the TDM
decoder if the decoder is started before the FIFO. The channel appears
shifted in memory in an unpredictable way.

To fix this, the trick is to start the FIFO before the TDM decoder. This
way the FIFO is already waiting when the 1st channel is produced and it is
correctly placed in memory.

Jerome Brunet (2):
  ASoC: meson: axg-card: make links nonatomic
  ASoC: meson: axg-tdm-interface: manage formatters in trigger

 sound/soc/meson/axg-card.c          |  1 +
 sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

--
2.33.0

2 years agoASoC: rt5682s: Downsizing the DAC volume scale
Derek Fang [Thu, 21 Oct 2021 12:03:03 +0000 (20:03 +0800)]
ASoC: rt5682s: Downsizing the DAC volume scale

Use 0.75db/step of DAC volume instead of 1.5 to get
a more smooth volume curve.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211021120303.4601-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: meson: axg-tdm-interface: manage formatters in trigger
Jerome Brunet [Wed, 20 Oct 2021 11:42:17 +0000 (13:42 +0200)]
ASoC: meson: axg-tdm-interface: manage formatters in trigger

So far, the formatters have been reset/enabled using the .prepare()
callback. This was done in this callback because walking the formatters use
a mutex so it could not be done in .trigger(), which is atomic by default.

It turns out there is a problem on capture path of the AXG series.
The FIFO may get out of sync with the TDM decoder if the IP are not enabled
in a specific order. The FIFO must be enabled before the formatter starts
producing data. IOW, we must deal with FE before the BE. The .prepare()
callback is called on the BEs before the FE so it is not OK for the AXG.

The .trigger() callback order can be configured, and it deals with the FE
before the BEs by default. To solve our problem, we just need to start and
stop the formatters from the .trigger() callback. It is OK do so now that
the links have been made 'nonatomic' in the card driver.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20211020114217.133153-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: meson: axg-card: make links nonatomic
Jerome Brunet [Wed, 20 Oct 2021 11:42:16 +0000 (13:42 +0200)]
ASoC: meson: axg-card: make links nonatomic

Non atomic operations need to be performed in the trigger callback
of the TDM interfaces. Those are BEs but what matters is the nonatomic
flag of the FE in the DPCM context. Just set nonatomic for everything so,
at least, it is clear.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20211020114217.133153-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: cs42l42: Remove unused runtime_suspend/runtime_resume callbacks
Richard Fitzgerald [Mon, 18 Oct 2021 16:44:31 +0000 (17:44 +0100)]
ASoC: cs42l42: Remove unused runtime_suspend/runtime_resume callbacks

The driver has runtime_suspend and runtime_resume callbacks, but
pm_runtime is never enabled so these functions won't be called. They
could not be used anyway because the runtime_suspend would cause jack
detect to stop working.

These functions are unused - delete them.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211018164431.5871-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fix unmet dependency on GPIOLIB
Julian Braha [Sun, 10 Oct 2021 21:56:27 +0000 (17:56 -0400)]
ASoC: fix unmet dependency on GPIOLIB

When SND_SOC_SC7180 or SND_SOC_STORM is selected,
and GPIOLIB is not selected, Kbuild gives the following
warning:

WARNING: unmet direct dependencies detected for SND_SOC_MAX98357A
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_STORM [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y]
  - SND_SOC_SC7180 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && I2C [=y]

This is because SND_SOC_MAX98357A is selected
by SND_SOC_STORM and SND_SOC_SC7180, but
these config options do not select or depend on
GPIOLIB, despite SND_SOC_MAX98357A depending on
GPIOLIB.

These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://lore.kernel.org/r/20211010215627.17869-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge branch 'asoc-5.15' into asoc-5.16
Mark Brown [Thu, 21 Oct 2021 13:41:32 +0000 (14:41 +0100)]
Merge branch 'asoc-5.15' into asoc-5.16

2 years agoMerge series "ASoC: qcom: sm8250: add support for TX and RX Macro dais" from Srinivas...
Mark Brown [Wed, 20 Oct 2021 11:11:40 +0000 (12:11 +0100)]
Merge series "ASoC: qcom: sm8250: add support for TX and RX Macro dais" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support for testing WCD938X connected via TX and RX Macros
on SM8250 MTP.

Srinivas Kandagatla (2):
  ASoC: qcom: sm8250: add support for TX and RX Macro dais
  ASoC: qcom: sm8250: Add Jack support

 sound/soc/qcom/sm8250.c | 79 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

--
2.21.0

2 years agoASoC: amd: acp: Add support for RT5682-VS codec
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:38 +0000 (12:39 +0530)]
ASoC: amd: acp: Add support for RT5682-VS codec

In newer variants primary codec is rt5682vs. Add support for newer
codec variants in generic machine driver module and define driver
data to register SOF sound card.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-9-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add support for Maxim amplifier codec
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:37 +0000 (12:39 +0530)]
ASoC: amd: acp: Add support for Maxim amplifier codec

In newer chrome boards we have max98360a as an amplifier codec.
Add support for max98360a in generic machine driver and configure
driver data to enable SOF sound card support on newer boards .

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-8-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add SOF audio support on Chrome board
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:36 +0000 (12:39 +0530)]
ASoC: amd: acp: Add SOF audio support on Chrome board

Chrome board has RT5682 codec and RT1019 amp connected to I2S SP
controller on ACP hw. Also it support DMIC capture endpoints with
inbuilt pdm controller on ACP hw block. Add driver module to create
backend dai links for sof dsp core. We pass driver data with audio
end points configuration to register sound cards and create device
nodes for all audio endpoints.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-7-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add legacy sound card support for Chrome audio
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:35 +0000 (12:39 +0530)]
ASoC: amd: acp: Add legacy sound card support for Chrome audio

Renoir based Chrome board has RT5682 as primary headset codec and
RT1019 amp device connected to I2SSP ACP i2s controller. Add driver
to register legacy sound card devices on Chrome board.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-6-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add generic machine driver support for ACP cards
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:34 +0000 (12:39 +0530)]
ASoC: amd: acp: Add generic machine driver support for ACP cards

We have machines with different audio endpoints configurations
across various distributions. We need to support multiple sound
cards for different combinations of I2S instance and codecs hw.
Now we also need to support SOF-DSP endpoints based sound cards.
All such card combinations slightly differs in terms of machine
ops callback. This patch adds ACP generic machine driver module
that exposes method to create ACP cards dai links and define new
ops for audio endpoints configurations. Initially we have added
dailink support for RT5682 and RT1019 codec connection with ACP
I2S_SP instance. We will add newer codecs in this module to use
this for all AMD's ACP block sound cards supports in future.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-5-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add callback for machine driver on ACP
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:33 +0000 (12:39 +0530)]
ASoC: amd: acp: Add callback for machine driver on ACP

Add method to select and register machine driver for acp platform
based on ACPI ID.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-4-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add I2S support on Renoir platform
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:32 +0000 (12:39 +0530)]
ASoC: amd: acp: Add I2S support on Renoir platform

Add I2S dai driver for Renoir platform and register with common
acp framework to support non dsp I2S use case on Renoir.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-3-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: Add common framework to support I2S on ACP SOC
Ajit Kumar Pandey [Tue, 19 Oct 2021 07:09:31 +0000 (12:39 +0530)]
ASoC: amd: Add common framework to support I2S on ACP SOC

We are using legacy way of exposing dais and DMA configuration that
requires separate driver modules for various ACP SOC with almost
similar hw configuration. Moreover the legacy approach requires
separate I2S and DMA module platform devices registration and need
machine specific quirk to control various I2S endpoints. Add generic
dai driver and platform driver for I2S controller on ACP hw block.
This common framework can be used by various ACP platform devices
that shares common specs.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-2-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rockchip: Use generic dmaengine code
Sugar Zhang [Tue, 28 Sep 2021 01:35:57 +0000 (09:35 +0800)]
ASoC: rockchip: Use generic dmaengine code

This reverts commit 75b31192fe6ad20b42276b20ee3bdf1493216d63.

The original purpose of customized pcm was to config prealloc buffer size
flexibly. but, we can do the same thing by soc-generic-dmaengine-pcm.

And the generic one can generated the better config by querying DMA
capabilities from dmaengine driver rather than the Hard-Coded one.

e.g.

the customized one:

  static const struct snd_pcm_hardware snd_rockchip_hardware = {
         .info                   = SNDRV_PCM_INFO_MMAP |
                                   SNDRV_PCM_INFO_MMAP_VALID |
                                   SNDRV_PCM_INFO_PAUSE |
                                   SNDRV_PCM_INFO_RESUME |
                                   SNDRV_PCM_INFO_INTERLEAVED,
  ...

the generic one:

  ret = dma_get_slave_caps(chan, &dma_caps);
  if (ret == 0) {
          if (dma_caps.cmd_pause && dma_caps.cmd_resume)
                  hw.info |= SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME;
          if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT)
                  hw.info |= SNDRV_PCM_INFO_BATCH;
  ...

So, let's revert back to use the generic dmaengine pcm.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Reviewed-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/1632792957-80428-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoMerge branch 'asoc-5.15' into asoc-5.16
Mark Brown [Mon, 18 Oct 2021 20:15:13 +0000 (21:15 +0100)]
Merge branch 'asoc-5.15' into asoc-5.16

2 years agoASoC: qcom: sm8250: Add Jack support
Srinivas Kandagatla [Wed, 6 Oct 2021 17:27:45 +0000 (18:27 +0100)]
ASoC: qcom: sm8250: Add Jack support

WCD938X on SM8250 MTP is connected via TX macro which has MBHC support,
So add this jack support in the soundcard driver too.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211006172745.22103-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: sm8250: add support for TX and RX Macro dais
Srinivas Kandagatla [Wed, 6 Oct 2021 17:27:44 +0000 (18:27 +0100)]
ASoC: qcom: sm8250: add support for TX and RX Macro dais

On SM8250 MTP boards WCD938x codec is connected via TX and RX Macros,
so add support for this dais in the soundcard driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211006172745.22103-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: enable Yellow Carp platform machine driver build
Vijendar Mukunda [Mon, 18 Oct 2021 11:20:44 +0000 (16:50 +0530)]
ASoC: amd: enable Yellow Carp platform machine driver build

This patch enables Yellow Carp platform machine driver build.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20211018112044.1705805-14-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: add YC machine driver using dmic
Vijendar Mukunda [Mon, 18 Oct 2021 11:20:43 +0000 (16:50 +0530)]
ASoC: amd: add YC machine driver using dmic

Add Yellow Carp platform machine driver using dmic.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20211018112044.1705805-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>