Skip to content

Conversation

setotau
Copy link

@setotau setotau commented Aug 6, 2025

This PR adds support for sdm660 LPI TLMM, sdm660-internal soundcard, initial sound support for clover, clover-plus and lavender

relates #17

Thanks to @flamingradian for the most of work

@setotau setotau force-pushed the setotau/qcom-sdm660-6.15.y-audio-bringup branch 2 times, most recently from b4c7cae to e798ded Compare August 8, 2025 16:28
@flamingradian
Copy link

flamingradian commented Aug 14, 2025 via email

@setotau setotau force-pushed the setotau/qcom-sdm660-6.15.y-audio-bringup branch from e798ded to 731a6d6 Compare August 14, 2025 18:48
@setotau
Copy link
Author

setotau commented Aug 14, 2025

Rebased and reworded some commits

@setotau setotau force-pushed the setotau/qcom-sdm660-6.15.y-audio-bringup branch from 731a6d6 to 3769500 Compare August 14, 2025 21:30
@setotau setotau force-pushed the setotau/qcom-sdm660-6.15.y-audio-bringup branch 6 times, most recently from 59468ed to 16efd51 Compare August 27, 2025 20:26
setotau and others added 16 commits August 28, 2025 20:10
By default pin_offset is calculated by formula: LPI_TLMM_REG_OFFSET * pin_id.
However not all platforms are using this pin_offset formula (e.g. SDM660 LPASS
LPI uses a predefined array of offsets [1]), so extend lpi_pingroup struct
with pin_offset field, introduce extended LPI_PINGROUP_OFFSET macro with
pin_offet field and introduce LPI_FLAG_USE_PREDEFINED_PIN_OFFSET flag.
This adds an ability to use predefined offset for pin if it exists.

[1] https://git.codelinaro.org/clo/la/kernel/msm-4.4/-/blob/LA.UM.7.2.c27-07400-sdm660.0/drivers/pinctrl/qcom/pinctrl-lpi.c#L107

Signed-off-by: Nickolay Goppen <[email protected]>
Add bindings for pin controller in SDM660 Low Power Audio SubSystem
LPASS).

Co-Developed-by: Richard Acayan <[email protected]>
Signed-off-by: Richard Acayan <[email protected]>
Signed-off-by: Nickolay Goppen <[email protected]>
The Snapdragon 660 has a Low-Power Island (LPI) TLMM for configuring
pins related to audio. Add the driver for this.
Also, this driver uses predefined pin_offsets for each pin taken from
downstream driver, which does not follow the usual 0x1000 distance
between pins and uses an array with predefined offsets that do not
follow any regular pattern [1].

[1] https://git.codelinaro.org/clo/la/kernel/msm-4.4/-/blob/LA.UM.7.2.c27-07400-sdm660.0/drivers/pinctrl/qcom/pinctrl-lpi.c#L107

Co-Developed-by: Nickolay Goppen <[email protected]>
Signed-off-by: Richard Acayan <[email protected]>
Signed-off-by: Nickolay Goppen <[email protected]>
The internal MI2S ports are found on devices with the internal sound
card for Snapdragon 660. Add support for them.

Signed-off-by: Richard Acayan <[email protected]>
Add the internal MI2S stream capabilities as specified by the audio
kernel modules and configure the ports as MI2S ports.

Link: https://android.googlesource.com/kernel/msm-extra/+/530cffa4cc977a348753831b163eb9d3302b954a/asoc/msm-dai-q6-v2.c#4597
Signed-off-by: Richard Acayan <[email protected]>
Add the port mappings for internal MI2S, found on the Snapdragon 660
internal sound card.
Add the internal MI2S ports found on the SDM660 internal sound card.

Signed-off-by: Richard Acayan <[email protected]>
Add the ASM-AFE routing for internal MI2S ports.

Signed-off-by: Richard Acayan <[email protected]>
The Snapdragon 670 and Snapdragon 660 both share the same drivers for
the sound cards. These different sound cards are tasha, tavil, and
internal. Add support for the internal sound card.

Known issues:
 - the TDM frequency might be inaccurate
 - these sound card drivers have so many constants that might change

Signed-off-by: Richard Acayan <[email protected]>
These options are essential for the SDM660 internal sound card driver to
work properly. Select them.

Fixes: 842b79f ("ASoC: qcom: add sdm660 internal sound card support")
Reported-by: Aboothahir U <[email protected]>
Signed-off-by: Richard Acayan <[email protected]>
The codec version CAJON_2_0 on the Snapdragon 670 requires touching the
HPH test registers. Add the quirk so this driver can also support
SDM670.

Signed-off-by: Richard Acayan <[email protected]>
The digital and analog codecs communicate with each other, synchronized
by an MCLK, which cannot turn off before the codecs power down. The bit
clock is better managed by the sound card driver instead of the digital
codec, since it (to my knowledge) does not power down the clock. Add the
Q6AFE clock controller to connect the MCLK with the codecs, and a fixed
clock to model a fake bit clock for consumption by the digital codec.

Signed-off-by: Richard Acayan <[email protected]>
The LPASS LPI TLMM pin controller controls pins for use by the analog
and digital codecs, such as the PDM bus, the digital microphone pins,
and the compander pins. Add it to support the codecs.

Signed-off-by: Richard Acayan <[email protected]>
The digital codec is responsible for controlling playback volume and
sending PCM data to the analog codec. Add it.

Signed-off-by: Richard Acayan <[email protected]>
The #clock-cells property is essential for clock nodes that are
referenced by other devicetree nodes. Add the property so devices that
depend on it probe successfully.

Fixes: 3bce317 ("arm64: dts: qcom: sdm630: add clocks for digital and analog audio codecs")
Reported-by: Aboothahir U <[email protected]>
Signed-off-by: Richard Acayan <[email protected]>
flamingradian and others added 5 commits August 28, 2025 20:13
The PM660L analog audio codec (PMIC revision 4) controls the headphone
jack, and optionally the earpiece and speaker, at the vendor's decision.
Add the analog audio codec.

Signed-off-by: Richard Acayan <[email protected]>
…r services

qcom,protection-domain property is required for adsp to properly APR functioning, such as:
 * Working q6afecc clocks
 * Opening AFE ports

Signed-off-by: Nickolay Goppen <[email protected]>
Add the sound card and configure the SoC generic analog and digital
codecs to complete the drive-by sound support series.

Signed-off-by: Richard Acayan <[email protected]>
@setotau setotau force-pushed the setotau/qcom-sdm660-6.15.y-audio-bringup branch from 16efd51 to 7e6ac90 Compare August 28, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants