Commit Graph

31607 Commits

Author SHA1 Message Date
Krzysztof Kozlowski
a9d843e6b2
ASoC: codecs: wcd939x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-7-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:21 +01:00
Krzysztof Kozlowski
5e388488f0
ASoC: codecs: wcd938x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-6-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:20 +01:00
Krzysztof Kozlowski
42f3a2caf8
ASoC: codecs: wcd937x: Move max port number defines to enum
Instead of having separate define to indicate number of TX and RX
Soundwire ports, move it to the enums defining actual port
indices/values.  This makes it more obvious why such value was chosen as
number of TX/RX ports.
Note: the enums start from 1, thus number of ports equals to the last
vaue in the enum.

WCD937X_MAX_SWR_PORTS is used in one of structures in the header, so
entire enum must be moved to the top of the header file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-5-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:19 +01:00
Krzysztof Kozlowski
06fa827127
ASoC: codecs: wcd938x: Drop unused defines and enums
Drop defines and enums not used in the driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-4-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:18 +01:00
Krzysztof Kozlowski
125ed86b0d
ASoC: codecs: wsa884x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa884x_port_ids, e.g.
WSA884X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-3-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:17 +01:00
Krzysztof Kozlowski
add41ea550
ASoC: codecs: wsa883x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa_port_ids, e.g.
WSA883X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-2-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:16 +01:00
Krzysztof Kozlowski
874d04fe15
ASoC: codecs: wsa881x: Use designator array initializers for Soundwire ports
Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa_port_ids, e.g.
WSA881X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-1-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:41:16 +01:00
Chen Ni
275d57ae44
ASoC: cs42l42: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Fixes: 90f6a2a20b ("ASoC: cs42l42: Add SoundWire support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Link: https://patch.msgid.link/20240716025307.400156-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:44 +01:00
Takashi Iwai
aaa5e1aa39
ASoC: Use __counted_by() annotation for snd_soc_pcm_runtime
The struct snd_soc_pcm_runtime has a flex array of snd_soc_component
objects at its end, and the size is kept in num_components field.
We can add __counted_by() annotation for compiler's assistance to
catch array overflows.

A slight additional change is the assignment of rtd->components[];
the array counter has to be incremented at first for avoiding
false-positive reports from compilers.

Also, the allocation size of snd_soc_pcm_runtime is cleaned up with
the standard struct_size() helper, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240726155237.21961-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:42 +01:00
Chen Ni
42eb47310f
ASoC: mediatek: mt8192: remove redundant null pointer check before of_node_put
of_node_put() has taken the null pointer check into account. So it is safe
to remove the duplicated check before of_node_put().

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240709085131.1436128-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:41 +01:00
Biju Das
4f8cd05a43
ASoC: sh: rz-ssi: Add full duplex support
Add full duplex support, to support simultaneous
playback/record on the same ssi channel.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20240715092322.119879-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:40 +01:00
Krzysztof Kozlowski
b3f35bae68
ASoC: codecs: lpass-wsa-macro: Do not hard-code dai in VI mixer
The wsa_macro_vi_feed_mixer_put() callback for setting VI feedback mixer
value could be used for different DAIs (planned in the future CPS DAI),
so make the code a bit more generic by using DAI ID from widget->shift,
instead of hard-coding it.  The get() callback already follows such
convention.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240723144607.123240-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:39 +01:00
Ma Ke
3ff810b9be
ASoC: rt5682s: Return devm_of_clk_add_hw_provider to transfer the error
Return devm_of_clk_add_hw_provider() in order to transfer the error, if it
fails due to resource allocation failure or device tree clock provider
registration failure.

Fixes: bdd229ab26 ("ASoC: rt5682s: Add driver for ALC5682I-VS codec")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20240717115436.3449492-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:38 +01:00
Zhang Yi
6024f3429f
ASoC: codecs: ES8326: suspend issue
We find that we need to disable micbias for the codec to enter suspend
So We modify the trigger conditions for enable_micbias and disable_micbias

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240726031002.35055-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:18:36 +01:00
Krzysztof Kozlowski
7eb62acd43
ASoC: codecs: wsa884x: Simplify handling variant
Driver does not use detected variant variable past the init function, so
do not store it in the state container structure.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-4-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:19 +01:00
Krzysztof Kozlowski
cd15fded0e
ASoC: codecs: wsa883x: Simplify handling variant/version
Driver does not use detected variant/version variables past the init
function, so do not store them in the state container structure.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-3-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:18 +01:00
Krzysztof Kozlowski
2fbf16992e
ASoC: codecs: wsa883x: Handle reading version failure
If reading version and variant from registers fails (which is unlikely
but possible, because it is a read over bus), the driver will proceed
and perform device configuration based on uninitialized stack variables.
Handle it a bit better - bail out without doing any init and failing the
update status Soundwire callback.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-2-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:17 +01:00
Krzysztof Kozlowski
3d2a69eb50
ASoC: codecs: wsa881x: Drop unused version readout
Driver does not use the device version after reading it from the
registers, so simplify by dropping unneeded code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240710-asoc-wsa88xx-version-v1-1-f1c54966ccde@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-29 01:17:16 +01:00
Linus Torvalds
bf80f1391a Devicetree fixes for 6.11, part 1
- Treewide conversion of of_property_for_each_u32() to drop internal
   arguments making struct property opaque
 
 - Add binding for Amlogic A4 SoC watchdog
 
 - Fix constraints for AD7192 'single-channel' property
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmaj8ncACgkQ+vtdtY28
 YcMwZRAAh618Xfw+J8pxv62PMw11r0hgMNYoHPYDMt47D7g9Wwa71xdR6OpfIpf+
 EyHUXrnXJT6f5sm8mVe9Gsni0MZfgdkwchxlCQej0rJKchdLdAFNXbg4GbhF+0Ht
 tA3Y6bPB9FYKHExd87flnt4AO3ypF+1ihjSAAoy4EyEZUfyKgQVPyebDGwlPYlkH
 dmhF+q9d94LVw3lj/C7htWGELProogsU3i498ey7m/w8jwiJav2DVJ0cRuld/aPG
 7VwGQhJzdndlH1MPcl9slzIPadUrZ0S3/7V4c9cC0E22XpHJzp4RSdGmzsXJ7adp
 Q+OlQYiyZLLhEA/alVO/j5SJtfxt+T6+lrpbbu1wcJMFoukXusvL+0KbxxbExEn0
 /3MrZuxEq3F+jcKtMR/1PFcO7o1uEzzyTZcdufV3siABjZqmG4AFzBhHWP4Xh2Uw
 6hs7R/Ktf2lmacCK9fawfJF6Qq4RtFIakUuI6S3Q3oHHTRw6kr1Lsw+Wko/K20mO
 BEdfhocxEk5vf/kGxcBfM+GTybhagbBh0GxYB/Lm8vATfLHzhunipbc0ZwozDfPu
 IWiY+Nv+hGeGhfvSfNFUcsknF+QwtSjGis7hQjHkJc/siahaXJVAaf+tvtL1xm/p
 0CGPIJFZgzkcbjCT3iPVaJjfyRlMe9l7HJ6XiBSrMpiFpZPTgT8=
 =Nn/d
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-fixes-for-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull more devicetree updates from Rob Herring:
 "Most of this is a treewide change to of_property_for_each_u32() which
  was small enough to do in one go before rc1 and avoids the need to
  create of_property_for_each_u32_some_new_name().

   - Treewide conversion of of_property_for_each_u32() to drop internal
     arguments making struct property opaque

   - Add binding for Amlogic A4 SoC watchdog

   - Fix constraints for AD7192 'single-channel' property"

* tag 'devicetree-fixes-for-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  dt-bindings: iio: adc: ad7192: Fix 'single-channel' constraints
  of: remove internal arguments from of_property_for_each_u32()
  dt-bindings: watchdog: add support for Amlogic A4 SoCs
2024-07-27 12:46:16 -07:00
Linus Torvalds
eb966e0c5f sound fixes for 6.11-rc1
A collection of the fixes gathered since the previous PR.
 We see a bit large LOCs at a HD-audio quirk, but that's only bulk
 COEF data, hence it's safe to take.  In addition to that, there
 were two minor fixes for MIDI 2.0 handling for ALSA core, and the
 rest are all rather random small and device-specific fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmajSFIOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8SjBAAyynx5t5Ui/Gp9VqvyFzUAl9zpHn4hIz5T/SN
 +XRNcq9VN+anqu+55PqWpoX5E0WRQW36AyCeMO7yA0RLhTCvPAtH2OmLfHQhvh48
 +Zpw89molMP19KdRi+nezJlrTQby8zHBGConN3jalovRrM1bqpGeiQ3bdydhqSdt
 dAfhCEn3ckOhNZU0PTASnZGScqTpl+OP0XKXSD3KBceT7EEsUodTcq1NqDcoHbBS
 V/4hJct7vDcbA64P+zo3rrhEkbeDa3s152ajcs589aElIKQVTQhZNNvxe7ygDXHe
 30qXjCI6gQDUWuGHwuN0IlNiI/GkhLExvK+Wa1xBP+vjTqWtpxzuQ8rMwa+EM48Y
 AZ7Rk7GUsvceCzGIto6p+ZRlt1LG2dJFYbfqw9fUA6JvMDhStDcrFzSooWrmcl8Z
 8EN7L9viYEDl15TzSA6FKTeFh1gSPe+/hsZ9r3XuTL611/paqPs+HTnQ3T7ua9mr
 EylSfEeJ3NKbcJqwnCLClSzmgClPaBkseDwnHS0OT4xMmbI5Q1/WIzjdvF+EM2RN
 RxgkvJyhdpp/9bxtkeojekKcK4qeuGcY4Gaqd6etBX9KgfyTh/n098dlI0BJmZrV
 y3cZNH9zojzzTmP7+UcTjVp+LocF5nswB3rhMJgYKJPFXJMoj5xzHIm8LyRt7qTQ
 9xIYlAY=
 =RcQQ
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of fixes gathered since the previous pull.

  We see a bit large LOCs at a HD-audio quirk, but that's only bulk COEF
  data, hence it's safe to take. In addition to that, there were two
  minor fixes for MIDI 2.0 handling for ALSA core, and the rest are all
  rather random small and device-specific fixes"

* tag 'sound-fix-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_components
  ASoC: amd: yc: Support mic on Lenovo Thinkpad E16 Gen 2
  ALSA: hda/realtek: Implement sound init sequence for Samsung Galaxy Book3 Pro 360
  ALSA: hda/realtek: cs35l41: Fixup remaining asus strix models
  ASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare
  ASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for ChainDMA
  ALSA: ump: Force 1 Group for MIDI1 FBs
  ALSA: ump: Don't update FB name for static blocks
  ALSA: usb-audio: Add a quirk for Sonix HD USB Camera
  ASoC: TAS2781: Fix tasdev_load_calibrated_data()
  ASoC: tegra: select CONFIG_SND_SIMPLE_CARD_UTILS
  ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable
  ALSA: usb-audio: Move HD Webcam quirk to the right place
  ALSA: hda: tas2781: mark const variables as __maybe_unused
  ALSA: usb-audio: Fix microphone sound on HD webcam.
  ASoC: sof: amd: fix for firmware reload failure in Vangogh platform
  ASoC: Intel: Fix RT5650 SSP lookup
  ASOC: SOF: Intel: hda-loader: only wait for HDaudio IOC for IPC4 devices
  ASoC: SOF: imx8m: Fix DSP control regmap retrieval
2024-07-26 11:01:31 -07:00
Linus Torvalds
c2a96b7f18 Driver core changes for 6.11-rc1
Here is the big set of driver core changes for 6.11-rc1.
 
 Lots of stuff in here, with not a huge diffstat, but apis are evolving
 which required lots of files to be touched.  Highlights of the changes
 in here are:
   - platform remove callback api final fixups (Uwe took many releases to
     get here, finally!)
   - Rust bindings for basic firmware apis and initial driver-core
     interactions.  It's not all that useful for a "write a whole driver
     in rust" type of thing, but the firmware bindings do help out the
     phy rust drivers, and the driver core bindings give a solid base on
     which others can start their work.  There is still a long way to go
     here before we have a multitude of rust drivers being added, but
     it's a great first step.
   - driver core const api changes.  This reached across all bus types,
     and there are some fix-ups for some not-common bus types that
     linux-next and 0-day testing shook out.  This work is being done to
     help make the rust bindings more safe, as well as the C code, moving
     toward the end-goal of allowing us to put driver structures into
     read-only memory.  We aren't there yet, but are getting closer.
   - minor devres cleanups and fixes found by code inspection
   - arch_topology minor changes
   - other minor driver core cleanups
 
 All of these have been in linux-next for a very long time with no
 reported problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZqH+aQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymoOQCfVBdLcBjEDAGh3L8qHRGMPy4rV2EAoL/r+zKm
 cJEYtJpGtWX6aAtugm9E
 =ZyJV
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the big set of driver core changes for 6.11-rc1.

  Lots of stuff in here, with not a huge diffstat, but apis are evolving
  which required lots of files to be touched. Highlights of the changes
  in here are:

   - platform remove callback api final fixups (Uwe took many releases
     to get here, finally!)

   - Rust bindings for basic firmware apis and initial driver-core
     interactions.

     It's not all that useful for a "write a whole driver in rust" type
     of thing, but the firmware bindings do help out the phy rust
     drivers, and the driver core bindings give a solid base on which
     others can start their work.

     There is still a long way to go here before we have a multitude of
     rust drivers being added, but it's a great first step.

   - driver core const api changes.

     This reached across all bus types, and there are some fix-ups for
     some not-common bus types that linux-next and 0-day testing shook
     out.

     This work is being done to help make the rust bindings more safe,
     as well as the C code, moving toward the end-goal of allowing us to
     put driver structures into read-only memory. We aren't there yet,
     but are getting closer.

   - minor devres cleanups and fixes found by code inspection

   - arch_topology minor changes

   - other minor driver core cleanups

  All of these have been in linux-next for a very long time with no
  reported problems"

* tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits)
  ARM: sa1100: make match function take a const pointer
  sysfs/cpu: Make crash_hotplug attribute world-readable
  dio: Have dio_bus_match() callback take a const *
  zorro: make match function take a const pointer
  driver core: module: make module_[add|remove]_driver take a const *
  driver core: make driver_find_device() take a const *
  driver core: make driver_[create|remove]_file take a const *
  firmware_loader: fix soundness issue in `request_internal`
  firmware_loader: annotate doctests as `no_run`
  devres: Correct code style for functions that return a pointer type
  devres: Initialize an uninitialized struct member
  devres: Fix memory leakage caused by driver API devm_free_percpu()
  devres: Fix devm_krealloc() wasting memory
  driver core: platform: Switch to use kmemdup_array()
  driver core: have match() callback in struct bus_type take a const *
  MAINTAINERS: add Rust device abstractions to DRIVER CORE
  device: rust: improve safety comments
  MAINTAINERS: add Danilo as FIRMWARE LOADER maintainer
  MAINTAINERS: add Rust FW abstractions to FIRMWARE LOADER
  firmware: rust: improve safety comments
  ...
2024-07-25 10:42:22 -07:00
Shengjiu Wang
ab53dfdcdd
ASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_components
The static snd_soc_dai_link_components cause conflict for multiple
instances of this generic driver. For example, when there is
wm8962 and SPDIF case enabled together, the contaminated
snd_soc_dai_link_components will cause another device probe fail.

Fixes: 6d174cc4f2 ("ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1721877773-5229-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-25 14:20:30 +01:00
Luca Ceresoli
9722c3b66e of: remove internal arguments from of_property_for_each_u32()
The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara <andre.przywara@arm.com> # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner <richard.leitner@linux.dev> # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown <broonie@kernel.org> # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman <mpe@ellerman.id.au> # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd <sboyd@kernel.org> # clk
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-07-25 06:53:47 -05:00
Takashi Iwai
1d9ce44404
ASoC: amd: yc: Support mic on Lenovo Thinkpad E16 Gen 2
Lenovo Thinkpad E16 Gen 2 AMD model (model 21M5) needs a corresponding
quirk entry for making the internal mic working.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240725065442.9293-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-25 12:12:38 +01:00
Peter Ujfalusi
e6fc5fcaef
ASoC: SOF: ipc4-topology: Preserve the DMA Link ID for ChainDMA on unprepare
The DMA Link ID is set to the IPC message's primary during dai_config,
which is only during hw_params.
During xrun handling the hw_params is not called and the DMA Link ID
information will be lost.

All other fields in the message expected to be 0 for re-configuration, only
the DMA Link ID needs to be preserved and the in case of repeated
dai_config, it is correctly updated (masked and then set).

Cc: stable@vger.kernel.org
Fixes: ca5ce0caa6 ("ASoC: SOF: ipc4/intel: Add support for chained DMA")
Link: https://github.com/thesofproject/linux/issues/5116
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240724081932.24542-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-24 11:29:13 +01:00
Peter Ujfalusi
ae67ed9010
ASoC: SOF: ipc4-topology: Only handle dai_config with HW_PARAMS for ChainDMA
The DMA Link ID is only valid in snd_sof_dai_config_data when the
dai_config is called with HW_PARAMS.

The commit that this patch fixes is actually moved a code section without
changing it, the same bug exists in the original code, needing different
patch to kernel prior to 6.9 kernels.

Cc: stable@vger.kernel.org
Fixes: 3858464de5 ("ASoC: SOF: ipc4-topology: change chain_dma handling in dai_config")
Link: https://github.com/thesofproject/linux/issues/5116
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240724081932.24542-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-24 11:29:12 +01:00
Dan Carpenter
92c7822216
ASoC: TAS2781: Fix tasdev_load_calibrated_data()
This function has a reversed if statement so it's either a no-op or it
leads to a NULL dereference.

Fixes: b195acf526 ("ASoC: tas2781: Fix wrong loading calibrated data sequence")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/18a29b68-cc85-4139-b7c7-2514e8409a42@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-22 13:04:51 +01:00
Arnd Bergmann
83340b855d
ASoC: tegra: select CONFIG_SND_SIMPLE_CARD_UTILS
This I2S client driver now uses functions exported from a helper module
but fails to link when the helper is disabled:

ERROR: modpost: "simple_util_parse_convert" [sound/soc/tegra/snd-soc-tegra210-i2s.ko] undefined!
ERROR: modpost: "simple_util_get_sample_fmt" [sound/soc/tegra/snd-soc-tegra210-i2s.ko] undefined!

Add a Kconfig select line to ensure it's always turned on here.

Fixes: 2502f8dd8c ("ASoC: tegra: I2S client convert formats handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://patch.msgid.link/20240719074831.3253995-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-22 13:04:50 +01:00
Pierre-Louis Bossart
9931f7d5d2
ASoC: Intel: use soc_intel_is_byt_cr() only when IOSF_MBI is reachable
the Intel kbuild bot reports a link failure when IOSF_MBI is built-in
but the Merrifield driver is configured as a module. The
soc-intel-quirks.h is included for Merrifield platforms, but IOSF_MBI
is not selected for that platform.

ld.lld: error: undefined symbol: iosf_mbi_read
>>> referenced by atom.c
>>>               sound/soc/sof/intel/atom.o:(atom_machine_select) in archive vmlinux.a

This patch forces the use of the fallback static inline when IOSF_MBI is not reachable.

Fixes: 536cfd2f37 ("ASoC: Intel: use common helpers to detect CPUs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407160704.zpdhJ8da-lkp@intel.com/
Suggested-by: Takashi Iwai <tiwai@suse.de>
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://patch.msgid.link/20240722083002.10800-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-22 13:04:49 +01:00
Linus Torvalds
12cc3d5389 sound updates for 6.11-rc1
Lots of changes in this cycle, but mostly for cleanups and
 refactoring.  Significant amount of changes are about DT schema
 conversions for ASoC at this time while we see other usual
 suspects, too.  Some highlights below:
 
 Core:
 - Re-introduction of PCM sync ID support API
 - MIDI2 time-base extension in ALSA sequencer API
 
 ASoC:
 - Syncing of features between simple-audio-card and the two
   audio-graph cards
 - Support for specifying the order of operations for components
   within cards to allow quirking for unusual systems
 - Lots of DT schema conversions
 - Continued SOF/Intel updates for topology, SoundWire, IPC3/4
 - New support for Asahi Kasei AK4619, Cirrus Logic CS530x, Everest
   Semiconductors ES8311, NXP i.MX95 and LPC32xx, Qualcomm LPASS
   v2.5 and WCD937x, Realtek RT1318 and RT1320 and Texas
   Instruments PCM5242
 
 HD-audio:
 - More quirks, Intel PantherLake support, senarytech codec support
 - Refactoring of Cirrus codec component-binding
 
 Others:
 - ALSA control kselftest improvements, and fixes for input value
   checks in various drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmaZNdoOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/PWw//XYFQ2v+bc0x62LI1rIEt1/mSz6R1moHf85fK
 CjDOvHoGlZEkXuTmycK8b522/9tslHyE+8P97TZAy/6ph/yT44JgwQaadAvTZdWK
 eKrchogf+v6DaQar8+nmXp8409HBcfJdrSJth2xR5OhY741/kGBF1/YCBHZaIQan
 T87ag0tu1PVWQuLhdRlghkNYds+oaSX6wMaLRzVYI2TFYfHZOWYfVYd/NACb8KtO
 z66TqybOxOpq4xCi+umNaGn2TxdDvo427JgioAKzcGLodowRKmqNV+mXddfrhBEE
 Fwq4o8YGxgX+oaNn4aLQdrrREc1tuwQj0Kwpt/rkh4ESTgugcElq5hJCgPY8U3Ej
 5+ih7ZeIojKnfjNivHuath7tXe1inqPEK3RBt3qMoUldIxNhJ8WfIF0RNzW/QRY2
 g4JAI/4lswqPz6vYKULatDk+ZEW6PiV72kwW+4Vt7NxZnn9VFzP27qHuwkUHP5HM
 0q4/NKrv+MFPedOLEeEm/1dmE7NRT4tRJuIV+RwMJ0cyP4l2jSCwyDpxfkFqGitc
 wB0AXK3YLwISlKjziCox1cAex8F2XhjCdpOyOV6hTc3Dv/DySMHysv+4Uf4/kvst
 3GrqdkMHy4cEUYj/Sj+VunfColsX2KnQAN+e4Sonn+5nPsw7ypGkpM1Kf+wTQuNK
 EoxpzGo=
 =hn0h
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "Lots of changes in this cycle, but mostly for cleanups and
  refactoring.

  Significant amount of changes are about DT schema conversions for ASoC
  at this time while we see other usual suspects, too.

  Some highlights below:

  Core:
   - Re-introduction of PCM sync ID support API
   - MIDI2 time-base extension in ALSA sequencer API

  ASoC:
   - Syncing of features between simple-audio-card and the two
     audio-graph cards
   - Support for specifying the order of operations for components
     within cards to allow quirking for unusual systems
   - Lots of DT schema conversions
   - Continued SOF/Intel updates for topology, SoundWire, IPC3/4
   - New support for Asahi Kasei AK4619, Cirrus Logic CS530x, Everest
     Semiconductors ES8311, NXP i.MX95 and LPC32xx, Qualcomm LPASS v2.5
     and WCD937x, Realtek RT1318 and RT1320 and Texas Instruments
     PCM5242

  HD-audio:
   - More quirks, Intel PantherLake support, senarytech codec support
   - Refactoring of Cirrus codec component-binding

  Others:
   - ALSA control kselftest improvements, and fixes for input value
     checks in various drivers"

* tag 'sound-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (349 commits)
  kselftest/alsa: Log the PCM ID in pcm-test
  kselftest/alsa: Use card name rather than number in test names
  ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
  ALSA: hda/tas2781: Add new quirk for Lenovo Hera2 Laptop
  ALSA: seq: ump: Skip useless ports for static blocks
  ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
  ALSA: usb: Use BIT() for bit values
  ALSA: usb: Fix UBSAN warning in parse_audio_unit()
  ALSA: hda/realtek: Enable headset mic on Positivo SU C1400
  ASoC: tas2781: Add new Kontrol to set tas2563 digital Volume
  ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply
  ASoC: codecs: wcd937x: Remove the string compare in MIC BIAS widget settings
  ASoC: codecs: wcd937x-sdw: Fix Unbalanced pm_runtime_enable
  ASoC: dt-bindings: cirrus,cs42xx8: Convert to dtschema
  ASoC: cs530x: Remove bclk from private structure
  ASoC: cs530x: Calculate proper bclk rate using TDM
  ASoC: dt-bindings: cirrus,cs4270: Convert to dtschema
  firmware: cs_dsp: Rename fw_ver to wmfw_ver
  firmware: cs_dsp: Clarify wmfw format version log message
  firmware: cs_dsp: Make wmfw and bin filename arguments const char *
  ...
2024-07-19 12:39:34 -07:00
Venkata Prasad Potturu
f2038c12e8
ASoC: sof: amd: fix for firmware reload failure in Vangogh platform
Setting ACP ACLK as clock source when ACP enters D0 state causing
firmware load failure, as per design clock source should be internal
clock.

Remove acp_clkmux_sel field so that ACP will use internal clock
source when ACP enters into D0 state.

Fixes: d0dab6b76a ("ASoC: SOF: amd: Add sof support for vangogh platform")

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20240718062004.581685-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-18 11:17:00 +01:00
Linus Torvalds
1200af3ac1 - New Drivers
- Add support for ROHM BD96801 Power Management IC
    - Add support for Cirrus Logic CS40L50 Haptic Driver with Waveform Memory
    - Add support for Marvell 88PM886 Power Management IC
 
  - New Device Support
    - Add support for Keyboard Backlight to ChromeOS Embedded Controller
    - Add support for LEDs to ChromeOS Embedded Controller
    - Add support for Charge Control to ChromeOS Embedded Controller
    - Add support for the HW Monitoring Service to ChromeOS Embedded Controller
    - Add support for AUXADCs to MediaTek MT635{7,8,9} Power Management ICs
 
  - New Functionality
    - Allow Syscon consumers to supply their own Regmaps on registration
 
  - Fix-ups
    - Constify/staticise applicable data structures
    - Remove superfluous/duplicated/unused sections
    - Device Tree binding adaptions/conversions/creation
    - Trivial; spelling, whitespace, coding-style adaptions
    - Utilise centrally provided helpers and macros to aid simplicity/duplication
    - Drop i2c_device_id::driver_data where the value is unused
    - Replace ACPI/DT firmware helpers with agnostic variants
    - Move over to GPIOD (descriptor-based) APIs
    - Annotate a bunch of __counted_by() cases
    - Straighten out some includes
 
  - Bug Fixes
    - Ensure potentially asserted recent lines are deasserted during initialisation
    - Avoid "<module>.ko is added to multiple modules" warnings
    - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings
    - Fix Wvoid-pointer-to-enum-cast warnings
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmaWf6sACgkQUa+KL4f8
 d2HhAw//UMujhKk/IfzGck3RoaKH3H22oVpd98BpzJCZBKSpl9pGsumHCicBMVAK
 gp8SuwKNCAX+Fa/TubHz0xH6FWxLFXezh5DvO1t1DrPNokG+u4QPTfgMJ1IfBMHO
 w7aL74rtJEyWBeod4+qNVoq6KNDaWjiWQlxGQ+9IoSNmxSTL6pkYMqo935RnqhRr
 nm2TfSOIshk4tiO9tVA1ecCgjVwsG51803hypmd1AH6qBb7JsY6k1HWukLGaqUiV
 +57oQzCTPIRYJhYdca06xi4ZmPg2kmoYKlxqW5ExyM7Mxs9aZZzwwZ7929LKXC6o
 ebAPDc3auoww7B5mHbbVuBj0gDZKtfXpBRKSHLNtmhi0xmjnwZxQIumkpVGQALkI
 0TQffgYVU4O7IXsAZG9w5igyMzEo9SZJMyrfFaQ0iB3rx5bXuh4b6btfewAkyI1H
 +o3Yjymf4CR1trY9qnWCGWM/COQLIiGRhsk/RqGjy0xtpQo1Skx+AIkc6QD2zl6Y
 ohC0JzEWTQe7c1DOM3SLpNoCb/GbFpVi0RrXRVfRltPHpVb/r54Zlbo+PrCaC8FB
 EkU+86XbxGMh7hLtz5yhmnNCWKHQ6jbaFESwtZLo4d42CKvZaobL4xVCL56OntsH
 ikmTNG+X0mUAZiCwGgK5OhEVCAtCcjRtz1U93wgDBaz7Y39z+yM=
 =DSjk
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - ROHM BD96801 Power Management IC
   - Cirrus Logic CS40L50 Haptic Driver with Waveform Memory
   - Marvell 88PM886 Power Management IC

  New Device Support:
   - Keyboard Backlight to ChromeOS Embedded Controller
   - LEDs to ChromeOS Embedded Controller
   - Charge Control to ChromeOS Embedded Controller
   - HW Monitoring Service to ChromeOS Embedded Controller
   - AUXADCs to MediaTek MT635{7,8,9} Power Management ICs

  New Functionality:
   - Allow Syscon consumers to supply their own Regmaps on registration

  Fix-ups:
   - Constify/staticise applicable data structures
   - Remove superfluous/duplicated/unused sections
   - Device Tree binding adaptions/conversions/creation
   - Trivial; spelling, whitespace, coding-style adaptions
   - Utilise centrally provided helpers and macros to aid
     simplicity/duplication
   - Drop i2c_device_id::driver_data where the value is unused
   - Replace ACPI/DT firmware helpers with agnostic variants
   - Move over to GPIOD (descriptor-based) APIs
   - Annotate a bunch of __counted_by() cases
   - Straighten out some includes

  Bug Fixes:
   - Ensure potentially asserted recent lines are deasserted during
     initialisation
   - Avoid "<module>.ko is added to multiple modules" warnings
   - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings
   - Fix Wvoid-pointer-to-enum-cast warnings"

* tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (87 commits)
  mfd: timberdale: Attach device properties to TSC2007 board info
  mfd: tmio: Move header to platform_data
  mfd: tmio: Sanitize comments
  mfd: tmio: Update include files
  mmc: tmio/sdhi: Fix includes
  mfd: tmio: Remove obsolete io accessors
  mfd: tmio: Remove obsolete platform_data
  watchdog: bd96801_wdt: Add missing include for FIELD_*()
  dt-bindings: mfd: syscon: Add APM poweroff mailbox
  dt-bindings: mfd: syscon: Split and enforce documenting MFD children
  dt-bindings: mfd: rk817: Merge support for RK809
  dt-bindings: mfd: rk817: Fixup clocks and reference dai-common
  dt-bindings: mfd: syscon: Add TI's opp table compatible
  mfd: omap-usb-tll: Use struct_size to allocate tll
  dt-bindings: mfd: Explain lack of child dependency in simple-mfd
  dt-bindings: mfd: Dual licensing for st,stpmic1 bindings
  mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by
  mfd: tps6594-core: Remove unneeded semicolon in tps6594_check_crc_mode()
  mfd: lm3533: Move to new GPIO descriptor-based APIs
  mfd: tps65912: Use devm helper functions to simplify probe
  ...
2024-07-17 17:42:20 -07:00
Curtis Malainey
6f6a23d42b
ASoC: Intel: Fix RT5650 SSP lookup
Commit 8efcd48646 ("ASoC: Intel: sof_rt5682: use common module for
sof_card_private initialization") migrated the pin assignment in the
context struct up to soc-acpi-intel-ssp-common.c. This uses a lookup
table to see if a device has a amp/codec before assigning the pin. The
issue here arises when combination parts that serve both (with 2 ports)
are used.

sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.3/adl_rt5682_def/SSP0-Codec'
CPU: 1 PID: 2079 Comm: udevd Tainted: G     U             6.6.36-03391-g744739e00023 #1 3be1a2880a0970f65545a957db7d08ef4b3e2c0d
Hardware name: Google Anraggar/Anraggar, BIOS Google_Anraggar.15217.552.0 05/07/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x69/0xa0
 sysfs_warn_dup+0x5b/0x70
 sysfs_create_dir_ns+0xb0/0x100
 kobject_add_internal+0x133/0x3c0
 kobject_add+0x66/0xb0
 ? device_add+0x65/0x780
 device_add+0x164/0x780
 snd_soc_add_pcm_runtimes+0x2fa/0x800
 snd_soc_bind_card+0x35e/0xc20
 devm_snd_soc_register_card+0x48/0x90
 platform_probe+0x7b/0xb0
 really_probe+0xf7/0x2a0
 ...
kobject: kobject_add_internal failed for SSP0-Codec with -EEXIST, don't try to register things with the same name in the same directory.

The issue is that the ALC5650 was only defined in the codec table and
not the amp table which left the pin unassigned but the dai link was
still created by the machine driver.

Also patch the suffix filename code for the topology to prevent double
suffix names as a result of this change.

Fixes: 8efcd48646 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization")
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240716084012.299257-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-16 14:07:56 +01:00
Pierre-Louis Bossart
9ee3f0d8c9
ASOC: SOF: Intel: hda-loader: only wait for HDaudio IOC for IPC4 devices
Multiple users report a regression bisected to commit d5263dbbd8
("ASoC: SOF: Intel: don't ignore IOC interrupts for non-audio
transfers"). The firmware version is the likely suspect, as these
users relied on SOF 2.0 while Intel only tested with the 2.2 release.

Rather than completely disable the wait_for_completion(), which can
help us gather timing information on the different stages of the boot
process, the simplest course of action is to just disable it for older
IPC versions which are no longer under active development.

Closes: https://github.com/thesofproject/linux/issues/5072
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218961
Fixes: d5263dbbd8 ("ASoC: SOF: Intel: don't ignore IOC interrupts for non-audio transfers")
Tested-by: Mike Krinkin <krinkin.m.u@gmail.com>
Tested-by: Todd Brandt <todd.e.brandt@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://patch.msgid.link/20240716084530.300829-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-16 14:07:55 +01:00
Daniel Baluta
2634f745ea
ASoC: SOF: imx8m: Fix DSP control regmap retrieval
According to Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
fsl,dsp-ctrl is a phandle to syscon block so we need to use correct
function to retrieve it.

Currently there is no SOF DSP DTS merged into mainline so there is no
need to support the old way of retrieving the dsp control node.

Fixes: 9ba23717b2 ("ASoC: SOF: imx8m: Implement DSP start")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20240715151653.114751-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-15 19:08:09 +01:00
Mark Brown
c51cba4755
Fix the unbalanced pm_runtime_enable in wcd937x-sdw
Merge series from Mohammad Rafi Shaik <quic_mohs@quicinc.com>:

This patch set change will fix the unbalanced pm_runtime_enable in wcd937x-sdw soundwire slave.

And removed the string compare with widget name in MIC BIAS settings, instead
of string compare use the MIC BIAS id's as value.

Removed separate handling for vdd-buck regulator supply which is not
required. The vdd-buck regulator supply enabled using bulk enable.

Added the error handling in wcd937x_probe() and disable the regulators in error case.
2024-07-12 17:38:18 +01:00
Shenghao Ding
75ed63a5ab
ASoC: tas2781: Add new Kontrol to set tas2563 digital Volume
Requriment from customer to add new kcontrol to set tas2563 digital
Volume

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240710064238.1480-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-12 15:34:05 +01:00
Mohammad Rafi Shaik
216d04139a
ASoC: codecs: wcd937x: Remove separate handling for vdd-buck supply
Remove separate handling for vdd-buck regulator supply which is not
required. The vdd-buck regulator supply enabled using bulk enable.

Add the error handling in wcd937x_probe() and disable the regulators in
error case.

Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/linux-sound/834d31cc-f4bc-4db7-a25b-f9869e550eb6@wanadoo.fr/
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-4-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-12 14:44:25 +01:00
Mohammad Rafi Shaik
a5f727f423
ASoC: codecs: wcd937x: Remove the string compare in MIC BIAS widget settings
Remove the string compare with widget name in MIC BIAS settings, instead
of string compare use the MIC BIAS id's.

Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Closes: https://lore.kernel.org/linux-sound/ba911ebd-aef5-46af-ace1-84d13bee6876@linaro.org/
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-3-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-12 14:44:24 +01:00
Mohammad Rafi Shaik
0ffc5a40ad
ASoC: codecs: wcd937x-sdw: Fix Unbalanced pm_runtime_enable
Fix the unbalanced pm_runtime_enable! in wcd937x-sdw soundwire slave.

Fixes: c99a515ff1 ("ASoC: codecs: wcd937x-sdw: add SoundWire driver")
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Link: https://patch.msgid.link/20240704081723.3394153-2-quic_mohs@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-12 14:44:23 +01:00
Mark Brown
1ee45e649e
firmware: cs_dsp: Some small coding improvements
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Commit series that makes some small improvements to code and the
kernel log messages.
2024-07-11 00:26:23 +01:00
Paul Handrigan
0d1ebba74f
ASoC: cs530x: Remove bclk from private structure
Remove the bclk int from the private structure and pass it into
the set_bclk function.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710160416.2617173-2-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-10 18:45:25 +01:00
Paul Handrigan
c62bec0fe3
ASoC: cs530x: Calculate proper bclk rate using TDM
Calculate the proper bclk rate using the number of tdm slots
and the width of the tdm data.

Fixes: 2884c29152 ("ASoC: cs530x: Support for cs530x ADCs")
Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710160416.2617173-1-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-10 18:45:24 +01:00
Richard Fitzgerald
dc0e5ca885
firmware: cs_dsp: Rename fw_ver to wmfw_ver
Rename the confusingly named struct member fw_ver to wmfw_ver. It
contains the wmfw format version of the loaded wmfw file.

This commit also contains an update to wm_adsp for the new name.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-10 18:45:05 +01:00
Krzysztof Kozlowski
a8915e2fe8
ASoC: qcom: topology: Simplify with cleanup.h
Allocate memory, which is being freed at end of the scope, with
scoped/cleanup.h to reduce number of error paths and make code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701171917.596173-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-09 22:50:48 +01:00
Krzysztof Kozlowski
d0f4ce8a28
ASoC: codecs: aw88395: Simplify with cleanup.h
Allocate memory, which is being freed at end of the scope, with
scoped/cleanup.h to reduce number of error paths and make code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701171917.596173-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-09 22:50:47 +01:00
Chen Ni
e52a73e694
ASoC: Intel: sof_sdw: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240709030921.585740-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-09 17:37:26 +01:00
Shenghao Ding
be5db7581f
ASoc: TAS2781: rename the tas2781_reset as tasdevice_reset
Rename the tas2781_reset as tasdevice_reset in case of misunderstanding.
RESET register for both tas2563 and tas2781 is same and the use of reset
pin is also same.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240709043342.946-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-09 17:37:25 +01:00
Mark Brown
54e49a3c9d
ASoC: fsl-asoc-card: add S/PDIF controller support
Merge series from Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>:

This is a series of patches aiming to make the machine driver
`fsl-asoc-card` compatible with S/PDIF controllers on imx boards.  The
main goal is to allow the use of S/PDIF controllers with ASRC modules.

The `imx-spdif` machine driver already has specific support for S/PDIF
controllers but doesn't support using an ASRC with it. However, the
`fsl-asoc-card` machine driver has the necessary code to create a sound
card which can use an ASRC module.
It is then possible to extend the support for S/PDIF audio cards by
merging the `imx-spdif` driver into `fsl-asoc-card`.

The first three patches adapt the `fsl-asoc-card` driver to support
multiple codec use cases.
The driver can get 2 codec phandles from the device tree, and
codec-related variables are doubled.
`for_each_codecs` macros are also used when possible to ease adding
other multi-codec use cases in the future.
It makes possible to use the two S/PDIF dummy codec drivers
`spdif_receiver` and `spdif_transmitter` instead of `snd-soc-dummy`,
which was used in `imx-spdif`.

The fourth patch merges the S/PDIF support from `imx-spdif` to
`fsl-asoc-card`.
`fsl-asoc-card` offers the same functionalities as `imx-spdif` did, but
this merge also extends the S/PDIF support with the possibility of using
an ASRC.
Compatible "fsl,imx-audio-spdif" is kept, but `fsl-asoc-card` uses
different DT properties compared to `imx-spdif`:
* The "spdif-controller" property from `imx-spdif` is named "audio-cpu"
  in `fsl-asoc-card`.
* `fsl-asoc-card` uses codecs explicitly declared in DT with
  "audio-codec". With an S/PDIF, codec drivers `spdif_transmitter` and
  `spdif_receiver` should be used. Driver `imx-spdif` used instead the
  dummy codec and a pair of boolean properties, "spdif-in" and
  "spdif-out".
Backward compatibility is therefore implemented in `fsl-asoc-card`.
However, it is recommended to use the new properties when needed.
Especially, declaring and using S/PDIF transmitter and/or receiver nodes
is better than using the dummy codec.

The last three patches update the device tree bindings of
`fsl-asoc-card` and update all in-tree device trees to use the
`fsl-asoc-card` properties.
Note that as the old properties are still supported:
* previous versions of in-tree device trees are still supported.
* out-of-tree device trees are still supported.

This series of patches was successfully built for arm64 and x86 on top
of the latest "for-next" branch of the ASoC git tree on the 26th of June
2024.
These modifications have also been tested on an i.MX8MN evaluation board
with a linux kernel RT v6.1.26-rt8.
2024-07-08 19:30:39 +01:00
Mark Brown
0c6c65111e
ASoC: Simplify code with cleanup.h
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Allocate the memory with scoped/cleanup.h to reduce error handling
(simpler error paths) and make the code a bit smaller.
2024-07-08 16:50:14 +01:00
Elinor Montmasson
6d174cc4f2
ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c
The imx-spdif machine driver creates audio card to directly use an
S/PDIF device. However, it doesn't support interacting with an ASRC.
fsl-asoc-card already has the support to create audio card which can
use the ASRC.

Merge the S/PDIF support from imx-spdif into driver fsl-asoc-card
to extend the support of S/PDIF audio card with the use of ASRC devices.

fsl-asoc-card uses slightly different DT properties than imx-spdif:
* the "spdif-controller" property from imx-spdif is named "audio-cpu" in
  fsl-asoc-card.
* fsl-asoc-card uses codecs explicitly declared in DT
  with "audio-codec".
  With an SPDIF, codec drivers spdif_transmitter and
  spdif_receiver should be used.
  Driver imx-spdif used instead the dummy codec and a pair of
  boolean properties, "spdif-in" and "spdif-out".

To keep backward compatibility, support for "spdif-controller",
"spdif-in" and "spdif-out" is also added to fsl-asoc-card.
However, it is recommended to use the new properties if possible.
It is better to declare transmitter and/or receiver in DT
than using the dummy codec.

DTs using compatible "fsl,imx-audio-spdif" are still compatible, and
fsl-asoc-card will behave the same as imx-spdif
for these DTs.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-5-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 16:09:38 +01:00
Elinor Montmasson
fcc6ace84f
ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-links
Adapt the driver to work with configurations using two codecs or more.
Modify fsl_asoc_card_probe() to handle use cases where 2 codecs are
given in the device tree.
This will be needed to add support for the SPDIF.

Use cases using one codec will ignore any given codecs other than the
first.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-4-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 16:09:37 +01:00
Elinor Montmasson
c68fa0d9b0
ASoC: fsl-asoc-card: add second dai link component for codecs
Add a second dai link component for codecs that will be used for use
cases with 2 codecs.
It is needed for future integration of the SPDIF support, which will
use spdif_receiver and spdif_transmitter drivers.

To prevent deferring in use cases using only one codec, also set
by default the number of codecs to 1 for the relevant dai links.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-3-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 16:09:36 +01:00
Elinor Montmasson
a613b63db2
ASoC: fsl-asoc-card: add support for dai links with multiple codecs
Add support for dai links using multiple codecs for multi-codec
use cases.

Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com>
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240627083104.123357-2-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 16:09:35 +01:00
Shenghao Ding
1cc509edbe
ASoc: TAS2781: replace beXX_to_cpup with get_unaligned_beXX for potentially broken alignment
Use get_unaligned_be16 instead of be16_to_cpup and get_unaligned_be32
instead of be32_to_cpup for potentially broken alignment.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240707083011.98-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:10 +01:00
Krzysztof Kozlowski
522133d440
ASoC: dapm: Simplify snd_soc_dai_link_event_pre_pmu() with cleanup.h
Allocate the memory with scoped/cleanup.h in
snd_soc_dai_link_event_pre_pmu() to reduce error handling (less error
paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-11-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:03 +01:00
Krzysztof Kozlowski
5b3cc85673
ASoC: dapm: Simplify dapm_cnew_widget() with cleanup.h
Allocate the memory with scoped/cleanup.h in dapm_cnew_widget() to
reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-10-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:02 +01:00
Krzysztof Kozlowski
1a7b846818
ASoC: ops: Simplify with cleanup.h
Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-9-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:02 +01:00
Krzysztof Kozlowski
7d996c8a5f
ASoC: simple-card: Use cleanup.h instead of devm_kfree()
Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-8-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:01 +01:00
Krzysztof Kozlowski
b39f7713ec
ASoC: audio-graph-card2: Use cleanup.h instead of devm_kfree()
Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-7-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:50:00 +01:00
Krzysztof Kozlowski
5725c16af2
ASoC: audio-graph-card: Use cleanup.h instead of devm_kfree()
Allocate the memory with scoped/cleanup.h, instead of devm interface, to
make the code more obvious that memory is not used outside this scope.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-6-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:59 +01:00
Krzysztof Kozlowski
6440e7b2a0
ASoC: simple-card-utils: Simplify with cleanup.h
Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-5-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:58 +01:00
Krzysztof Kozlowski
56d426f552
ASoC: codecs: wcd934x: Simplify with cleanup.h
Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-4-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:57 +01:00
Krzysztof Kozlowski
6344ab5d08
ASoC: codecs: wcd9335: Simplify with cleanup.h
Allocate the memory with scoped/cleanup.h to reduce error handling (less
error paths) and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-3-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:56 +01:00
Krzysztof Kozlowski
f9cbfb6612
ASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_probe() with cleanup.h
Allocate the memory with scoped/cleanup.h in audio_iio_aux_probe() to
reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-2-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:55 +01:00
Krzysztof Kozlowski
408e493817
ASoC: codecs: audio-iio-aux: Simplify audio_iio_aux_add_dapms() with cleanup.h
Allocate the memory with scoped/cleanup.h in audio_iio_aux_add_dapms()
to reduce error handling (less error paths) and make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-1-71219dfd0aef@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08 12:49:54 +01:00
Shenghao Ding
ccb367c5ab
ASoc: pcm6240: Remove unnecessary name-prefix for all the controls
Adding name-prefix for each audio controls is a redundant, because
name-prefix will be automatically added behind the control name when
creating a new control.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240705064846.1723-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-05 13:19:51 +01:00
Mark Brown
fc800b84b4
Add support for non-interleaved mode in qmc_audio
Merge series from Herve Codina <herve.codina@bootlin.com>:

The qmc_audio driver supports only audio in interleaved mode.
Non-interleaved mode can be easily supported using several QMC channel
per DAI. In that case, data related to ch0 are sent to (received from)
the first QMC channel, data related to ch1 use the next QMC channel and
so on up to the last channel.

In terms of constraints and settings, the interleaved and
non-interleaved modes are slightly different.

In interleaved mode:
  - The sample size should fit in the number of time-slots available for
    the QMC channel.
  - The number of audio channels should fit in the number of time-slots
    (taking into account the sample size) available for the QMC channel.

In non-interleaved mode:
  - The number of audio channels is the number of available QMC
    channels.
  - Each QMC channel should have the same number of time-slots.
  - The sample size equals the number of time-slots of one QMC channel.

This series add support for the non-interleaved mode in the qmc_audio
driver and is composed of the following parts:
  - Patches 1 and 2: Fix some issues in the qmc_audio
  - Patches 3 to 6: Prepare qmc_audio for the non-interleaved mode
  - Patches 7 and 8: Extend the QMC driver API
  - Patches 9 and 10: The support for non-interleaved mode itself

Compared to the previous iteration, this v2 series mainly improves
qmc_audio_access_is_interleaved().
2024-07-04 18:41:11 +01:00
Mark Brown
ecaec47b88
ASoC: codecs: lpass-rx-macro: Few code cleanups
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Improve a bit the Qualcomm LPASS RX macro driver and align similar parts
of code with LPASS WSA macro driver for consistency.

No external dependencies.
2024-07-04 18:41:03 +01:00
Shenghao Ding
cabf0b0cff
ASoc: tas2781: Set "Speaker Force Firmware Load" as the common kcontrol for both tas27871 and tas2563
Set "Speaker Force Firmware Load" as the common kcontrol
for both tas27871 and tas2563 and move it into newly-created
tasdevice_snd_controls, and keep the digital gain and analog
gain in tas2781_snd_controls.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240704094939.1824-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 16:02:15 +01:00
Aleksandr Mishin
5080808c33
ASoC: amd: Adjust error handling in case of absent codec device
acpi_get_first_physical_node() can return NULL in several cases (no such
device, ACPI table error, reference count drop to 0, etc).
Existing check just emit error message, but doesn't perform return.
Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios()
where it is dereferenced.

Adjust this error handling by adding error code return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 02527c3f23 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20240703191007.8524-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:42:25 +01:00
Krzysztof Kozlowski
9f3ae72c5d
ASoC: codecs: wcd939x: Fix typec mux and switch leak during device removal
Driver does not unregister typec structures (typec_mux_dev and
typec_switch_desc) during removal leading to leaks.  Fix this by moving
typec registering parts to separate function and using devm interface to
release them.  This also makes code a bit simpler:
 - Smaller probe() function with less error paths and no #ifdefs,
 - No need to store typec_mux_dev and typec_switch_desc in driver state
   container structure.

Cc: stable@vger.kernel.org
Fixes: 10f514bd17 ("ASoC: codecs: Add WCD939x Codec driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20240701122616.414158-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:42:24 +01:00
Shengjiu Wang
1e0dff741b
ASoC: ak4458: remove "reset-gpios" property handler
commit c721f189e8 ("reset: Instantiate reset GPIO controller for
shared reset-gpios") check if there is no "resets" property
will fallback to "reset-gpios".

So don't need to handle "reset-gpios" separately in the driver,
the "reset-gpios" handler is duplicated with "resets" control handler,
remove it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1720009575-11677-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:42:23 +01:00
Peter Ujfalusi
6558e8737a
ASoC: SOF: ipc4-topology: Use single token list for the copiers
There is no need to keep separate token list for dai and 'common' copier
token list when the 'common' list is actually the aif list, the
SOF_COPIER_DEEP_BUFFER_TOKENS are not applicable for buffers.

We could have separate lists for all types but it is probably simpler to
just use a single list for all types of copiers. Function specific tokens
will be only parsed by function specific code anyways.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240704085944.371450-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:42:23 +01:00
Herve Codina
188d9cae54
ASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode.
The current fsl_qmc_audio works in interleaved mode. The audio samples
are interleaved and all data are sent to (received from) one QMC
channel.

Using several QMC channels, non interleaved mode can be easily
supported. In that case, data related to ch0 are sent to (received from)
the first QMC channel, data related to ch1 use the next QMC channel and
so on up to the last channel.

In terms of constraints and settings, the two modes are slightly
different:
- Interleaved mode:
    - The sample size should fit in the number of time-slots available
      for the QMC channel.
    - The number of audio channels should fit in the number of
      time-slots (taking into account the sample size) available for the
      QMC channel.
- Non-interleaved mode:
    - The number of audio channels is the number of available QMC
      channels.
    - Each QMC channel should have the same number of time-slots.
    - The sample size equals the number of time-slots of one QMC
      channel.

Add support for the non-interleaved mode allowing multiple QMC channel
per DAI. The DAI switches in non-interleaved mode when more that one QMC
channel is available.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-11-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:25:00 +01:00
Herve Codina
b81cfa6643
ASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved()
Constraints are set by qmc_dai_startup(). These constraints are specific
to the interleaved mode.

With the future introduction of support for non-interleaved mode, a new
set of constraints will be set. To make the code clear and keep
qmc_dai_startup() simple, extract the current interleaved mode
constraints settings to a specific function.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-7-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:57 +01:00
Herve Codina
33a6969fbc
ASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit()
Submitting data to QMC channels is done in several places: transfer
completions and DAI start. The operation done is simple and consist in
one function call.

With the future introduction of support for non-interleaved mode,
submitting data will be more complex.

To avoid copy/paste of code in several places, introduce
qmc_audio_pcm_{read,write}_submit() whose goal is to handle this
data submission.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-6-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:56 +01:00
Herve Codina
5e51a1f9df
ASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion routines
The current QMC audio driver uses only one QMC channel per DAI. The
context used by QMC channel transfer (read and write) completion
routines does not contains any QMC channel and the only one available
per DAI is used to schedule the next transfer.
This works pretty well with only one QMC channel per DAI.

The future support for non-inlerleave mode will use several QMC channel
per DAI. In that case, QMC channel transfer completion routines need to
identify the QMC channel related to the completion.

In order to fill this lack, even if identifying the current QMC channel
among several QMC channels is not needed for the current code, add one
indirection level and introduce the qmc_dai_chan data structrure.
This structure contains the QMC channel involved in the completion and
refererences to the runtime context (capture and playback) used by the
DAI.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-5-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:55 +01:00
Herve Codina
42212b2ce8
ASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handling
The driver mixes some internal values for channel DMA buffer handling
and PCM pointer handling. In the currently supported interleaved mode,
this mix does not lead to any issues but in order to prepare the
support for the non-interleaved mode, having them clearly separated will
ease the support and avoid additional computation to convert values used
in channel DMA buffer management in values usable for PCM pointer.

Use a specific set of variable for PCM pointer handling and an other set
for channel DMA buffer.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-4-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:54 +01:00
Herve Codina
86dd725b57
ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatch
./scripts/checkpatch.pl --strict --codespell detected several issues
when running on the fsl_qmc_audio.c file:
  - CHECK: spaces preferred around that '*' (ctx:VxV)
  - CHECK: Alignment should match open parenthesis
  - CHECK: Comparison to NULL could be written "!prtd"
  - CHECK: spaces preferred around that '/' (ctx:VxV)
  - CHECK: Lines should not end with a '('
  - CHECK: Please don't use multiple blank lines
Some of them are present several times.

Fix all of these issues without any functional changes.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:53 +01:00
Herve Codina
e625999023
ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned value
devm_kasprintf() can return a NULL pointer on failure but this returned
value is not checked.

Fix this lack and check the returned value.

Fixes: 075c7125b1 ("ASoC: fsl: Add support for QMC audio")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:24:52 +01:00
Peter Ujfalusi
82bb8db966
ASoC: SOF: Intel: hda-pcm: Limit the maximum number of periods by MAX_BDL_ENTRIES
The HDaudio specification Section 3.6.2 limits the number of BDL entries to 256.

Make sure we don't allow more periods than this normative value.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240704090106.371497-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:09:11 +01:00
Bard Liao
7441e7f3e6
ASoC: rt711-sdw: add missing readable registers
Those registers will be used when JD source is RT711_JD2_1P8V_1PORT.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20240704092327.652609-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:09:10 +01:00
Kai Vehmanen
9065693dcc
ASoC: SOF: Intel: hda: fix null deref on system suspend entry
When system enters suspend with an active stream, SOF core
calls hw_params_upon_resume(). On Intel platforms with HDA DMA used
to manage the link DMA, this leads to call chain of

   hda_dsp_set_hw_params_upon_resume()
 -> hda_dsp_dais_suspend()
 -> hda_dai_suspend()
 -> hda_ipc4_post_trigger()

A bug is hit in hda_dai_suspend() as hda_link_dma_cleanup() is run first,
which clears hext_stream->link_substream, and then hda_ipc4_post_trigger()
is called with a NULL snd_pcm_substream pointer.

Fixes: 2b009fa082 ("ASoC: SOF: Intel: hda: Unify DAI drv ops for IPC3 and IPC4")
Link: https://github.com/thesofproject/linux/issues/5080
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://patch.msgid.link/20240704085708.371414-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:09:09 +01:00
Krzysztof Kozlowski
67820eb9f4
ASoC: codecs: lpass-wsa-macro: Simplify with cleanup.h
Driver's probe() has two allocations which are needed only within the
probe() itself - for devm_regmap_init_mmio().

Usage of devm interface is a bit misleading here, because these can be
freed right after each scope finishes.

This makes the code a bit more obvious and self documenting.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-6-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:42 +01:00
Krzysztof Kozlowski
c72585d792
ASoC: codecs: lpass-rx-macro: Use unsigned for number of widgets
Driver uses ARRAY_SIZE() to get number of widgets later passed to
snd_soc_dapm_new_controls(), which is an 'unsigned int'.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-5-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:41 +01:00
Krzysztof Kozlowski
bf95919fe1
ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()
Number of widgets in array passed to snd_soc_dapm_new_controls() cannot
be negative, so make it explicit by using 'unsigned int', just like
snd_soc_add_component_controls() is doing.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-4-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:40 +01:00
Krzysztof Kozlowski
0c02cacf62
ASoC: codecs: lpass-rx-macro: Keep static regmap_config as const
The driver has static 'struct regmap_config', which is then customized
depending on device version.  This works fine, because there should not
be two devices in a system simultaneously and even less likely that such
two devices would have different versions, thus different regmap config.
However code is cleaner and more obvious when static data in the driver
is also const - it serves as a template.

Mark the 'struct regmap_config' as const and duplicate it in the probe()
with kmemdup to allow customizing per detected device variant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-3-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:39 +01:00
Krzysztof Kozlowski
ee5e13b2c9
ASoC: codecs: lpass-rx-macro: Simplify with cleanup.h
Allocate the default register values array with scoped/cleanup.h to
reduce number of error paths and make code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-2-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:38 +01:00
Krzysztof Kozlowski
891168dc4a
ASoC: codecs: lpass-rx-macro: Simplify PDS cleanup with devm
Eliminate PDS cleanup by using devm_add_action_or_reset() which results
in one less error path and smaller cleanup in remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-1-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:43:37 +01:00
Linus Walleij
3b628e617b
ASoC: tas5086: Convert to GPIO descriptors
Switch the driver to use GPIO descriptors.

Notice that we let the gpiolib handle line inversion for the
active low reset line (nreset !reset).

There are no upstream device trees using the tas5086 compatible
string, if there were, we would need to ascertain that they all
set the GPIO_ACTIVE_LOW flag on their GPIO lines.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20240701-asoc-tas-gpios-v1-1-d69ec5d79939@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 21:28:36 +01:00
Javier Carrasco
e15cc906b9
ASoC: wsa884x: Constify struct regmap_config
`wsa884x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-9-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:28 +01:00
Javier Carrasco
22c361dc7c
ASoC: wsa883x: Constify struct regmap_config
`wsa883x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-8-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:27 +01:00
Javier Carrasco
5ffab1d3f3
ASoC: wsa881x: Constify struct regmap_config
`wsa881x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-7-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:27 +01:00
Javier Carrasco
7abfa29ba6
ASoC: jz4770: Constify struct regmap_config
`jz4760_codec_regmap_config` is not modified and can be declared as
const to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-6-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:26 +01:00
Javier Carrasco
8d9c0ede48
ASoC: jz4760: Constify struct regmap_config
`jz4760_codec_regmap_config` is not modified and can be declared as
const to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-5-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:25 +01:00
Javier Carrasco
52f0aa5fb9
ASoC: cs53l30: Constify struct regmap_config
`cs53l30_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-4-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:24 +01:00
Javier Carrasco
0271df05e6
ASoC: cs35l36: Constify struct regmap_config
`cs35l36_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-3-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:23 +01:00
Javier Carrasco
306e0317bd
ASoC: cs35l35: Constify struct regmap_config
`cs35l35_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-2-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:22 +01:00
Javier Carrasco
cb14818012
ASoC: cs35l34: Constify struct regmap_config
`cs35l34_regmap` is not modified and can be declared as const to move
its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240703-sound-const-regmap_config-v1-1-2e379b0446a7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 17:35:21 +01:00
Mark Brown
91419b0d9a
ASoC: cs35l56: Set correct upper volume limit
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

These two commits set the upper limit of the Speaker Volume control
to +12dB instead of +100dB.

This should have been a simple 1-line change to the #define in the
header file, but only the HDA cs35l56 driver is using this define.
The ASoC cs35l56 driver was using hardcoded numbers instead of the
header defines.

So the first commit changes the ASoC driver to use the #defined
constants. The second commit corrects the value of the constant.
2024-07-03 17:30:47 +01:00
Chancel Liu
c288f0a1c0
ASoC: fsl_xcvr: Improve suspend/resume flow in fsl_xcvr_trigger()
In the current flow all interrupts are disabled in runtime suspend
phase. However interrupts enablement only exists in fsl_xcvr_prepare().
After resume fsl_xcvr_prepare() may not be called so it will cause all
interrupts still disabled even if resume from suspend. Interrupts
should be explictily enabled after resume.

Also, DPATH reset setting only exists in fsl_xcvr_prepare(). After
resume from suspend DPATH should be reset otherwise there'll be channel
swap issue.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://patch.msgid.link/20240628094354.780720-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 15:17:51 +01:00
Richard Fitzgerald
c66995ae40
ASoC: cs35l56: Use header defines for Speaker Volume control definition
The "Speaker Volume" control was being defined using four hardcoded magic
numbers. There are #defines in the cs35l56.h header for these numbers, so
change the code to use the defined constants.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240703095517.208077-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-03 13:05:42 +01:00
Rob Herring (Arm)
31a45f9190
ASoC: tas2781: Use of_property_read_reg()
Replace the open-coded parsing of "reg" with of_property_read_reg().
The #ifdef is also easily replaced with IS_ENABLED().

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240702215402.839673-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 23:35:53 +01:00
Rob Herring (Arm)
4aad1d9471
ASoC: PCM6240: Use of_property_read_reg()
Replace the open-coded parsing of "reg" with of_property_read_reg().
The #ifdef is also easily replaced with IS_ENABLED().

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240702215349.839350-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 23:35:52 +01:00
Mark Brown
d06432b046
ASoC: topology: kcontrol registration cleanup
Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

Code used to create standalone and widget controls is mostly same, with
with exception that in standalone case dynamic object needs to be
registered and control created directly.

Following patches clean up and unify kcontrol creation code in topology
code.
2024-07-02 21:32:07 +01:00
Amadeusz Sławiński
8f2942b919
ASoC: topology: Unify code for creating standalone and widget enum control
Code used to create standalone and widget enum control is same, with
exception that in standalone case dynamic object needs to be registered
and control created directly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-14-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:08 +01:00
Amadeusz Sławiński
4654ca7cc8
ASoC: topology: Unify code for creating standalone and widget mixer control
Code used to create standalone and widget mixer control is same, with
exception that in standalone case dynamic object needs to be registered
and control created directly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-13-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:07 +01:00
Amadeusz Sławiński
0867278200
ASoC: topology: Unify code for creating standalone and widget bytes control
Code used to create standalone and widget bytes control is same, with
exception that in standalone case dynamic object needs to be registered
and control created directly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-12-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:06 +01:00
Amadeusz Sławiński
c2dad0db01
ASoC: topology: Reshuffle function placement
In preparation for following cleanups move functions around.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-11-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:05 +01:00
Amadeusz Sławiński
76d8aa0f72
ASoC: topology: Rename function creating widget kcontrol
In following patches it will be reused to also create standalone
kcontrol, so it makes sense to name it in more generic way.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-10-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:04 +01:00
Amadeusz Sławiński
f14a33fcad
ASoC: topology: Align dynamic object initialization for controls
soc_tplg_dbytes_create() missed se->dobj.index initialization, so add it
there. Additionally separate dynamic object initialization into separate
logical block code.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-9-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:03 +01:00
Amadeusz Sławiński
963942f73b
ASoC: topology: Correctly set shift_r in soc_tplg_denum_create()
This aligns soc_tplg_denum_create() with
soc_tplg_dapm_widget_denum_create(), as there is no reason for
difference in behavior.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-8-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:03 +01:00
Amadeusz Sławiński
d1d0262a1f
ASoC: topology: Cleanup soc_tplg_dapm_widget_denum_create
Minor cleanups to increase readability.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:02 +01:00
Amadeusz Sławiński
40a16442a0
ASoC: topology: Cleanup soc_tplg_dapm_widget_dmixer_create
Minor cleanups to increase readability.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:01 +01:00
Amadeusz Sławiński
52f4f7272c
ASoC: topology: Cleanup soc_tplg_dapm_widget_dbytes_create
Minor cleanups to increase readability.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:27:00 +01:00
Amadeusz Sławiński
8ec2a26435
ASoC: topology: Properly initialize soc_enum values
soc_tplg_denum_create_values() should properly set its values field.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:26:59 +01:00
Amadeusz Sławiński
7aa129706b
ASoC: topology: Do not do unnecessary dobj management
Widget kcontrols do not need to be managed as topology dynamic objects
with an index and a linked list. As they are always associated with a
widget which is already a topology dynamic object, thus all
addition/removals of a widget will by design manage the kcontrol.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:26:58 +01:00
Amadeusz Sławiński
97a05cb4ab
ASoC: topology: Simplify code
Instead of using goto, when there is no controls, just do a loop when
there are. Overall the check seems to be a bit redundant as
num_kcontrols will only be above 0 if kcontrols are set anyway, but
let's keep it, while simplifying code.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 14:26:57 +01:00
Maxim Kochetkov
1d3724c92d
ASoC: codecs: nau8824: Add master clock handling
Use master clock "mclk" if provided through device tree.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://patch.msgid.link/20240701211631.92384-3-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-02 13:59:30 +01:00
Mark Brown
a893a804c6
ASoC: simple-audio-mux: add state-labels
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

simple-audio-mux is designed to be used generally, thus "Input 1" or
"Input 2" are used to selecting MUX input. This numbered inputs would work,
but might be not user friendly in some case, for example in case of system
hardware design has some clear labels.
Adds new "state-labels" property and enable to select MUX by own state names.

Original
	> amixer set "MUX" "Input 1"
	> amixer set "MUX" "Input 2"

Use mux-names
	sound_mux: mux {
		compatible = "simple-audio-mux";
		mux-gpios = <...>;
=>		state-labels = "Label_A", "Label_B";
	};

	> amixer set "MUX" "Label_A"
	> amixer set "MUX" "Label_B"
2024-07-02 13:03:13 +01:00
Mark Brown
d0401d07a9
ASoC: cs35l56: Remove obsolete and redundant code
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

These commits remove various code that is either no longer needed,
or is redundant.
2024-07-02 13:03:05 +01:00
Mark Brown
cc1deba840
ASoC: codecs: wsa88xx: add support for static port
Merge series from srinivas.kandagatla@linaro.org:

Existing way of allocating soundwire master ports on Qualcommm platforms is
dynamic, and in linear order starting from 1 to MAX_PORTS.
This will work as long as soundwire device ports are 1:1 mapped
linearly. However on most Qcom SoCs like SM8550, SM8650, x1e80100, these
are NOT mapped in that order.

The result of this is that only one speaker among the pair of speakers
is always silent, With recent changes for WSA codec to support codec
versions and along with these patches we are able to get all speakers
working on these SoCs.
2024-07-02 13:02:57 +01:00
Krzysztof Kozlowski
765d3a2aa1
ASoC: codecs: lpass-wsa-macro: Fix using NULL pointer in probe() dev_err
The 'wsa->dev' is assigned closer to the end of the probe() function, so
the dev_err() must not use it - it is still NULL at this point.  Instead
there is already a local 'dev' variable.

Fixes: 727de4fbc5 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240628095831.207942-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 20:07:29 +01:00
Krzysztof Kozlowski
2e068fe01e
ASoC: codecs: lpass-rx-macro: Fix using NULL pointer in probe() dev_err
The 'rx->dev' is assigned closer to the end of the probe() function, so
the dev_err() must not use it - it is still NULL at this point.  Instead
there is already a local 'dev' variable.

Fixes: dbacef0589 ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240628095831.207942-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 20:07:29 +01:00
Nathan Chancellor
f1afb360b6
ASoC: fsl: lpc3xxx-i2s: Include bitfield.h for FIELD_PREP
bitfield.h is not explicitly included but it is required for FIELD_PREP
to be expanded by the preprocessor. If it is not implicitly included,
there will be a compiler error (as seen with ARCH=hexagon allmodconfig):

  sound/soc/fsl/lpc3xxx-i2s.c:169:10: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    169 |                 tmp |= LPC3XXX_I2S_WW8 | LPC3XXX_I2S_WS_HP(LPC3XXX_I2S_WW8_HP);
        |                        ^
  sound/soc/fsl/lpc3xxx-i2s.h:42:30: note: expanded from macro 'LPC3XXX_I2S_WW8'
     42 | #define LPC3XXX_I2S_WW8      FIELD_PREP(0x3, 0) /* Word width is 8bit */
        |                              ^
  sound/soc/fsl/lpc3xxx-i2s.c:205:34: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    205 |                              LPC3XXX_I2S_DMA1_TX_EN | LPC3XXX_I2S_DMA0_TX_DEPTH(4));
        |                                                       ^
  sound/soc/fsl/lpc3xxx-i2s.h:65:38: note: expanded from macro 'LPC3XXX_I2S_DMA0_TX_DEPTH'
     65 | #define LPC3XXX_I2S_DMA0_TX_DEPTH(s) FIELD_PREP(0xF0000, s) /* Set the DMA1 TX Request level */
        |                                      ^
  sound/soc/fsl/lpc3xxx-i2s.c:210:34: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    210 |                              LPC3XXX_I2S_DMA0_RX_EN | LPC3XXX_I2S_DMA1_RX_DEPTH(4));
        |                                                       ^
  sound/soc/fsl/lpc3xxx-i2s.h:70:38: note: expanded from macro 'LPC3XXX_I2S_DMA1_RX_DEPTH'
     70 | #define LPC3XXX_I2S_DMA1_RX_DEPTH(s) FIELD_PREP(0x700, s) /* Set the DMA1 RX Request level */
        |                                      ^

Include bitfield.h explicitly, so that FIELD_PREP is always expanded,
clearing up the compiler error.

Fixes: 0959de657a ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20240701-lpc32xx-asoc-fix-include-for-field_prep-v1-1-0c5d7f71921b@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 20:07:28 +01:00
Nathan Chancellor
f4662e6d51
ASoC: fsl: lpc3xxx-i2s: Avoid using ret uninitialized in lpc32xx_i2s_probe()
clang points out that ret may be used uninitialized in
lpc32xx_i2s_probe() in an error pointer path (which becomes fatal with
CONFIG_WERROR):

  sound/soc/fsl/lpc3xxx-i2s.c:326:47: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
    326 |                                      "failed to init register map: %d\n", ret);
        |                                                                           ^~~
  sound/soc/fsl/lpc3xxx-i2s.c:310:9: note: initialize the variable 'ret' to silence this warning
    310 |         int ret;
        |                ^
        |                 = 0
  1 error generated.

One solution would be a small refactoring of the second parameter in
dev_err_probe(), PTR_ERR(i2s_info_p->regs), to be the value of ret in
the if statement. However, a nicer solution for debugging purposes,
which is the point of this statement, would be to use the '%pe'
specifier to symbolically print the error pointer value. Do so, which
eliminates the uninitialized use of ret, clearing up the warning.

Fixes: 0959de657a ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20240701-lpc32xx-asoc-fix-uninitialized-ret-v1-1-985d86189739@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 17:50:50 +01:00
Shenghao Ding
55f0a1fa6e
ASoc: tas2781: Add name_prefix as the prefix name of DSP firmwares and calibrated data files
Add name_prefix as the prefix name of DSP firmwares
and calibrated data files which stored speaker
calibrated impedance.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240629101112.628-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 16:14:57 +01:00
Srinivas Kandagatla
e1bc5c324b
ASoC: codecs: wsa884x: parse port-mapping information
Add support to parse static master port map information from device tree.
This is required for correct port mapping between soundwire device and
master ports.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240626-port-map-v2-4-6cc1c5608cdd@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 14:53:25 +01:00
Srinivas Kandagatla
1cf3295bd1
ASoC: codecs: wsa883x: parse port-mapping information
Add support to parse static master port map information from device tree.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240626-port-map-v2-2-6cc1c5608cdd@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 14:53:23 +01:00
Kuninori Morimoto
3913ecb388
ASoC: simple-audio-mux: enable to select MUX names
simple-audio-mux is designed to be used generally, thus "Input 1" or
"Input 2" are used to selecting MUX input. This numbered inputs would
work, but might be not user friendly in some case, for example in case
of system hardware design has some clear labels.
Adds new "state-labels" property and enable to select MUX by own state
names.

Original
	> amixer set "MUX" "Input 1"

Use mux-names
	sound_mux: mux {
		compatible = "simple-audio-mux";
		mux-gpios = <...>;
		state-labels = "Label_A", "Label_B";
	};

	> amixer set "MUX" "Label_A"

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87msn27xpg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 14:10:32 +01:00
Chancel Liu
19dec6650e
ASoC: fsl_rpmsg: Add support for i.MX95 platform
Add compatible string and specific soc data to support rpmsg sound card
on i.MX95 platform.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://patch.msgid.link/20240626071202.7149-2-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 13:12:35 +01:00
Richard Fitzgerald
e5524e3316
ASoC: cs35l56: Remove redundant clearing of clk_stop_mode1
struct sdw_slave_prop is zero-initialized by the SoundWire core so there
is no need to clear clk_stop_mode1 to false. Removing this also avoids
having an unnecessary build dependency on a struct member.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240701104444.172556-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 13:12:28 +01:00
Richard Fitzgerald
e2996141d6
ASoC: cs35l56: Remove support for A1 silicon
No product was ever released with A1 silicon so there is no
need for the driver to include support for it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240701104444.172556-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 13:12:27 +01:00
Richard Fitzgerald
5d7e328e20
ASoC: cs35l56: Revert support for dual-ownership of ASP registers
This patch reverts a series of commits that allowed for the ASP
registers to be owned by either the driver or the firmware. Nothing
currently depends on the functionality that is being reverted, so
it is safe to remove.

The commits being reverted are (last 3 are bugfixes to the first 2):
commit 72a77d7631
("ASoC: cs35l56: Fix to ensure ASP1 registers match cache")
commit 07f7d6e7a1
("ASoC: cs35l56: Fix for initializing ASP1 mixer registers")
commit 4703b014f2
("ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()")
commit c14f09f010
("ASoC: cs35l56: Fix deadlock in ASP1 mixer register initialization")
commit dfd2ffb373
("ASoC: cs35l56: Prevent overwriting firmware ASP config")

These reverts have been squashed into a single commit because there
would be no reason to revert only some of them (which would just
reintroduce bugs).

The changes introduced by the commits were well-intentioned but
somewhat misguided. ACPI does not provide any information about how
audio hardware is linked together, so that information has to be
hardcoded into drivers. On Windows the firmware is customized to
statically setup appropriate configuration of the audio links,
and the intent of the commits was to re-use this information if the
Linux host drivers aren't taking control of the ASP. This would
avoid having to hardcode the ASP config into the machine driver on
some systems.

However, this added complexity and race conditions into the driver.
It also complicates implementation of new code.

The only case where the ASP is used but the host is not taking
ownership is when CS35L56 is used in SoundWire mode with the ASP
as a reference audio interconnect. But even in that case it's not
necessarily required even if the firmware initialized it. Typically
it is used to avoid the host SDCA drivers having to be capable of
aggregating capture paths from multiple SoundWire peripherals. But
the SOF SoundWire support is capable of doing that aggregation.

Reverting all these commits significantly simplifies the driver.
Let's just use the normal Linux mechanisms of the machine driver and
ALSA controls to set things up instead of trying to use the firmware
to do use-case setup.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20240701104444.172556-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-01 13:12:26 +01:00
Mark Brown
4235c80ba4
Add audio support for LPC32XX CPUs
Merge series from Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>:

This pach set is to bring back audio to machines with a LPC32XX CPU.
The legacy LPC32XX SoC used to have audio spport in linux 2.6.27.
The support was dropped due to lack of interest from mainaeners.
2024-06-28 18:07:12 +01:00
James Ogletree
c486def5b3 ASoC: cs40l50: Support I2S streaming to CS40L50
Introduce support for Cirrus Logic Device CS40L50: a
haptic driver with waveform memory, integrated DSP,
and closed-loop algorithms.

The ASoC driver enables I2S streaming to the device.

Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com>
Signed-off-by: James Ogletree <jogletre@opensource.cirrus.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240620161745.2312359-6-jogletre@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-06-28 15:36:15 +01:00
Jerome Brunet
730674b21d
ASoC: meson: tdm: add sample rate support up to 768kHz
Add support for 705.6kHz and 768kHz sample rates

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20240628123256.2019224-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28 13:39:33 +01:00
Chen Ni
1a70579723
ASoC: max98088: Check for clk_prepare_enable() error
clk_prepare_enable() may fail, so we should better check its return
value and propagate it in the case of error.

Fixes: 62a7fc32a6 ("ASoC: max98088: Add master clock handling")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20240628080534.843815-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28 13:39:31 +01:00
Yang Li
061505a1a6
ASoC: Remove unneeded semicolon
./sound/soc/codecs/ak4619.c:757:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9442
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://patch.msgid.link/20240628052406.36644-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28 13:39:30 +01:00
Jerome Brunet
4adf454ff6
ASoC: soc-utils: allow sample rate up to 768kHz for the dummy dai
The dummy DAI should allow any (reasonable) rates possible.
Make the rate continuous for dummy and set range from 5512Hz to 768kHz

The change is mostly cosmetic as dummy is skipped when setting
the hwparams.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20240628120130.2015665-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28 13:39:29 +01:00
Piotr Wojtaszczyk
0959de657a
ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs
This driver was ported from an old version in linux 2.6.27 and adjusted
for the new ASoC framework and DMA API.

Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Link: https://patch.msgid.link/20240627150046.258795-12-piotr.wojtaszczyk@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-28 13:39:23 +01:00
Krzysztof Kozlowski
36ac1e29f4
ASoC: codecs: lpass-wsa-macro: add missing select of common code
The Qualcomm LPASS WSA macro codec driver uses now parts of common
module, so it has to select SND_SOC_LPASS_MACRO_COMMON.

  sound/soc/codecs/lpass-wsa-macro.o: in function `wsa_macro_probe':
  sound/soc/codecs/lpass-wsa-macro.c:2767:(.text+0x1c9c): undefined reference to `lpass_macro_get_codec_version'

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406272231.th1LtuLk-lkp@intel.com/
Fixes: 5dcf442bbb ("ASoC: codecs: lpass-wsa-macro: Prepare to accommodate new codec versions")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240627125203.171048-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-27 14:11:25 +01:00
Mark Brown
d2b1955656
ASoC: imx-audmix: Split capture device to be a new
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

The transmitter and receiver part of the SAI interface need to be
configured with different master/slave mode, especially to work
with the audiomix module.

The SAI1 TX is in master mode, but SAI1 RX is in slave mode.
So add another two DAIs for TX and RX separately in fsl_sai driver.

There will be three devices for audiomix sound card, hw:x,0 is
the playback device for one SAI, hw:x,1 is the playback device
for another SAI, hw:x,2 is the capture device for audmix
output.
2024-06-27 12:30:52 +01:00
Mark Brown
6a0d3607f5
ASoC: simple-card / audio-graph:
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Introduce the ability for sound cards to manually order the startup of
the various components in the card.
2024-06-27 12:30:40 +01:00
Shuming Fan
936abb09c1
ASoC: rt712-sdca: add the function for version B
The version B will support the multi-lane function and integrate the DMIC function
in one SoundWire interface.
Due to some registers having different default values between version A and B,
this patch also removes the redundant default registers to avoid confusion.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20240620103237.2124196-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 20:54:02 +01:00
Shuming Fan
f2177731b6
ASoC: rt712-sdca: change the definition name of SDCA channel number
This patch doesn't have any change of functionality.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20240620103224.2124179-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 18:35:53 +01:00
Aleksandr Mishin
f9f7f29f64
ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()
If IORESOURCE_MEM "lpass-rxtx-cdc-dma-lpm" or "lpass-va-cdc-dma-lpm"
resources is not provided in Device Tree due to any error,
platform_get_resource_byname() will return NULL which is later
dereferenced. According to sound/qcom,lpass-cpu.yaml, these resources
are provided, but DT can be broken due to any error. In such cases driver
must be able to protect itself, since the DT is external data for the
driver.
Adjust this issues by adding NULL return check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: b138706225 ("ASoC: qcom: Add regmap config support for codec dma driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20240605104953.12072-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 18:35:51 +01:00
Shengjiu Wang
05d996e113
ASoC: imx-audmix: Split capture device for audmix
There will be three devices for this sound card, hw:x,0 is
the playback device for one SAI, hw:x,1 is the playback device
for another SAI, hw:x,2 is the capture device for audmix
output. then capture device and playback device can be configured
with different master/slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1718174452-17596-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:48:14 +01:00
Shengjiu Wang
6232a7eb1a
ASoC: fsl_audmix: Split playback and capture stream to different DAI
As audmix requires playback and capture stream in different
master/slave mode, so separate playback and capture stream to
different DAI. There are three DAIs required, two DAIs for playback
one DAI for capture.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1718174452-17596-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:48:13 +01:00
Shengjiu Wang
15c9583904
ASoC: fsl_sai: Add separate DAI for transmitter and receiver
The transmitter and receiver part of the SAI interface need to be
configured with different master/slave mode, especially to work
with the audiomix module.

+-------+               +-----------+
| SAI1  |   --TX-->     |           |
|       |   <--RX--     |           |
+-------+               |           |
                        | AUDIOMIX  |
+-------+               |           |
| SAI2  |   --TX-->     |           |
+-------+               +-----------+

The SAI1 TX is in master mode, but SAI1 RX is in slave mode.
So add another two DAIs for TX and RX separately. but only
defined fsl_sai_set_dai_fmt_tx() and fsl_sai_set_dai_fmt_rx()
ops function for current case, in the future, the other ops
function for TX and RX can be defined if required.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/1718174452-17596-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:48:12 +01:00
Kuninori Morimoto
e64343fa57
ASoC: audio-graph-card2: add link-trigger-order support
Some Sound Card might need special trigger ordering which is based on
CPU/Codec connection. It is already supported on ASoC, but Audio Graph
Card2 still not yet support it. Let's support it.

Cc: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87msnqzoj8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:47:59 +01:00
Kuninori Morimoto
4d4125d8f5
ASoC: audio-graph-card: add link-trigger-order support
Some Sound Card might need special trigger ordering which is based on
CPU/Codec connection. It is already supported on ASoC, but Audio Graph
Card still not yet support it. Let's support it.

Cc: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o786zojd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:47:58 +01:00
Kuninori Morimoto
8696d732f1
ASoC: simple-audio-card: add link-trigger-order support
Some Sound Card might need special trigger ordering which is based on
CPU/Codec connection. It is already supported on ASoC, but Simple Audio
Card still not yet support it. Let's support it.

Cc: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plsmzojk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:47:57 +01:00
Kuninori Morimoto
5d9cacdccf
ASoC: simple-card-utils: add link-trigger-order support
Some Sound Card might need special trigger ordering which is based on
CPU/Codec connection. It is already supported on ASoC, but Simple Audio
Card / Audio Graph Card still not support it. Let's support it.

Cc: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87r0d2zojq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 17:47:56 +01:00
Krzysztof Kozlowski
06462d6f3f
ASoC: codecs: lpass-macro: Use enum for handling codec version
Replace 'int' with proper 'enum lpass_codec_version' in every place
which handles the parsed codec version (not raw register values!) to be
explicit about contents of the variable.  This makes code easier to read
and compilers could check missing switch cases.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625165736.722106-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 16:34:55 +01:00
Krzysztof Kozlowski
ebc1a54051
ASoC: codecs: lpass-macro: Gracefully handle unknown version
Qualcomm LPASS macro codec driver parses registers in order to
detect version of the codec.  It recognizes codecs v2.0 - v2.8, however
we know that there are earlier versions and 'enum lpass_codec_version'
has also v1.0, v1.1 and v1.2.  If by any chance we run on unrecognized
version, driver will use random value from the stack as the codec
version.

Fix it by mapping such cases to an enum of value 0:
LPASS_CODEC_VERSION_UNKNOWN.

Fixes: 378918d591 ("ASoC: codecs: lpass-macro: add helpers to get codec version")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625165736.722106-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 16:34:54 +01:00
Jack Yu
68f97fe330
ASoC: rt5645: fix issue of random interrupt from push-button
Modify register setting sequence of enabling inline command
to fix issue of random interrupt from push-button.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://patch.msgid.link/9a7a3a66cbcb426487ca6f558f45e922@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 16:34:48 +01:00
Krzysztof Kozlowski
727de4fbc5
ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version
Starting with v2.5 of Qualcomm LPASS Codec, few registers in the WSA
macro block change.  Bring proper support for this v2.5 and newer
versions, to fix second speaker playback (speaker was silent).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-3-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 12:09:53 +01:00
Krzysztof Kozlowski
5dcf442bbb
ASoC: codecs: lpass-wsa-macro: Prepare to accommodate new codec versions
The driver for Qualcomm LPASS WSA macro codec was developed and tested
on codec v2.1, however v2.5 has significant changes in the registers.
The driver correctly works for v2.1 codec, but has issues when running
on SoC with v2.5 codec (so starting with SM8450, even though playback
works properly on that SoC).

Prepare the driver for handling differences in register layouts of newer
version.  This does not have functional impact on older codec versions,
but just:
1. Renames few soc_enums and widgets as v2.1,
2. For registers being different in v2.5, moves the defaults and regmap
   configuration to new structures,
3. Adds new 'struct wsa_reg_layout' with offsets and masks for few
   registers, so most of the code can stay unchaged on v2.5,
4. Chooses proper widgets, regmap config and register layout based on
   version of the codec.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-2-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 12:09:52 +01:00
Krzysztof Kozlowski
04f4de6f68
ASoC: codecs: lpass-wsa-macro: Drop unused define
WSA_MACRO_MUX_INP_MASK2 define is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240625-qcom-audio-wsa-second-speaker-v1-1-f65ffdfc368c@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 12:09:51 +01:00
Vyacheslav Frantsishko
63b47f026c
ASoC: amd: yc: Fix non-functional mic on ASUS M5602RA
The Vivobook S 16X IPS needs a quirks-table entry for the internal microphone to function properly.

Signed-off-by: Vyacheslav Frantsishko <itmymaill@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20240626070334.45633-1-itmymaill@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26 12:08:34 +01:00
Shuming Fan
50b8affb56
ASoC: rt711-sdca: add GE selected mode control
The SDCA spec defines a 'selected_mode' control which can override
the 'detected_mode' reported by hardware.
This is useful for platform integration as well as in cases
where the hardware(e.g. 3.5mm jack cable) is not able to accurately detect the jack type.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Tested-by: yung-chuan.liao@linux.intel.com
Link: https://patch.msgid.link/20240625084303.2273911-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-25 19:12:44 +01:00
Krzysztof Kozlowski
903e850936
ASoC: codecs: lpass-rx-macro: add missing handling of v2.1 codec
We have also v2.1 version of the codec (see 'enum lpass_codec_version'),
so handle it as well in all switch cases.

Fixes: dbacef0589 ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://patch.msgid.link/20240625160614.450506-1-krzysztof.kozlowski@linaro.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-25 19:12:43 +01:00
Uwe Kleine-König
6f9faf1410
ASoC: codecs: Drop explicit initialization of struct i2c_device_id::driver_data to 0
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240624131728.1244053-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-25 15:54:18 +01:00
Mark Brown
694850baa4
ASoC: Intel: boards: updates for 6.11 - part2
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Minor additions and cleanups this time.
2024-06-25 12:34:52 +01:00
Mark Brown
4006f157db
ASoC: codecs: ES8326: Solving headphone detection and
Merge series from Zhang Yi <zhangyi@everest-semi.com>:

We propose four patches to solve headphone detection and suspend issues.
And there are several registers that should be read-only registers. So
we create es8326_writeable_register, and set these registers to false.
2024-06-25 12:34:44 +01:00
Bard Liao
c073f07576
ASoC: Intel: sof_sdw: select PINCTRL_CS42L43 and SPI_CS42L43
Cs42l43 bridge mode needs the two configurations.

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://patch.msgid.link/20240624121119.91552-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:40:09 +01:00
Pierre-Louis Bossart
92d5b5930e
ASoC: Intel: sof_sdw: add quirk for Dell SKU 0B8C
Jack detection needs to rely on JD2, as most other Dell
AlderLake-based devices.

Closes: https://github.com/thesofproject/linux/issues/5021
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://patch.msgid.link/20240624121119.91552-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:40:08 +01:00
Brent Lu
e364ffceab
ASoC: Intel: maxim-common: add max_98373_get_tx_mask function
Add a helper function max_98373_get_tx_mask() to get tx mask from
max98373 ACPI device properties at runtime.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240624121119.91552-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:40:07 +01:00
Pierre-Louis Bossart
65c90df918
ASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP
Experimental tests show that JD2_100K is required, otherwise the jack
is detected always even with nothing plugged-in.

To avoid matching with other known quirks the SKU information is used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240624121119.91552-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:40:06 +01:00
Shenghao Ding
00dd4d86ed
ASoc: tas2781: Add name_prefix as the prefix name of firmwares and kcontrol to support corresponding TAS2563/TAS2781s
Add name_prefix as the prefix name of firmwares and
kcontrol to support corresponding TAS2563/TAS2781s.
name_prefix is not mandatory.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240621132309.564-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:34 +01:00
Peter Ujfalusi
fe836c78ef
ASoC: SOF: ipc4-topology: Use correct queue_id for requesting input pin format
It is incorrect to request the input pin format of the destination widget
using the output pin index of the source module as the indexes are not
necessarily matching.
moduleA.out_pin1 can be connected to moduleB.in_pin0 for example.

Use the dst_queue_id to request the input format of the destination module.

This bug remained unnoticed likely because in nocodec topologies we don't
have process modules after a module copier, thus the pin/queue index is
ignored.
For the process module case, the code was likely have been tested in a
controlled way where all the pin/queue/format properties were present to
work.

Update the debug prints to have better information.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: stable@vger.kernel.org # v6.8+
Link: https://patch.msgid.link/20240624121519.91703-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:33 +01:00
Jiaxin Yu
4ae814dabc
ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.
There are two hardware connection methods for DMICs on the MT6358. In cases
where more than two DMICs are used, we need to time-multiplex these DMICs.
Therefore, we need to dynamically switch the modes of these DMICs based on
the actual usage scenarios.

            ---- DMIC1
AU_VIN0 ---
            ---- DMIC2

AU_VIN2 --- ----DMIC3

When we want to use DMIC1/2, configure it to one-wire mode. When we want to
use DMIC1/3, configure it to two-wire mode.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://patch.msgid.link/20240613020725.27874-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:32 +01:00
Zhang Yi
34fa846f52
ASoC: codecs: ES8326: regcache_sync error issue
We modified the regmap_config members to fix cach sync error.
There are several registers that should be read-only registers.
If these registers are written while synchronizing the register values,
the codec will enter an error state.So we create es8326_writeable_register,
and set these registers to false

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:26 +01:00
Zhang Yi
7e7dbdee96
ASoC: codecs: ES8326: Minimize the pop noise
Executing regcache_sync at initialization, we can hear a gentle pop
noise. So we created es8326_init for initialization instead of
executing es8326_resume

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:25 +01:00
Zhang Yi
4eed78198b
ASoC: codecs: ES8326: Slove headphone detection issue
We modified the headphone detection setting to avoid an error button state
after codec resume from suspend state

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20240624030607.4307-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:24 +01:00
Chen-Yu Tsai
282a4482e1
ASoC: mediatek: mt8195: Add platform entry for ETDM1_OUT_BE dai link
Commit e70b8dd267 ("ASoC: mediatek: mt8195: Remove afe-dai component
and rework codec link") removed the codec entry for the ETDM1_OUT_BE
dai link entirely instead of replacing it with COMP_EMPTY(). This worked
by accident as the remaining COMP_EMPTY() platform entry became the codec
entry, and the platform entry became completely empty, effectively the
same as COMP_DUMMY() since snd_soc_fill_dummy_dai() doesn't do anything
for platform entries.

This causes a KASAN out-of-bounds warning in mtk_soundcard_common_probe()
in sound/soc/mediatek/common/mtk-soundcard-driver.c:

	for_each_card_prelinks(card, i, dai_link) {
		if (adsp_node && !strncmp(dai_link->name, "AFE_SOF", strlen("AFE_SOF")))
			dai_link->platforms->of_node = adsp_node;
		else if (!dai_link->platforms->name && !dai_link->platforms->of_node)
			dai_link->platforms->of_node = platform_node;
	}

where the code expects the platforms array to have space for at least one entry.

Add an COMP_EMPTY() entry so that dai_link->platforms has space.

Fixes: e70b8dd267 ("ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240624061257.3115467-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-24 13:38:10 +01:00
Mark Brown
2604faa7b7
ASoC: nau8822: add MCLK support
Merge series from Andrejs Cainikovs <andrejs.cainikovs@gmail.com>:

This change adds local MCLK handling, which would cover a case when a
reference audio clock is present in a system, but is not allowed to be
changed, see [1].

[1]: https://lore.kernel.org/all/ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com/
2024-06-23 13:13:14 +01:00
Mark Brown
eed139331b
ASoC: qcom: display port changes
Merge series from srinivas.kandagatla@linaro.org:

This patchset adds support for.
	1. parse Display Port module tokens from ASoC topology
	2. add support to DP/HDMI Jack events.
	3. fixes a typo in function name in sm8250

Verified these patches on X13s along with changes to tplg in
https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/tree/topic/x13s-dp?ref_type=heads
and ucm changes from https://github.com/Srinivas-Kandagatla/alsa-ucm-conf/tree/topic/x13s-dp

x1e80100 is verified by Krzysztof with his changes in tplg

https://git.codelinaro.org/linaro/qcomlt/audioreach-topology/-/merge_requests/7/commits
2024-06-23 13:13:07 +01:00
Mark Brown
86a37eb60b
ASoC: Few constifications (mostly arguments)
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make few pointers in ASoC functions as pointers to const, so the code is
clearer to read, a bit safer and allows further constifications (e.g.
placing some data as rodata).
2024-06-23 13:13:00 +01:00
Mark Brown
d6bb39fe4f
ASoC: Add ak4619 codec support
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

This is v3 patch-set for ak4619 driver.
It was created by Khanh, and I updated/adjusted to upstream.
It was tested on Renesas V4M GrayH

Link: https://lore.kernel.org/r/877ceotnrg.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87frtb3x4k.wl-kuninori.morimoto.gx@renesas.com
2024-06-23 13:12:52 +01:00
Mark Brown
d332008962
ASoC: add compatible for ti,pcm5242
Merge series from Christian Hewitt <christianshewitt@gmail.com>:

Update bindings and add a driver compatible for the pcm5242
chip used on the Odroid HiFi-Shield2 i2c mezzanine board.
2024-06-23 13:12:45 +01:00
Mark Brown
f57d7f5289
ASoC: codecs: wcd family: cleanups
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Set of simple cleanups from similar issues in all Qualcomm WCD93xx
codecs.

The first patch "ASoC: codecs: wcd-mbhc: Constify passed MBHC reg
fields" is a requirement for few others, but except this they are
independent.
2024-06-23 13:12:38 +01:00
Mark Brown
b493c97d08
tlv320adc3xxx: Allow MICBIAS pins to be used as
Merge series from Ricard Wanderlof <ricard.wanderlof@axis.com>:

In some cases, depending on system design, the MICBIAS pins on the
chip are not needed as such, but a couple of extra GPIO pins would be
useful. This patch allows the MICBIAS pins to be configured in the
device tree as general purpose output pins, controlled via the GPIO
framework.

Owing to their originally intended purpose there are some limitations:
when the MICBIAS pins are deactivated, they will float, so will likely
need a pulldown in many applications. When activated, they will
assume the voltage specified by the micbias1-vg and micbias2-vg
properties, respectively, meaning that the resulting output voltage
will be 2.0 V, 2.5 V or AVDD .
2024-06-23 13:12:24 +01:00
Mark Brown
f6272b59e8
Cirrus Logic Family of ADCs
Merge series from Paul Handrigan <paulha@opensource.cirrus.com>:

This patchset provides ASoC support for the latest family
of Cirrus Logic multichannel, high performance audio ADCs.
The devices that are supported are CS5302 (2 channel ADC),
CS5304 (4 channel ADC), and CS5308 (8 channel ADC).
2024-06-23 13:12:16 +01:00
Christian Hewitt
9c9b172fdd
ASoC: Add support for ti,pcm5242 to the pcm512x driver
Add a compatible string to enable support for the ti,pcm5242 DAC chip
in the pcm512x driver.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://patch.msgid.link/20240622131245.2607533-3-christianshewitt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-22 14:46:29 +01:00
Paul Handrigan
2884c29152
ASoC: cs530x: Support for cs530x ADCs
Add support for the cs530x family of high performance
ADCs.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://patch.msgid.link/20240621151757.1661265-3-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-22 12:14:24 +01:00
Hao Ge
3722873d49
ASoc: PCM6240: Return directly after a failed devm_kzalloc() in pcmdevice_i2c_probe()
The value “-ENOMEM” was assigned to the local variable “ret”
in one if branch after a devm_kzalloc() call failed at the beginning.
This error code will trigger then a pcmdevice_remove() call with a passed
null pointer so that an undesirable dereference will be performed.
Thus return the appropriate error code directly.

Fixes: 1324eafd37 ("ASoc: PCM6240: Create PCM6240 Family driver code")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Link: https://patch.msgid.link/20240617020954.17252-1-hao.ge@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:10 +01:00
Vijendar Mukunda
8978e1f7bc
ASoC: amd: acp: add pcm constraints for buffer size and period size
ACP common dma driver has a buffer size and period size restriction
which should be 64 byte aligned. Add pcm constraints for the same.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:09 +01:00
Vijendar Mukunda
d85695b01c
ASoC: amd: acp: move i2s clock generation sequence
I2S clock generation registers should be programmed before starting the I2S
dma when I2S controller is programmed as clock master. Move i2s clock
generation register programming sequence prior to i2s dma start.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:08 +01:00
Vijendar Mukunda
5b162f60e7
ASoC: amd: acp: modify conditional check for programming i2s mclk
ACP provides different IO configurations(ACP PDM, I2S and SoundWire).
I2S mclk should be programmed only when I2S configuration is selected and
I2S controller is programmed as clock master.
Modify the conditional check for programming i2s mclk.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:07 +01:00
Vijendar Mukunda
50f1670145
ASoC: amd: acp: remove unused variables from acp_resource structure
Remove unused variables i2s_pin_cfg_offset and i2s_mode from acp_resource
structure entries.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:06 +01:00
Vijendar Mukunda
75a08ec8c3
ASoC: amd: acp: remove acp_i2s_probe function
In acp_i2s_probe(), acp_base null check is verified.
As already acp_base null check will be verified in acp platform
driver probe sequence, additional NULL check in acp_i2s_probe() is not
needed. Remove acp_i2s_probe() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240617072844.871468-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-21 13:18:05 +01:00
Mark Brown
de7a09dec4
ASoC: Merge up fixes
We need some of the AMD fixes as a base for new work.
2024-06-21 13:17:21 +01:00
Elinor Montmasson
90f3feb241
ASoC: fsl-asoc-card: set priv->pdev before using it
priv->pdev pointer was set after being used in
fsl_asoc_card_audmux_init().
Move this assignment at the start of the probe function, so
sub-functions can correctly use pdev through priv.

fsl_asoc_card_audmux_init() dereferences priv->pdev to get access to the
dev struct, used with dev_err macros.
As priv is zero-initialised, there would be a NULL pointer dereference.
Note that if priv->dev is dereferenced before assignment but never used,
for example if there is no error to be printed, the driver won't crash
probably due to compiler optimisations.

Fixes: 708b4351f0 ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240620132511.4291-2-elinor.montmasson@savoirfairelinux.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-20 16:11:19 +01:00
Vijendar Mukunda
379bcd2c91
ASoC: amd: acp: move chip->flag variable assignment
chip->flag variable assignment will be skipped when acp platform device
creation is skipped. In this case chip>flag value will not be set.
chip->flag variable should be assigned along with other structure
variables for 'chip' structure. Move chip->flag variable assignment
prior to acp platform device creation.

Fixes: 3a94c8ad0a ("ASoC: amd: acp: add code for scanning acp pdm controller")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 18:32:06 +01:00
Vijendar Mukunda
70fa3900c3
ASoC: amd: acp: remove i2s configuration check in acp_i2s_probe()
ACP supports different pin configurations for I2S IO. Checking ACP pin
configuration value against specific value breaks the functionality for
other I2S pin configurations. This check is no longer required in i2s dai
driver probe call as i2s configuration check will be verified during acp
platform device creation sequence.
Remove i2s_mode check in acp_i2s_probe() function.

Fixes: b24484c18b ("ASoC: amd: acp: ACP code generic to support newer platforms")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 18:32:05 +01:00
Vijendar Mukunda
98d919dfee
ASoC: amd: acp: add a null check for chip_pdev structure
When acp platform device creation is skipped, chip->chip_pdev value will
remain NULL. Add NULL check for chip->chip_pdev structure in
snd_acp_resume() function to avoid null pointer dereference.

Fixes: 088a40980e ("ASoC: amd: acp: add pm ops support for acp pci driver")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240617072844.871468-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 18:32:04 +01:00
Jack Yu
fe1ff61487
ASoC: rt1318: Add RT1318 audio amplifier driver
This is the initial i2s-based amplifier driver for rt1318.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://msgid.link/r/b3055442ce6d4994aa01aa1fad6ba1fe@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 14:50:34 +01:00
Khanh Le
ca73d31436
ASoC: Add ak4619 codec support
Add support for the Asahi Kasei AK4619 audio codec.

[Kuninori cleanuped and adjusted to upstream code]

Signed-off-by: Khanh Le <khanh.le.xr@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/87iky5wxvr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 13:50:52 +01:00
Simon Trimmer
3ec1428d7b
ASoC: cs35l56: Accept values greater than 0 as IRQ numbers
IRQ lookup functions such as those in ACPI can return error values when
an IRQ is not defined. The i2c core driver converts the error codes to a
value of 0 and the SPI bus driver passes them unaltered to client device
drivers.

The cs35l56 driver should only accept positive non-zero values as IRQ
numbers.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: 8a731fd37f ("ASoC: cs35l56: Move utility functions to shared file")
Link: https://msgid.link/r/20240617135338.82006-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-19 11:54:31 +01:00
Shuming Fan
60ff540a1d
ASoC: Intel: soc-acpi: mtl: fix speaker no sound on Dell SKU 0C64
Dell SKU 0C64 has a single rt1318 amplifier.
The prefix name of control still needs to be set rt1318-1 corresponding to UCM config.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://msgid.link/r/20240612075740.1678082-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 18:57:33 +01:00
Krzysztof Kozlowski
34935cd472
ASoC: codecs: wcd939x: Drop unused num_ports field
The driver does not use few 'num_ports' in 'struct wcd939x_sdw_priv'.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-23-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:35 +01:00
Krzysztof Kozlowski
2642b6aa9d
ASoC: codecs: wcd939x: Drop unused RX/TX direction enum
The enum with RX/TX soundwire direction is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-22-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:34 +01:00
Krzysztof Kozlowski
f49100facc
ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info
Driver does not modify static wcd939x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-21-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:33 +01:00
Krzysztof Kozlowski
8e5d5b2c96
ASoC: codecs: wcd939x: Constify static data
Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-20-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:32 +01:00
Krzysztof Kozlowski
3f1deca19e
ASoC: codecs: wcd938x: Drop unused num_ports field
The driver does not use few 'num_ports' in 'struct wcd938x_sdw_priv'.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-19-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:31 +01:00
Krzysztof Kozlowski
43e7400f6b
ASoC: codecs: wcd938x: Drop unused RX/TX direction enum
The enum with RX/TX soundwire direction is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-18-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:30 +01:00
Krzysztof Kozlowski
af57d5e3b5
ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info
Driver does not modify static wcd938x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-17-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:29 +01:00
Krzysztof Kozlowski
424e6bc432
ASoC: codecs: wcd938x: Constify static data
Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-16-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:28 +01:00
Krzysztof Kozlowski
6dc7b8a104
ASoC: codecs: wcd937x: Drop unused chipid member
The driver stores the read chipid in 'struct wcd937x_priv' but never
needs it after.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-15-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:27 +01:00
Krzysztof Kozlowski
c2d9fd2e94
ASoC: codecs: wcd937x: Drop unused state container fields
The driver does not use few 'struct wcd937x_priv' and 'struct
wcd937x_sdw_priv' members, so just drop them for smaller code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-14-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:26 +01:00
Krzysztof Kozlowski
d8e746719d
ASoC: codecs: wcd937x: Drop unused enums, defines and types
Few declarations (defines, struct codec_port_info, enums) are not used
and can be safely dropped.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-13-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:25 +01:00
Krzysztof Kozlowski
c8ed66cbc3
ASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info
Driver does not modify static wcd937x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-12-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:24 +01:00
Krzysztof Kozlowski
0ad42c04e9
ASoC: codecs: wcd937x: Constify static data
Driver does not modify few static data (MBHC reg fields, IRQ chip), so
make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-11-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:23 +01:00
Krzysztof Kozlowski
9ea2271322
ASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe()
wcd934x_codec_parse_data() function is called only from probe(), so
printing errors on resource acquisition is discouraged, because it can
pollute dmesg in case of probe deferral.  The actual deferral is here
unlikely, but still the code is a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-10-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:22 +01:00
Krzysztof Kozlowski
a252188244
ASoC: codecs: wcd934x: Drop unused mic bias voltage fields
Driver stores the voltage of mic bias in fields in state container
structure, but actually never reads them - except for the mic2 bias
(micb2_mv field).  Drop the fields from the structure so the code will
be a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-9-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:21 +01:00
Krzysztof Kozlowski
5ad81bf49a
ASoC: codecs: wcd934x: Constify static data
Driver does not modify few static data (arrays with sample rates, MBHC
reg fields, regmap config), so make them const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-8-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:20 +01:00
Krzysztof Kozlowski
1bce5c586b
ASoC: codecs: wcd934x: Drop unused interp path enum
The enum with inter path is not used.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-7-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:19 +01:00
Krzysztof Kozlowski
1d1cda22da
ASoC: codecs: wcd9335: Drop unused dmic rate handling
Driver was prepared to adjust DMIC microphone parameters according to
DMIC clock rate which is read from platform data or Devicetree.  The
latter part never happened, so the code is always called with
dmic_clk_rate=0, prints error and uses default/fallback values.  All
this part can be simplified by dropping dead parts of code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-6-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:19 +01:00
Krzysztof Kozlowski
3ed4beba49
ASoC: codecs: wcd9335: Drop unneeded error message
Error-level should not be used as debugging.  The code (function
wcd9335_get_dmic_clk_val()) will always be called with same parameters,
so this is not really useful debug anyway, so drop it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-5-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:18 +01:00
Krzysztof Kozlowski
4a03b5dbad
ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe()
wcd9335_parse_dt() function is called only from probe(), so printing
errors on resource acquisition is discouraged, because it can pollute
dmesg.  Use dev_err_probe() to fix this and also make the code a bit
simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-4-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:17 +01:00
Krzysztof Kozlowski
b2ff7c88bf
ASoC: codecs: wcd9335: Constify static data
Driver does not modify few static data (arrays with sample rates,
interrupt description, regmap config), so make them const for code
safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-3-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:16 +01:00
Krzysztof Kozlowski
60ce48f531
ASoC: codecs: wcd9335: Drop unused state container fields
The driver does not use few 'struct wcd9335_codec' members, so just drop
them for smaller code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-2-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:15 +01:00
Krzysztof Kozlowski
e565ab1849
ASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields
The wcd-mbhc-v2 helper code/module does not modify passed array of
registry fields, thus it can be made const for code safety.  It will
also allow individual drivers to allocate the array in rodata.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-1-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:47:14 +01:00
Shenghao Ding
9f774c757e
ASoc: tas2781: Enable RCA-based playback without DSP firmware download
In only loading RCA (Reconfigurable Architecture) binary case, no DSP
program will be working inside tas2563/tas2781, that is dsp-bypass mode,
do not support speaker protection, or audio acoustic algorithms in this
mode.

Fixes: ef3bcde75d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240614133646.910-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:45:53 +01:00
Andrejs Cainikovs
93f12a7568
ASoC: nau8822: add MCLK support
This change adds MCLK clock handling directly within driver.
When used in combination with simple-audio-card, and mclk-fs is set,
simple-audio-card will change MCLK frequency before configuring PLL.
In some cases, however, MCLK reference clock should be static (see [1]),
which means it needs to be moved away from simple-audio-card.

[1]: https://lore.kernel.org/all/ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com/

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-4-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:45:46 +01:00
Andrejs Cainikovs
9c3b21cc85
ASoC: nau8822: set NAU8822_REFIMP_80K only once
Following bias state machine logic this bit is set twice before playback.
This change makes sure this bit set is set only once.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Suggested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-3-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:45:45 +01:00
Andrejs Cainikovs
9292013bd3
ASoC: nau8822: move nau8822_set_dai_sysclk()
Next commit in series makes a change which calls nau8822_set_pll() from
nau8822_set_dai_sysclk(). Moving latter after the former would avoid a
forward declaration, and this is exactly what this change does.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Link: https://msgid.link/r/20240613084652.13113-2-andrejs.cainikovs@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 16:45:44 +01:00
Ricard Wanderlof
6c01001414
ASoC: tlv320adc3xxx: Add support for using MICBIAS pins as GPO
Add boolean ti,micbias1-gpo and ti,micbias2-gpo devicetree properties.

When set, the respective MICBIAS pins can be used as general purpose
outputs controlled via the GPIO framework, in addition to the two
configurable GPIO pins.

This is useful in applications where the MICBIAS functionality is
not required, but it is useful to have a couple of extra GPIO pins.

The voltage on the respective MICBIAS pin in the active state is
governed by the ti,micbias1-vg and ti,micbias2-vg properties,
respectively (same properties as when the pins are used as
MICBIAS pins).

Signed-off-by: Ricard Wanderlof <ricard.wanderlof@axis.com>
Link: https://msgid.link/r/20240607-tlv320adc3xxx-micbias-gpo-v3-2-59dbec8b98f4@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:21:04 +01:00
Krzysztof Kozlowski
24790a3cd1
ASoC: qcom: x1e80100: Add USB DisplayPort plug support
Add support for handling jack events of USB (DisplayPort).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:20:11 +01:00
Srinivas Kandagatla
7e815bb9ab
ASoC: qcom: sc8280xp: add Display port Jack
Add support for Display Port Jack events.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:20:10 +01:00
Srinivas Kandagatla
735db4ea16
ASoC: qcom: common: add Display port Jack function
Add a common function to add Display port jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:20:09 +01:00
Srinivas Kandagatla
6d620e50bb
ASoC: qcom: q6dsp: parse Display port tokens
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://msgid.link/r/20240606104922.114229-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:20:08 +01:00
Krzysztof Kozlowski
de267e7a6e
ASoC: Constify return of snd_soc_dai_get_pcm_stream()
Returned 'struct snd_soc_pcm_stream' by snd_soc_dai_get_pcm_stream() is
not modified by the users, so it can be changed as pointer to const.
This is a necessary step towards making the 'dai->driver' a pointer to
const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-5-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:19:56 +01:00
Krzysztof Kozlowski
785d64c494
ASoC: Constify DAI passed to get_channel_map
get_channel_map() is supposed to obtain map of channels without
modifying the state of the given DAI, so make the pointer to 'struct
snd_soc_dai' as pointing to const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-4-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:19:55 +01:00
Krzysztof Kozlowski
f3ac3da7e4
ASoC: Constify passed data to core function
Several ASoC functions receive pointers to data which is not modified,
e.g. pointers to 'snd_soc_dai', 'snd_soc_pcm_runtime',
'snd_pcm_hw_params' and 'snd_soc_dai_link'.

All these pointers can be made as a pointer to const.  This makes code
safer, serves as clear annotation of function's intentions (no ownership
passed to the function, no modifications) and allows putting pointed
structures in rodata (if ever applicable).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-3-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-18 14:19:54 +01:00
Krzysztof Kozlowski
595265c926
ASoC: Constify DAI ops auto_selectable_formats
The static arrays passed as 'auto_selectable_formats' are not modified
by the drivers nor by the core code, so make it const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://msgid.link/r/20240617125735.582963-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17 18:29:02 +01:00
Kuninori Morimoto
195815c275
ASoC: audio-graph-card2: add support for aux devices
Add device tree property to define auxiliary devices to be added to
Audio Graph Card which is already supported on Simle Card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/878qz4ry81.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17 13:08:32 +01:00
Christophe JAILLET
1c75adb22d
ASoC: SOF: mediatek: Constify struct mtk_adsp_ipc_ops
'struct mtk_adsp_ipc_ops' is not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, "struct mtk_adsp_ipc" also needs to be adjusted to this
new const qualifier.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  15533	   2383	      0	  17916	   45fc	sound/soc/sof/mediatek/mt8195/mt8195.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  15557	   2367	      0	  17924	   4604	sound/soc/sof/mediatek/mt8195/mt8195.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/a45d6b2b5ec040ea0fc78fca662c2dca3f13a49f.1718312321.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17 13:08:31 +01:00
Jeff Johnson
39eab01487
ASoC: fsl: imx-pcm-fiq: add missing MODULE_DESCRIPTION() macro
With ARCH=arm, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/fsl/imx-pcm-fiq.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/r/20240616-md-arm-sound-soc-fsl-v2-1-228772e81a54@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17 13:08:28 +01:00
Mark Brown
c8d0930a04
ASoC: codecs: lpass: add support for v2.5 rx macro
Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support to reading codec version and also adds
support for v2.5 codec version in rx macro.

LPASS 2.5 and up versions have changes in some of the rx blocks which
are required to get headset functional correctly.

Tested this on SM8450, X13s and x1e80100 crd.

This changes also fixes issue with sm8450, sm8550, sm8660 and x1e80100.
2024-06-15 16:24:35 +01:00
Srinivas Kandagatla
432e5074f8
ASoC: codec: lpass-rx-macro: add support for 2.5 codec version
LPASS Codec v2.5 has significant changes in the rx register strides.
Due to this headset playback on SM8550, SM8650, x1e80100 and all SoCs
after SM8450 have only Left working.

This patch adjusts the registers to accomdate 2.5 changes. With this
fixed now L and R are functional on Headset playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Link: https://lore.kernel.org/r/20240612-lpass-codec-v25-v4-3-f63d3676dbc4@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-14 15:34:17 +01:00
Srinivas Kandagatla
dbacef0589
ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions
LPASS Codec v2.5 has significant changes in the rx block register strides.
This is a preparatory patch to do the required changes in the existing driver
to be able to accomdate these changes.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Link: https://lore.kernel.org/r/20240612-lpass-codec-v25-v4-2-f63d3676dbc4@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-14 15:34:16 +01:00
Srinivas Kandagatla
378918d591
ASoC: codecs: lpass-macro: add helpers to get codec version
LPASS Digital codec have changes in register layout across multiple
versions. Add a proper way read the codec version allowint all the lpass
macro drivers (tx, rx, wsa, va) to configure the registers correctly.

LPASS VA macro has the required registers to read the codec version.
Read the the version and make it available to other lpass codec macros
using the common helper functions.

Existing method of using LPASS IP version is not accurate as the same
the codec versioning is totally independent of LPASS IP block versions.

These helper functions should be able to provide a convient way to get
the codec version, and will help scale the drivers in right direction.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Link: https://lore.kernel.org/r/20240612-lpass-codec-v25-v4-1-f63d3676dbc4@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-14 15:34:15 +01:00
Srinivas Kandagatla
be1fae62cf
ASoC: q6apm-lpass-dai: close graph on prepare errors
There is an issue around with error handling and graph management with
the exising code, none of the error paths close the graph, which result in
leaving the loaded graph in dsp, however the driver thinks otherwise.

This can have a nasty side effect specially when we try to load the same
graph to dsp, dsp returns error which leaves the board with no sound and
requires restart.

Fix this by properly closing the graph when we hit errors between
open and close.

Fixes: 30ad723b93 ("ASoC: qdsp6: audioreach: add q6apm lpass dai support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # X13s
Link: https://lore.kernel.org/r/20240613-q6apm-fixes-v1-1-d88953675ab3@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-14 15:22:20 +01:00
Richard Fitzgerald
8af49868e5
ASoC: cs35l56: Disconnect ASP1 TX sources when ASP1 DAI is hooked up
If the ASP1 DAI is hooked up by the machine driver the ASP TX mixer
sources should be initialized to disconnected. There aren't currently
any available products using the ASP so this doesn't affect any
existing systems.

The cs35l56 does not have any fixed default for the mixer source
registers. When the cs35l56 boots, its firmware patches these registers
to setup a system-specific routing; this is so that Windows can use
generic SDCA drivers instead of needing knowledge of chip-specific
registers. The setup varies between end-products, which each have
customized firmware, and so the default register state varies between
end-products. It can also change if the firmware on an end-product is
upgraded - for example if a change was needed to the routing for Windows
use-cases. It must be emphasized that the settings applied by the
firmware are not internal magic tuning; they are statically implementing
use-case setup that on Linux would be done via ALSA controls.

The driver is currently syncing the mixer controls with whatever
initial state the firmware wrote to the registers, so that they report
the actual audio routing. But if the ASP DAI is hooked up this can create
a powered-up DAPM graph without anything intentionally setting up a path.
This can lead to parts of the audio system powering up unexpectedly.

For example when cs35l56 is connected to cs42l43 using a codec-codec link,
this can create a complete DAPM graph which then powers-up cs42l43. But
the cs42l43 can only be clocked from its SoundWire bus so this causes a
bunch of errors in the kernel log where cs42l43 is unexpectedly powered-up
without a clock.

If the host is taking ownership of the ASP (either directly or as a
codec-to-codec link) there is no need to keep the mixer settings that the
firmware wrote. The driver has ALSA controls for setting these using
standard Linux mechanisms. So if the machine driver hooks up the ASP the
ASP mixers are initialized to "None" (no input). This prevents unintended
DAPM-graph power-ups, and means the initial state of the mixers is
always going to be None.

Since the initial state of the mixers can vary from system to system and
potentially between firmware upgrades, no use-case manager can currently
assume that cs35l56 has a known initial state. The firmware could just as
easily default them to "None" as to any input source. So defaulting them
to "None" in the driver is not increasing the entropy of the system.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240613132527.46537-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-14 15:22:19 +01:00
Greg Kroah-Hartman
ff985c7597 auxbus: make to_auxiliary_drv accept and return a constant pointer
In the quest to make struct device constant, start by making
to_auxiliary_drv() return a constant pointer so that drivers that call
this can be fixed up before the driver core changes.

As the return type previously was not constant, also fix up all callers
that were assuming that the pointer was not going to be a constant one
in order to not break the build.

Cc: Dave Ertman <david.m.ertman@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Bingbu Cao <bingbu.cao@intel.com>
Cc: Tianshu Qiu <tian.shu.qiu@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Michael Chan <michael.chan@broadcom.com>
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: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org
Cc: linux-rdma@vger.kernel.org
Cc: sound-open-firmware@alsa-project.org
Cc: linux-sound@vger.kernel.org
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # drivers/media/pci/intel/ipu6
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20240611130103.3262749-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-13 16:43:26 +02:00
Jeff Johnson
fe833e4397
ASoC: amd: add missing MODULE_DESCRIPTION() macros
With ARCH=x86, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/renoir/snd-acp3x-rn.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/yc/snd-soc-acp6x-mach.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/acp/snd-acp-i2s.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/acp/snd-acp-pdm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/acp/snd-acp-legacy-common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/acp/snd-acp-pci.o
WARNING: modpost: missing MODULE_DESCRIPTION() in sound/soc/amd/ps/snd-soc-ps-mach.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240612-md-sound-soc-amd-v1-1-ad1de0409c11@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-13 10:20:06 +01:00