Commit graph

12507 commits

Author SHA1 Message Date
Linus Torvalds
7a64bdfaf3 sound updates #2 for 6.17-rc1
For catching up the remaining stuff for 6.17: only small updates
 and the rest are mostly small fixes.
 
 - Fixes in HD-audio codec driver Kconfig, so that configurations
   can be more easily/safely carried between different versions
 - Fixes in ASoC SDCA, FSL xcvr, AW88399
 - ASoC IMX WM8524 support
 - HD-audio and USB-audio quirks and fixes
 - A minor selftest fix
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmiMtFsOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/VTA/+M9QtrWs3IUGUncud9ku4Jd7YnKqR+PE8hUey
 Y5rPXpj1jH7wx3bXtSbIzrn5rr2uaZ4LwX6cygmXxh9xwKJDOyCXCQ7v9X19wVFu
 cw9SYFnokBVXgQ0fibXixps0YB4Ll86mflckv7TgVT0W4kYmu3XLDRsmtdnXKRrG
 7LOdXON+6jbluTQGXJcxh3pXNOMmeJlQ6FxajHgPQ91iQlB5fZc6tEiLZ06fzOaE
 BOyWNwitXBcsUjitHralJNUfY1POvSBBai13chY3L2xkntVR7uoojia507+YyCqA
 dqGErDclSo85dHd2ZLwGKsT63tPSgPMfP6q7BS08uZrkqrMAH9KsSyg3HB7SHXcm
 VvS9Is4ThovPAkq0naaGoT3UIHNuLBAG0dPy56U6YHRQa0rmp/ZBBGhLTvW735lF
 uugtfDmimoZ12YmC2DkalptcOeOelB+V6CVWYF9D4558DGqLTwHtvn4zs5/oR7yt
 4r6qNiBzrcKqxcMjlXgQYHHdhkCbiqbXw87daDhoLJtBtIXASpRfRBJpOx+lDe9Y
 LCRDq9juGsclDQdr+rzeO7NVhLrEiZmkabenYr6VWZSCjle7d5ro7yRc8qLAlu0Z
 WRUqw7P0wnIZYgSXieaMaEBndiFo0PJljPJGYS+lGjVKduNM9eTdR12PNwZeVRP+
 wFwtKzM=
 =Q+iZ
 -----END PGP SIGNATURE-----

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

Pull more sound updates from Takashi Iwai:
 "For catching up the remaining stuff for 6.17: only small updates and
  the rest are mostly small fixes.

   - Fixes in HD-audio codec driver Kconfig, so that configurations can
     be more easily/safely carried between different versions

   - Fixes in ASoC SDCA, FSL xcvr, AW88399

   - ASoC IMX WM8524 support

   - HD-audio and USB-audio quirks and fixes

   - A minor selftest fix"

* tag 'sound-6.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ALSA: usb: scarlett2: Fix missing NULL check
  mips: Update HD-audio configs again
  LoongArch: Update HD-audio codec configs
  arm: Update HD-audio configs again
  selftests: ALSA: fix memory leak in utimer test
  ALSA: usb-audio: Add DSD support for Comtrue USB Audio device
  ALSA: hda/hdmi: Enable drivers as default
  ALSA: hda/cirrus: Enable drivers as default
  ALSA: hda/realtek: Enable drivers as default
  ALSA: hda/realtek - Fix mute LED for HP Victus 16-d1xxx (MB 8A26)
  ALSA: hda/realtek - Fix mute LED for HP Victus 16-s0xxx
  ALSA: hda: Fix the wrong register was used for DVC of TAS2770
  ALSA: scarlett2: Add retry on -EPROTO from scarlett2_usb_tx()
  ALSA: hda/realtek - Fix mute LED for HP Victus 16-r1xxx
  ASoC: codecs: Add acpi_match_table for aw88399 driver
  ASoC: dt-bindings: atmel,at91-ssc: add microchip,sam9x7-ssc
  ASoC: imx-card: Add WM8524 support
  ASoC: fsl_xcvr: get channel status data with firmware exists
  ASoC: fsl_xcvr: get channel status data when PHY is not exists
  ASoC: SDCA: Add support for -cn- value properties
  ...
2025-08-01 12:26:24 -07:00
Linus Torvalds
6fac1139d9 soundwire updates for 6.17
Couple of small core changes and driver updates:
  - Core: handling of nesting irqs to outside the lock, stream parameters
    handing on port prep failures.
  - AMD driver support for ACP 7.2 platforms and improved handing of slave
    alerts and resume sequences
  - Qualcomm updating driver debug spew
  - Intel BPT message length limitations, rt721 codec as wake capable etc
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmiMrioACgkQfBQHDyUj
 g0e7AxAAxuDTHXt4m5wnxicSrzSeWDfUTV4JgsiibD3JwyEa5ETOu7Ep6vSGe9t+
 14gTY1z9/ItXsL2k3MdBi6N8b0lzvHG0/R2HA4hw+qYa+clv93pSC/DHlXKSzF6G
 ejdDsx+bikUKwGWTS3zZ2+zEr0O8piXIB3oJJF7SwCz+NGUl0GA4WLSBbn9WMqW0
 ftK+FpSJA2rm164mVEKgYW5XVSnFYajCILYD3fUx3hu+7mhqBX4yU0A381IvOXfT
 gnCWCuRGFeSWS71SnBV5a7hJAPLYARUryJqFhDus+GJZEjN0YWpc1Nkf3uIaHK2S
 ME6/htPcCWRoADcMPFJum/mIw6+kJRYYByWzOz8S0OhhUM2Xvtsrd4BniY5dcSy4
 iRKn4tj1ZDflpsFqyDXb7eoqJvSgX49CHTIFs6YWhy4nisiB7MdfJDW/i9ebQkGc
 2MGCqthmmWdp1GNZ6FCbtHMfZoD0I30q0HAdxlGOMJD86jU+VhyV4mYu22rVP5jV
 EoYX5mCeMiUUyD70BSxdWcrFMM0FOyn8xhHAZIy6DqsXgKHXaoFc8Hn5schLY5Xc
 /WWG/Oe0xqgbEew2JB5a/Yu9Wk4PlQP4XXSNceTtkxER3W5ktnPxDMsy2qpVm1N/
 XJ1lILOviQJRMILwDZkGOKxcfo3hf/ZyyFYGC4wstFFewaXm8fo=
 =+9EP
 -----END PGP SIGNATURE-----

Merge tag 'soundwire-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire

Pull soundwire updates from Vinod Koul:
 "A couple of small core changes and driver updates:

   - Core: handling of nesting irqs to outside the lock, stream
     parameters handing on port prep failures.

   - AMD driver support for ACP 7.2 platforms and improved handing of
     slave alerts and resume sequences

   - Qualcomm updating driver debug spew

   - Intel BPT message length limitations, rt721 codec as wake capable
     etc"

* tag 'soundwire-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: amd: Add support for acp7.2 platform
  soundwire: stream: restore params when prepare ports fail
  soundwire: debugfs: move debug statement outside of error handling
  soundwire: amd: add check for status update registers
  soundwire: intel_auxdevice: add rt721 codec to wake_capable_list
  soundwire: Correct some property names
  soundwire: update Intel BPT message length limitation
  soundwire: intel_ace2.x: Use str_read_write() helper
  soundwire: amd: cancel pending slave status handling workqueue during remove sequence
  soundwire: amd: serialize amd manager resume sequence during pm_prepare
  soundwire: qcom: demote probe registration printk
  ASoC: cs42l43: Remove unnecessary work functions
  soundwire: Move handle_nested_irq outside of sdw_dev_lock
  MAINTAINERS: Remove Sanyog Kale as reviewer on SoundWire
2025-08-01 11:09:27 -07:00
Takashi Iwai
d35cdd6ed5 ASoC: More updates for v6.17
A few more updates, mostly fixes and device IDs plus some small
 enhancements for the FSL xcvr driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiHZP8ACgkQJNaLcl1U
 h9DzHgf7B38+Y0biLZA4PbhoT4jIqx7Z6cjzw4enVAd+heYD8dCrYIf+7mADCi/1
 0rjJ76k8FvYyXUihvd+7Tm+0K9kBy8RHjA/KKiNUHqk12JziKg6fnTQTO2/zinQO
 VjIrVtMediD7lUVDJ8NeN/xwpl4UagpyYi7JdWM12bBpcpxE8Hz+nvYZiAQKfaLC
 6Fde6G1tTYQsfVnpEdidqNCIvlRCXsFbeWfBa3BDEC2gZwDuozs+caDD4zDgirJ4
 +K31t9d9yWD2oqJALB1HrUZ35edzvc+AmWE6CfWIaN7pxgwdqqOIbL2jdcOdV6Sy
 pbxrbXFQ8FKMm8knO7BtSsHhVtm22Q==
 =jUba
 -----END PGP SIGNATURE-----

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

ASoC: More updates for v6.17

A few more updates, mostly fixes and device IDs plus some small
enhancements for the FSL xcvr driver.
2025-07-28 14:28:21 +02:00
Weidong Wang
e95122a32e
ASoC: codecs: Add acpi_match_table for aw88399 driver
Add acpi_match_table to the aw88399 driver so that
it can be used on more platforms.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://patch.msgid.link/20250725094602.10017-1-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-25 13:44:29 +01:00
Takashi Iwai
bca53a176f ASoC: Updates for v6.17
There's a few new drivers here and quite a lot of cleanup work from
 Morimoto-san but generally this has been quite a quiet release,
 resulting in a fairly small diffstat.  Highlights include:
 
  - Refactoring of the Kconfig menus to be hopefully more consistant and
    easier to navigate.
  - Refactoring of the DAPM code, mainly hiding functionality that
    doesn't need to be exposed to drivers.
  - Removal of the unused upstream weak paths DAPM functionality.
  - Further work on the generic handling for SoundWire SDCA devices.
  - Cleanups of our usage of the PM autosuspend functions, this pulls in
    some PM core changes on a shared tag.
  - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
    various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI TAS5753.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiCG4gACgkQJNaLcl1U
 h9DDLAgAg48dNlG1argnaoTmWQ8j5fVV2aCfzPL3+UxIj/Jy3HQGusUXuCqvxCnl
 CeZ249oQMACSxwaBthFXoFoSiv9KkD+FbB+mw+BjJWnE77fP56Z+nqR2LE2xWRTU
 F4gcGu5aeqxjFDtmWf9xEh27hgtIB63P98CkXGyJKxxvTtWCp/JQzkvRJRN3Hpuf
 9lFQr7GSt3aaNOxyon9aOczAfMa/BWcfmL7BVesuXtWzTKVJiFJVTS1mhl/7NNVR
 oZ1QLj8OdJOFWddyWwN8okZZ6omHdpdtnRWw/FOA0PiCALpBpXvd9FAuFfIA+FrU
 5fCDfYgvkX1sz1csD1RaOs2nGAehxA==
 =GR/0
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.17

There's a few new drivers here and quite a lot of cleanup work from
Morimoto-san but generally this has been quite a quiet release,
resulting in a fairly small diffstat.  Highlights include:

 - Refactoring of the Kconfig menus to be hopefully more consistant and
   easier to navigate.
 - Refactoring of the DAPM code, mainly hiding functionality that
   doesn't need to be exposed to drivers.
 - Removal of the unused upstream weak paths DAPM functionality.
 - Further work on the generic handling for SoundWire SDCA devices.
 - Cleanups of our usage of the PM autosuspend functions, this pulls in
   some PM core changes on a shared tag.
 - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
   various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI TAS5753.
2025-07-24 14:47:49 +02:00
Takashi Iwai
0aa9e51298 Merge branch 'for-linus' into for-next
Merge the last-piece from 6.16 devel branch to sync the code base.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-24 14:46:21 +02:00
Derek Fang
d312962188
ASoC: rt5650: Eliminate the high frequency glitch
The glitch was detected in the high frequency of the HP playback.
This patch adjusts the DAC dither setting to avoid this situation
for almost all cases.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://patch.msgid.link/20250721034728.1396238-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-21 13:26:52 +01:00
Takashi Iwai
7cd3c8cafb Merge branch 'for-linus' into for-next
Synch HD-audio changes landed in 6.16-rc7.
Mostly for file rename tracking.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-21 09:23:34 +02:00
Alexander Stein
8778837f0a
ASoC: codec: tlv320aic32x4: Fix reset GPIO check
rstn_gpio being a GPIO descriptor the check is wrong (inverted) for
releasing the reset of the codec.

Fixes: 790d5f8ee6 ("ASoC: codec: tlv320aic32x4: Convert to GPIO descriptors")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250716065708.4041153-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 11:15:20 +01:00
Mark Brown
dd10ed1caf
ASoC: convert from clk round_rate() to
Merge series from Brian Masney <bmasney@redhat.com>:

The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() clk ops, so let's go ahead and convert the
drivers in the rtc subsystem using the Coccinelle semantic patch
posted below. I did a few minor cosmetic cleanups of the code in a
few cases.

Coccinelle semantic patch:

    virtual patch

    // Look up the current name of the round_rate function
    @ has_round_rate @
    identifier round_rate_name =~ ".*_round_rate";
    identifier hw_param, rate_param, parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    	...
    }

    // Rename the route_rate function name to determine_rate()
    @ script:python generate_name depends on has_round_rate @
    round_rate_name << has_round_rate.round_rate_name;
    new_name;
    @@

    coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")

    // Change rate to req->rate; also change occurrences of 'return XXX'.
    @ chg_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier ERR =~ "E.*";
    expression E;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    -return -ERR;
    +return -ERR;
    |
    - return rate_param;
    + return 0;
    |
    - return E;
    + req->rate = E;
    +
    + return 0;
    |
    - rate_param
    + req->rate
    )
    ...>
    }

    // Coccinelle only transforms the first occurrence of the rate parameter
    // Run a second time. FIXME: Is there a better way to do this?
    @ chg_rate2 depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    - rate_param
    + req->rate
    ...>
    }

    // Change parent_rate to req->best_parent_rate
    @ chg_parent_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

    // Convert the function definition from round_rate() to determine_rate()
    @ func_definition depends on chg_rate @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier generate_name.new_name;
    @@

    - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
    -               unsigned long *parent_rate_param)
    + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
    {
        ...
    }

    // Update the ops from round_rate() to determine_rate()
    @ ops depends on func_definition @
    identifier has_round_rate.round_rate_name;
    identifier generate_name.new_name;
    @@

    {
        ...,
    -   .round_rate = round_rate_name,
    +   .determine_rate = new_name,
        ...,
    }

Note that I used coccinelle 1.2 instead of 1.3 since the newer version
adds unnecessary braces as described in this post.
https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/
2025-07-15 21:44:05 +01:00
Brian Masney
a37d9c8aef
ASoC: codecs: rt5682s: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-3-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:52 +01:00
Brian Masney
4e15a10f6f
ASoC: codecs: rt5682: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-2-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:51 +01:00
Brian Masney
8a4d73121d
ASoC: codecs: da7219: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20250710-sound-clk-round-rate-v1-1-4a9c3bb6ff3a@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-15 13:38:50 +01:00
Mark Brown
bfd291279f
ASoC: codec: Convert to GPIO descriptors for
Merge series from Peng Fan <peng.fan@nxp.com>:

This patchset is a pick up of patch 1,2 from [1]. And I also collect
Linus's R-b for patch 2. After this patchset, there is only one user of
of_gpio.h left in sound driver(pxa2xx-ac97).

of_gpio.h is deprecated, update the driver to use GPIO descriptors.

Patch 1 is to drop legacy platform data which in-tree no users are using it
Patch 2 is to convert to GPIO descriptors

Checking the DTS that use the device, all are using GPIOD_ACTIVE_LOW
polarity for reset-gpios, so all should work as expected with this patch.

[1] https://lore.kernel.org/all/20250408-asoc-gpio-v1-0-c0db9d3fd6e9@nxp.com/
2025-07-14 11:34:16 +01:00
Peng Fan
790d5f8ee6
ASoC: codec: tlv320aic32x4: Convert to GPIO descriptors
of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor, and set consumer
   name.
 - Use gpiod_set_value to configure output value.

While at here, reorder the included headers.

Checking the DTS that use the device, all are using GPIOD_ACTIVE_LOW
polarity for reset-gpios, so all should work as expected with this patch.

Cc: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-3-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:56 +01:00
Peng Fan
b709c1aef5
ASoC: codec: tlv320aic32x4: Sort headers alphabetically
Sort headers alphabetically to easily insert new ones
and drop unused ones.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-2-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:55 +01:00
Peng Fan
69d5b62c4b
ASoC: codec: tlv320aic32x4: Drop aic32x4_pdata usage
There is no machine is using aic32x4_pdata as platform_data, so
remove the dead code.

Cc: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250710-asoc-gpio-1-v2-1-2233b272a1a6@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:54 +01:00
Oder Chiou
d235538723
ASoC: rt5660: Fix the dmic data source from GPIO2
The patch fixes an issue with the dmic data pin connected to GPIO2.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://patch.msgid.link/20250711034813.3278989-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:36:30 +01:00
Takashi Iwai
691351de31 ALSA: hda: Drop superfluous driver->ops NULL checks
After all conversions, driver->ops became a must in most places
(except for the codec power setup which might be called before binding
to the codec driver), hence we can get rid of the superfluous
driver->ops NULL checks, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-26-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
cabaf5908e ALSA: hda: Drop old codec binding method
Now that all patch_ops usage have been converted to the new
hda_codec_ops probe, we can drop patch_ops from the hda_codec,
together with the calls of patch_ops callbacks.

The hda_codec_ops.free callback is removed as all have been replaced
with the new remove callback.

Also, correct comments mentioning "patch"; it's replaced with "codec
driver".

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-25-tiwai@suse.de
2025-07-11 09:55:38 +02:00
Takashi Iwai
6bf917e9aa ALSA: hda: Introduce hda_codec_driver ops
Until now, we use "patch_ops" embedded in hda_codec object for
defining the callbacks that are used in various places to manage
HD-audio codec.  But from the device driver POV, this should have been
rather the driver ops, instead of the callbacks in the codec object.

This patch defines the driver ops for HD-audio codec driver as the
replacement.  We reuse the same struct hda_codec_ops, and this is put
as hda_codec_driver.ops.  When the driver->ops callbacks are defined,
they are called primarily instead of codec->patch_ops callbacks.

With converting to the driver ops, there is no need to pass the ugly
patch_ops handling in hda_device_id tables.  That is, driver_data
field of hda_device_id becomes really optional and it can be used for
passing the codec-specific data (e.g. specifying a model).

The codec entries after the conversion should be with HDA_CODEC_ID()
and co, instead of the former HDA_CODEC_ENTRY().

Once after converting all codec drivers to use driver ops, we can get
rid of codec patch_ops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-10-tiwai@suse.de
2025-07-11 09:55:37 +02:00
Takashi Iwai
ed677858d4 ALSA: hda: Move widget capability macros into hdaudio.h
The get_wcaps() and co are used not only by HD-audio core but also
other driver code, hence it'd be better to put into the common header
instead of local.h.

OTOH, there are macros of the same name like get_wcaps() that are
still used in sound/pci/hda/* locally, and those conflict with each
other.  So we need to rename get_wcaps() (to be moved from hda-core)
with the proper snd_hdac prefix for avoiding name conflicts, and
define in the common hdaudio.h.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-2-tiwai@suse.de
2025-07-11 09:55:36 +02:00
Mark Brown
f5b92c7449
ASoC: don't set dapm->bias_level directly
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

We have many set_bias_level functions, thus dapm->bias_level should be
handled by owner function, not by its callback functions.
2025-07-09 16:36:11 +01:00
Kuninori Morimoto
67bdd67aed
ASoC: rt715: don't set dapm->bias_level
snd_soc_component_set_bias_level() (A) which will call .set_bias_level()
callback (B) will be called from snd_soc_dapm_force_bias_level() (C) only,
and it sets dapm->bias_level (D) inside. No need to set it by each driver.
Remove it.

(A)	int snd_soc_component_set_bias_level(...)
	{
		...
		if (component->driver->set_bias_level)
(B)			ret = component->driver->set_bias_level(...);
		...
	}

(C)	int snd_soc_dapm_force_bias_level(...)
	{
		...
		if (dapm->component)
(A)			ret = snd_soc_component_set_bias_level(...);

		if (ret == 0)
(D)			dapm->bias_level = level;
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plebmmax.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-08 09:49:52 +01:00
Kuninori Morimoto
a3c3e84fc4
ASoC: rt700: don't set dapm->bias_level
snd_soc_component_set_bias_level() (A) which will call .set_bias_level()
callback (B) will be called from snd_soc_dapm_force_bias_level() (C) only,
and it sets dapm->bias_level (D) inside. No need to set it by each driver.
Remove it.

(A)	int snd_soc_component_set_bias_level(...)
	{
		...
		if (component->driver->set_bias_level)
(B)			ret = component->driver->set_bias_level(...);
		...
	}

(C)	int snd_soc_dapm_force_bias_level(...)
	{
		...
		if (dapm->component)
(A)			ret = snd_soc_component_set_bias_level(...);

		if (ret == 0)
(D)			dapm->bias_level = level;
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87qzyrmmb2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-08 09:49:52 +01:00
Mark Brown
bb96a315b4
ASoC: soc-dapm: cleanups
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

This is prepare to hiding snd_soc_dapm_context inside soc-dapm.c
2025-07-07 21:02:59 +01:00
Mark Brown
12826a49f0
treewide: Remove redundant
Merge series from Sakari Ailus <sakari.ailus@linux.intel.com>:

Late last year I posted a set to switch to __pm_runtime_mark_last_busy()
and gradually get rid of explicit pm_runtime_mark_last_busy() calls in
drivers, embedding them in the appropriate pm_runtime_*autosuspend*()
calls. The overall feedback I got at the time was that this is an
unnecessary intermediate step, and removing the
pm_runtime_mark_last_busy() calls can be done after adding them to the
relevant Runtime PM autosuspend related functions.
2025-07-04 22:42:36 +01:00
Sakari Ailus
bbe5e3c433
ASoC: codecs: Remove redundant pm_runtime_mark_last_busy() calls
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/20250704075456.3222642-1-sakari.ailus@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-04 19:28:19 +01:00
Rob Herring (Arm)
bc163baef5
ASoC: Use of_reserved_mem_region_to_resource() for "memory-region"
Use the newly added of_reserved_mem_region_to_resource() function to
handle "memory-region" properties.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://patch.msgid.link/20250703183523.2075276-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-04 13:09:47 +01:00
Richard Fitzgerald
3b3312f28e
ASoC: cs35l56: probe() should fail if the device ID is not recognized
Return an error from driver probe if the DEVID read from the chip is not
one supported by this driver.

In cs35l56_hw_init() there is a check for valid DEVID, but the invalid
case was returning the value of ret. At this point in the code ret == 0
so the caller would think that cs35l56_hw_init() was successful.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 84851aa055 ("ASoC: cs35l56: Move part of cs35l56_init() to shared library")
Link: https://patch.msgid.link/20250703102521.54204-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-03 12:22:27 +01:00
Weidong Wang
29ddce17e9
ASoC: codecs: Add calibration function to aw88399 chip
Add calibration functionality to the aw88399 chip.
When the chip is in calibration condition, calibration
can be achieved by configuring the chip's internal DSP
and save the calibration values in cali_re.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://patch.msgid.link/20250627110306.23488-1-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-29 22:12:12 +01:00
Mark Brown
51c18d4d88
ASoC: Standardize ASoC menu
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current Kconfig menu at [ALSA for SoC audio support] has no rules.
So, some venders are using menu style, some venders are listed each drivers
on top page, etc. It is difficult to find target vender and/or drivers
because it is very random.

Let's standardize ASoC menu, like below

	--- ALSA for SoC audio support
	      Analog Devices  --->
	      AMD  --->
	      Apple  --->
	      Atmel  --->
	      Au1x  ----
	      Broadcom  --->
	      Cirrus Logic  --->
	      DesignWare  --->
	      Freescale  --->
	      Google  --->
	      Hisilicon  --->
	      ...

One concern is *vender folder* alphabetical order vs *vender name*
alphabetical order were different. For example "sunxi" menu is
"Allwinner".

Link: https://lore.kernel.org/r/8734c8bf3l.wl-kuninori.morimoto.gx@renesas.com
2025-06-25 16:27:47 +01:00
Mark Brown
9d330278c9
ASoC: codecs: wcd93xx: Drop enums for chipid values
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Minor cleanup while preparing for adding WCD9378 support: do not use
enum for values which are not an enumeration.
2025-06-25 15:36:25 +01:00
Jack Yu
ff21a6ec0f
ASoC: rt721-sdca: fix boost gain calculation error
Fix the boost gain calculation error in rt721_sdca_set_gain_get.
This patch is specific for "FU33 Boost Volume".

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://patch.msgid.link/1b18fcde41c64d6fa85451d523c0434a@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-24 13:55:18 +01:00
Shengjiu Wang
17cc308b18
ASoC: wm8524: enable constraints when sysclk is configured.
In some cases, the sysclk won't be configured on init, and sysclk can be
changed in hw_params() according to different sample rate, for example,
for 44kHz sample rate, the sysclk is 11.2896MHz, for 48kHz sample rate,
the sysclk is 12.288MHz.

In order to support the above case, only enable constraints when sysclk
is configured, and check the rate in hw_params.

So overall there are three cases that need to be considered:
- call set_sysclk() on init, then constraints will be initialized.
- don't call set_sysclk() on init, but call it after startup(), then
  constraints will be configured, the constraints can be cleared with
  call set_sysclk() again in shutdown().
- don't call set_sysclk() in the whole flow, then there are no any
  constraints. The clocks depend on cpu dai.

Enlarge the WM8524_NUM_RATES to 12, as the supported rate range is 8kHz
to 192kHz.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250620021403.624303-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 17:12:54 +01:00
Mark Brown
c4ca928a6d
ASoC: hdac_hdmi: Rate limit logging on connection and disconnection
We currently log parse failures for ELD data and some disconnection events
as errors without rate limiting. These log messages can be triggered very
frequently in some situations, especially ELD parsing when there is nothing
connected to a HDMI port which will generate:

hdmi-audio-codec hdmi-audio-codec.1.auto: HDMI: Unknown ELD version 0

While there's doubtless work that could be done on reducing the number of
connection notification callbacks it's possible these may be legitimately
generated by poor quality physical connections so let's use rate limiting
to mitigate the log spam for the parse errors and lower the severity for
disconnect logging to debug level.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250613-asoc-hdmi-eld-logging-v1-1-76d64154d969@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:54 +01:00
Krzysztof Kozlowski
a48352921f
ASoC: codecs: wcd939x: Add defines for major/minor version decoding
Replace hard-coded register values with defines for checking major and
minor versions of device.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-4-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:41 +01:00
Krzysztof Kozlowski
5d3ccd356e
ASoC: codecs: wcd939x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with.  The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-3-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:40 +01:00
Krzysztof Kozlowski
100877df34
ASoC: codecs: wcd938x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with.  The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-2-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:39 +01:00
Krzysztof Kozlowski
2f6ff1e615
ASoC: codecs: wcd937x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with.  The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-1-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:26:38 +01:00
Terry Cheong
5eb8a0d773
ASoC: hdmi-codec: use SND_JACK_AVOUT as jack status
Use SND_JACK_AVOUT as the mask to align with hdac_hdmi driver so that we
can determine HDMI/DP devices from event type.

Most drivers that uses hdmi-codec driver will not be affected since they
are creating jacks with SND_JACK_LINEOUT mask. They will still report
SND_JACK_LINEOUT when the jack status is updated with
snd_soc_jack_report.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Link: https://patch.msgid.link/20250613-hdmi-v1-1-665ba7ecd5e7@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-13 12:23:56 +01:00
Shenghao Ding
8a5a5cecb7
ASoC: tas2781: Move the "include linux/debugfs.h" into tas2781.h
Move the include linux/debugfs.h into tas2781.h for code clean.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250612044252.1025-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:22:05 +01:00
Richard Fitzgerald
e5d5b3aebd
ASoC: cs35l56: Use SoundWire address as alternate firmware suffix on L56 B0
Use the SoundWire link number and device unique ID as the firmware file
qualifier suffix on CS35L56 B0 if .bin files are not found with the older
suffix. Some changes in wm_adsp needed to support this have been included
in this patch because they are trivial.

The allows future products with CS35L56 B0 silicon to use the same firmware
file naming as CS35L57 and cs35L63, while retaining backward compatibility
for firmware that has already been published with the old naming scheme.

The old suffix is searched first, partly because there are already many
files using that naming scheme, but also because they are a smaller subset
of all the possible fallback name options offered by wm_adsp so we know
that it will either find the qualified files or fail. All the firmware
files already published have the wmfw qualified with only the ACPI SSID and
the bin files qualified with both SSID and the suffix.

Originally, the firmware file names indicated which amplifier instance they
were for by appending the ALSA prefix string. This is the standard ASoC way
of distinguishing different instances of the same device. However, on
SoundWire systems the SoundWire physical unique address is available as a
unique identifier for each amp, and this address is hardwired by the
address pin on the amp.

The firmware files are specific for each physical amp so they must be
applied to that amp. Using the ALSA prefix for the filename qualifier means
that to name a firmware file it must be determined what prefix string the
machine driver will assign to each device and then use that to name the
firmware file correctly. This is straightforward in traditional ASoC
systems where the machine driver is specific to a particular piece of
hardware. But on SoundWire the machine driver is generic and can handle a
very wide range of hardware. It is more difficult to determine exactly what
the prefix will be on any particular production device, and more prone to
mistakes. Also, when the machine driver switches to generating this
automatically from SDCA properties in ACPI, there is an additional layer of
complexity in determining the mapping. This uncertainty is unnecessary
because the firmware is built for a specific amp. with known address, so we
can use that directly instead of introducing a redundant intermediate
alias. This ensures the firmware is applied to the amp it was intended for.

There are already many published firmware for CS35L56 B0 silicon so this
first looks for the original name suffix, to keep backward compatibility.
If this doesn't find .bin files it will switch to using the new name suffix
so that future products using CS35L56 B0 can start to use the new suffix.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250612121428.1667-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:21:44 +01:00
Richard Fitzgerald
d1fc768795
ASoC: cs35l56: Use SoundWire address as firmware name suffix for new silicon
Use the SoundWire link number and device unique ID as the firmware file
qualifier suffix on CS35L57, CS35L63 and revisions of CS35L56 after B0. The
change in wm_adsp needed to support this has been included in this patch
because it is fairly trivial.

Originally, the firmware file names indicated which amplifier instance they
were for by appending the ALSA prefix string. This is the standard ASoC way
of distinguishing different instances of the same device. However, on
SoundWire systems the SoundWire physical unique address is available as a
unique identifier for each amp, and this address is hardwired by a pin on
the amp.

The firmware files are specific for each physical amp so they must be
applied to that amp. Using the ALSA prefix for the filename qualifier means
that to name a firmware file it must be determined what prefix string the
machine driver will assign to each device and then use that to name the
firmware file correctly. This is straightforward in traditional ASoC
systems where the machine driver is specific to a particular piece of
hardware. But on SoundWire the machine driver is generic and can handle a
very wide range of hardware. It is more difficult to determine exactly what
the prefix will be on any particular production device, and more prone to
mistakes. Also, when the machine driver switches to generating this
automatically from SDCA properties in ACPI, there is an additional layer of
complexity in determining the mapping. This uncertainty is unnecessary
because the firmware is built for a specific amp. with known address, so we
can use that directly instead of introducing the redundant intermediate
alias. This ensures the firmware is applied to the amp it was intended for.

There have not been any firmwares published for CS35L57 or CS35L63, so
these can safely be switched to using the SoundWire unique address as the
suffix string. Also note that the machine driver in older kernel version
only has match entries for the CS35L56 Soundwire identity so any future
product with a cs35L57 or CS35L63 would require a new kernel anyway.

There are already many published firmware for CS35L56 B0 silicon so this
keeps the original naming scheme on those, to preserve backward
compatibility.

Note that although sdw_slave.id contains a unique_id field, this cannot
be trusted because the SoundWire core code also puts magic values into it
that it uses as a flag. So the unique ID is read from the chip register.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250612121428.1667-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-12 13:21:43 +01:00
Mark Brown
2ccb770828
ASoC: codecs: More const and unused member cleanups
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make static data const for code safety and drop some unused fields in
structs.
2025-06-09 17:36:20 +01:00
Charles Keepax
0cbce868ff ASoC: cs42l43: Remove unnecessary work functions
Now the SoundWire IRQ lock has been changed in the core, it is no longer
necessary to use a bunch of work functions to dodge mutex inversions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250609143041.495049-4-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2025-06-09 21:36:07 +05:30
Mark Brown
5f4f86d5e0
ASoC: Add Richtek RTQ9124 support
Merge series from cy_huang@richtek.com:

This patch series adds Richtek RTQ9124 1x30W audio amplifier support.
2025-06-09 16:44:29 +01:00
Mark Brown
23d3f6ecaf
ASoC: tas571x: add support for tas5753
Merge series from Bram Vlerick <bram.vlerick@openpixelsystems.org>:

Add support for the ti,tas5753 to tas571x driver.
2025-06-09 16:44:17 +01:00
Mark Brown
4388f5d214
ASoC: Intel: avs: Add rt5640 board support
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Small set of patches intoducing two low-impact improvements to rt5640
codec driver and then avs_rt5640 machine board driver. The board
behavior is based on existing boards such as avs_rt274.

In regard to the retry-device-verification change, there is number of
similar "fixes" found in the Realtek code in sound/soc/codecs. What I
provide here is verified with tests, the delay is not mentioned in the
spec I have access to.
2025-06-09 16:44:08 +01:00
Mark Brown
65613ac1b4
ASoC: codecs: wcd93xx: Few simplifications of code and
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Make the WCD93xx codec drivers simpler using
devm_regulator_bulk_get_enable() and obtain missing VDD_PX supply on
wcd939x.

Context depends on fixes:
https://lore.kernel.org/r/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-0-0b8a2993b7d3@linaro.org
2025-06-09 16:44:04 +01:00