Skip to content

Conversation

@bharadwaj-raju
Copy link

@bharadwaj-raju bharadwaj-raju commented Dec 27, 2025

This patchset fixes speaker output on the Fairphone 5. It consists of:

  • Work by Srinivas Kandagatla on SoundWire and SC7280 code, which makes sure we don't call SoundWire codepaths for AW88261. This fixes a nullptr deref, as reported on Mobian: https://salsa.debian.org/Mobian-team/devices/kernels/qcom-linux/-/merge_requests/8
  • Work by Luca Weiss on adding the required pinctrls and dai-links in the device-tree, and adding support for quinary MI2S, etc.
  • A revert by Bhushan of commit 43a3484 which prevents AW88261 bootup
  • Work by me to implement dynamic renaming in AW88261 driver code so that both the left and right ones can coexist, and the sleep state for the pinctrl
  • Work by Alexandre Ferrieux to advertise S32_LE as the audio format to ALSA, which is necessary for sufficiently loud volume since the DSP expects left-justified 24-bit in a 32-bit container, while ALSA's S24_LE gives it to us right-justified.

Srinivas Kandagatla added 4 commits December 21, 2025 20:09
For some reason we endedup allocating sdw_stream_runtime for every cpu dai,
this has two issues.
1. we never set snd_soc_dai_set_stream for non soundwire dai, which
   means there is no way that we can free this, resulting in memory leak
2. startup and shutdown callbacks can be called without
   hw_params callback called. This combination results in memory leak
because machine driver sruntime array pointer is only set in hw_params
callback.

Fix this by
 1. adding a helper function to get sdw_runtime for substream
which can be used by shutdown callback to get hold of sruntime to free.
 2. only allocate sdw_runtime for soundwire dais.

Fixes: d32bac9 ("ASoC: qcom: Add helper for allocating Soundwire stream runtime")
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Stable@vger.kernel.org
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Steev Klimaszewski <threeway@gmail.com> # Thinkpad X13s
remove redundant code and pointers to handle sdw_stream_runtime by
making use of qcom_snd_sdw_get_stream(). This removes need of machine
specific shutdown and hw_params sdw callbacks and also need to store
sdw_stream_runtime pointers in machine drivers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Steev Klimaszewski <threeway@gmail.com> # Thinkpad X13s
sdm845 machine driver can make use of common sdw functions to do most of
the soundwire related operations. Remove such redundant code from sdm845
driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Steev Klimaszewski <threeway@gmail.com> # Thinkpad X13s
sc7280 machine driver can make use of common sdw functions to do most of
the soundwire related operations. Remove such redundant code from sc7280
driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Steev Klimaszewski <threeway@gmail.com> # Thinkpad X13s
@bhush9
Copy link

bhush9 commented Dec 27, 2025

@z3ntu FYI.

lweiss-fairphone and others added 8 commits December 27, 2025 17:11
[bharadwaj.raju@machinesoul.in: add sleep pinctrl as well]

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Bharadwaj Raju <bharadwaj.raju@machinesoul.in>
When multiple aw88261 amps are present in a system, they cannot be
enabled together since the names of the DAIs, kcontrols, DAPM widgets,
and DAPM routes conflict unless they are dynamically renamed to include
the channel number as a suffix.

Signed-off-by: Bharadwaj Raju <bharadwaj.raju@machinesoul.in>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Add support for the QUINARY_MI2S_RX which is used on some devices to
send audio data to speaker amplifiers.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
... to something that's decently working, at least in some circumstances
like with aplay but not paplay still
so speaker plays back at correct speed!
Solve the ALSA/ADSP misunderstanding about S24, by advertising S32 to
ALSA,  while still sending to ADSP as usual (24 bits + padding)

This is required because when using, asm_multi_channel_pcm_fmt_blk_v2
expectation from DSP is that we send 24 bits data packed to significant
bits packet on 32 bits (pcm_s32le).

Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>
@bharadwaj-raju bharadwaj-raju force-pushed the sc7280-6.18.y-audio-fixups-clean branch from 8cb0ca1 to 05b04e8 Compare December 27, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants