Skip to content

Commit 8ad5294

Browse files
laklimovbroonie
authored andcommitted
ASoC: codecs: add new pm4125 audio codec driver
The audio codec is found in Qualcomm PM2250/PM4125 PMICs and is used on platforms like Qualcomm QCM2290. It has soundwire interface and corresponding RX and TX slave devices. It has only two input channels: HPH left and right. The line output (LO) is linked to HPHL so the hardware has some limitations regarding concurrent playback via HPH and LO for instance. The codec driver also uses WCD MBCH framework. The MBHC functionality is implemented in a minimalistic way to enable IRQs and avoid different issues with IRQs. Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20250915-pm4125_audio_codec_v1-v4-3-b247b64eec52@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f83ec76 commit 8ad5294

5 files changed

Lines changed: 2658 additions & 0 deletions

File tree

sound/soc/codecs/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ config SND_SOC_ALL_CODECS
192192
imply SND_SOC_PCM512x_SPI
193193
imply SND_SOC_PCM6240
194194
imply SND_SOC_PEB2466
195+
imply SND_SOC_PM4125_SDW
195196
imply SND_SOC_RK3308
196197
imply SND_SOC_RK3328
197198
imply SND_SOC_RK817
@@ -1542,6 +1543,23 @@ config SND_SOC_PEB2466
15421543
To compile this driver as a module, choose M here: the module
15431544
will be called snd-soc-peb2466.
15441545

1546+
config SND_SOC_PM4125
1547+
depends on SND_SOC_PM4125_SDW
1548+
tristate
1549+
depends on SOUNDWIRE || !SOUNDWIRE
1550+
1551+
config SND_SOC_PM4125_SDW
1552+
tristate "PM4125 audio codec - SDW"
1553+
select SND_SOC_PM4125
1554+
select SND_SOC_WCD_MBHC
1555+
select REGMAP_IRQ
1556+
depends on SOUNDWIRE
1557+
select REGMAP_SOUNDWIRE
1558+
help
1559+
The PMIC PM4125 has an in-built audio codec IC used with SoCs
1560+
like QCM2290, and it is connected via soundwire and SPMI.
1561+
To compile this codec driver say Y or m.
1562+
15451563
config SND_SOC_RK3308
15461564
tristate "Rockchip RK3308 audio CODEC"
15471565
depends on ARM64 || COMPILE_TEST

sound/soc/codecs/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ snd-soc-pcm512x-i2c-y := pcm512x-i2c.o
222222
snd-soc-pcm512x-spi-y := pcm512x-spi.o
223223
snd-soc-pcm6240-y := pcm6240.o
224224
snd-soc-peb2466-y := peb2466.o
225+
snd-soc-pm4125-y := pm4125.o
226+
snd-soc-pm4125-sdw-y := pm4125-sdw.o
225227
snd-soc-rk3308-y := rk3308_codec.o
226228
snd-soc-rk3328-y := rk3328_codec.o
227229
snd-soc-rk817-y := rk817_codec.o
@@ -642,6 +644,12 @@ obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o
642644
obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o
643645
obj-$(CONFIG_SND_SOC_PCM6240) += snd-soc-pcm6240.o
644646
obj-$(CONFIG_SND_SOC_PEB2466) += snd-soc-peb2466.o
647+
obj-$(CONFIG_SND_SOC_PM4125_SDW) += snd-soc-pm4125-sdw.o
648+
obj-$(CONFIG_SND_SOC_PM4125) += snd-soc-pm4125.o
649+
ifdef CONFIG_SND_SOC_PM4125_SDW
650+
# avoid link failure by forcing sdw code built-in when needed
651+
obj-$(CONFIG_SND_SOC_PM4125) += snd-soc-pm4125-sdw.o
652+
endif
645653
obj-$(CONFIG_SND_SOC_RK3308) += snd-soc-rk3308.o
646654
obj-$(CONFIG_SND_SOC_RK3328) += snd-soc-rk3328.o
647655
obj-$(CONFIG_SND_SOC_RK817) += snd-soc-rk817.o

0 commit comments

Comments
 (0)