Commit graph

47321 commits

Author SHA1 Message Date
Vijendar Mukunda
0d9e4cf5b6
ASoC: SOF: amd: add conditional check for acp_clkmux_sel register
Few AMD platforms require ACP ACLK as clock source.
Add conditional check for clock mux selection register for
switching between internal clock and ACP ACLK.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:17 +01:00
Vijendar Mukunda
f3b2f8b715
ASoC: SOF: amd: remove redundant clock mux selection register write
ACP clock mux selection register is already programmed during acp init
sequence.
Remove the redundant register write.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:16 +01:00
Vijendar Mukunda
60eb816ed8
ASoC: SOF: amd: add module parameter for firmware debug
Add module parameter for firmware debug. If firmware debug
flag is enabled, clear the fusion stall bit which is required
for enabling firmware debugging through JTAG.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:15 +01:00
Vijendar Mukunda
0a1428141f
ASoC: SOF: amd: enable ACP external global interrupt
Previously ACP SOF firmware used to enable the ACP external
global interrupt register.
This will restrict to report ACP host interrupts only after
firmware loading is successful.
This register needs to be set from host driver to handle
other ACP interrupts(SoundWire Interrupts) before loading
the ACP firmware.

Add field for external interrupt enable register in acp descriptor
structure and enable the external interrupt enable register.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:14 +01:00
Vijendar Mukunda
aa83615242
ASoC: SOF: amd: remove unused sha dma interrupt code
During initial development time for RN platform, when SHA
dma gets completed, SHA DMA engine used to raise the ACP interrupt.
In ACP interrupt handler, SHA DMA interrupt got handled.
Currently SHA DMA compleition is verified by checking
transfer count using read poll time out logic.
Remove unused SHA dma interrupt handling code.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:13 +01:00
Charles Keepax
1613781d7e
ASoC: cs35l41: Correct amp_gain_tlv values
The current analog gain TLV seems to have completely incorrect values in
it. The gain starts at 0.5dB, proceeds in 1dB steps, and has no mute
value, correct the control to match.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230823085308.753572-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:27:06 +01:00
Kuninori Morimoto
220adc0fda
ASoC: fsl: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308152047.psX1QNDh-lkp@intel.com/
Cc: Randy Dunlap <rdunlap@infradead.org>
Fixes: 446b31e894 ("ASoC: soc-dai.h: remove unused call back functions")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/r/87a5ujubj0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-22 12:48:33 +01:00
Peter Ujfalusi
26ef47e5ba
ASoC: SOF: ipc4-topology: Add module parameter to ignore the CPC value
Add a new module parameter ipc4_ignore_cpc which can be used to force the
kernel to ignore the queried CPC value for all firmware modules and use 0
instead.

The CPC lookup is still done to report missing configurations and the
debug print is going to be different to be explicit that the CPC is ignored
and what was the value we would have used.

The CPC value is sent to the firmware with the MOD_INIT_INSTANCE message
and it is used by the firmware as a parameter for clock scaling.

The flag is intended to be used only when there is a need to validate the
firmware behavior regarding to clock scaling since the 0 CPC value will
force the DSP to run in full speed, disabling the scaling and provides
additional counter point to rule out clock management related issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822065419.24374-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-22 12:48:32 +01:00
Kuninori Morimoto
2cbd5304ea
ASoC: pxa: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.hoM5o9LV-lkp@intel.com/
Fixes: 446b31e894 ("ASoC: soc-dai.h: remove unused call back functions")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878ra3ubid.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-22 12:48:31 +01:00
Mark Brown
4244cf39ad
ASoC: SOF: ipc4-topology: Fixes for pipelines with SRC
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The SRC component in a pipeline provides flexibility on the sampling
rate which was not handled previously.  This series will improve the
kernel side with the needed logic to be able to deal with the SRC type
of components in pipelines.
2023-08-22 12:48:16 +01:00
Mark Brown
0bbe06493b
Add cs42l43 PC focused SoundWire CODEC
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This patch chain adds support for the Cirrus Logic cs42l43 PC focused
SoundWire CODEC. The chain is currently based of Lee's for-mfd-next
branch.

This series is mostly just a resend keeping pace with the kernel under
it, except for a minor fixup in the ASoC stuff.

Thanks,
Charles

Charles Keepax (4):
  dt-bindings: mfd: cirrus,cs42l43: Add initial DT binding
  mfd: cs42l43: Add support for cs42l43 core driver
  pinctrl: cs42l43: Add support for the cs42l43
  ASoC: cs42l43: Add support for the cs42l43

Lucas Tanure (2):
  soundwire: bus: Allow SoundWire peripherals to register IRQ handlers
  spi: cs42l43: Add SPI controller support

 .../bindings/sound/cirrus,cs42l43.yaml        |  313 +++
 MAINTAINERS                                   |    4 +
 drivers/mfd/Kconfig                           |   23 +
 drivers/mfd/Makefile                          |    3 +
 drivers/mfd/cs42l43-i2c.c                     |   98 +
 drivers/mfd/cs42l43-sdw.c                     |  239 ++
 drivers/mfd/cs42l43.c                         | 1188 +++++++++
 drivers/mfd/cs42l43.h                         |   28 +
 drivers/pinctrl/cirrus/Kconfig                |   11 +
 drivers/pinctrl/cirrus/Makefile               |    2 +
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c      |  609 +++++
 drivers/soundwire/bus.c                       |   32 +
 drivers/soundwire/bus_type.c                  |   12 +
 drivers/spi/Kconfig                           |    7 +
 drivers/spi/Makefile                          |    1 +
 drivers/spi/spi-cs42l43.c                     |  284 ++
 include/linux/mfd/cs42l43-regs.h              | 1184 +++++++++
 include/linux/mfd/cs42l43.h                   |  102 +
 include/linux/soundwire/sdw.h                 |    9 +
 include/sound/cs42l43.h                       |   17 +
 sound/soc/codecs/Kconfig                      |   16 +
 sound/soc/codecs/Makefile                     |    4 +
 sound/soc/codecs/cs42l43-jack.c               |  946 +++++++
 sound/soc/codecs/cs42l43-sdw.c                |   74 +
 sound/soc/codecs/cs42l43.c                    | 2278 +++++++++++++++++
 sound/soc/codecs/cs42l43.h                    |  131 +
 26 files changed, 7615 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml
 create mode 100644 drivers/mfd/cs42l43-i2c.c
 create mode 100644 drivers/mfd/cs42l43-sdw.c
 create mode 100644 drivers/mfd/cs42l43.c
 create mode 100644 drivers/mfd/cs42l43.h
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs42l43.c
 create mode 100644 drivers/spi/spi-cs42l43.c
 create mode 100644 include/linux/mfd/cs42l43-regs.h
 create mode 100644 include/linux/mfd/cs42l43.h
 create mode 100644 include/sound/cs42l43.h
 create mode 100644 sound/soc/codecs/cs42l43-jack.c
 create mode 100644 sound/soc/codecs/cs42l43-sdw.c
 create mode 100644 sound/soc/codecs/cs42l43.c
 create mode 100644 sound/soc/codecs/cs42l43.h

--
2.30.2
2023-08-22 12:48:04 +01:00
Senhong Liu
8e66571591
ASoC: rt5640: fix typos
I noticed typos and i fixed them.

Signed-off-by: Senhong Liu <liusenhong2022@email.szu.edu.cn>
Link: https://lore.kernel.org/r/20230819133345.39961-1-liusenhong2022@email.szu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 17:24:44 +01:00
Venkata Prasad Potturu
f7da88003c
ASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform
Enable signed firmware loading for Vangogh platform using dmi quirks.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 16:05:49 +01:00
Venkata Prasad Potturu
6a69b724b2
ASoC: SOF: amd: Add support for signed fw image loading
Add support for signed firmware code bin and data bin
loading for amd platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 16:05:48 +01:00
Venkata Prasad Potturu
d0dab6b76a
ASoC: SOF: amd: Add sof support for vangogh platform
Add pci driver and platform driver to enable SOF support
on ACP5x architecture based Vangogh platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 16:05:47 +01:00
Takashi Iwai
17a1eab7b7 ALSA: hda/tas2781: Fix PM refcount unbalance at tas2781_hda_bind()
The error path of tas2781_hda_bind() needs to release PM refcount as
well.  Modify the code flow to handle properly.

Fixes: 5be27f1e3e ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com
Link: https://lore.kernel.org/r/20230820172635.22236-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21 16:20:55 +02:00
Takashi Iwai
1c80cc055b ALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi()
The error path at tas2781_read_acpi() doesn't release the acpi_device
adev but releases another device physdev instead.  This results in a
refcount leak.  Fix it by replacing with the right object.

Fixes: 5be27f1e3e ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com
Link: https://lore.kernel.org/r/20230820172635.22236-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21 16:20:54 +02:00
Takashi Iwai
5fadc941d0 ALSA: usb-audio: Fix init call orders for UAC1
There have been reports of USB-audio driver spewing errors at the
probe time on a few devices like Jabra and Logitech.  The suggested
fix there couldn't be applied as is, unfortunately, because it'll
likely break other devices.

But, the patch suggested an interesting point: looking at the current
init code in stream.c, one may notice that it does initialize
differently from the device setup in endpoint.c.  Namely, for UAC1, we
should call snd_usb_init_pitch() and snd_usb_init_sample_rate() after
setting the interface, while the init sequence at parsing calls them
before setting the interface blindly.

This patch changes the init sequence at parsing for UAC1 (and other
devices that need a similar behavior) to be aligned with the rest of
the code, setting the interface at first.  And, this fixes the
long-standing problems on a few UAC1 devices like Jabra / Logitech,
as reported, too.

Reported-and-tested-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Closes: https://lore.kernel.org/r/202bbbc0f51522e8545783c4c5577d12a8e2d56d.camel@infinera.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230821111857.28926-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21 16:20:25 +02:00
Ranjani Sridharan
70b0924b22
ASoC: SOF: ipc4-topology: Modify the reference output valid_bits for copier
If the copier has only output valid_bits across all its output
formats, the reference for selecting the output format must be set that
instead of the valid_bits from the selected input format.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:10:08 +01:00
Ranjani Sridharan
769e8f6cd7
ASoC: SOF: ipc4-topology: Fix pipeline params at the output of copier
When we walk the list of connected widgets from the source to the sink
to prepare all widgets, the pipeline_params must be modified to reflect
the output audio format at each widget. But, the copier only modifies
the sample format in the pipeline_params. So, fix it to also modify the
rate and channels.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:10:07 +01:00
Ranjani Sridharan
56ecc16404
ASoC: SOF: ipc4-topology: Fix the output reference params for SRC
For playback, the SRC sink rate must be configured based on the requested
output format which is restricted to only handle DAI's that support a
single audio format for now. For capture, the SRC module should convert
the rate to match the rate requested by the PCM hw_params.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:10:06 +01:00
Ranjani Sridharan
ef24388225
ASoC: SOF: ipc4-topology: Modify pipeline params based on SRC output format
Modify the pipeline_params based on the SRC output format and set the
sink_rate in the IPC data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:10:05 +01:00
Colin Ian King
f286620b5d ALSA: hda/realtek: Fix spelling mistake "powe" -> "power"
There is a spelling mistake in a quirk entry. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Fixes: 3babae915f ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://lore.kernel.org/r/20230821080003.16678-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21 12:40:55 +02:00
Greg Kroah-Hartman
642073c306 Merge commit b320441c04 ("Merge tag 'tty-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next
We need the serial-core fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-20 14:29:37 +02:00
Randy Dunlap
db4bfcba7b um: Fix hostaudio build errors
Use "select" to ensure that the required kconfig symbols are set
as expected.
Drop HOSTAUDIO since it is now equivalent to UML_SOUND.

Set CONFIG_SOUND=m in ARCH=um defconfig files to maintain the
status quo of the default configs.

Allow SOUND with UML regardless of HAS_IOMEM. Otherwise there is a
kconfig warning for unmet dependencies. (This was not an issue when
SOUND was defined in arch/um/drivers/Kconfig. I have done 50 randconfig
builds and didn't find any issues.)

This fixes build errors when CONFIG_SOUND is not set:

ld: arch/um/drivers/hostaudio_kern.o: in function `hostaudio_cleanup_module':
hostaudio_kern.c:(.exit.text+0xa): undefined reference to `unregister_sound_mixer'
ld: hostaudio_kern.c:(.exit.text+0x15): undefined reference to `unregister_sound_dsp'
ld: arch/um/drivers/hostaudio_kern.o: in function `hostaudio_init_module':
hostaudio_kern.c:(.init.text+0x19): undefined reference to `register_sound_dsp'
ld: hostaudio_kern.c:(.init.text+0x31): undefined reference to `register_sound_mixer'
ld: hostaudio_kern.c:(.init.text+0x49): undefined reference to `unregister_sound_dsp'

and this kconfig warning:
WARNING: unmet direct dependencies detected for SOUND

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Fixes: d886e87cb8 ("sound: make OSS sound core optional")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: lore.kernel.org/r/202307141416.vxuRVpFv-lkp@intel.com
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-um@lists.infradead.org
Cc: Tejun Heo <tj@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: linux-kbuild@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
2023-08-19 23:30:22 +02:00
Charles Keepax
fc918cbe87
ASoC: cs42l43: Add support for the cs42l43
The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
(Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
for portable applications. It provides a high dynamic range, stereo
DAC for headphone output, two integrated Class D amplifiers for
loudspeakers, and two ADCs for wired headset microphone input or
stereo line input. PDM inputs are provided for digital microphones.

The ASoC component provides the majority of the functionality of the
device, all the audio functions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230804104602.395892-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 23:41:54 +01:00
BrenoRCBrito
3b1f08833c
ASoC: amd: yc: Add VivoBook Pro 15 to quirks list for acp6x
VivoBook Pro 15 Ryzen Edition uses Ryzen 6800H processor, and adding to
 quirks list for acp6x will enable internal mic.

Signed-off-by: BrenoRCBrito <brenorcbrito@gmail.com>
Link: https://lore.kernel.org/r/20230818211417.32167-1-brenorcbrito@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 23:40:09 +01:00
Yue Haibing
9f53373464 ALSA: asihpi: Remove unused declarations
These are not implemented, so can remove them.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230818124852.51468-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 15:42:06 +02:00
Alper Nebi Yasak
919a4a9418
ASoC: amd: acp: Add kcontrols and widgets per-codec in common code
Commit 7ac3404c2e ("ASoC: amd: acp: Map missing jack kcontrols") adds
card kcontrols and DAPM widgets corresponding to jacks for Headphone and
Headset Mic. But these were already being added in acp-legacy-mach.c and
acp-sof-mach.c, so this causes a probe error:

  sof_mach rt5682s-hs-rt1019: control 2:0:0:Headphone Jack Switch:0 is already present
  sof_mach rt5682s-hs-rt1019: ASoC: Failed to add Headphone Jack Switch: -16
  sof_mach rt5682s-hs-rt1019: devm_snd_soc_register_card(sof-rt5682s-hs-rt1019) failed: -16
  sof_mach: probe of rt5682s-hs-rt1019 failed with error -16

Removing the new duplicates from the common code might be enough to fix
the issue. But some of the codecs use different kcontrols and widgets.
NAU8821 alone has an "Int Mic". MAX98360A has a single "Spk", while
RT1019 has "Left Spk" and "Right Spk" (and two codec instances with name
prefixes).

Since there are per-codec differences, add the kcontrols and widgets
in the common code as each dai-link is being initialized, instead of in
the two machine drivers' probe().

Also, MAX98388 has Left and Right instances, but uses a single "SPK"
widget. That seems weird, so normalize it to use two widgets (one per
each instance like RT1019) while we're adding controls.

Fixes: 7ac3404c2e ("ASoC: amd: acp: Map missing jack kcontrols")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230818080314.32991-1-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 13:55:06 +01:00
Shuming Fan
aa98697c7d
ASoC: rt5645: improve the depop sequences of CBJ detection
This patch will improve the depop function of CBJ detection before the headphone playback
when the system resumes.
We also want to complete the CBJ detection in the system-level resume function.
It could avoid triggering the detection at the playing state of headphones.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230818023732.2153170-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 13:55:05 +01:00
Takashi Iwai
6c0217b110 ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops
Finally all users have been converted to the new PCM copy ops, let's
drop the obsoleted copy_kernel and copy_user ops completely.

Link: https://lore.kernel.org/r/20230815190136.8987-26-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:19 +02:00
Takashi Iwai
205d3e030a ASoC: pcm: Drop obsoleted PCM copy_user ops
Now all ASoC users have been replaced to use the new PCM copy ops,
let's drop the obsoleted copy_user ops and its helper function.

Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815190136.8987-25-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:19 +02:00
Takashi Iwai
9bebd65443 ASoC: dmaengine: Use iov_iter for process callback, too
Along with the conversion to PCM copy ops, use the iov_iter for the
pointer to be passed to the dmaengine process callback, too.  It
avoids the direct reference of iter_iov_addr(), and it can potentially
help for the drivers to access memory properly (although both atmel
and stm drivers don't use the given buffer address at all for now).

Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Link: https://lore.kernel.org/r/20230815190136.8987-23-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Takashi Iwai
56b00d10ff ASoC: dmaengine: Convert to generic PCM copy ops
This patch converts the ASoC dmaenging driver code to use the new
unified PCM copy callback.  It's a straightforward conversion from
*_user() to *_iter() variants.

The process callback is still using the direct pointer as of now, but
it'll be converted in the next patch.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230815190136.8987-22-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Takashi Iwai
ce2d8ed8d8 ASoC: qcom: Convert to generic PCM copy ops
This patch converts the qcom lpass driver code to use the new unified
PCM copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Banajit Goswami <bgoswami@quicinc.com>
Link: https://lore.kernel.org/r/20230815190136.8987-21-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Takashi Iwai
95396d83e9 ASoC: mediatek: Convert to generic PCM copy ops
This patch converts the mediatek BT SCO driver code to use the new
unified PCM copy callback.  It's a straightforward conversion from
*_user() to *_iter() variants.  As copy_form/to_iter() updates the
internal offset at each read/write, we can drop the cur_*_idx counter
in the loop, too.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815190136.8987-20-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Takashi Iwai
66201cacc3 ASoC: component: Add generic PCM copy ops
For following the ALSA PCM core change, a new PCM copy ops is added
toe ASoC component framework: snd_soc_component_driver receives the
copy ops, and snd_soc_pcm_component_copy() helper is provided.

This also fixes a long-standing potential bug where the ASoC driver
covers only copy_user PCM callback and misses the copy from kernel
pointers (such as OSS PCM layer), too.

As of this patch, the old copy_user is still kept, but it'll be
dropped later after all drivers are converted.

Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815190136.8987-19-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Takashi Iwai
62da99b56f ALSA: pcmtest: Update comment about PCM copy ops
Just an update of a comment mentioning the old PCM callbacks to
correct to the new PCM copy ops.

Link: https://lore.kernel.org/r/20230815190136.8987-17-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:26 +02:00
Takashi Iwai
390244f5ba ALSA: xen: Convert to generic PCM copy ops
This patch converts the xen frontend driver code to use the new
unified PCM copy callback.  It's a straightforward conversion from
*_user() to *_iter() variants.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: xen-devel@lists.xenproject.org
Link: https://lore.kernel.org/r/20230815190136.8987-16-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:25 +02:00
Takashi Iwai
2f432f4702 ALSA: sh: Convert to generic PCM copy ops
This patch converts the sh_dac_audio driver code to use the new
unified PCM copy callback.  It's a straightforward conversion from
*_user() to *_iter() variants.

Link: https://lore.kernel.org/r/20230815190136.8987-15-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:24 +02:00
Takashi Iwai
2098765e95 ALSA: rme9652: Convert to generic PCM copy ops
This patch converts the rme9652 driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-14-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:24 +02:00
Takashi Iwai
90ed231177 ALSA: hdsp: Convert to generic PCM copy ops
This patch converts the hdsp driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-13-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:23 +02:00
Takashi Iwai
c3abdf06a9 ALSA: rme96: Convert to generic PCM copy ops
This patch converts the rme96 driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Link: https://lore.kernel.org/r/20230815190136.8987-12-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:22 +02:00
Takashi Iwai
50496aa216 ALSA: rme32: Convert to generic PCM copy ops
This patch converts the rme32 driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Link: https://lore.kernel.org/r/20230815190136.8987-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:21 +02:00
Takashi Iwai
75bd8e3f4c ALSA: nm256: Convert to generic PCM copy ops
This patch converts the nm256 driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Link: https://lore.kernel.org/r/20230815190136.8987-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:21 +02:00
Takashi Iwai
49aa6ed94c ALSA: korg1212: Convert to generic PCM copy ops
This patch converts the korg1212 driver code to use the new unified
PCM copy callback.  The open-coded conditional memory copies are
replaced with simpler copy_from/to_iter() calls.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:20 +02:00
Takashi Iwai
07ee02a2e1 ALSA: es1938: Convert to generic PCM copy ops
This patch converts the es1938 driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants in most parts.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:19 +02:00
Takashi Iwai
9d0fdc602d ALSA: emu8000: Convert to generic PCM copy ops
This patch converts the SB Emu8000 driver code to use the new unified
PCM copy callback.  The conversion is a bit complicated because of
many open code in emu8000_pcm.c.  GET_VAL() and LOOP_WRITE() macros
were rewritten / simplified with copy_from_iter().  As
copy_from_iter() updates the internal offset value, we can drop the
corresponding part, too.

Link: https://lore.kernel.org/r/20230815190136.8987-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:19 +02:00
Takashi Iwai
e2964cd7ef ALSA: gus: Convert to generic PCM copy ops
This patch converts the GUS driver code to use the new unified PCM
copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:18 +02:00
Takashi Iwai
526a19b3e3 ALSA: dummy: Convert to generic PCM copy ops
This patch converts the dummy driver code to use the new unified PCM
copy callback.  As dummy driver doesn't do anything in the callback,
it's just a simple replacement.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230815190136.8987-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:17 +02:00
Takashi Iwai
561b4fa9c1 ALSA: core: Add memory copy helpers between iov_iter and iomem
Add two more helpers for copying memory between iov_iter and iomem,
which will be used by the new PCM copy ops in a few drivers.
The existing helpers became wrappers of those now.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:16 +02:00
Takashi Iwai
cf393babb3 ALSA: pcm: Add copy ops with iov_iter
iov_iter is a universal interface to copy the data chunk from/to
user-space and kernel in a unified manner.  This API can fit for ALSA
PCM copy ops, too; we had to split to copy_user and copy_kernel in the
past, and those can be unified to a single ops with iov_iter.

This patch adds a new PCM copy ops that passes iov_iter for copying
both kernel and user-space in the same way.  This patch touches only
the ALSA PCM core part, and the actual users will be replaced in the
following patches.

The expansion of iov_iter is done in the PCM core right before calling
each copy callback.  It's a bit suboptimal, but I took this now as
it's the most straightforward replacement.  The more conversion to
iov_iter in the caller side is a TODO for future.

As of now, the old copy_user and copy_kernel ops are still kept.
Once after all users are converted, we'll drop the old copy_user and
copy_kernel ops, too.

Link: https://lore.kernel.org/r/20230815190136.8987-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:18:15 +02:00
Shenghao Ding
5be27f1e3e ALSA: hda/tas2781: Add tas2781 HDA driver
Create tas2781 side codec HDA driver for Lenovo Laptops. The quantity
of the speakers has been define in ACPI. All of the tas2781s in the
laptop will be aggregated as one audio speaker. The code supports
realtek codec as the primary codec. Code offers several controls for
digtial/analog gain setting during playback, and other for eq params
setting in case of different audio profiles, such as music, voice,
movie, etc.

[ adjusted patch to be applied to the latest for-next branch -- tiwai ]

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://lore.kernel.org/r/20230818085836.1442-2-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:14:43 +02:00
Shenghao Ding
3babae915f ALSA: hda/tas2781: Add tas2781 HDA driver
Integrate tas2781 configs for Lenovo Laptops. All of the tas2781s in the
laptop will be aggregated as one audio device. The code support realtek
as the primary codec. Rename "struct cs35l41_dev_name" to
"struct scodec_dev_name" for all other side codecs instead of the certain
one.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://lore.kernel.org/r/20230818085836.1442-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:14:34 +02:00
Ruan Jinjie
828b871ac1 ALSA: Make SND_PCMTEST depend on DEBUG_FS
Since pcmtest is a test module that manipulates or gets
notification via debugfs, without DEBUG_FS it can not work fine.
So make SND_PCMTEST depend on DEBUG_FS.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230817093740.1732738-1-ruanjinjie@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 09:10:22 +02:00
Takashi Iwai
a707885aff ALSA: aoa: Fix typos in PCM fix patch
There was typos in the previous fix for PCM to detach the struct
device that caused build errors.  Corrected here.

Fixes: bc41a7228c ("ALSA: pcm: Don't embed device")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308181347.q3XPr3Lm-lkp@intel.com/
Link: https://lore.kernel.org/r/20230818070913.23336-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 09:09:39 +02:00
Mark Brown
cfee987c92
ASoC: Merge up fixes
For the benefit of CI.
2023-08-17 22:38:42 +01:00
Mark Brown
44cb08fd23
ASoC: Convert remaining Realtek codecs to GPIO
Merge series from Linus Walleij <linus.walleij@linaro.org>:

After dropping unused headers a few Realtek devices
actually using the GPIO descriptors remain.

Converting them to use optional GPIO descriptors is
pretty straight-forward.
2023-08-17 18:36:42 +01:00
Mark Brown
ab0b5072d1
ASoC: cs35l56: Update ACPI HID and property
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

These two patches add an ACPI HID and update the way the platform-
specific firmware identifier is extracted from the ACPI.
2023-08-17 18:36:28 +01:00
Linus Walleij
8793bee716
ASoC: rt5682s: Convert to use GPIO descriptors
Convert the RT5682S to use GPIO descriptors and drop the
legacy GPIO headers.

We remove the global GPIO number from the platform data,
but it is still possible to create board files using GPIO
descriptor tables, if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-5-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 15:10:13 +01:00
Linus Walleij
ed11701751
ASoC: rt5682: Convert to use GPIO descriptors
Convert the RT5682 to use GPIO descriptors and drop the
legacy GPIO headers.

We remove the global GPIO number from the platform data,
but it is still possible to create board files using GPIO
descriptor tables, if desired.

Make sure to make sure SDW devices can associate with
an LDO1 EN descriptor too, if they so desire by putting
the lookup into the common code.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-4-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 15:10:13 +01:00
Linus Walleij
ab2a5d1706
ASoC: rt5668: Convert to use GPIO descriptors
Convert the RT5668 to use GPIO descriptors and drop the
legacy GPIO headers.

We remove the global GPIO number from the platform data,
but it is still possible to create board files using GPIO
descriptor tables, if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-3-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 15:10:12 +01:00
Linus Walleij
647a3c4c33
ASoC: rt5665: Convert to use GPIO descriptors
The RT5665 driver has some stub support for GPIO descriptors
going back to the initial driver commit, where there are
two GPIO descriptors for the LDO and headphone detection
defined in the device state. Well, let's make use of the
descriptor properly.

We remove the global GPIO number from the platform data,
but it is still possible to create board files using GPIO
descriptor tables, if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-2-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 15:10:11 +01:00
Linus Walleij
a9b5f21073
ASoC: rt5640: Convert to just use GPIO descriptors
The RT5640 driver is already using GPIO descriptors for some
stuff, all that is needed is to convert the remaining LDO1
control line to also use descriptors.

Simplify the code using gpiod_get_optional() and drop the
special "of" parsing function: these descriptors need not
come from device tree and it's optional so hey.

Keep some NULL checks around the GPIO operations even though
gpiolib is essentially NULL-tolerant, because by checking
for whether we have a valid GPIO descriptor or not we can
avoid a 400 ms delay which is great.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-1-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 15:10:10 +01:00
Maso Huang
9873277fc2
ASoC: mediatek: mt7986: add machine driver with wm8960
Add support for mt7986 board with wm8960.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230817101338.18782-5-maso.huang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:09:18 +01:00
Maso Huang
8d0d4884ba
ASoC: mediatek: mt7986: add platform driver
Add mt7986 platform driver.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230817101338.18782-4-maso.huang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:09:17 +01:00
Maso Huang
9f8df795ae
ASoC: mediatek: mt7986: support etdm in platform driver
Add mt7986 etdm dai driver support.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230817101338.18782-3-maso.huang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:09:16 +01:00
Maso Huang
c4c3c32d08
ASoC: mediatek: mt7986: add common header
Add header files for register definition and structure.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230817101338.18782-2-maso.huang@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:09:16 +01:00
Shenghao Ding
3d521f9f36
ASoC: tas2781: fixed register access error when switching to other chips
fixed register access error when switching to other tas2781 -- refresh the page
inside regmap on the switched tas2781

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://lore.kernel.org/r/20230817093257.951-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:09:12 +01:00
Simon Trimmer
e8500a7027
ASoC: cs35l56: Add an ACPI match table
An ACPI ID has been allocated for CS35L56 ASoC devices so that they can
be instantiated from ACPI Device entries.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230817112712.16637-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:05:31 +01:00
Maciej Strozek
897a6b5a03
ASoC: cs35l56: Read firmware uuid from a device property instead of _SUB
Use a device property "cirrus,firmware-uid" to get the unique firmware
identifier instead of using ACPI _SUB. There aren't any products that use
_SUB.

There will not usually be a _SUB in Soundwire nodes. The ACPI can use a
_DSD section for custom properties.

There is also a need to support instantiating this driver using software
nodes. This is for systems where the CS35L56 is a back-end device and the
ACPI refers only to the front-end audio device - there will not be any ACPI
references to CS35L56.

Fixes: e496112529 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230817112712.16637-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-17 13:05:30 +01:00
Takashi Iwai
01ed7f3535 ALSA: core: Drop snd_device_initialize()
Now all users of snd_device_intialize() are gone, let's drop it.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:33 +02:00
Takashi Iwai
2419891e3f ALSA: seq: Create device with snd_device_alloc()
Align with the other components, and use snd_device_alloc() for the
new sound device for sequencer, too.  No functional changes.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:28 +02:00
Takashi Iwai
911fcb76e3 ALSA: timer: Create device with snd_device_alloc()
Align with the other components, and use snd_device_alloc() for the
new sound device for timer, too.  No functional changes.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:21 +02:00
Takashi Iwai
b53a41ee9c ALSA: compress: Don't embed device
Embedding the struct device to snd_compr object may result in UAF when
the delayed kobj release is used.  Like other devices, let's detach
the struct device from the snd_compr by allocating dynamically via
snd_device_alloc().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:15 +02:00
Takashi Iwai
ea29a02fd8 ALSA: rawmidi: Don't embed device
This patch detaches the struct device from the snd_rawmidi object by
allocating via snd_device_alloc(), just like done for other devices.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:08 +02:00
Takashi Iwai
897c8882df ALSA: hwdep: Don't embed device
Like control and PCM devices, it's better to avoid the embedded struct
device for hwdep (although it's more or less well working), too.
Change it to allocate via snd_device_alloc(), and free the memory at
the common snd_hwdep_free().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:24:01 +02:00
Takashi Iwai
bc41a7228c ALSA: pcm: Don't embed device
So far we use the embedded struct device for each PCM substreams in
struct snd_pcm.  This may result in UAF when the delayed kobj release
is used; each corresponding struct device is still accessed at the
(delayed) device release, while the snd_pcm object may be already
gone.

As a workaround, detach the struct device from the snd_pcm object by
allocating via the new snd_device_alloc() helper.

A caveat is that we store the PCM substream pointer to drvdata since
the device resume and others require the access to it.

This patch is based on the fix Curtis posted initially.  In this
patch, the changes are split and use the new helper function instead.

Link: https://lore.kernel.org/r/20230801171928.1460120-1-cujomalainey@chromium.org
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:23:45 +02:00
Takashi Iwai
6a66b01de4 ALSA: control: Don't embed ctl_dev
Embedding the ctl_dev in the snd_card object may result in UAF when
the delayed kobj release is used; at the delayed kobj release, it
still accesses the struct device itself while the card memory (that
embeds the struct device) may be already gone.

As a workaround, detach the struct device from the card object by
allocating via the new snd_device_alloc() helper.  The rest are just
replacing ctl_dev access to the pointer.

This is based on the fix Curtis posted initially.  In this patch, the
changes are split and use the new helper function instead.

Link: https://lore.kernel.org/r/20230801171928.1460120-1-cujomalainey@chromium.org
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:23:30 +02:00
Takashi Iwai
7f018db19b ALSA: core: Introduce snd_device_alloc()
Introduce a new helper, snd_device_alloc(), for allocating a struct
device that is bound with the sound class.  It's a replacement of
snd_device_initialize().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230816160252.23396-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:21:40 +02:00
Yang Yingliang
2e6f979037 ALSA: hda: cs35l41: change cs35l41_prop_model to static
cs35l41_prop_model is only used in cs35l41_hda_property.c now,
change it to static.

Fixes: ef4ba63f12 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230817014252.1511232-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17 09:03:37 +02:00
Krzysztof Kozlowski
17b9f4387e
ASoC: samsung: tm2_wm5110: parse audio-routing
Parse generic sound card "audio-routing" property and fallback to
"samsung,audio-routing" if it is missing.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810063300.20151-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:20 +01:00
Krzysztof Kozlowski
2dc8c03665
ASoC: samsung: odroid: parse audio-routing
Parse generic sound card "audio-routing" property and fallback to
"samsung,audio-routing" if it is missing.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810063300.20151-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:19 +01:00
Krzysztof Kozlowski
c91e67145b
ASoC: samsung: midas_wm1811: parse audio-routing
Parse generic sound card "audio-routing" property and fallback to
"samsung,audio-routing" if it is missing.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810063300.20151-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:18 +01:00
Krzysztof Kozlowski
55ebfafbc3
ASoC: samsung: aries_wm8994: parse audio-routing
Parse generic sound card "audio-routing" property and fallback to
"samsung,audio-routing" if it is missing.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810063300.20151-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:17 +01:00
Krzysztof Kozlowski
ebba2fd5ad
ASoC: samsung: odroid: use of_property_present to check for property
"samsung,audio-widgets" and "samsung,audio-routing" are not boolean
properties, thus more appropriate is to use of_property_present() to
check if they are present.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810063300.20151-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:16 +01:00
Chao Song
2d218b4584
ASoC: SOF: ipc4-pcm: fix possible null pointer deference
The call to snd_sof_find_spcm_dai() could return NULL,
add nullable check for the return value to avoid null
pointer defenrece.

Fixes: 7cb19007ba ("ASoC: SOF: ipc4-pcm: add hw_params")
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230816133311.7523-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 14:47:01 +01:00
Kailang Yang
46cdff2369 ALSA: hda/realtek - Remodified 3k pull low procedure
Set spec->en_3kpull_low default to true.
Then fillback ALC236 and ALC257 to false.

Additional note: this addresses a regression caused by the previous
fix 69ea4c9d02 ("ALSA: hda/realtek - remove 3k pull low procedure").
The previous workaround was applied too widely without necessity,
which resulted in the pop noise at PM again.  This patch corrects the
condition and restores the old behavior for the devices that don't
suffer from the original problem.

Fixes: 69ea4c9d02 ("ALSA: hda/realtek - remove 3k pull low procedure")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217732
Link: https://lore.kernel.org/r/01e212a538fc407ca6edd10b81ff7b05@realtek.com
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-16 14:20:27 +02:00
Brady Norander
905240d169 ALSA: hda: intel-dsp-cfg: Add Chromebook quirk to ADL/RPL
AlderLake and RaptorLake Chromebooks currently use the HDA driver by
default. Add a quirk to use the SOF driver on these platforms, which is
needed for functional internal audio.

Signed-off-by: Brady Norander <bradynorander@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/ZNuDLk5hgmfKrZg6@arch
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-16 08:37:40 +02:00
Takashi Iwai
4098967943 ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_properties
model->hid is a pointer, and should be rather NULL-checked in the loop
of cs35l41_prop_model_table.

Fixes: ef4ba63f12 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308160506.8lCEeFDG-lkp@intel.com/
Link: https://lore.kernel.org/r/20230816063525.23009-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-16 08:36:07 +02:00
Stefan Binding
ef4ba63f12 ALSA: hda: cs35l41: Support systems with missing _DSD properties
Some systems using CS35L41 with HDA were released without some
required _DSD properties in ACPI. To support these special cases,
add an api to configure the correct properties for systems with
this issue.

This initial commit moves the no _DSD support for Lenovo
Legion Laptops (CLSA0100, CLSA0101) into a new framework which
can be extended to support additional laptops in the future.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230815161033.3519-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-15 20:51:19 +02:00
Takashi Iwai
220c8f6713 ASoC: Fixes for v6.5
A fairly large collection of fixes here, mostly SOF and Intel related.
 The one core fix is Hans' change which reduces the log spam when working
 out new use cases for DPCM.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTbq9kACgkQJNaLcl1U
 h9DjOwf+LH6skuS33cgeXKBEWdu5xP1WJ82y7Xjfr+kzecSZSSQEBI1NJgEBHNbk
 yd4ZnCnTy2/WKdj/IxsuifK8WrqT8jIpWXw25SUeYw+VavgLDXfDZvzmQaO0oigR
 ACIwhgtJJshlYzNIYvwyL2CMjZPliGEr6LGLA2Da4lxFivo9JFN2imRzS/k5aQ2o
 YdsVg0xH/TytNUZ//gJh1HaRfOzu1hsqAawzcWnTAEX1EadViZSAFHsdn02VA2Yg
 gLONXU+w1WrsKkTgUnrnAgnFDvda06KIO17M+bNXkiDZa+wVMJ2Zh8p89j4psHBN
 d+JpY9PQHcyx0BEufvtCYHsdfAh7cg==
 =zEhY
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.5-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.5

A fairly large collection of fixes here, mostly SOF and Intel related.
The one core fix is Hans' change which reduces the log spam when working
out new use cases for DPCM.
2023-08-15 20:46:13 +02:00
Krzysztof Kozlowski
49a4a8d126
ASoC: rockchip: Fix Wvoid-pointer-to-enum-cast warning
'version' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  rockchip_pdm.c:587:18: error: cast to smaller integer type 'enum rk_pdm_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230815143204.379708-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 19:23:00 +01:00
Krzysztof Kozlowski
5a18033249
ASoC: codecs: wm8904: Fix Wvoid-pointer-to-enum-cast warning
'devtype' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  wm8904.c:2205:21: error: cast to smaller integer type 'enum wm8904_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230815143204.379708-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 19:22:59 +01:00
Krzysztof Kozlowski
66de320b02
ASoC: codecs: tlv320aic32x4: Fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  tlv320aic32x4.c:1352:18: error: cast to smaller integer type 'enum aic32x4_type' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230815143204.379708-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 19:22:58 +01:00
Mark Brown
7f0315ded4
ASoC: cs35l56: Don't patch firmware that is already
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Use the FIRMWARE_MISSING flag in the CS35L56 to determine whether it is
safe to download a firmware patch.
2023-08-15 19:22:40 +01:00
Mark Brown
a90a7a0016
Use devm_kmemdup to replace devm_kmalloc + memcpy
Merge series from Li Zetao <lizetao1@huawei.com>:

This patch set use the helper function devm_kmemdup() to replace
devm_kmalloc + memcpy, which is the same as implementing the function
separately.
2023-08-15 19:22:33 +01:00
Mark Brown
6e9fd076e7
ASoC: SOF: topology: simplify kcontrol names with
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The use of the widget name as a prefix for the kcontrol name is quite
useful in the case of multiple pipelines going to the same endpoint,
but it's overkill in simpler cases.

This patchset extends the existing DAPM code to drop the widget name
prefix and make the kcontrol names simpler when there's no possible
ambiguity, e.g.  "gain.2.1 Main Playback Volume" becomes just "Main
Playback Volume".
2023-08-15 19:22:25 +01:00
Mark Brown
63e0410276
ASoC: Intel: RPL/MTL machine updates for 6.6
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

4 commits with the match tables for RaptorLake and MeteorLake devices.
2023-08-15 19:22:03 +01:00
Richard Fitzgerald
67bd793ba5
ASoC: cs35l56: Don't overwrite a patched firmware
Only attempt to download wmfw/bin files to a non-secured part if
it reports FIRMWARE_MISSING. If FIRMWARE_MISSING is false the
firmware has already been patched and overwriting the patch could
corrupt the running firmware.

For a secured part the wmfw/bin can be downloaded even if
FIRMWARE_MISSING is false, because they will only patch tunings.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230815124826.5447-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:56:47 +01:00
Richard Fitzgerald
62ddad4238
ASoC: wm_adsp: Support powering-up DSP without trying to load firmware
Add a flag to wm_adsp_power_up() that indicates whether it should attempt
to find and load firmware files.

This is to support DSPs that have built-in firmware that may already have
been patched (for example, by the BIOS). In that case the patch must not
be overwritten because that could corrupt the running firmware.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230815124826.5447-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:56:46 +01:00
Chao Song
a942409c97
ASoC: SOF: Intel: Refactor code for HDA stream creation
Existing HDA stream creation is split into two
for loops for capture and playback, but most of
the code in the two for loops are duplicated.

This patch refactors HDA stream creation with a
single for loop, thus remove code duplication.

No functional change in this patch.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814231519.79051-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:54:56 +01:00
Pierre-Louis Bossart
c5556d8651
ASoC: SOF: remove duplicate code due to merge
Commit 8111310849 ("ASoC: Merge up fixes") added the same code
twice, remove the extra call.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230814234235.87268-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:54:55 +01:00
Balamurugan C
f7555da71e
ASoC: Intel: RPL: Add entry for HDMI-In capture support on non-I2S codec boards.
Adding HDMI-In capture support for the RPL products doesn't have onboard
I2S codec.but need to support HDMI-In capture via I2S and audio playback
through HDMI/DP monitor.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814231358.78971-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:26:03 +01:00
Chao Song
fec75606f4
ASoC: Intel: soc-acpi: add support for Dell SKU0C87 devices
This patch adds the acpi match table for Dell SKU0C87
devices, the codec layout is:
    SDW0: RT714 DMIC
    SDW1: RT1318 Speaker
    SDW2: RT1318 Speaker

Note that there is no jack codec on SKU0C87 devices.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814231358.78971-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:26:02 +01:00
Balamurugan C
fbc82c016d
ASoC: Intel: soc-acpi: Add entry for HDMI_In capture support in RPL match table
Adding HDMI-In capture via I2S feature support in RPL platfroms.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814231358.78971-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:26:01 +01:00
Balamurugan C
fc8b9d05a0
ASoC: Intel: soc-acpi: Add entry for sof_es8336 in RPL match table.
Adding support for ES83x6 codec in RPL match table.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814231358.78971-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:26:00 +01:00
Jyri Sarha
56ce7b791b
ASoC: SOF: topology: Add a token for dropping widget name in kcontrol name
Adds SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME token, and copies the
token's tuple value to the no_wname_in_kcontrol_name flag in struct
snd_soc_dapm_widget.

If the tuple value for the token in the topology is true, then the
widget name is not added to the mixer name. In practice "gain.2.1 Post
Mixer Analog Playback Volume" becomes just "Post Mixer Analog Playback
Volume".

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814232325.86397-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:25:56 +01:00
Jyri Sarha
f7f4a5ad8e
ASoC: dapm: Add a flag for not having widget name in kcontrol name
The existing soc-dapm code may add a prefix to control names, which in
some cases is useful but in others leads to long and confusing kcontrol
names such as "gain 2.1 Main Playback Volume".

This patch suggests an added flag to prevent the widget name prefix
from being added. That flag will be set in the topology file on a
per-widget basis.

The flag no_wname_in_kcontrol_name is added to struct snd_soc_dapm_widget,
and the logic in dapm_create_or_share_kcontrol() is changed to not to
add widget name if the flag is set.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230814232325.86397-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 13:25:55 +01:00
mnlife
62cc82e648
ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access
When snd_soc_card_jack_new is not called or the call fails,
calling this function causes a null pointer access

Signed-off-by: mnlife <mnlife@126.com>
Link: https://lore.kernel.org/r/20230811142511.6570-1-mnlife@126.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 22:10:35 +01:00
Ajye Huang
273bc8bf22
ASoC: Intel: Add rpl_nau8318_8825 driver
Boards were using this in older kernels before adl and rpl ids were
split. Add this back to maintain support.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230804085648.3721416-1-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 22:10:34 +01:00
Li Zetao
29681184da
ASoC: SOF: ipc3: Use devm_kmemdup to replace devm_kmalloc + memcpy
Use the helper function devm_kmemdup() rather than duplicating its
implementation, which helps to enhance code readability.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20230810114738.2103792-3-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 19:44:39 +01:00
Li Zetao
b0a4c7f592
ASoC: tas5805m: Use devm_kmemdup to replace devm_kmalloc + memcpy
Use the helper function devm_kmemdup() rather than duplicating its
implementation, which helps to enhance code readability.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230810114738.2103792-2-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 19:44:38 +01:00
Guiting Shen
11e756cc85
ASoC: tlv320aic32x4: Fix the divide by zero
The value of register(NDAC,MDAC,NADC,MADC,BCLKN) maybe zero lead to
divide by zero in clk_aic32x4_div_recalc_rate().And the rate should be
divide by 128 if the value was zero in this function according to the
datasheet.

Add the macro AIC32X4_DIV_MAX to present the 128 and return 0 if failing
to read the value of register.

Signed-off-by: Guiting Shen <aarongt.shen@gmail.com>
Link: https://lore.kernel.org/r/20230813125520.11067-1-aarongt.shen@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:37 +01:00
Biju Das
b39eee2754
ASoC: ak4613: Simplify probe()
Simpilfy probe() by replacing of_device_get_match_data() and id lookup for
retrieving match data by i2c_get_match_data().

While at it, drop unused local variable np from probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230813073458.59606-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:36 +01:00
Kuninori Morimoto
446b31e894
ASoC: soc-dai.h: remove unused call back functions
Now, all drivers are using ops call backs.
Let's remove unused other call back functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cyzx9m4o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:35 +01:00
Kuninori Morimoto
2edc4a2cc1
ASoC: codecs/hdmi-codec: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edkd9m4t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:34 +01:00
Kuninori Morimoto
878b5fee6e
ASoC: codecs/cx2072x: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs4t9m4y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:33 +01:00
Kuninori Morimoto
e22a907d66
ASoC: codecs/cs47lxx: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87h6p99m55.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:32 +01:00
Kuninori Morimoto
80585b0c6a
ASoC: soc-topology: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87il9p9m5a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:32 +01:00
Kuninori Morimoto
586685f14d
ASoC: codecs/wm*: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzu59m5f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:31 +01:00
Kuninori Morimoto
4f1ec3da4e
ASoC: hisilicon: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87leel9m5l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:30 +01:00
Kuninori Morimoto
e86cc958cf
ASoC: starfive: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Walker Chen <walker.chen@starfivetech.com>
Link: https://lore.kernel.org/r/87msz19m5r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:29 +01:00
Kuninori Morimoto
b396843799
ASoC: loongson: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7jh9m5w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:28 +01:00
Kuninori Morimoto
89621b57ee
ASoC: uniphier: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm3x9m62.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:27 +01:00
Kuninori Morimoto
bd6af1bc86
ASoC: rockchip: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0od9m6i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:26 +01:00
Kuninori Morimoto
d656593b3d
ASoC: mediatek: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/87sf8t9m6n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:25 +01:00
Kuninori Morimoto
fda5c5e752
ASoC: samsung: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ttt99m6y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:24 +01:00
Kuninori Morimoto
dd64a7546d
ASoC: cirrus: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/87wmy59m7a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:22 +01:00
Kuninori Morimoto
cfacc4d8c0
ASoC: jz4740: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1il9m7f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:21 +01:00
Kuninori Morimoto
2d3155a907
ASoC: meson: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg319m7m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:20 +01:00
Kuninori Morimoto
e9f512121e
ASoC: intel: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qgdb0sa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:19 +01:00
Kuninori Morimoto
2ff8a43d4d
ASoC: atmel: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87350tb0sg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:19 +01:00
Kuninori Morimoto
516ee7009f
ASoC: tegra: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874jl9b0sl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:18 +01:00
Kuninori Morimoto
fc95a8a3ea
ASoC: sunxi: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/875y5pb0sr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:17 +01:00
Kuninori Morimoto
ce11656ccd
ASoC: ux500: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/877cq5b0sx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:16 +01:00
Kuninori Morimoto
2d2f304444
ASoC: au1x: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878ralb0t3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:15 +01:00
Kuninori Morimoto
e4222bbdec
ASoC: qcom: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a5v1b0ta.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:14 +01:00
Kuninori Morimoto
4b0891a7b6
ASoC: rsnd: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkfhb0tg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:13 +01:00
Kuninori Morimoto
e419067786
ASoC: pxa: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cyzxb0tl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:12 +01:00
Kuninori Morimoto
53c577ba4f
ASoC: stm: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edkdb0tq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:11 +01:00
Kuninori Morimoto
9f625f5e6c
ASoC: sti: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs4tb0tw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:10 +01:00
Kuninori Morimoto
450e722223
ASoC: sof: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6p9b0u2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:09 +01:00
Kuninori Morimoto
ca6b2aac2a
ASoC: img: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87il9pb0u8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:08 +01:00
Kuninori Morimoto
ac27ca16a0
ASoC: fsl: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzu5b0ue.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:07 +01:00
Kuninori Morimoto
755ecb0062
ASoC: bcm: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87leelb0uk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:06 +01:00
Kuninori Morimoto
598d2dce58
ASoC: pxa: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87msz1b0uq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:05 +01:00
Kuninori Morimoto
ddef7aff70
ASoC: dwc: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/87o7jhb0v4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:05 +01:00
Kuninori Morimoto
4062afe986
ASoC: amd: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pm3xb0va.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:04 +01:00
Kuninori Morimoto
7baf6b1e4f
ASoC: adi: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0odb0vg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:03 +01:00
Kuninori Morimoto
b4a752b505
ASoC: adi: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sf8tb0vp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:02 +01:00
Kuninori Morimoto
dd9d64de8e
ASoC: ti: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ttt9b0vw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:01 +01:00
Kuninori Morimoto
624fee4511
ASoC: soc-dai.h: merge DAI call back functions into ops
snd_soc_dai_driver has .ops for call back functions (A), but it also
has other call back functions (B). It is duplicated and confusable.

	struct snd_soc_dai_driver {
		...
 ^		int (*probe)(...);
 |		int (*remove)(...);
(B)		int (*compress_new)(...);
 |		int (*pcm_new)(...);
 v		...
(A)		const struct snd_soc_dai_ops *ops;
		...
	}

This patch merges (B) into (A).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8dpb0w6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:00 +01:00
Mark Brown
85cc1ee950
ASoC: rt: Drop unused GPIO includes
Merge series from Linus Walleij <linus.walleij@linaro.org>:

These drivers include legacy GPIO headers for no reason
at all, so get rid of the includes.
2023-08-14 00:09:18 +01:00
Mark Brown
690f5c8d6a
sound: Remove redundant of_match_ptr() macro
Merge series from Ruan Jinjie <ruanjinjie@huawei.com>:

Since these sound drivers depend on CONFIG_OF, there is
no need to wrap the macro of_match_ptr() here.
2023-08-14 00:09:10 +01:00
Linus Walleij
797df2a670
ASoC: rt715: Drop GPIO includes
This driver include two GPIO legacy headers and one contemporary,
yet doesn't use symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-14-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:38:00 +01:00
Linus Walleij
1a625a7a5d
ASoC: rt5682-sdw: Drop GPIO includes
This driver include two GPIO legacy headers yet doesn't use
symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-13-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:59 +01:00
Linus Walleij
b72a4dc2be
ASoC: rt5660: Drop GPIO includes
This driver include two GPIO legacy headers yet doesn't use
symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-12-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:58 +01:00
Linus Walleij
0b759f3b3f
ASoC: rt5659: Drop legacy GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. It is using the new consumer
include <linux/gpio/consumer.h already. Drop the surplus
include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-11-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:57 +01:00
Linus Walleij
92f1b48277
ASoC: rt5645: Drop legacy GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. It is using the new consumer
include <linux/gpio/consumer.h already. Drop the surplus
include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-10-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:56 +01:00
Linus Walleij
9fdc4feacd
ASoC: rt5514: Drop GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-9-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:56 +01:00
Linus Walleij
12ffd88e39
ASoC: rt5514-spi: Drop GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-8-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:55 +01:00
Linus Walleij
f36c684e99
ASoC: rt1308: Drop GPIO includes
This driver include two GPIO legacy headers yet doesn't use
symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-7-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:54 +01:00
Linus Walleij
ba55dde45b
ASoC: rt1305: Drop GPIO includes
This driver include two GPIO legacy headers yet doesn't use
symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-6-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:53 +01:00
Linus Walleij
e04cbe5320
ASoC: rt1019: Drop GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-5-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:52 +01:00
Linus Walleij
8a5a8015b1
ASoC: rt1016: Drop GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-4-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:52 +01:00
Linus Walleij
3abc707685
ASoC: rt1015p: Drop legacy GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. It is using the new consumer
include <linux/gpio/consumer.h already. Drop the surplus
include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-3-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:51 +01:00
Linus Walleij
c7a7f4444b
ASoC: rt1015: Drop GPIO include
This driver include the GPIO legacy header <linux/gpio.h yet
doesn't use symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-2-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:50 +01:00
Linus Walleij
a5c8e75b34
ASoC: rt1011: Drop GPIO includes
This driver include two GPIO legacy headers yet doesn't use
symbols from any of them. Drop the includes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org
Link: https://lore.kernel.org/r/20230812-descriptors-asoc-v1-1-eb4dca1f68af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:49 +01:00
Ruan Jinjie
f479832b42
ALSA: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com
Reviewed-by: Takashi Iwai <tiwai@suse.de
Link: https://lore.kernel.org/r/20230811071426.2343133-6-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:47 +01:00
Ruan Jinjie
6136b6a281
ASoC: ssm3515: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com
Link: https://lore.kernel.org/r/20230811071426.2343133-5-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:47 +01:00
Ruan Jinjie
29546c3af6
ASoC: sunxi: sun4i-spdif: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com
Link: https://lore.kernel.org/r/20230811071426.2343133-4-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:46 +01:00
Ruan Jinjie
f83e34034f
ASoC: atmel: tse850-pcm5142: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com
Link: https://lore.kernel.org/r/20230811071426.2343133-3-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:45 +01:00
Ruan Jinjie
67ed781228
ASoC: atmel: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com
Link: https://lore.kernel.org/r/20230811071426.2343133-2-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 19:37:44 +01:00
Yue Haibing
8acf4de306
ASoC: cygnus: Remove unused declarations
Commit a6ee05d94e ("ASoC: cygnus: Add Cygnus audio DAI driver")
declared but never implemented these.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20230811110021.31656-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 18:16:53 +01:00
Yue Haibing
bb6979c5ac
ASoC: q6dsp: Remove unused declaration
Commit 5477518b8a ("ASoC: qdsp6: audioreach: add q6apm support")
declared but never implemented these.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20230811100130.36664-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 18:16:52 +01:00
Shuming Fan
37aba31908
ASoC: rt1308-sdw: fix random louder sound
This patch uses a vendor register to check whether the system hibernated ever.
The driver will only set the preset when the driver brings up or the system hibernated.
It will avoid the unknown issue that makes the speaker output louder and can't control the volume.

Signed-off-by: Shuming Fan <shumingf@realtek.com
Link: https://lore.kernel.org/r/20230811093822.37573-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 18:16:32 +01:00
Jiri Slaby (SUSE)
892bc209f2 tty: use u8 for flags
This makes all those 'char's an explicit 'u8'. This is part of the
continuing unification of chars and flags to be consistent u8.

This approaches tty_port_default_receive_buf().

Note that we do not change signedness as we compile with
-funsigned-char.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@reisers.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Matt Johnston <matt@codeconstruct.com.au>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-18-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:45 +02:00
Jiri Slaby (SUSE)
a8d9cd2318 tty: use u8 for chars
This makes all those 'unsigned char's an explicit 'u8'. This is part of
the continuing unification of chars and flags to be consistent u8.

This approaches tty_port_default_receive_buf(). Flags to be next.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@reisers.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Matt Johnston <matt@codeconstruct.com.au>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-17-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:45 +02:00
Jiri Slaby (SUSE)
e8161447bb tty: make tty_ldisc_ops::*buf*() hooks operate on size_t
Count passed to tty_ldisc_ops::receive_buf*(), ::lookahead_buf(), and
returned from ::receive_buf2() is expected to be size_t. So set it to
size_t to unify with the rest of the code.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@reisers.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Matt Johnston <matt@codeconstruct.com.au>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-16-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:45 +02:00
Stefan Binding
7c76116639 ALSA: hda/cs8409: Support new Dell Dolphin Variants
Add 4 new Dell Dolphin Systems, same configuration as older systems.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230811123044.1045651-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-11 16:45:52 +02:00
Yang Li
061599c828
ASoC: SOF: Intel: Remove duplicated include in lnl.c
./sound/soc/sof/intel/lnl.c: hda.h is included more than once.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230810005555.4610-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-10 18:10:21 +01:00
Jack Yu
927073ee46
ASoC: rt715: Add software reset in io init
Add software reset before setting preset registers to make sure
all the registers are the default value before preset.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/4f405c7deb9642e1a8599c5f103b5759@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-10 15:44:40 +01:00
Stefan Binding
98c68ea031 ALSA: hda/realtek: Switch Dell Oasis models to use SPI
All I2C Dell Oasis models using CS35L41 have been changed to use SPI.
In addition, System 10280cc5 is no longer required.

Fixes: de90f5165b ("ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops")
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230809142957.675933-3-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-10 10:11:56 +02:00
Stefan Binding
fb8cce69e5 ALSA: hda/realtek: Add quirks for HP G11 Laptops
These HP G11 laptops use Realtek HDA codec combined with
2xCS35L41 Amplifiers using SPI or I2C with External Boost.

Laptop 103c8c26 has been removed as this has been replaced
by this new series of laptops.

Fixes: 3e10f6ca76 ("ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops")
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230809142957.675933-2-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-10 10:11:33 +02:00
Takashi Sakamoto
ff7a0b4016 ALSA: dice: add stream format parameters for Weiss devices
Hard-coded stream format parameters are added for Weiss Engineering
FireWire devices. When the device vendor and model match, the parameters
are copied into the stream format cache. This allows for setting all
supported sampling rates up to 192kHz, and consequently adjusting the
number of available I/O channels.

Signed-off-by: Rolf Anderegg <rolf.anderegg@weiss.ch>
Signed-off-by: Michele Perrone <michele.perrone@weiss.ch>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230809002631.750120-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-10 10:10:34 +02:00
Nathan Chancellor
9c28423d3c
ASoC: SOF: Intel: Initialize chip in hda_sdw_check_wakeen_irq()
Clang warns (or errors with CONFIG_WERROR):

  sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized]
    423 |         if (chip && chip->check_sdw_wakeen_irq)
        |             ^~~~
  sound/soc/sof/intel/hda.c:418:39: note: initialize the variable 'chip' to silence this warning
    418 |         const struct sof_intel_dsp_desc *chip;
        |                                              ^
        |                                               = NULL
  1 error generated.

Add the missing initialization, following the pattern of the other irq
functions.

Fixes: 9362ab78f1 ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230809-intel-hda-missing-chip-init-v1-1-61557ca6fa8a@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-10 00:27:23 +01:00
Jerome Brunet
c1f848f121
ASoC: meson: axg-tdm-formatter: fix channel slot allocation
When the tdm lane mask is computed, the driver currently fills the 1st lane
before moving on to the next. If the stream has less channels than the
lanes can accommodate, slots will be disabled on the last lanes.

Unfortunately, the HW distribute channels in a different way. It distribute
channels in pair on each lanes before moving on the next slots.

This difference leads to problems if a device has an interface with more
than 1 lane and with more than 2 slots per lane.

For example: a playback interface with 2 lanes and 4 slots each (total 8
slots - zero based numbering)
- Playing a 8ch stream:
  - All slots activated by the driver
  - channel #2 will be played on lane #1 - slot #0 following HW placement
- Playing a 4ch stream:
  - Lane #1 disabled by the driver
  - channel #2 will be played on lane #0 - slot #2

This behaviour is obviously not desirable.

Change the way slots are activated on the TDM lanes to follow what the HW
does and make sure each channel always get mapped to the same slot/lane.

Fixes: 1a11d88f49 ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20230809171931.1244502-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-10 00:22:55 +01:00
Mark Brown
8111310849
ASoC: Merge up fixes
For the benefit of CI
2023-08-10 00:19:02 +01:00
Mark Brown
59146c3cd3
ASoC: cs35l56: Bugfixes
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Miscellaneous bugfixes for the cs35l56 codec driver.
2023-08-09 17:40:39 +01:00
Peter Ujfalusi
e6475ce253
ASoC: SOF: ipc4-topology: Update the basecfg for copier earlier
The sof_ipc4_update_resource_usage() call updates the CPC value in basecfg
and it must be done prior to making a copy of the copier configuration
for the init message.
Other module types do the resource update as last step or in case of a
process module at the correct time, before the memcpy.

Fixes: d8a2c98793 ("ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230809125656.27585-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-09 13:59:47 +01:00
Marek Szyprowski
48c6253fef
ASoC: samsung: midas_wm1811: Fix 'Headphone Switch' control creation
'Headphone Switch' control is already registered from
sound/soc/codecs/wm_hubs.c:479, so duplicating it in midas_wm1811
causes following probe failure:

midas-audio sound: control 2:0:0:Headphone Switch:0 is already present
midas-audio sound: ASoC: Failed to add Headphone Switch: -16
midas-audio sound: Failed to register card: -16
midas-audio: probe of sound failed with error -16

Fix this by dropping duplicated control.

Fixes: d27224a45e ("ASoC: samsung: midas_wm1811: Map missing jack kcontrols")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20230809100446.2105825-1-m.szyprowski@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-09 12:52:36 +01:00
Kuninori Morimoto
1a5ca2aad7
ASoC: rsnd: call of_node_put() when break
We need to call of_node_put() when break from
for_each_child_of_node(). This patch add missing
of_node_put().

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkfh9g68.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-09 12:52:35 +01:00
Simon Trimmer
e24ef967c7
ASoC: cs35l56: Call wm_adsp_power_down() before reloading firmware
When cs35l56_system_resume() needs to reload firmware it should call
wm_adsp_power_down() to put cs_dsp into a powered-down state before
cs35l56_secure_patch() or cs35l56_patch() calls wm_adsp_power_up().

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808164702.21272-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 22:34:04 +01:00
Simon Trimmer
d0a3a6ad0d
ASoC: wm_adsp: Expose the DSP power down actions as wm_adsp_power_down()
To support self-booting DSPs that operate outside of a conventional DAPM
event life cycle expose a companion function to wm_adsp_power_up() so
that the correct state of the DSP firmware and controls can be recorded.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808164702.21272-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 22:34:03 +01:00
Richard Fitzgerald
f5eb9503e8
ASoC: cs35l56: Wait for control port ready during system-resume
The CS35L56 could be hard-reset during a system suspend-resume cycle,
either by the codec driver, in cs35l56_system_resume_early(), or by ACPI.
After a hard reset the driver must wait for the control port to be ready
(datasheet tIRS time) before attempting to access the CS35L56.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808164702.21272-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 22:34:02 +01:00
Richard Fitzgerald
853734588d
ASoC: cs35l56: Don't rely on GPIOD_OUT_LOW to set RESET initially low
The ACPI setting for a GPIO default state has higher priority than the
flag passed to devm_gpiod_get_optional() so ACPI can override the
GPIOD_OUT_LOW. Explicitly set the GPIO low when hard resetting.

Although GPIOD_OUT_LOW can't be relied on this doesn't seem like a
reason to stop passing it to devm_gpiod_get_optional(). So we still pass
it to state our intent, but can deal with it having no effect.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808164702.21272-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 22:34:01 +01:00
Richard Fitzgerald
ebd0f7b08e
ASoC: cs35l56: Avoid uninitialized variable in cs35l56_set_asp_slot_positions()
Re-implement setting of ASP TDM slots so that only the common loop to
build the register word is factored out.

The original cs35l56_set_asp_slot_positions() had an apparent
uninitialized variable if the passed register address was neither of the
ASP slot registers. In fact this would never happen because the calling
code passed valid registers.

While it's trivial to initialize the variable or add a default case,
actually the only common code was the loop at the end of the function,
which simply manipulates some mask values and is identical for either
register. Factoring out the regmap_write() didn't really gain anything.

So instead re-implement the code to replace the original function with
cs35l56_make_tdm_config_word() that only does the loop, and change the
calling code to call regmap_write() directly.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808164702.21272-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 22:34:00 +01:00
Yu Liao
a932f45a18
ASoC: pxa: address unused variable warning
gcc with W=1 reports
sound/soc/pxa/pxa-ssp.c:594:15: warning: variable 'acds' set but not used [-Wunused-but-set-variable]
                                            ^
This variable is not used so remove it.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308040619.BEismjFv-lkp@intel.com/
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Link: https://lore.kernel.org/r/20230808132519.637452-1-liaoyu15@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:27 +01:00
Arnd Bergmann
87b5617243
ASoC: codecs: aw88261: avoid uninitialized variable warning
aw88261_reg_update() returns an unintialized error code in the
success path:

sound/soc/codecs/aw88261.c:651:7: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                if (aw_dev->prof_cur != aw_dev->prof_index) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/aw88261.c:660:9: note: uninitialized use occurs here
        return ret;
               ^~~
sound/soc/codecs/aw88261.c:651:3: note: remove the 'if' if its condition is always true
                if (aw_dev->prof_cur != aw_dev->prof_index) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Return zero instead here.

Fixes: 028a2ae256 ("ASoC: codecs: Add aw88261 amplifier driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230808125703.1611325-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:26 +01:00
Charles Keepax
7f5cf19703
ASoC: intel: sof_sdw: Simplify get_slave_info
Now the first device on a link is not treated specially there is no
need to have a separate loop to handle the current link over the
future links, as the logic is identical. Combine this all into a
single processing loop.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-12-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:26 +01:00
Charles Keepax
317dcdecaf
ASoC: intel: sof_sdw: Allow different devices on the same link
If the current code encounters a new type of device on a SoundWire
link, it will abort processing that link and move onto the next
link. However, there is no reason to disallow this setup, it would
appear this was being disallowed to work around issues introduced
by only the first endpoint on each link being checked, which is now
fixed.

The device type shouldn't determine which DAI link it is connected to,
the group ID and aggregation status should.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:25 +01:00
Charles Keepax
f82742dd47
ASoC: intel: sof_sdw: Support multiple groups on the same link
The current code checks the first device on a link and assumes
that all the other devices on the link will have the same endpoint
aggregation status and endpoint group ID.

Say for example a system looked like:

SDW0 - Amp 1 (Aggregated, Group 1), Mic 1 (Aggregated, Group 2)
SDW1 - Amp 2 (Aggregated, Group 1), Mic 2 (Aggregated, Group 2)

The current code would create the DAI link for the aggregated amps,
although it is worth noting that the only reason Mic 2 is not added is
the additional check that aborts processing the link when the device
changes. Then when processing the DAI link for the microphones, Mic
2 would not be added, as the check will only be done on the first
device, which would be Amp 2 and thus the wrong group, causing the
whole link to be skipped.

Move the endpoint check to be for each device rather than the first
device on each link.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-10-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:24 +01:00
Charles Keepax
f3eb3d45fd
ASoC: intel: sof_sdw: Device loop should not always start at adr_index
The current loops at the top of create_sdw_dailink process the devices
on each link starting from device index adr_index. But adr_index is only
meaningful on the first on these SoundWire links, as it is the index of
the current device on that link. This means devices will be skipped on
later links.

Say for example the system looks like this:

SDW0 - Codec (Not Aggregated), Amp 1 (Aggregated, Group 1)
SDW1 - Amp 2 (Aggregated, Group 1), Amp 3 (Aggregated, Group 1)

The code should create 2 DAI links, one for the CODEC and one for the
aggregated amps. It will create the DAI link for the codec no problem.
When it creates the DAI link for Group 1 however, create_sdw_dailink
will be called with an adr_index of 1, since that is the index of Amp
1 on SDW0.  However, as the loop in create_sdw_dailink moves onto SDW1
it will again start from adr_index, skipping Amp 2. Resulting in the amp
DAI link only have amps 1 and 3 in it.

It is reasonable to start at adr_index on the first link, since
earlier devices have by definition already been processed. However,
update the code when processing later links to handle all devices.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:23 +01:00
Charles Keepax
59736ca62e
ASoC: intel: sof_sdw: Move range check of codec_conf into inner loop
There are two problems with the current range check on the codec_conf
array.

Firstly, adr_link_next->num_adr refers to the number of devices
on the current SoundWire link, but adr_index refers to the first
SoundWire link involved in the DAI link. This means that subtracting
these two numbers is only meaningful on the first SoundWire link in the
DAI and broken on later links.

Secondly, the intention of the range check is to add the number
of remaining devices on the currently link to the current index
and ensure enough space remains. However, this assumes that all
remaining devices on the SoundWire link will be added to the current
DAI link. Ideally this would not be the case, and devices could be
grouped as the user desired.

Moving the range check into the inner loop both simplifies the code (no
need to add and subtract offsets) and allows future refactoring such
that devices on a single SoundWire link don't have to all be grouped onto
a single DAI link. The check will be processed slightly more often since
it is processed for each device rather each link but this is probe time
and the numbers involved are very small here (4 links, likely no more
than 2-4 devices per link).

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:22 +01:00
Charles Keepax
0e82229fb7
ASoC: intel: sof_sdw: Update DLC index each time one is added
In create_sdw_dailink, rather than bulk updating the index into the
DAI link components array, at the end of processing a link, do so each
time the code adds a new component. This simplifies things slightly,
as an intermediate variable is no longer needed to track the current
place in the DAI link components array.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:21 +01:00
Charles Keepax
c3d7e29ad8
ASoC: intel: sof_sdw: Pull device loop up into create_sdw_dailink
The loops which fill the codec DAI link component structures are split
across create_sdw_dailink and create_codec_dai_name. This causes the
code to be rather confusing, needing to return out the function to allow
the upper loop to iterate. Remove the create_codec_dai_name helper and
pull its code up into create_sdw_dailink, this makes it more obvious
what is happening in the code. This patch makes no functional change
just hoists the code up a level.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:20 +01:00
Charles Keepax
92e9f10a09
ASoC: intel: sof_sdw: Add helper to create a single codec DLC
Add a helper function to create a single codec DAI link component
structure. This sets things up for more refactoring of the creating of
the DAI links.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:19 +01:00
Charles Keepax
87608d3e9d
ASoC: intel: sof-sdw: Move check for valid group id to get_dailink_info
Move the check for a valid group id into get_dailink_info as
well. This does cause a slight change in behaviour in that the system
will return an error rather than just ignoring the link with an
invalid group id. There are presently no systems with invalid group
ids in mainline and failing seems more appropriate since it will
better highlight the code needs fixing.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:18 +01:00
Charles Keepax
e1cfd5fef3
ASoC: intel: sof_sdw: Check link mask validity in get_dailink_info
As get_dailink_info spins through all the links anyway simply check the
link masks there. This saves an extra check and means the code will
fail earlier if the mask is invalid.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:17 +01:00
Charles Keepax
3003ea9cb7
ASoC: intel: sof_sdw: Remove duplicate NULL check on adr_link
get_dailink_info already checked if the adr_link pointer was NULL so
there is no need to recheck later in sof_card_dai_links_create.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:16 +01:00
Charles Keepax
c307ca16c9
ASoC: intel: sof_sdw: Printk's should end with a newline
Add the missing new lines.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:15 +01:00
Li Zetao
8e5c4a9fc4
ASoC: imx-audio-rpmsg: Remove redundant initialization owner in imx_audio_rpmsg_driver
The module_rpmsg_driver() will set "THIS_MODULE" to driver.owner when
register a rpmsg_driver driver, so it is redundant initialization to set
driver.owner in the statement. Remove it for clean code.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230808021728.2978035-1-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 18:57:14 +01:00
Alper Nebi Yasak
94c40dbbff
ASoC: amd: acp3x-rt5682-max9836: Configure jack as not detecting Line Out
The RT5682, RT1015 and RT1015p codecs used in this driver do not seem
capable of distinguishing Line Out connections from Headphone, but
the driver configures its jack object as if it can. Remove the wrong
value from the jack creation call to avoid any confusion.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Link: https://lore.kernel.org/r/20230805162216.441410-1-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 13:59:24 +01:00
Ranjani Sridharan
90219f1bd2
ASoC: SOF: intel: hda: Clean up link DMA for IPC3 during stop
With IPC3, we reset hw_params during the stop trigger, so we should also
clean up the link DMA during the stop trigger.

Fixes: 1bf83fa665 ("ASoC: SOF: Intel: hda-dai: Do not perform DMA cleanup during stop")
Closes: https://github.com/thesofproject/linux/issues/4455
Closes: https://github.com/thesofproject/linux/issues/4482
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217673
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230808110627.32375-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 13:59:21 +01:00
Justin Stitt
3d28c46631 ALSA: hda/tegra: refactor deprecated strncpy
`strncpy` is deprecated for use on NUL-terminated destination strings [1].

A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on its destination buffer argument which is
_not_ the case for `strncpy`!

It should be noted that the current implementation is unlikely to have a
bug because `drv_name` is a string literal with a size of 9 while
`card->driver` has a size of 16. However, it is probably worthwhile to
switch to a more robust and less ambiguous interface.

[1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html

Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20230807-sound-pci-hda-v1-1-6d9cdcd085ca@google.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-08 14:46:11 +02:00
Ivan Orlov
bba0498bd2 ALSA: pcmtest: Remove redundant definitions
Remove redundant definitions of DEVNAME and CARD_NAME, as they're not
useful. The former is not used anywhere, and the latter is used only
in module parameters descriptions.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230804110740.9867-2-ivan.orlov0322@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-08 14:44:43 +02:00
Ivan Orlov
205b96e307 ALSA: pcmtest: Move buffer iterator initialization to prepare callback
Trigger callback is not the best place for buffer iterator
initialization, so move it out to the prepare callback, where it
have to be.

Minor enhancement: remove blank line.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230804110740.9867-1-ivan.orlov0322@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-08 14:44:42 +02:00
Mark Brown
442ece6b34
ASoC: SOF: Intel: add LunarLake support
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset first fixes a number of errors made in the hda-mlink
support, then adds Lunar Lake definitions. The main contribution is
the hda-dai changes where the HDaudio DMA is now used for SSP, DMIC
and SoundWire. In previous hardware the GPDMA (aka DesignWare) was
used and controlled by the audio firmware. The volume of code is
minimized with the abstraction added in previous kernel cycles.

Due to cross-dependencies between ASoC and SoundWire trees, the full
support for jack detection will be deferred to the next kernel
cycle. There's not much point to ask for a sync of the two trees to
support one patch for each tree - we are at -rc5 already.
2023-08-08 13:28:53 +01:00
jairaj-arava
e619948826
ASoC: Intel: sof-sdw-cs42142: fix for codec button mapping
The CS42142 soundwire codec button mapping is corrected to
handle the button detection correctly.

Fixes: 43cdea08a4 ("ASoC: Intel: sof_sdw: Add helper function for cs42l42 codec")
Signed-off-by: jairaj-arava <jairaj.arava@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807215000.515846-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:11:49 +01:00
Pierre-Louis Bossart
bd76caa26a
ASoC: Intel: sof-sdw: update jack detection quirk for LunarLake RVP
Experimental results show that the headset is only detected with the
JD2 quirk.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807215000.515846-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:11:48 +01:00
Pierre-Louis Bossart
02c7f8729a
ASoC: SOF: Intel: hda-mlink: add sublink to dev_dbg() log
When using more than one sublink for amplifier aggregation, we need to
add the sublink info to debug the programming sequences.

No functional change, only additional precisions in the log.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:48 +01:00
Pierre-Louis Bossart
1eaff2647e
ASoC: SOF: IPC4: clarify 'pipeline_ids' usage and logs
A pipeline is identified by two indices: 'instance_id' and 'pipeline_id'

This is clearly seen in kernel logs when creating a pipeline

"Create widget pipeline.20 instance 0 - pipe 20 - core 0"

but other logs are less clear

"ipc4 set pipeline 1 state 4"

Change definitions and logs to make sure the logs clearly identify
which of the two indices are used in state transitions.

No functional change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:48 +01:00
Pierre-Louis Bossart
699e146d9e
ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs
The solution used before LunarLake relies on a 'Multi-gateway'
firmware configuration. This is no longer needed with the DMA hardware
handling multiple links directly. To avoid adding a platform-specific
quirk in the generic IPC4 code, this patch resets the device count
when fetching the stream context.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:47 +01:00
Pierre-Louis Bossart
34e38f03d7
ASoC: SOF: Intel: hda-mlink: add helper to get sublink LSDIID register
We need to retrieve the current value to deal with the HDAudio
WAKEEN/WAKESTS setup.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:46 +01:00
Pierre-Louis Bossart
9362ab78f1
ASoC: SOF: Intel: add abstraction for SoundWire wake-ups
The existing code cannot work for LunarLake, let's add a layer of
abstraction.

No functional change in this patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:45 +01:00
Pierre-Louis Bossart
186ca4b522
ASoC: SOF: Intel: hda: add hw_params/free/trigger callbacks
These callbacks are just wrappers to keep the code relatively clean.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:44 +01:00
Pierre-Louis Bossart
2960ee5c48
ASoC: SOF: Intel: hda-dai: add helpers for SoundWire callbacks
During the hw_params and hw_free stages, we need to map the stream tag
and channels in the PCMSyCM registers.

The trigger callback is just a wrapper.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:43 +01:00
Pierre-Louis Bossart
bb0b992c1b
ASoC: SOF: Intel: hda-dai-ops: add ops for SoundWire
Same abstraction as SSP/DMIC, with only the get_hlink helper changing.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:42 +01:00
Pierre-Louis Bossart
f8ba62ac86
ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU DAI
When we have multiple CPU DAIs in a dailink, typically for SoundWire
aggregated solutions with amplifiers on multiple links, we only want
to allocate one HDaudio stream_tag. The simplest solution is to
allocate the hext_stream/stream_tag for the DAI with index 0 in the
dailink, and reuse the same stream for all other CPU DAIs.

This assumption relies on serialization of DAIs by the ASoC core,
where all CPU DAIs are handled in a loop.

The stream release follows the same idea of releasing the tag for the
first DAI only. Ideally we would want the loop to be handled in
reverse-order to summetry, but there is no risk of reusing a
stream_tag which is no longer valid.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:41 +01:00
Pierre-Louis Bossart
b6c508b46d
ASoC: SOF: Intel: hda-dai: add DMIC support
We can reuse the same helpers as for SSP, with just the link type
being different.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:40 +01:00
Pierre-Louis Bossart
a8338e7645
ASoC: SOF: Intel: hda-dai: add ops for SSP
Add new ops for SSP.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:39 +01:00
Pierre-Louis Bossart
12547730e5
ASoC: SOF: Intel: hda-dai-ops: add/select DMA ops for SSP
The DMA widget ops are almost similar to the HDaudio ones, with the
exception of codec_dai_set_hext_stream() which is not relevant and the
format calculation which isn't dependent on the codec dai.

The DMA ops can be selected only starting with ACE_2_0.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:38 +01:00
Pierre-Louis Bossart
e78576c4aa
ASoC: SOF: Intel: LNL: enable DMIC/SSP offload in probe/resume
In the LunarLake hardware, the default IP ownership changed to the
host driver, instead of the firmware in previous generation.

In the absence of any capability negotiation, we need to assume a
fixed partitioning between host driver and firmware. The OFLEN bit
needs to be set as early as possible for resources handled by the
firmware, since we can't control when the firmware might try to access
the resources.

For now DMIC and SSP are handled by the DSP firmware. SoundWire is a
separate case, the OFLEN bit can be set when starting-up and resuming
the aux device for each link.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:37 +01:00
Pierre-Louis Bossart
c22d532797
ASoC: SOF: Intel: split MTL and LNL operations
It was just a matter of time before we found a case where we needed
separate ops for MTL and LNL. For LNL we need to set the DMIC/SSP
OFLEN bit in the probe and resume steps, and this can only be done
cleanly with separate ops.

The function prototypes in mtl.h were added in the same order as their
implementation in mtl.c.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:36 +01:00
Ranjani Sridharan
64a63d9914
ASoC: SOF: Intel: LNL: Add support for Lunarlake platform
Add initial support for Lunarlake. For now only HDAudio interfaces are
supported, DMIC/SSP/SoundWire require additional work so that the DAIs
reuse the HDaudio DMA stream allocation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:35 +01:00
Pierre-Louis Bossart
701c0ba46f
ASoC: SOF: Intel: hda: add interface definitions for ACE2.x
All interfaces are accessible without the DSP and rely on the HDaudio
DMA only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:34 +01:00
Pierre-Louis Bossart
ef8a29bae8
ASoC: SOF: ipc4-topology: restore gateway config length
The initial code had a logic flaw where the gateway config length kept
increasing after each playback/capture trigger, with the DMA config
TLV being added at every call of sof_ipc4_prepare_copier_module()

This didn't cause any issues with regular playback/capture, but this
was flagged as an error by firmware in the case of multiple amplifiers
on different links.

Fixes: a0659f81c3 ("ASoC: SOF: ipc4-topology: add DMA config TLV to IPC data")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:33 +01:00
Ranjani Sridharan
defc0c638d
ASoC: SOF: ipc4: avoid uninitialized default instance 0
When a pipeline contains multiple DAI widgets, the pipe_widget is not
set up except for the first DAI. This result in the pipe_widget having
a default instance 0, which can conflict with another real the
pipeline instance 0 and leads to spurious transitions.

This patch makes sure the instance_id is properly initialized to a
-EINVAL value.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:32 +01:00
Pierre-Louis Bossart
7a52d7062e
ASoC: SOF: Intel: fix u16/32 confusion in LSDIID
Likely a combination of copy-paste and test coverage problem. Oops.

Fixes: 87a6ddc0cf ("ASoC: SOF: Intel: hda-mlink: program SoundWire LSDIID registers")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:31 +01:00
Pierre-Louis Bossart
7075b0c91b
ASoC: SOF: Intel: hda-mlink: fix off-by-one error
The HCHAN parameter should be the highest channel number, not the
channel count.

While we're at it, handle LCHAN with the dual __ffs helper.

Fixes: ccc2f0c1b6 ("ASoC: SOF: Intel: hda-mlink: add helper to program SoundWire PCMSyCM registers")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 23:09:30 +01:00
Yang Yingliang
93fd2be6eb
ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper
Use memdup_user_nul() helper instead of open-coding to
simplify the code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230725120247.509422-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 19:56:07 +01:00
Hans de Goede
f957172bf7
ASoC: lower "no backend DAIs enabled for ... Port" log severity
If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
frontend and backend have not been setup yet this results in
e.g. the following errors getting logged:

[   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22

pipewire triggers this leading to 96 lines getting logged
after the user has logged into a GNOME session.

Change the actual "no backend DAIs enabled for ... Port" error to
dev_err_once() to avoid it getting repeated 48 times. While at it
also improve the error by hinting the user how to fix this.

To not make developing new UCM profiles harder, also log the error
at dev_dbg() level all the time (vs once). So that e.g. dyndbg can
be used to (re)enable the messages.

Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
the other error getting logged 48 times. Userspace passing wrong
parameters should not lead to dmesg messages.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230805171435.31696-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 19:56:06 +01:00
Mark Brown
a3440da490
ASoC: Map missing jack kcontrols
Merge series from Alper Nebi Yasak <alpernebiyasak@gmail.com>:

This patchset adds missing jack kcontrols for each independently
detectable audio peripheral and maps jack pins to those kcontrols
accordingly, with the primary intent to enable/improve jack detection
handling in PulseAudio and PipeWire through JackControl UCM values.

Usually it's just splitting a joint anything-is-connected "Headset Jack"
kcontrol (from [1]) into those like "Headphone Jack" and "Headset Mic"
(similar to a previous series for Intel Chromebooks [2]). This split is
important to avoid automatically switching to a nonexistent external
microphone when a headphone-only device is connected.

When the underlying hardware seems to support it, this also adds a "Line
Out" kcontrol. This is important in case the hardware can actually
support a line-level connection via a different configuration (bypassing
output amplifiers?), or simply for userspace to display "Line Out"
instead of "Headphones" to the user for connected line-out devices.

Beyond the mappings, I had to add PIN_SWITCH card kcontrols and DAPM
widgets to avoid "unknown pin" errors on my devices, so tried to do them
for all. For Intel devices I saw a pattern of routing things to
"Platform Clock" and added to that as well. Looking at patch 5/7 of a
Mediatek-related series [3], I can only guess that routes could be
further improved, but don't know exactly how for each device. And one
more concern is I don't know if the names conflict with any controls
from codecs, although I tried to keep to names of existing widgets.

As far as I can tell, the root cause for most of why these are missing
originates to things being developed for ChromeOS, whose userspace reads
the jack input device and doesn't care for these kcontrols. There's
non-ChromeOS cases as well, maybe things got copy-pasted around and
people didn't need or couldn't figure out how to get more specific than
a single jack kcontrol. The secondary intent in this patchset is to fix
this *everywhere*, so future copy-pastes result in the right behaviour.

For more context also see:

[1] ASoC: soc-card: Create jack kcontrol without pins
https://lore.kernel.org/alsa-devel/20220408041114.6024-1-akihiko.odaki@gmail.com/

[2] ASoC: Intel: Chromebooks: remap jack pins
https://lore.kernel.org/alsa-devel/20220616214055.134943-1-pierre-louis.bossart@linux.intel.com/

[3] ASoC: mediatek: Allow separate handling of headphone and headset mic jack
https://lore.kernel.org/alsa-devel/20220922235951.252532-1-nfraprado@collabora.com/

[4] ASoC: rk3399_gru_sound: Add DAPM pins, kcontrols for jack detection
https://lore.kernel.org/alsa-devel/20200721182709.6895-1-alpernebiyasak@gmail.com/

This applies onto next-20230802. Unfortunately most of it is untested
except for a few Chromebooks I have (Kevin, Lick, Hana, Cozmo), because
I'm intentionally generalizing to everything.
2023-08-07 19:51:47 +01:00
Mark Brown
495c9e5ea3
ASoC: codecs: Add awinic AW88261 audio amplifier
Merge series from wangweidong.a@awinic.com:

The awinic AW88261 is an I2S/TDM input, high efficiency digital Smart K
audio amplifier.
2023-08-07 19:51:39 +01:00
Mark Brown
5a119551b6
ASoC: SoundWire codecs: improve pm_runtime handling
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset improves the pm_runtime behavior in rare corner cases
identified by the Intel CI in the last 6 months.

a) in stress-tests, it's not uncommon to see the following type of
warnings when the codec reports as ATTACHED

    "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
    sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"

This warning was not correlated with any functional issue, but it
exposed a design issue on when to enable pm_runtime. The recommended
practice in the pm_runtime documentation is to keep the devices in
'suspended' mode and mark them as 'active' when they are really
functional.

b) enabling pm_runtime when the codec reports as ATTACHED also creates
a problematic case when the ASoC pm_runtime_get_sync() will silently
fail due to the -EACCESS error handling. This can happen when playback
starts before the codec is enumerated.

This patchset modifies the initial stages so that codecs are
pm_runtime enabled in the .probe() callback, but become pm_runtime
'active' only when they report present. This is better aligned with
the design of the pm_runtime helpers and improved CI results
significantly.

This patchset modifies all existing SoundWire codecs (except Qualcomm
ones), but the pattern of changes is exactly the same in all patches.
2023-08-07 19:51:32 +01:00
Xia Fukun
41aad09055
ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()
Here hdr is a pointer, and we should measure the size of
struct sof_ipc_cmd_hdr.

Fixes: 12c41c779f ("ASoC: SOF: Refactor rx function for fuzzing")
Signed-off-by: Xia Fukun <xiafukun@huawei.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20230807075118.128122-1-xiafukun@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 19:44:54 +01:00
Hans de Goede
1f56643514
ASoC: lower "no backend DAIs enabled for ... Port" log severity
If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
frontend and backend have not been setup yet this results in
e.g. the following errors getting logged:

[   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22

pipewire triggers this leading to 96 lines getting logged
after the user has logged into a GNOME session.

Change the actual "no backend DAIs enabled for ... Port" error to
dev_err_once() to avoid it getting repeated 48 times. While at it
also improve the error by hinting the user how to fix this.

To not make developing new UCM profiles harder, also log the error
at dev_dbg() level all the time (vs once). So that e.g. dyndbg can
be used to (re)enable the messages.

Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
the other error getting logged 48 times. Userspace passing wrong
parameters should not lead to dmesg messages.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230805171435.31696-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 19:44:54 +01:00
Weidong Wang
028a2ae256
ASoC: codecs: Add aw88261 amplifier driver
Add i2c and amplifier registration for
aw88261 and their associated operation functions.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230804114749.215460-4-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 15:23:53 +01:00
Weidong Wang
7f4ec77802
ASoC: codecs: Add code for bin parsing compatible with aw88261
Add aw88261 compatible code to the aw88395_lib.c file
so that it can parse aw88261's bin file.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230804114749.215460-3-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 15:23:52 +01:00
Mark Brown
1ec6dffded
ASoC: jz4740: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the jz4740 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230712-asoc-jz-maple-v1-1-3f745adf96e5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:41:05 +01:00
Krzysztof Kozlowski
38b288ab45
ASoC: codecs: max9892x: Reformat to coding style
Reformat the code to match Linuxn coding style: re-indent continued
lines and stop too-early line wrapping, drop unneeded {} brackets.  No
functional impact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230730201826.70453-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:41:04 +01:00
Krzysztof Kozlowski
ddef7518e7
ASoC: codecs: max9892x: Unify interleave mode OF property
MAX98926 and MAX98927 are quite similar and use the same bindings,
although drivers were not implementing them in the same way:
MAX98926 has boolean "interleave-mode" but MAX98927 has uint32
"interleave_mode".  Unify them under maxim,interleave-mode, already used
in other Maxim device.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230730201826.70453-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:41:03 +01:00
Alper Nebi Yasak
d27224a45e
ASoC: samsung: midas_wm1811: Map missing jack kcontrols
This driver does not map jack pins to kcontrols that PulseAudio/PipeWire
need to handle jack detection events. The WM1811 codec used here seems
to support detecting Headphone and Headset Mic connections. Expose each
to userspace as a kcontrol and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-28-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:09 +01:00
Alper Nebi Yasak
c9d3401844
ASoC: samsung: lowland: Split Line Out jack kcontrol from Headphone
This driver has correctly mapped jack kcontrols for Headphone and
Headset Mic. However, it is also mapping Line Out jack detection events
to the Headphone kcontrol.

The WM5100 codec used here can distinguish Line Out connections from
Headphone connections. Decouple the two, expose Line Out to userspace as
an independent kcontrol and add the necessary widget.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-27-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:08 +01:00
Alper Nebi Yasak
4d87362f01
ASoC: samsung: littlemill: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The WM8958 codec used
here can detect Headphone and Headset Mic connections. Expose each to
userspace as a kcontrol and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-26-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:06 +01:00
Alper Nebi Yasak
24127e5a07
ASoC: rockchip: rockchip_rt5645: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5645 codec used
here supports detecting Headphone and Headset Mic connections. Expose
both to userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-25-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:05 +01:00
Alper Nebi Yasak
d60e810a0f
ASoC: rk3399-gru-sound: Map missing Line Out jack kcontrol
Commit d0508b4f16 ("ASoC: rk3399_gru_sound: Add DAPM pins, kcontrols
for jack detection") maps kcontrols for Headphones and Headset Mic jacks
for this driver so that PulseAudio and PipeWire can handle insertion
events for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widget.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-24-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:04 +01:00
Alper Nebi Yasak
242372d64e
ASoC: qcom: sdm845: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5663 codec used
here can detect Headphone and Headset Mic connections. Expose each to
userspace as a kcontrol.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-23-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:03 +01:00
Alper Nebi Yasak
4ab959e5a1
ASoC: qcom: sc7280: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5682 and
RT5682s codecs used here can detect Headphone and Headset Mic
connections. Expose each to userspace as a kcontrol.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-22-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:02 +01:00
Alper Nebi Yasak
883bfefca4
ASoC: qcom: sc7180: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5682 and
RT5682s codecs used here can detect Headphone and Headset Mic
connections. Expose each to userspace as a kcontrol.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-21-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:33:00 +01:00
Alper Nebi Yasak
45bda58af8
ASoC: qcom: apq8016_sbc: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. It seems to support
detecting Headphone and Headset Mic connections. Expose each to
userspace as a kcontrol and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-20-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:59 +01:00
Alper Nebi Yasak
26de9cc1b9
ASoC: mediatek: mt8186-mt6366-da7219-max98357: Map missing jack kcontrols
Commit 8e98674868 ("ASoC: mediatek: mt8186-da7219: Expose individual
headset jack pins") maps kcontrols for Headphone and Headset Mic jacks
for this driver so that PulseAudio and PipeWire can handle jack
detection events for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-19-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:58 +01:00
Alper Nebi Yasak
09a22368bb
ASoC: mediatek: mt8183-mt6358-ts3a227-max98357: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The TS3A227 component
used here can detect Headphones and Headset Mic connections. Expose each
to userspace as kcontrols and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-18-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:57 +01:00
Alper Nebi Yasak
9c7388baa2
ASoC: mediatek: mt8183-da7219-max98357: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The DA7219 codec used
here can detect Headphones, Headset Mic and Line Out connections. Expose
each to userspace as kcontrols and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-17-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:55 +01:00
Alper Nebi Yasak
0ef5533f7b
ASoC: mediatek: mt8173-rt5650: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5645 codec used
here can detect Headphone and Headset Mic connections. Expose both to
userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-16-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:54 +01:00
Alper Nebi Yasak
8badca99ca
ASoC: mediatek: mt8173-rt5650-rt5676: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5645 codec used
here can detect Headphone and Headset Mic connections. Expose both to
userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-15-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:53 +01:00
Alper Nebi Yasak
87eb19815f
ASoC: mediatek: mt8173-rt5650-rt5514: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5645 codec used
here can detect Headphone and Headset Mic connections. Expose each to
userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-14-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:52 +01:00
Alper Nebi Yasak
73864428ba
ASoC: mediatek: mt8173-max98090: Configure jack as a Headset jack
This driver has correctly mapped jack kcontrols for Headphone and
Headset Mic. However, it is configuring the jack to only care about
Headphone events. The MAX98090 codec used here can detect both
connections, so configure the jack as such.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-13-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:51 +01:00
Alper Nebi Yasak
105e84586b
ASoC: imx-es8328: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. It seems to have a
single detection GPIO pin used to report everything as a Headset. But it
has widgets for Headphone and Mic Jack, so expose both to userspace as
kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-12-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:49 +01:00
Alper Nebi Yasak
7265089ade
ASoC: Intel: sof_da7219_max98373: Map missing Line Out jack kcontrol
Commit 2913bb1f68 ("ASoC: Intel: sof_da7219_max98373: remap jack
pins") maps kcontrols for Headphone and Headset Mic jacks for this
driver so that PulseAudio and PipeWire can handle jack detection events
for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-11-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:48 +01:00
Alper Nebi Yasak
2830bfdbe9
ASoC: Intel: kbl_da7219_max98927: Map missing Line Out jack kcontrol
Commit b9f53b9fc1 ("ASoC: Intel: kbl_da7219_max98927: remap jack
pins") maps kcontrols for Headphone and Headset Mic jacks for this
driver so that PulseAudio and PipeWire can handle jack detection events
for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-10-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:47 +01:00
Alper Nebi Yasak
da09176f1f
ASoC: Intel: kbl_da7219_max98357a: Map missing Line Out jack kcontrol
Commit c2065d43ae ("ASoC: Intel: kbl_da7219_max98357a: remap jack
pins") maps kcontrols for Headphone and Headset Mic jacks for this
driver so that PulseAudio and PipeWire can handle jack detection events
for these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-9-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:46 +01:00
Alper Nebi Yasak
4e06382c0d
ASoC: Intel: bytcr_wm5102: Map missing Line Out jack kcontrol
Commit ecd77d494e ("ASoC: Intel: bytcr_wm5102: Add jack detect
support") maps kcontrols for Headphone and Headset Mic jacks for this
driver so that PulseAudio and PipeWire can handle jack detection events
for these peripherals.

The WM5102 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-8-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:45 +01:00
Alper Nebi Yasak
92d7071f75
ASoC: Intel: bxt_da7219_max98357a: Map missing Line Out jack kcontrol
Commit bbdd4ea219 ("ASoC: Intel: bxt_da7219_max98357a: remap jack
pins") maps kcontrols for Headphone and Headset Mic jacks for this
driver so that PulseAudio and PipeWire can handle detection events for
these peripherals.

The DA7219 codec used here can also distinguish between Headphone and
Line Out connections that go into the same physical port. Expose the
latter to userspace as a kcontrol as well and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-7-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:44 +01:00
Alper Nebi Yasak
c699fc46f4
ASoC: Intel: avs: da7219: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The DA7219 codec used
here can detect Headphones, Headset Mic and Line Out connections. Expose
each to userspace as kcontrols and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-6-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:42 +01:00
Alper Nebi Yasak
00c7ee8208
ASoC: amd: acp3x-rt5682-max9836: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5682, RT1015
and RT1015p codecs used here can detect Headphone and Headset Mic
connections. Expose the former two to userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-5-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:41 +01:00
Alper Nebi Yasak
7ac3404c2e
ASoC: amd: acp: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5682, RT5682s,
NAU8825 and NAU8821 codecs used here can detect Headphone and Headset
Mic connections. Expose both to userspace as kcontrols and add the
necessary widgets. Split the jack and pin structs per-codec to
accommodate for per-codec differences.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-4-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:40 +01:00
Alper Nebi Yasak
596c92fb77
ASoC: amd: acp-rt5645: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5645 codec used
here can detect Headphone and Headset Mic connections. Expose both to
userspace as kcontrols.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-3-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:39 +01:00
Alper Nebi Yasak
5532a1cfed
ASoC: amd: acp-da7219-max98357a: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The DA7219 codec used
here can detect Headphones, Headset Mic and Line Out connections. Expose
each to userspace as kcontrols and add the necessary widgets.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-2-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:38 +01:00
Pierre-Louis Bossart
b48f324f89
ASoC: max98373-sdw: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:33 +01:00
Pierre-Louis Bossart
d6ce285641
ASoC: max98363: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:32 +01:00
Pierre-Louis Bossart
4af11e11de
ASoC: rt5682-sdw: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:31 +01:00
Pierre-Louis Bossart
df93dfa2b4
ASoC: rt1318-sdw: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:30 +01:00
Pierre-Louis Bossart
64bae6732b
ASoC: rt1316-sdw: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:30 +01:00
Pierre-Louis Bossart
1772552eb3
ASoC: rt1308-sdw: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:29 +01:00
Pierre-Louis Bossart
e4a3b8cf40
ASoC: rt715-sdca: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:28 +01:00
Pierre-Louis Bossart
279be59195
ASoC: rt715: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:27 +01:00
Pierre-Louis Bossart
8d890ecef1
ASoC: rt712-sdca-dmic: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:26 +01:00
Pierre-Louis Bossart
f3da2ed110
ASoC: rt1712-sdca: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:25 +01:00
Pierre-Louis Bossart
6b8f8c5e6f
ASoC: rt700: enable pm_runtime in probe, keep status as 'suspended'
This patch suggests enabling pm_runtime during the probe, but marking the
device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

The changes are directly inspired by RT711 and RT711-sdca changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:24 +01:00
Pierre-Louis Bossart
0c321fb857
ASoC: rt711-sdca: enable pm_runtime in probe, keep status as 'suspended'
In stress cases involving module insertion/removal followed by
playback/capture, it can happen that capture/playback is started
before the codec enumeration completes.

The codec driver registers its components with the ASoC framework
during the probe stage, so there is currently no way for the card
creation to wait for the codec enumeration/initialization to complete.

In addition, when the capture/playback starts, the ASoC framework uses
pm_runtime_get_sync() to properly refcount and power-manage
devices. This is problematic in the SoundWire case because pm_runtime
is enabled during the enumeration/initialization stage, so
pm_runtime_get_sync() will return -EACCESS which is
ignored. Additional errors will happen when setting the pm_runtime
status as 'active' because the parent is not properly resumed,
resulting in an error such as:

"rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"

This patch suggests enabling pm_runtime during the probe, but marking
the device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

Closes: https://github.com/thesofproject/linux/issues/4328
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:23 +01:00
Pierre-Louis Bossart
a8590dd73d
ASoC: rt711: enable pm_runtime in probe, keep status as 'suspended'
In stress cases involving module insertion/removal followed by
playback/capture, it can happen that capture/playback is started
before the codec enumeration completes.

The codec driver registers its components with the ASoC framework
during the probe stage, so there is currently no way for the card
creation to wait for the codec enumeration/initialization to complete.

In addition, when the capture/playback starts, the ASoC framework uses
pm_runtime_get_sync() to properly refcount and power-manage
devices. This is problematic in the SoundWire case because pm_runtime
is enabled during the enumeration/initialization stage, so
pm_runtime_get_sync() will return -EACCESS which is
ignored. Additional errors will happen when setting the pm_runtime
status as 'active' because the parent is not properly resumed,
resulting in an error such as:

"rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"

This patch suggests enabling pm_runtime during the probe, but marking
the device as 'active' only after it is enumerated. That will force a
dependency between the card and the codec, pm_runtime_get_sync() will
have to wait for the codec device to resume and hence implicitly wait
for the enumeration/initialization to be completed. In the nominal
case where the codec device is already active the get_sync() would
only perform a ref-count increase.

Closes: https://github.com/thesofproject/linux/issues/4328
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:22 +01:00
Pierre-Louis Bossart
6ab1810502
ASoC: rt5682-sdw: make regmap cache-only in probe
The RT5682 needs specific attention: there are two regmap in
rt5682_priv struct, one is sdw_regmap which is for IO transfer, and
the other is used for registers control.

We need to set both regmaps when we set cache only. Because if we set
rt5682->sdw_regmap only, rt5682->regmap won't set/get the right value
when it call regmap_write/read(rt5682->sdw_regmap, ...). If we set
rt5682->regmap only, regmap_write(rt5682->sdw_regmap, ...) is used
in rt5682_clock_config which will be called by the ..bus_config ops.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:21 +01:00
Pierre-Louis Bossart
49ae74abc7
ASoC: SoundWire codecs: make regmap cache-only in probe
The SoundWire bus may start after the probe where the SoundWire ASoC
components are registered. This creates a time window where the card
can be created and the registers be accessed.

As discussed on the mailing list, we can't really control when codecs
are enumerated and initialized, but we can make sure the access to the
codecs is cached until the hardware is accessible.

This patch configures regcache_cache_only() with a 'true' parameter in
the probe function, and a 'false' parameter in the io_init routine.

The rt5682 is handled through a different patch due to its specific
cache handling.

Link: https://lore.kernel.org/alsa-devel/20230503144102.242240-1-krzysztof.kozlowski@linaro.org/
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:20 +01:00
Pierre-Louis Bossart
3f3d66ba99
ASoC: SoundWire codecs: return error status in probe
For some reason the first batch of SoundWire codec drivers squelch
errors in the SoundWire probe callback.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802153629.53576-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:19 +01:00
Zhang Shurong
c163108e70
ASoC: rt5665: add missed regulator_bulk_disable
The driver forgets to call regulator_bulk_disable()

Add the missed call to fix it.

Fixes: 33ada14a26 ("ASoC: add rt5665 codec driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_A560D01E3E0A00A85A12F137E4B5205B3508@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:14 +01:00
Yang Yingliang
9606cda350
ASoC: ti: davinci-evm: simplify the code with module_platform_driver
The init/exit() of driver only calls platform_driver_register/unregister,
it can be simpilfied with module_platform_driver.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230804085402.1328033-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-04 13:30:44 +01:00
Fabio Estevam
422f10adc3
ASoC: wm8960: Add support for the power supplies
WM8960 has the following power supplies:

- AVDD
- DBVDD
- DCVDD
- SPKVDD1
- SPKVDD1

Add support for them.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230803215506.142922-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-04 13:30:43 +01:00
Trevor Wu
1d54134df4
ASoC: SOF: mediatek: mt8186 modify dram type as non-cache
To prevent incorrect access between the host and DSP sides, we need to
modify DRAM as a non-cache memory type. Additionally, we can retrieve
the size of shared DMA from the device tree.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Reviewed-by: Kuan-Hsun Cheng <Allen-KH.Cheng@mediatek.com>
Link: https://lore.kernel.org/r/20230803075028.32170-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-04 13:30:41 +01:00
Bard Liao
3853111015
ASoC: max98363: don't return on success reading revision ID
max98363_io_init needs to keep going when we read revision ID
successfully.

Fixes: 18c0af945f ("ASoC: max98363: add soundwire amplifier driver")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230804034734.3848227-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-04 13:26:51 +01:00
Takashi Iwai
4d84f763f7 ASoC: Fix for v6.5
Not really a fix, but rather a licensing update for the fsl_micfil
 driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTL+ToACgkQJNaLcl1U
 h9AxVAf/eOl186cHrwHv1OId/GI+H7DtDfUY9NXMALxxVzqlzyp/Q8Giw0QYwWMc
 ALCET44nMErbukRTrItfwvQR91NK4NZo4tOuIC+SNZL7lmWAsSZpWx7OrL/e43LI
 9qTP3YI412S5RF5Ph6wKlAiB2mqM/3zYAqjgKXHe0qT59DHjm3Utk1feqJ6aZR5C
 73osmygh3Y1ZF/IS43E2J01aLxOSkLzmROnNh8po5ZilwQkZxGcedzFt2AfkWe3b
 GwSi96hK2ahZkSXjUNSzzY7IwnMsblceIFbYTfPBW4jZ45rreANO8HIcisxND4FZ
 8l/fijwjEs9OTbqy6jJIsin/r2/L5Q==
 =HGzt
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.5-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fix for v6.5

Not really a fix, but rather a licensing update for the fsl_micfil
driver.
2023-08-04 13:53:15 +02:00
Takashi Iwai
d700a11633 Merge branch 'topic/intel-hda' into for-next
Pull ArrowLake-S PCI ID addition and config for MTL/LNL

Link: https://lore.kernel.org/r/20230802150105.24604-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 13:05:42 +02:00
Kai Vehmanen
3f8c530fc4 ALSA: hda/i915: extend connectivity check to cover Intel ARL
Expand the HDA/I915 connectivity check to correctly handle
the PCI topology used in some Intel Arrow Lake products.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Tested-by: "T, Arun" <arun.t@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230802150105.24604-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 12:53:53 +02:00
Pierre-Louis Bossart
d2852b8c04 ALSA: hda: intel-dsp-cfg: add LunarLake support
One more PCI ID for the road.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802150105.24604-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 12:53:53 +02:00
Pierre-Louis Bossart
73e6ebf6a2 ALSA: hda: intel-dsp-cfg: use common include for MeteorLake
This was not updated in Commit 0cd0a7c2c5 ("ALSA: intel-dsp-config: Convert to PCI device IDs defines")

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230802150105.24604-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 12:53:53 +02:00
Kai Vehmanen
3bef068168 ALSA: hda: add HD Audio PCI ID for Intel Arrow Lake-S
Add HD Audio PCI ID for Intel Arrow Lake-S platform.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230802150105.24604-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 12:53:53 +02:00
dengxiang
788449ae57 ALSA: usb-audio: Add support for Mythware XA001AU capture and playback interfaces.
This patch adds a USB quirk for Mythware XA001AU USB interface.

Signed-off-by: dengxiang <dengxiang@nfschina.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230803024437.370069-1-dengxiang@nfschina.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04 12:47:30 +02:00
Daniel Baluta
f803ec6368
ASoC: fsl: micfil: Use dual license micfil code
We need this in order to easily reuse register definitions
and some functions with Sound Open Firmware driver.

According to Documentation/process/license-rules.rst:
    "Dual BSD/GPL"	The module is dual licensed under a GPL v2
			variant or BSD license choice. The exact
			variant of the BSD license can only be
			determined via the license information
			in the corresponding source files.

so use "Dual BSD/GPL" for license string.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20230803072638.640789-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-03 14:54:06 +01:00
Sebastian Andrzej Siewior
248c74bf42
ASoC: mediatek: mt8186: Remove unused mutex.
The mutex mutex_request_dram has no user.

Remove mutex_request_dram.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230803083908.9DxbPvOK@linutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-03 12:29:12 +01:00
Stefan Binding
cfad53a99d ALSA: hda: cs35l41: Print amp configuration after bind
Print amp configuration information to be able to confirm ACPI
_DSD information (and other useful info) for each amp on each
system using CS35L41, without having to get the acpidump.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230802121235.467358-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-02 15:41:41 +02:00
Chancel Liu
a38a4090e2
ASoC: fsl_micfil: Use SET_SYSTEM_SLEEP_PM_OPS to simplify PM
Use SET_SYSTEM_SLEEP_PM_OPS to simplify suspend and resume function.
fsl_micfil_suspend() and fsl_micfil_resume() can be deleted.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230802052117.1293029-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-02 13:10:34 +01:00
Chancel Liu
367365051b
ASoC: fsl_micfil: Add fsl_micfil_use_verid function
fsl_micfil_use_verid() can help to parse the version info in VERID and
PARAM registers. Since the two registers are added only on i.MX93
platform, a member flag called use_verid is introduced to soc data
structure which indicates acquiring MICFIL version.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230802052117.1293029-3-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-02 13:10:33 +01:00
Chancel Liu
51d765f79c
ASoC: fsl_micfil: Add new registers and new bit definition
MICFIL IP is upgraded on i.MX93 platform. These new registers and new
bit definition are added to complete the register list.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230802052117.1293029-2-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-02 13:10:32 +01:00
Yu Liao
d28dc3d87f ALSA: ac97: set variables dev_attr_vendor_id to static
sparse reports
sound/ac97/bus.c:465:1: sparse: sparse: symbol 'dev_attr_vendor_id' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307242300.Oy0Dp2QI-lkp@intel.com/
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Link: https://lore.kernel.org/r/20230802022649.2514787-1-liaoyu15@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-02 09:27:39 +02:00
Yue Haibing
fbeb1ec85d ALSA: usb-audio: Remove unused function declaration
Commit 68e67f40b7 ("ALSA: snd-usb: move calls to usb_set_interface")
leave this unused declaration.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230801144512.18716-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 16:56:57 +02:00
Mark Brown
224be454ef
ASoC: Intel: machine driver updates for 6.6
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Lots of small cleanups coming from Bard Liao and Charles Keepax for
SoundWire platforms, and minor additions for RVPs and Chromebooks.
2023-08-01 14:56:00 +01:00
Mark Brown
d09fd7eb07
ASoC/SOF/Intel/AMD: cleanups for GCC11 -fanalyzer
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

GCC11 provides an '-fanalyzer' static analysis option which does not
provide too many false-positives. This patch cleans-up known
problematic code paths to help enable this capability in CI. We've
used this for about a month already.
2023-08-01 12:45:03 +01:00
Richard Fitzgerald
8ca3ee6f3f ALSA: hda/cs35l56: Reject I2C alias addresses
The ACPI nodes for CS35L56 can contain an extra I2CSerialBusV2 that
is not a real device, it is an alias address.

This alias address will not be in the cirrus,dev-index array, so reject
any instantions with a device address not found in the array.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-10-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:09 +02:00
Richard Fitzgerald
3106797d2b ALSA: hda/cs35l56: Fail if .bin not found and firmware not patched
A tuning patch is always needed to enable the ASP audio port.
If the BIOS did not patch the firmware, then it is mandatory to
have a .bin file.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-9-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:08 +02:00
Richard Fitzgerald
2f860dd895 ALSA: hda/cs35l56: Do not download firmware over existing RAM firmware
A RAM firmware can only be downloaded if the CS35L56 is currently
running from ROM firmware. The driver must not try to overwrite
the RAM if the CS35L56 is already running from that RAM.

Firmware can be downloaded in these two cases:

- The BIOS has already patched the firmware (secured mode).
  In this case the firmware files will only contain tunings that
  are safe to overwrite.

- The CS35L56 is running the built-in ROM firmware.

After a RAM firmware has been downloaded it can only be cleared by
hard resetting CS35L56. Some systems only hard-reset during
power-on and do not give the driver control of hard reset.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-8-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:08 +02:00
Richard Fitzgerald
0ba0dfd969 ALSA: hda/cs35l56: cs_dsp_power_down() on cs35l56_hda_fw_load() error path
If cs35l56_hda_fw_load() successfully called cs_dsp_power_up() the error
path must balance that with a call to cs_dsp_power_down().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-7-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:07 +02:00
Richard Fitzgerald
fb78d73dde ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()
In cs35l56_hda_unbind() cs_dsp_power_down() must be called to cleanup
before calling cs_dsp_remove cs_dsp_remove().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-6-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:06 +02:00
Richard Fitzgerald
e5bac77b67 ALSA: hda/cs35l56: Always power-up and start cs_dsp
Always call cs_dsp_power_up() and cs_dsp_run() in
cs35l56_hda_fw_load() even if there aren't any firmware files
to download. Also, if there aren't any firmware files to
download there is no need to do cs35l56_firmware_shutdown() and
cs35l56_system_reset().

If there aren't any firmware files there's no need to write
anything to the CS35L56 registers to make it work - it will
already be running the ROM firmware. So it's not strictly
necessary to start cs_dsp.

But it's perfectly ok to call cs_dsp_power_up() and
cs_dsp_run() without downloading any firmware. This avoids
having to support a state where audio is playing but cs_dsp
is not running.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-5-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:06 +02:00
Richard Fitzgerald
15c378d66f ALSA: hda/cs35l56: Call cs_dsp_power_down() before reloading firmware
When firmware is reloaded after a system resume cs_dsp_power_down() should
be called before calling cs_dsp_power_up().

The fw_patched flag should also be cleared and only set again if the
firmware download succeeded.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-4-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:05 +02:00
Richard Fitzgerald
c36570970a ALSA: hda/cs35l56: Do not mark cache dirty after REINIT
Only call regcache_mark_dirty() in cs35l56_hda_fw_load() if
the CS35L56 was SYSTEM_RESET.

recache_mark_dirty() changes the behaviour of regcache_sync()
to write out cache values that are not the default value, and
skip cache values that are the default.

AUDIO_REINIT does not reset the registers. regcache_mark_dirty()
after AUDIO_REINIT could cause the regcache_sync() to sync
registers incorrectly because it will assume that all registers
have reset to default.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-3-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:04 +02:00
Richard Fitzgerald
7b6466ad1d ALSA: hda/cs35l56: Complete firmware reboot before calling cs_dsp_run()
Move the call to cs_dsp_run() in cs35l56_hda_fw_load() so that it
is after the CS35L56 has been reset/reinit'd and the regmap
cache has been synced.

cs_dsp_run() syncs up ALSA control cache values with the DSP memory
so this must not be done until the firmware has reinitialized.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230731165726.7940-2-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01 08:30:04 +02:00
Trevor Wu
ed19c4a9b1
ASoC: SOF: ipc3: update dai_link_fixup for SOF_DAI_MEDIATEK_AFE
For MediaTek AFE, DAI DMA can support different bitwidths compared to
the BE DAI. Therefore, it is preferable to obtain the BE frame format
from the DAI_CONFIG.

Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731213242.434594-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:24:02 +01:00
Pierre-Louis Bossart
cf35ab3d58
ASoC: soc-acpi: improve log messagesin link_slaves_found()
use 'part_id' to follow MIPI/SoundWire wording and use more consistent
%#x format.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230731213242.434594-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:24:01 +01:00
Pierre-Louis Bossart
bb29a33c4b
ASoC: soc-acpi: move link_slaves_found()
Move existing function in common library to make sure the code can be
reused by other SoC vendors.

No functionality change outside of the move and added prefix.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230731213242.434594-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:24:00 +01:00
Pierre-Louis Bossart
799d9933ba
ASoC: SOF: Intel: start simplify the signature of link_slaves_found()
Start removing Intel-specific arguments to make that function usable
by other SOC vendors.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230731213242.434594-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:24:00 +01:00
Charles Keepax
a60ed3b738
ASoC: intel: sof_sdw: Move group_generated logic
Hoist the handling logic for group_generated up to the
sof_card_dai_links_create level. This avoids the need to pass the array
through multiple levels of functions.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:43 +01:00
Charles Keepax
a386162e7d
ASoC: intel: sof_sdw: Merge codec_conf_alloc into dailink_info
Rename get_sdw_dailink_info to simply get_dailink_info and have it also
return the number of codecs present. Then hoist the allocation of the
codec conf structure up into sof_card_dai_links_create. This saves an
extra loop through the adr_link array, allows us to get rid of
sof_card_codec_conf_alloc and makes the allocation more explicit.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:42 +01:00
Charles Keepax
98a7a1143f
ASoC: intel: sof_sdw: Clean up DAI link counting
The counting of each of the types of DAI link is a bit messy with things
added onto an intermediate variable as it goes along. Re-order things a
little to keep the order consistent with the rest of the function and
simplify the process down to a variable for each type of DAI and then
sum them at the end.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:41 +01:00
Chao Song
4754e29c77
ASoC: Intel: sof_sdw: add cs35l56 codec info
Add cs35l56 support in sof_sdw machine driver.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:40 +01:00
Charles Keepax
0095820081
ASoC: intel: sof_sdw: Allow direct specification of CODEC name
Add support for MFD based CODEC drivers, by allowing the CODEC name to
not be the SoundWire device directly.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:39 +01:00
Bard Liao
656dd91a3a
ASoC: Intel: sof_sdw: break earlier when a adr link contains different codecs
create_codec_dai_name() is used to create codec component's information
in different adr links. We can and should break before we do anything.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:38 +01:00
Charles Keepax
8673e68b59
ASoC: intel: sof_sdw: Move amp_num initialisation to mc_probe
The amp_num member of the info struct is zeroed at the start of
sof_card_dai_links_create, but then summed in mc_probe after
sof_card_dai_links_create is called. It is a little clearer to hoist the
initialisation out of sof_card_dai_links_create so it is on the same
level as the summation.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:37 +01:00
Charles Keepax
febac07b4c
ASoC: intel: sof_sdw: Remove redundant parameters in dai creation
Pull the device and mach struct out of the card rather than explicitly
passing to sof_card_dai_links_create.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:36 +01:00
Charles Keepax
855e69f4ff
ASoC: intel: sof_sdw: Minor tidy up of mc_probe
Shuffle things around to group operations a little more, and
consistently use card->dev.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:35 +01:00
Charles Keepax
fad1a9eff6
ASoC: intel: sof_sdw: Constify parameter to find_codec_part_info
The address passed to find_codec_part_info should be const.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:34 +01:00
Charles Keepax
31a54f78ad
ASoC: intel: sof_sdw: Simplify find_codec_info_acpi
Use a return rather than a break and an additional range check.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:33 +01:00
Charles Keepax
18c45cb362
ASoC: intel: sof_sdw: Use a module device table
A module device table is generally preferred over hard coding a
MODULE_ALIAS.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:32 +01:00
Charles Keepax
08f62f6291
ASoC: intel: sof_sdw: Remove some extra line breaks
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:31 +01:00
Charles Keepax
4fc16d21b7
ASoC: intel: sof_sdw: Rename codec_idx to codec_dlc_index
Having two local variables called codec_idx and codec_index, that refer
to different things is a little confusing. Rename codec_idx to
codec_dlc_index to indicate it points into the dai_link_component array.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:30 +01:00
Charles Keepax
1d1062382b
ASoC: intel: sof_sdw: Use consistent variable naming for links
The driver makes extensive use of both ACPI link and ASoC DAI link
structs, often referring to both with the variable name link. Make the
code a little easier to follow by consistently using adr_link for the
ACPI bits and dai_links for the ASoC bits.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:29 +01:00
Pierre-Louis Bossart
0cc85f2bfb
ASoC: Intel: sof_sdw: add support for SKU 0AFE
Yet another missing configuration, with the standard configuration

link0: rt711-sdca
link 1 and 2: rt1316-sdca
link3: rt714-sdca

Link: https://github.com/thesofproject/sof/issues/7799
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:29 +01:00
Bard Liao
616bee2c06
ASoC: Intel: sof_sdw: rename link_id to be_id
The link_id parameter in create_sdw_dailink is actually the BE link id.
Rename it to be_id to be consistent with the caller and less confusion.
No functionality change.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:28 +01:00
Pierre-Louis Bossart
3390d4ed82
ASoC: Intel: sof_sdw: allow mockup amplifier to provide feedback
The capture setting are missing and preventing topologies with
feedback from loading.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:27 +01:00
Pierre-Louis Bossart
4b68ce6912
ASoC: Intel: sof_sdw: reorder SoundWire codecs in Kconfig
No functionality change, just sort Realtek codecs using increasing
part IDs.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:26 +01:00