Commit graph

593 commits

Author SHA1 Message Date
Takashi Iwai
f5d9ddf121 ASoC: Updates for v6.9
This has been quite a small release, there's a lot of driver specific
 cleanups and minor enhancements but hardly anything on the core and only
 one new driver.  Highlights include:
 
  - SoundWire support for AMD ACP 6.3 systems.
  - Support for reporting version information for AVS firmware.
  - Support DSPless mode for Intel Soundwire systems.
  - Support for configuring CS35L56 amplifiers using EFI calibration
    data.
  - Log which component is being operated on as part of power management
    trace events.
  - Support for Microchip SAM9x7, NXP i.MX95 and Qualcomm WCD939x
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmXvE1AACgkQJNaLcl1U
 h9B15Qf8CrS5zHsD54bvTcumkDgbJ8Dl9f5qz4UN/AX0mcZ1UJU6sQ0HxIGEtlPc
 26pneHV9ZA0wSPw432NBpwcfe7AsWASmKUf6S2hsj4LMvnoj75iiZum8TE71ior7
 QI9ARnNipB1tHk7Kmgs/pe+CqX3hhCVqYUI9w5fMIj05T5qwYbqCERws6JA2Uw97
 6fb5CgI2uRYTShVVmYsE/FlxXmZqNN4NnNxlVvUSM5TE3Tayf+BCEqhpwuh59Pt/
 G+mZfj3eof0HdjGPQbLRPOWQOa3bT8gmT89OlbmmMf17+975pgShBbARzkv41vk1
 ifr6muHweaDLD7gloS/HUr4JRo9Daw==
 =ZYC5
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v6.9

This has been quite a small release, there's a lot of driver specific
cleanups and minor enhancements but hardly anything on the core and only
one new driver.  Highlights include:

 - SoundWire support for AMD ACP 6.3 systems.
 - Support for reporting version information for AVS firmware.
 - Support DSPless mode for Intel Soundwire systems.
 - Support for configuring CS35L56 amplifiers using EFI calibration
   data.
 - Log which component is being operated on as part of power management
   trace events.
 - Support for Microchip SAM9x7, NXP i.MX95 and Qualcomm WCD939x
2024-03-11 16:18:47 +01:00
Colin Ian King
1382d8b551
ASoC: qcom: Fix uninitialized pointer dmactl
In the case where __lpass_get_dmactl_handle is called and the driver
id dai_id is invalid the pointer dmactl is not being assigned a value,
and dmactl contains a garbage value since it has not been initialized
and so the null check may not work. Fix this to initialize dmactl to
NULL. One could argue that modern compilers will set this to zero, but
it is useful to keep this initialized as per the same way in functions
__lpass_platform_codec_intf_init and lpass_cdc_dma_daiops_hw_params.

Cleans up clang scan build warning:
sound/soc/qcom/lpass-cdc-dma.c:275:7: warning: Branch condition
evaluates to a garbage value [core.uninitialized.Branch]

Fixes: b81af585ea ("ASoC: qcom: Add lpass CPU driver for codec dma control")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://msgid.link/r/20240221134804.3475989-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-21 14:01:17 +00:00
Mark Brown
b96ccdcf9d
ASoC: Intel: avs: Fixes and new platforms support
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

The avs-driver continues to be utilized on more recent Intel machines.
As TGL-based (cAVS 2.5) e.g.: RPL, inherit most of the functionality
from previous platforms:

SKL <- APL <- CNL <- ICL <- TGL

rather than putting everything into a single file, the platform-specific
bits are split into cnl/icl/tgl.c files instead. Makes the division clear
and code easier to maintain.

Layout of the patchset:

First are two changes combined together address the sound-clipping
problem, present when only one stream is running - specifically one
CAPTURE stream.

Follow up is naming-scheme adjustment for some of the existing functions
what improves code incohesiveness. As existing IPC/IRQ code operates
solely on cAVS 1.5 architecture, it needs no abstraction. The situation
changes when newer platforms come into the picture. Thus the next two
patches abstract the existing IPC/IRQ handlers so that majority of the
common code can be re-used.

The ICCMAX change stands out a bit - the AudioDSP firmware loading
procedure differs on ICL-based platforms (and onwards) and having a
separate commit makes the situation clear to the developers who are
going to support the solution from LTS perspective. For that reason
I decided not to merge it into the commit introducing the icl.c file.
2024-02-21 00:52:26 +00:00
Arnd Bergmann
5b5089e2a1
ASoC: q6dsp: fix event handler prototype
clang-16 points out a mismatch in function types that was hidden
by a typecast:

sound/soc/qcom/qdsp6/q6apm-dai.c:355:38: error: cast from 'void (*)(uint32_t, uint32_t, uint32_t *, void *)' (aka 'void (*)(unsigned int, unsigned int, unsigned int *, void *)') to 'q6apm_cb' (aka 'void (*)(unsigned int, unsigned int, void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  355 |         prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler, prtd, graph_id);
sound/soc/qcom/qdsp6/q6apm-dai.c:499:38: error: cast from 'void (*)(uint32_t, uint32_t, uint32_t *, void *)' (aka 'void (*)(unsigned int, unsigned int, unsigned int *, void *)') to 'q6apm_cb' (aka 'void (*)(unsigned int, unsigned int, void *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  499 |         prtd->graph = q6apm_graph_open(dev, (q6apm_cb)event_handler_compr, prtd, graph_id);

The only difference here is the 'payload' argument, which is not even
used in this function, so just fix its type and remove the cast.

Fixes: 88b60bf047 ("ASoC: q6dsp: q6apm-dai: Add open/free compress DAI callbacks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://msgid.link/r/20240213101105.459402-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-13 13:28:43 +00:00
Mark Brown
d24255f0a1
ASoC: Merge up fixes due to dependency with new changes
Future ES8326 changes depend on already applied fixes, merge up the
fixes so we can do the new things.
2024-01-24 18:25:42 +00:00
Johan Hovold
c481016bb4
ASoC: qcom: sc8280xp: limit speaker volumes
The UCM configuration for the Lenovo ThinkPad X13s has up until now
been setting the speaker PA volume to the minimum -3 dB when enabling
the speakers, but this does not prevent the user from increasing the
volume further.

Limit the digital gain and PA volumes to a combined -3 dB in the machine
driver to reduce the risk of speaker damage until we have active speaker
protection in place (or higher safe levels have been established).

Note that the PA volume limit cannot be set lower than 0 dB or
PulseAudio gets confused when the first 16 levels all map to -3 dB.

Also note that this will probably need to be generalised using
machine-specific limits, but a common limit should do for now.

Cc:  <stable@vger.kernel.org>	# 6.5
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://msgid.link/r/20240122181819.4038-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-01-22 19:38:10 +00:00
Erick Archer
322ed3a10b
ASoC: qcom: Use devm_kcalloc() instead of devm_kzalloc()
Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Erick Archer <erick.archer@gmx.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://msgid.link/r/20240106171635.19881-1-erick.archer@gmx.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-01-22 00:06:37 +00:00
Takashi Iwai
0205f3753d ASoC: Updates for v6.8
This is a relatively quiet release, there's a lot of driver specific
 changes and the usual high level of activity in the SOF core but the
 one big core change was Mormioto-san's work to support more N:M
 CPU:CODEC mapping cases.  Highlights include:
 
  - Enhanced support for N:M CPU:CODEC mappings in the core and in
    audio-graph-card2.
  - Support for falling back to older SOF IPC versions where firmware for
    new versions is not available.
  - Support for notification of control changes generated by SOF firmware
    with IPC4.
  - Device tree support for describing parts of the card which can be
    active over suspend (for very low power playback or wake word use
    cases).
  - ACPI parsing support for the ES83xx driver, reducing the number of
    quirks neede for x86 systems.
  - Support for more AMD and Intel systems, NXP i.MX8m MICFIL, Qualcomm
    SM8250, SM8550, SM8650 and X1E80100.
  - Removal of Freescale MPC8610 support, the SoC is no longer supported
    by Linux.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmWbJ5EACgkQJNaLcl1U
 h9CZTwf/c8CPwoKABZear8jiQpZLUhFLuGQwSShPYVZ7XPzzTMp9BwVmd40DCnUi
 NeSc22t2UgT0H06nx3QK8sKOhrpQoBQVrIajf2AaxD44TJbsOYGGe4pMh1sXKAMF
 c0ybp8uRgsjiv2Y++SBXZLexGC11/b8eTFLV1nTK/i2nygGjbfWSJ9s4PpB9V6cA
 nZrQ/p+x/ZwaBejFUnvE06M7GHtCD6lxrB9Q1EmWA4RxcW7RNUtIN5gr16HlaMiC
 3gix4mg40llhBFF9s4eBjRBNKL2paiejPZwcYkAC8w+SkZ/roXaeN55g0avmDWyW
 AN9o096vaEVWKhZ/jdTHmFVf2PV2Iw==
 =rbT5
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v6.8

This is a relatively quiet release, there's a lot of driver specific
changes and the usual high level of activity in the SOF core but the
one big core change was Mormioto-san's work to support more N:M
CPU:CODEC mapping cases.  Highlights include:

 - Enhanced support for N:M CPU:CODEC mappings in the core and in
   audio-graph-card2.
 - Support for falling back to older SOF IPC versions where firmware for
   new versions is not available.
 - Support for notification of control changes generated by SOF firmware
   with IPC4.
 - Device tree support for describing parts of the card which can be
   active over suspend (for very low power playback or wake word use
   cases).
 - ACPI parsing support for the ES83xx driver, reducing the number of
   quirks neede for x86 systems.
 - Support for more AMD and Intel systems, NXP i.MX8m MICFIL, Qualcomm
   SM8250, SM8550, SM8650 and X1E80100.
 - Removal of Freescale MPC8610 support, the SoC is no longer supported
   by Linux.
2024-01-08 08:18:02 +01:00
Mark Brown
2f2998895c
ASoC: qcom: add sound card support for SM8650
Merge series from Neil Armstrong <neil.armstrong@linaro.org>:

Document the SM8650 sound card using the SM8450 fallback
and add the SM8650 compatible to the sc8280xp sound card
driver to use the sm8650 card driver_name like SM8450 & SM8550.
2023-12-19 16:46:16 +00:00
Mark Brown
aefe7a8e26
GPIO inclusion fixes to misc sound drivers
Merge series from Linus Walleij <linus.walleij@linaro.org>:

Mostly dropping unused headers, and a single driver rewrite.
2023-12-19 16:45:42 +00:00
Krzysztof Kozlowski
bb3392453d
ASoC: qcom: Fix trivial code style issues
Fix few trivial code style issues, pointed out by checkpatch, so they do
not get copied to new code (when old code is used as template):

  WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6 ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
  WARNING: function definition argument 'struct platform_device *' should also have an identifier name
  ERROR: code indent should use tabs where possible
  WARNING: please, no spaces at the start of a line
  WARNING: Missing a blank line after declarations
  WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231204100048.211800-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:04:25 +00:00
Krzysztof Kozlowski
6b9dc2da66
ASoC: qcom: Add x1e80100 sound machine driver
Add sound machine driver for the soundcards on Qualcomm X1E80100 SoC,
supporting up to four channel audio playback over Soundwire bus.  The
driver is based on existing sc8280xp.c driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231204100116.211898-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:04:22 +00:00
Neil Armstrong
7211094dd0
ASoC: qcom: sc8280xp: Add support for SM8650
Add compatibles for sound card on Qualcomm SM8650 boards.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231212-topic-sm8650-upstream-snd-card-v1-2-fbfc38471204@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:03:41 +00:00
Linus Walleij
809fc84b37
ASoC: qcom: sc7180: Drop GPIO include
This driver is including the legacy GPIO header <linux/gpio.h>
but not using any symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-2-e3004176bd8b@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18 14:03:30 +00:00
Krzysztof Kozlowski
3c5fcb20e0
ASoC: qcom: audioreach: Add 4 channel support
Add support four channel streams.  Map channel 3 and 4 to left/right
surround ("quad(side)" from ffmpeg standard channel list) to match what
is in qdsp6/q6dsp-common.c driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-11 12:54:10 +00:00
Krzysztof Kozlowski
bcd684eae5
ASoC: qcom: audioreach: drop duplicate channel defines
q6apm.h header already defines channel mapping values, so drop
duplicated devices from audioreach.h.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-11 12:54:09 +00:00
Krzysztof Kozlowski
ef14f40a36
ASoC: qcom: audioreach: Commonize setting channel mappings
Move code assigning channel mapping values to a common helper function.
This simplifies three out of four cases, with the last case using
incompatible type (uint16_t array instead of uint8_t array).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20231130180758.212172-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-11 12:54:08 +00:00
Srinivas Kandagatla
716d4e5373
ASoC: qcom: sc8280xp: Limit speaker digital volumes
Limit the speaker digital gains to 0dB so that the users will not damage them.
Currently there is a limit in UCM, but this does not stop the user form
changing the digital gains from command line. So limit this in driver
which makes the speakers more safer without active speaker protection in
place.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231204124736.132185-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-04 16:20:26 +00:00
Krzysztof Kozlowski
fdcaecfc71
ASoC: qcom: sc8280xp: Add support for SM8450 and SM8550
Add compatibles for sound card on Qualcomm SM8450 and SM8550 boards.
The compatibles were already documented.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201135332.154017-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-01 18:38:59 +00:00
Krzysztof Kozlowski
625ed9457d
ASoC: qcom: sc8280xp: set card driver name from match data
Sound machine drivers for all newer Qualcomm SoC platforms are the
exactly same, therefore it makes sense to use same machine driver for
newer platforms as well.  Choice of sound topology and user-space Alsa
UCM files depends however on card driver name, which must be customized
per each board.  Allow such customization by using driver match data as
sound card driver name.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201135332.154017-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-01 18:38:58 +00:00
Krzysztof Kozlowski
15c7fab0e0
ASoC: qcom: Move Soundwire runtime stream alloc to soundcards
Currently the Qualcomm Soundwire controller in its DAI startup op
allocates the Soundwire stream runtime.  This works fine for existing
designs, but has limitations for stream runtimes with multiple
controllers, like upcoming Qualcomm X1E80100 SoC with four WSA8840
speakers on two Soundwire controllers.

When two Soundwire controllers are added to sound card codecs, Soundwire
startup() is called twice, one for each Soundwire controller, and second
execution overwrites what was set before.  During shutdown() this causes
double free.

It is expected to have only one Soundwire stream runtime, thus it should
be allocated from SoC soundcard context startup(), not from each
Soundwire startup().  Such way will properly handle both cases: one and
two Soundwire controllers in the stream runtime.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231128165638.757665-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-29 18:53:25 +00:00
Krzysztof Kozlowski
d32bac9cb0
ASoC: qcom: Add helper for allocating Soundwire stream runtime
Newer Qualcomm SoC soundcards will need to allocate Soundwire stream
runtime in their startup op.  The code will be exactly the same for all
soundcards, so add a helper for that.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231128165638.757665-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-29 18:53:24 +00:00
Mark Brown
246f388ec1
sc7180: Add qdsp based soundcard
Merge series from Nikita Travkin <nikita@trvn.ru>:

Some devices, such as Acer Aspire 1, can't use lpass dirrectly, but
instead must use adsp core to play sound. Since otherwise the hardware
is, usually, very similar across the devices on the same platform, it
makes sense to reuse the same boardfile.

This series refactors the sc7180.c slightly and adds the functions to
control clocks via adsp instead of controlling the hardware directly.
2023-10-26 17:02:53 +01:00
Krzysztof Kozlowski
e29de7abda
ASoC: qcom: q6apm-lpass-dais: pass max number of channels to Audioreach
Using the params_channels() helper when setting hw_params, results in
passing to Audioreach minimum number of channels valid for given
hardware.  This is not valid for any hardware which sets minimum
channels to two and maximum to something bigger, like four channels.

Instead pass the maximum number of supported channels to allow playback
of multi-channel formats.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231017161429.431663-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-25 17:21:40 +01:00
Nikita Travkin
4531f512e3
ASoC: qcom: sc7180: Add support for qdsp6 baked sound
Some sc7180 devices use audio adsp to play sound. The setup for this
adsp is similar to the dirrect lpass usage but requires the use of
different link ids and clocks.

This commit adds support for the qdsp based audio, reusing the common
parts like audio codec setup and jack creation.

Since the setup is mostly generic and codec specific setup is guarded
behind a check, a generic compatible is added, similar to other
platforms. Even though those changes target Acer Aspire 1 as the only
user of the adsp audio on this platform present upstream at the moment
of the commit, those changes should be either dirrectly compatible or
trivially expandable to the other devices that will be added in the
future.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20231020-sc7180-qdsp-sndcard-v1-2-157706b7d06f@trvn.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-25 17:21:38 +01:00
Uwe Kleine-König
d0cc676c42
ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code.  However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

asoc_qcom_lpass_cpu_platform_remove() returned zero unconditionally.
Make it return void instead and convert all users to struct
platform_device::remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231013221945.1489203-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-23 13:29:47 +01:00
Mark Brown
a7ec043e60
ASoC: DT matching and header cleanups
Merge series from Rob Herring <robh@kernel.org>:

This is a series is part of ongoing clean-ups related to device
matching and DT related implicit includes. Essentially of_device.h has
a bunch of implicit includes and generally isn't needed any nore except
for of_match_device(). As we also generally want to get rid of
of_match_device() as well, I've done that so we're not updating the
includes twice.
2023-10-09 23:14:18 +01:00
Krzysztof Kozlowski
528a4a0bb0
ASoC: qcom: reduce number of binding headers includes
Move the includes of binding headers from Qualcomm SoC sound drivers
headers to unit files actually using these bindings.  This reduces the
amount of work for C preprocessor and makes usage of bindings easier to
follow.  No impact expected on the final binaries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231005075250.88159-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:14:19 +01:00
Krzysztof Kozlowski
0f729a285b
ASoC: qcom: explicitly include binding headers when used
Few units use qcom,lpass.h binding headers but they rely on them being
included through a different header.  Make the usage explicit which
allows easier to find the users of a header.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231005075250.88159-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:14:18 +01:00
Rob Herring
9958d85968
ASoC: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-5-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:13:59 +01:00
Rob Herring
ec5236c2e6
ASoC: qcom/lpass: Constify struct lpass_variant
'struct lpass_variant' is used for driver match data which is supposed to
be constant. It's not modified anywhere, so it's just a matter of adding
'const' everywhere.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-4-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:13:58 +01:00
Rob Herring
340d79a14d
ASoC: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09 13:13:56 +01:00
Kuninori Morimoto
9b1a2dfa8a
ASoC: qcom: convert not to use asoc_xxx()
ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8cgqnjc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-25 14:16:25 +02:00
Takashi Iwai
692f551015 ASoC: Updates for v6.6
The rest of the updates for v6.6, some of the highlights include:
 
  - A big API cleanup from Morimoto-san, rationalising the places we put
    functions.
  - Lots of work on the SOF framework, AMD and Intel drivers, including a
    lot of cleanup and new device support.
  - Standardisation of the presentation of jacks from drivers.
  - Provision of some generic sound card DT properties.
  - Conversion oof more drivers to the maple tree register cache.
  - New drivers for AMD Van Gogh, AWInic AW88261, Cirrus Logic cs42l43,
    various Intel platforms, Mediatek MT7986, RealTek RT1017 and StarFive
    JH7110.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTo6Y0ACgkQJNaLcl1U
 h9AnaAf/XiBSnZl2i9wFckPy7bLcR74YrP1sFet5ZAqtpIt+/DvzQlgFAraHJ4tR
 ScM2ZyyMwREaFhrHIXKLm8kbaOKeIjIMSxiHREVG9Wibq8d1TwaOHWAcXc9jMsQb
 3G23Aizy2h5yD+/VTh8q6aV+fmYZJDfr1tIu8zWva90HcL2fMGvLjVdt24RNejTL
 bgCC2GaaGP4pnC3xoBo1hGayvp0PES1BHVeyAXqMVscH+GCplPNJEdSHvU14OBck
 1Nfjf5NVkh5G0pvrbG/yblsn1Zm5HRAzCE7gF1OHLFH27ygvp7fGk6TIXXpvw23c
 OSvveYee2YLrf4kyndmv88Aq8JVTeA==
 =9F/T
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v6.6

The rest of the updates for v6.6, some of the highlights include:

 - A big API cleanup from Morimoto-san, rationalising the places we put
   functions.
 - Lots of work on the SOF framework, AMD and Intel drivers, including a
   lot of cleanup and new device support.
 - Standardisation of the presentation of jacks from drivers.
 - Provision of some generic sound card DT properties.
 - Conversion oof more drivers to the maple tree register cache.
 - New drivers for AMD Van Gogh, AWInic AW88261, Cirrus Logic cs42l43,
   various Intel platforms, Mediatek MT7986, RealTek RT1017 and StarFive
   JH7110.
2023-08-28 16:13:03 +02:00
Takashi Iwai
ce2d8ed8d8 ASoC: qcom: Convert to generic PCM copy ops
This patch converts the qcom lpass driver code to use the new unified
PCM copy callback.  It's a straightforward conversion from *_user() to
*_iter() variants.

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

Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Banajit Goswami <bgoswami@quicinc.com>
Link: https://lore.kernel.org/r/20230815190136.8987-21-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18 12:19:18 +02:00
Kuninori Morimoto
e4222bbdec
ASoC: qcom: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a5v1b0ta.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:14 +01:00
Yue Haibing
bb6979c5ac
ASoC: q6dsp: Remove unused declaration
Commit 5477518b8a ("ASoC: qdsp6: audioreach: add q6apm support")
declared but never implemented these.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20230811100130.36664-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 18:16:52 +01:00
Alper Nebi Yasak
242372d64e
ASoC: qcom: sdm845: Map missing jack kcontrols
This driver does not properly map jack pins to kcontrols that PulseAudio
and PipeWire need to handle jack detection events. The RT5663 codec used
here can detect Headphone and Headset Mic connections. Expose each to
userspace as a kcontrol.

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

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

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

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230802175737.263412-20-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:32:59 +01:00
Min-Hua Chen
df43fba7c7
ASoC: q6dsp: q6apm: make g_apm static
This patch fixes the following sprse warning:

sound/soc/qcom/qdsp6/q6apm.c:30:14: sparse: warning: symbol 'g_apm' was not declared. Should it be static?

No functional change intended

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Link: https://lore.kernel.org/r/20230713151744.86072-1-minhuadotchen@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-13 16:20:25 +01:00
Mark Brown
980d97efdb
ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral
Merge series from Johan Hovold <johan+linaro@kernel.org>:

I've been hitting a race during boot which breaks probe of the sound
card on the Lenovo ThinkPad X13s as I've previously reported here:

	https://lore.kernel.org/all/ZIHMMFtuDtvdpFAZ@hovoldconsulting.com/

The immediate issue appeared to be a probe deferral that was turned into
a hard failure, but addressing that in itself only made things worse as
it exposed further bugs.

I was hoping someone more familiar with the code in question would look
into this, but as this affects users of the X13s and breaks audio on my
machine every fifth boot or so, I decided to investigate it myself.

As expected, the Qualcomm codec drivers are broken and specifically leak
resources on component remove, which in turn breaks sound card probe
deferrals.

The source of the deferral itself appears to be legitimate and was
simply due to some audio component not yet having been registered due to
random changes in timing during boot.

These issues can most easily be reproduced by simply blacklisting the
q6apm_dai module and loading it manually after boot.

Included are also two patches that suppresses error messages on
component probe deferral to avoid spamming the logs during boot.
2023-07-06 16:03:07 +01:00
Srinivas Kandagatla
c1be62923d
ASoC: qcom: q6apm: do not close GPR port before closing graph
Closing GPR port before graph close can result in un handled notifications
from DSP, this results in spam of errors from GPR driver as there is no
one to handle these notification at that point in time.

Fix this by closing GPR port after graph close is finished.

Fixes: 5477518b8a ("ASoC: qdsp6: audioreach: add q6apm support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705131842.41584-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:38 +01:00
Johan Hovold
46ec420573
ASoC: qdsp6: audioreach: fix topology probe deferral
Propagate errors when failing to load the topology component so that
probe deferrals can be handled.

Fixes: 36ad9bf1d9 ("ASoC: qdsp6: audioreach: add topology support")
Cc: stable@vger.kernel.org      # 5.17
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:24 +01:00
Srinivas Kandagatla
4f3fcf5f6d
ASoC: qcom: q6afe-dai: fix Display Port Playback stream name
With recent changes to add more display ports did not change the Stream
name in q6afe-dai. This results in below error
"ASoC: Failed to add route DISPLAY_PORT_RX -> Display Port Playback(*)"
and sound card fails to probe.

Fix this by adding correct stream name.

Fixes: 90848a2557 ("ASoC: qcom: q6dsp: add support to more display ports")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705124850.40069-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-05 14:53:46 +01:00
Srinivas Kandagatla
ac192c1a54
ASoC: qdsp6: q6apm: use dai link pcm id as pcm device number
For some reason we ended up with a setup without this flag.
This resulted in inconsistent sound card devices numbers which
 are also not starting as expected at dai_link->id.
 (Ex: MultiMedia1 pcm ended up with device number 4 instead of 0)

With this patch patch now the MultiMedia1 PCM ends up with device number 0
as expected.

[This is causing unstable numbering in userspace as other changes go in,
which in turn gets noticed by some userspace.  There's been multiple
values so we can't simply pick one and revert to it.  Do not backport
since it will introduce a change. -- broonie]

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230628092404.13927-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 14:53:48 +01:00
Srinivas Kandagatla
82f76ac26c
ASoC: qcom: common: add default jack dapm pins
If the soundcard does not specify the dapm pins, let the common
code add these pins for jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/Message-Id: <20230302120327.10823-1-srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 18:02:07 +01:00
Mark Brown
3067e020d3
add snd_soc_{of_}get_dlc()
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current soc-core.c has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component). It gets .dai_name, but we need
.of_node too. Therefor user need to arrange.

It will be more useful if it gets both .dai_name and .of_node.
This patch adds snd_soc_{of_}get_dlc() for it, and convert to use it.
2023-06-21 00:56:00 +01:00
Kuninori Morimoto
6cf881b7f1
ASoC: qcom: use snd_soc_{of_}get_dlc()
Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt0udgn3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-20 12:49:24 +01:00