Skip to contentSkip to conversation

ASoC: add Senary SN624x SoundWire SDCA support

PATCH In review qianghua wang 3 participants 10 messages Aug 12 – Aug 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ASoC: add Senary SN624x SoundWire SDCA support

From: "qianghua.wang" <[email protected]>

This series adds SoundWire SDCA support for Senary SN624x multi-function codecs (jack, speaker amp, DMIC) on Intel Panther Lake.

Compared with the previous combined submission:

1. ACPI match changes use the ASoC: Intel subject prefix (not ASoC: codecs).
2. MAINTAINERS only lists Senary-owned files (sn624x*, soc_sdw_senary*); soc-acpi-intel-*-match.c stays under INTEL ASoC DRIVERS.
3. Only PTL match entries are included for now (no ARL/LNL/MTL).

Patch summary:

  1/3  codec driver + MAINTAINERS
  2/3  sdw_utils helpers and codec_info
  3/3  Intel PTL ACPI match + SOF mach select

Validated on LG Wildcat Lake / PTL with part_id 0x6247 (MODALIAS sdw:m0496p6247v03c01).

qianghua.wang (3):
ASoC: codecs: add SN624x SDCA SoundWire driver
ASoC: sdw_utils: add Senary SN624x helpers and codec_info
ASoC: Intel: soc-acpi: add SN624x entries for PTL

 MAINTAINERS                                   |    3 +
 include/sound/soc_sdw_utils.h                 |   20 +
 sound/soc/codecs/Kconfig                      |   12 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/sn624x-sdca-sdw.c            | 1873 +++++++++++++++++
 sound/soc/codecs/sn624x-sdca.h                |  144 ++
 sound/soc/intel/boards/Kconfig                |    1 +
 .../intel/common/soc-acpi-intel-ptl-match.c   |   81 +
 sound/soc/sdw_utils/Makefile                  |    4 +-
 sound/soc/sdw_utils/soc_sdw_senary_amp.c      |   80 +
 sound/soc/sdw_utils/soc_sdw_senary_dmic.c     |   49 +
 sound/soc/sdw_utils/soc_sdw_senary_sdca.c     |   63 +
 .../soc_sdw_senary_sdca_jack_common.c         |  197 ++
 sound/soc/sdw_utils/soc_sdw_utils.c           |  166 ++
 14 files changed, 2694 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/codecs/sn624x-sdca-sdw.c
 create mode 100644 sound/soc/codecs/sn624x-sdca.h
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_amp.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_dmic.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_sdca.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_sdca_jack_common.c
Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/3 ASoC: codecs: add SN624x SDCA SoundWire driver

From: "qianghua.wang" <[email protected]>

Add SoundWire SDCA driver for Senary SN624x multi-function codecs (jack, speaker amp, and DMIC). Extend the Senary MAINTAINERS entry for the new codec files only; Intel ACPI match tables remain under INTEL ASoC DRIVERS.

---
 MAINTAINERS                        |    3 +
 sound/soc/codecs/Kconfig           |   12 +
 sound/soc/codecs/Makefile          |    2 +
 sound/soc/codecs/sn624x-sdca-sdw.c | 1873 ++++++++++++++++++++++++++++
 sound/soc/codecs/sn624x-sdca.h     |  144 +++
 5 files changed, 2034 insertions(+)
 create mode 100644 sound/soc/codecs/sn624x-sdca-sdw.c
 create mode 100644 sound/soc/codecs/sn624x-sdca.h
MAINTAINERS +3 -0
index a21c79f3e436..f18e0ed039e9 100644
@@ -29837,9 +29837,12 @@ F:	tools/testing/selftests/cgroup/test_zswap.c
 
 SENARYTECH AUDIO CODEC DRIVER
 M:	bo liu <[email protected]>
+M:	qianghua.wang <[email protected]>
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/hda/codecs/senarytech.c
+F:	sound/soc/codecs/sn624x*
+F:	sound/soc/sdw_utils/soc_sdw_senary*
 
 THE REST
 M:	Linus Torvalds <[email protected]>
sound/soc/codecs/Kconfig +12 -0
index 4761ff4afb59..06e4a02f0c58 100644
@@ -238,6 +238,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT721_SDCA_SDW
 	imply SND_SOC_RT722_SDCA_SDW
+	imply SND_SOC_SN624X_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318
@@ -1968,6 +1969,17 @@ config SND_SOC_RT722_SDCA_SDW
 	select REGMAP_SOUNDWIRE
 	select REGMAP_SOUNDWIRE_MBQ
 
+config SND_SOC_SN624X_SDCA_SDW
+	tristate "Senary SN624x SDCA Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+	help
+	  Enable support for Senary SN624x SDCA SoundWire codecs.
+	  These multi-function devices provide headset jack, speaker
+	  amplifier, and digital microphone endpoints on the SoundWire
+	  bus.
+
 config SND_SOC_RT715
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index d2a689006d69..44b471d8b8c3 100644
@@ -285,6 +285,7 @@ snd-soc-rt715-y := rt715.o rt715-sdw.o
 snd-soc-rt715-sdca-y := rt715-sdca.o rt715-sdca-sdw.o
 snd-soc-rt721-sdca-y := rt721-sdca.o rt721-sdca-sdw.o
 snd-soc-rt722-sdca-y := rt722-sdca.o rt722-sdca-sdw.o
+snd-soc-sn624x-sdca-y := sn624x-sdca-sdw.o
 snd-soc-rt9120-y := rt9120.o
 snd-soc-rt9123-y := rt9123.o
 snd-soc-rt9123p-y := rt9123p.o
@@ -726,6 +727,7 @@ obj-$(CONFIG_SND_SOC_RT715)     += snd-soc-rt715.o
 obj-$(CONFIG_SND_SOC_RT715_SDCA_SDW)     += snd-soc-rt715-sdca.o
 obj-$(CONFIG_SND_SOC_RT721_SDCA_SDW)     += snd-soc-rt721-sdca.o
 obj-$(CONFIG_SND_SOC_RT722_SDCA_SDW)     += snd-soc-rt722-sdca.o
+obj-$(CONFIG_SND_SOC_SN624X_SDCA_SDW)    += snd-soc-sn624x-sdca.o
 obj-$(CONFIG_SND_SOC_RT9120)	+= snd-soc-rt9120.o
 obj-$(CONFIG_SND_SOC_RT9123)	+= snd-soc-rt9123.o
 obj-$(CONFIG_SND_SOC_RT9123P)	+= snd-soc-rt9123p.o
sound/soc/codecs/sn624x-sdca-sdw.c new file +1873 -0

1,873 lines not on this page · raw message

sound/soc/codecs/sn624x-sdca.h new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH 1/3] ASoC: codecs: add SN624x SDCA SoundWire driver

Hello,

Quoted 1 line · qianghua wang

From: "qianghua.wang" <[email protected]>

huh, why is here a . in your real name and in the real From header there isn't?

Quoted 102 lines

Add SoundWire SDCA driver for Senary SN624x multi-function codecs (jack, speaker amp, and DMIC). Extend the Senary MAINTAINERS entry for the new codec files only; Intel ACPI match tables remain under INTEL ASoC DRIVERS.

---
 MAINTAINERS                        |    3 +
 sound/soc/codecs/Kconfig           |   12 +
 sound/soc/codecs/Makefile          |    2 +
 sound/soc/codecs/sn624x-sdca-sdw.c | 1873 ++++++++++++++++++++++++++++
 sound/soc/codecs/sn624x-sdca.h     |  144 +++
 5 files changed, 2034 insertions(+)
 create mode 100644 sound/soc/codecs/sn624x-sdca-sdw.c
 create mode 100644 sound/soc/codecs/sn624x-sdca.h
MAINTAINERS +3 -0
index a21c79f3e436..f18e0ed039e9 100644
@@ -29837,9 +29837,12 @@ F:	tools/testing/selftests/cgroup/test_zswap.c
 
 SENARYTECH AUDIO CODEC DRIVER
 M:	bo liu <[email protected]>
+M:	qianghua.wang <[email protected]>
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/hda/codecs/senarytech.c
+F:	sound/soc/codecs/sn624x*
+F:	sound/soc/sdw_utils/soc_sdw_senary*
 
 THE REST
 M:	Linus Torvalds <[email protected]>
sound/soc/codecs/Kconfig +12 -0
index 4761ff4afb59..06e4a02f0c58 100644
@@ -238,6 +238,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT721_SDCA_SDW
 	imply SND_SOC_RT722_SDCA_SDW
+	imply SND_SOC_SN624X_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318
@@ -1968,6 +1969,17 @@ config SND_SOC_RT722_SDCA_SDW
 	select REGMAP_SOUNDWIRE
 	select REGMAP_SOUNDWIRE_MBQ
 
+config SND_SOC_SN624X_SDCA_SDW
+	tristate "Senary SN624x SDCA Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+	help
+	  Enable support for Senary SN624x SDCA SoundWire codecs.
+	  These multi-function devices provide headset jack, speaker
+	  amplifier, and digital microphone endpoints on the SoundWire
+	  bus.
+
 config SND_SOC_RT715
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index d2a689006d69..44b471d8b8c3 100644
@@ -285,6 +285,7 @@ snd-soc-rt715-y := rt715.o rt715-sdw.o
 snd-soc-rt715-sdca-y := rt715-sdca.o rt715-sdca-sdw.o
 snd-soc-rt721-sdca-y := rt721-sdca.o rt721-sdca-sdw.o
 snd-soc-rt722-sdca-y := rt722-sdca.o rt722-sdca-sdw.o
+snd-soc-sn624x-sdca-y := sn624x-sdca-sdw.o
 snd-soc-rt9120-y := rt9120.o
 snd-soc-rt9123-y := rt9123.o
 snd-soc-rt9123p-y := rt9123p.o
@@ -726,6 +727,7 @@ obj-$(CONFIG_SND_SOC_RT715)     += snd-soc-rt715.o
 obj-$(CONFIG_SND_SOC_RT715_SDCA_SDW)     += snd-soc-rt715-sdca.o
 obj-$(CONFIG_SND_SOC_RT721_SDCA_SDW)     += snd-soc-rt721-sdca.o
 obj-$(CONFIG_SND_SOC_RT722_SDCA_SDW)     += snd-soc-rt722-sdca.o
+obj-$(CONFIG_SND_SOC_SN624X_SDCA_SDW)    += snd-soc-sn624x-sdca.o
 obj-$(CONFIG_SND_SOC_RT9120)	+= snd-soc-rt9120.o
 obj-$(CONFIG_SND_SOC_RT9123)	+= snd-soc-rt9123.o
 obj-$(CONFIG_SND_SOC_RT9123P)	+= snd-soc-rt9123p.o
sound/soc/codecs/sn624x-sdca-sdw.c new file +13 -0
new file mode 100644
index 000000000000..5129e883cddc
@@ -0,0 +1,1873 @@
+// SPDX-License-Identifier: GPL-2.0-only
+//
+// sn624x-sdw-sdca.c -- SN624X SDCA ALSA SoC SoundWire audio driver
+//
+// Copyright(c) 2021 Realtek Semiconductor Corp.
+// Copyright(c) 2025 Senary Semiconductor Corp.
+//
+
+#include <linux/atomic.h>
+#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/find.h>
+#include <linux/device.h>

sound/soc/codecs/sn624x-sdca-sdw.c line 23

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+#include <linux/errno.h>
+#include <linux/jiffies.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/soundwire/sdw.h>
+#include <linux/soundwire/sdw_registers.h>
+#include <linux/soundwire/sdw_type.h>

Please rely on linux/soundwire/sdw.h to provide sdw_device_id and drop including linux/mod_devicetable.h. mod_devicetable.h will go away soon.

sound/soc/codecs/sn624x-sdca-sdw.c line 1761

Quoted 6 lines

[...]

sound/soc/codecs/sn624x-sdca-sdw.c new file +5 -0
+static const struct sdw_device_id sn624x_sdca_id[] = {
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6242, 0x3, 0x1, 0),
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6244, 0x3, 0x1, 0),
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6247, 0x3, 0x1, 0),
+	{},

Please make this

	{ }

(i.e. use a space between the braces and no trailing comma)

sound/soc/codecs/sn624x-sdca-sdw.c line 1763

Quoted 2 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +2 -0
+};
+MODULE_DEVICE_TABLE(sdw, sn624x_sdca_id);

Best regards
Uwe

#3 lore raw

reply [PATCH 1/3] ASoC: codecs: add SN624x SDCA SoundWire driver

Hi Uwe:
Thanks for your comments. I will address them in v2.
Best regards
Qianghua Wang

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Hello,

Quoted 1 line · qianghua wang

From: "qianghua.wang" <[email protected]>

huh, why is here a . in your real name and in the real From header there isn't?

Quoted 101 lines

Add SoundWire SDCA driver for Senary SN624x multi-function codecs (jack, speaker amp, and DMIC). Extend the Senary MAINTAINERS entry for the new codec files only; Intel ACPI match tables remain under INTEL ASoC DRIVERS.

---
 MAINTAINERS                        |    3 +
 sound/soc/codecs/Kconfig           |   12 +
 sound/soc/codecs/Makefile          |    2 +
 sound/soc/codecs/sn624x-sdca-sdw.c | 1873 ++++++++++++++++++++++++++++
 sound/soc/codecs/sn624x-sdca.h     |  144 +++
 5 files changed, 2034 insertions(+)
 create mode 100644 sound/soc/codecs/sn624x-sdca-sdw.c
 create mode 100644 sound/soc/codecs/sn624x-sdca.h
MAINTAINERS index renamed from MAINTAINERS +0 -0

a21c79f3e436..f18e0ed039e9 100644

MAINTAINERS +3 -0
@@ -29837,9 +29837,12 @@ F:	tools/testing/selftests/cgroup/test_zswap.c
 
 SENARYTECH AUDIO CODEC DRIVER
 M:	bo liu <[email protected]>
+M:	qianghua.wang <[email protected]>
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/hda/codecs/senarytech.c
+F:	sound/soc/codecs/sn624x*
+F:	sound/soc/sdw_utils/soc_sdw_senary*
 
 THE REST
 M:	Linus Torvalds <[email protected]>
sound/soc/codecs/Kconfig index renamed from sound/soc/codecs/Kconfig +0 -0

4761ff4afb59..06e4a02f0c58 100644

sound/soc/codecs/Kconfig +12 -0
@@ -238,6 +238,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT721_SDCA_SDW
 	imply SND_SOC_RT722_SDCA_SDW
+	imply SND_SOC_SN624X_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318
@@ -1968,6 +1969,17 @@ config SND_SOC_RT722_SDCA_SDW
 	select REGMAP_SOUNDWIRE
 	select REGMAP_SOUNDWIRE_MBQ
 
+config SND_SOC_SN624X_SDCA_SDW
+	tristate "Senary SN624x SDCA Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+	help
+	  Enable support for Senary SN624x SDCA SoundWire codecs.
+	  These multi-function devices provide headset jack, speaker
+	  amplifier, and digital microphone endpoints on the SoundWire
+	  bus.
+
 config SND_SOC_RT715
 	tristate
 
sound/soc/codecs/Makefile +0 -0
index d2a689006d69..44b471d8b8c3 100644
@@ -285,6 +285,7 @@ snd-soc-rt715-y := rt715.o rt715-sdw.o  

snd-soc-rt715-sdca-y := rt715-sdca.o rt715-sdca-sdw.o snd-soc-rt721-sdca-y := rt721-sdca.o rt721-sdca-sdw.o snd-soc-rt722-sdca-y := rt722-sdca.o rt722-sdca-sdw.o

sound/soc/codecs/Makefile +2 -0
+snd-soc-sn624x-sdca-y := sn624x-sdca-sdw.o
 snd-soc-rt9120-y := rt9120.o
 snd-soc-rt9123-y := rt9123.o
 snd-soc-rt9123p-y := rt9123p.o
@@ -726,6 +727,7 @@ obj-$(CONFIG_SND_SOC_RT715)     += snd-soc-rt715.o
 obj-$(CONFIG_SND_SOC_RT715_SDCA_SDW)     += snd-soc-rt715-sdca.o
 obj-$(CONFIG_SND_SOC_RT721_SDCA_SDW)     += snd-soc-rt721-sdca.o
 obj-$(CONFIG_SND_SOC_RT722_SDCA_SDW)     += snd-soc-rt722-sdca.o
+obj-$(CONFIG_SND_SOC_SN624X_SDCA_SDW)    += snd-soc-sn624x-sdca.o
 obj-$(CONFIG_SND_SOC_RT9120)	+= snd-soc-rt9120.o
 obj-$(CONFIG_SND_SOC_RT9123)	+= snd-soc-rt9123.o
 obj-$(CONFIG_SND_SOC_RT9123P)	+= snd-soc-rt9123p.o
sound/soc/codecs/sn624x-sdca-sdw.c new file +11 -0
new file mode 100644
index 000000000000..5129e883cddc
@@ -0,0 +1,1873 @@
+// SPDX-License-Identifier: GPL-2.0-only // // sn624x-sdw-sdca.c -- 
+SN624X SDCA ALSA SoC SoundWire audio driver // // Copyright(c) 2021 
+Realtek Semiconductor Corp.
+// Copyright(c) 2025 Senary Semiconductor Corp.
+//
+
+#include <linux/atomic.h>
+#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/find.h>
+#include <linux/device.h>

sound/soc/codecs/sn624x-sdca-sdw.c line 21

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+#include <linux/errno.h>
+#include <linux/jiffies.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/soundwire/sdw.h>
+#include <linux/soundwire/sdw_registers.h> #include 
+<linux/soundwire/sdw_type.h>

Please rely on linux/soundwire/sdw.h to provide sdw_device_id and drop including linux/mod_devicetable.h. mod_devicetable.h will go away soon.

sound/soc/codecs/sn624x-sdca-sdw.c line 1761

Quoted 6 lines

[...]

sound/soc/codecs/sn624x-sdca-sdw.c new file +5 -0
+static const struct sdw_device_id sn624x_sdca_id[] = {
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6242, 0x3, 0x1, 0),
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6244, 0x3, 0x1, 0),
+	SDW_SLAVE_ENTRY_EXT(0x0496, 0x6247, 0x3, 0x1, 0),
+	{},

Please make this

	{ }

(i.e. use a space between the braces and no trailing comma)

sound/soc/codecs/sn624x-sdca-sdw.c line 1763

Quoted 2 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +2 -0
+};
+MODULE_DEVICE_TABLE(sdw, sn624x_sdca_id);

Best regards
Uwe

maintainer
#4 lore raw

Re: [PATCH 1/3] ASoC: codecs: add SN624x SDCA SoundWire driver

In reply to qianghua wang
Quoted 4 lines · qianghua wang

Add SoundWire SDCA driver for Senary SN624x multi-function codecs (jack, speaker amp, and DMIC). Extend the Senary MAINTAINERS entry for the new codec files only; Intel ACPI match tables remain under INTEL ASoC DRIVERS.

This changelog describes the series, not this patch which only adds the CODEC driver.

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 244

Quoted 8 lines
sound/soc/codecs/Kconfig +1 -0
@@ -238,6 +238,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT721_SDCA_SDW
 	imply SND_SOC_RT722_SDCA_SDW
+	imply SND_SOC_SN624X_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318

Please keep this, the Makefile and the Kconfig lexically sorted.

sound/soc/codecs/Kconfig config SND_SOC_RT722_SDCA_SDW · line 1977

Quoted 6 lines
sound/soc/codecs/Kconfig +6 -0
+config SND_SOC_SN624X_SDCA_SDW
+       tristate "Senary SN624x SDCA Codec - SDW"
+       depends on SOUNDWIRE
+       select REGMAP_SOUNDWIRE
+       select REGMAP_SOUNDWIRE_MBQ
+       help

This also depends on SDCA.

sound/soc/codecs/sn624x-sdca-sdw.c line 56

Quoted 9 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +9 -0
+/*
+ * Trace helper: load with trace=1 or:
+ *   echo 1 > /sys/module/snd_soc_sn624x_sdca/parameters/trace
+ * For finer logs without trace=1, enable dynamic_debug on this file.
+ */
+static bool sn624x_trace;
+module_param_named(trace, sn624x_trace, bool, 0644);
+MODULE_PARM_DESC(trace,
+                "extra dev_dbg for probe, jack, SDW status (default off)");

You probably want to look at tracepoints and trace_printk() here, these are much more flexible features and can be easily tweaked at runtime. In general it's probably better to skip all these module parameters for upstream, they all look like debugging stuff which should hopefully not be needed.

sound/soc/codecs/sn624x-sdca-sdw.c line 97

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+static void sn624x_log_power_mode_once(struct device *dev,
+				       struct sn624x_sdca_priv *sn624x)
+{
+	unsigned int pm;
+	int ret;
+
+	if (!sn624x || !sn624x->regmap)
+		return;
+	if (atomic_xchg(&sn624x_power_mode_logged, 1) != 0)
+		return;

There doesn't seem to be any way to set this? Also consider printk_once().

sound/soc/codecs/sn624x-sdca-sdw.c line 1515

Quoted 7 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +6 -0
+static int sn624x_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
+				     struct snd_pcm_hw_params *params,
+				     struct snd_soc_dai *dai)
+{
 
+	stream_config.frame_rate = params_rate(params);
+	stream_config.ch_count = ch;

Do we need to configure SDCA clocking as well?

Quoted 6 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +6 -0
+static int sn624x_sdca_dev_system_suspend(struct device *dev)
+{
+	struct sn624x_sdca_priv *sn624x = dev_get_drvdata(dev);
+
+	if (!sn624x->first_hw_init)
+		return 0;

sound/soc/codecs/sn624x-sdca-sdw.c line 1792

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+
+	cancel_delayed_work_sync(&sn624x->jack_detect_work);
+
+	mutex_lock(&sn624x->disable_irq_lock);
+	sn624x->disable_irq = true;
+	sn624x_sdca_jack_irq_mask(sn624x);
+	mutex_unlock(&sn624x->disable_irq_lock);
+
+	return sn624x_sdca_dev_suspend(dev);
+}

I'd expect the work to be cancelled after disabling the interrupt, otherwise the interrupt could schedule more work between the cancellation and the disable.

#5 lore raw

PATCH 1/3 ASoC: codecs: add SN624x SDCA SoundWire driver

Hi Mark Brown:
Thanks for your comments. I will address them in v2.
Best regards
Qianghua Wang

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Re: [PATCH 1/3] ASoC: codecs: add SN624x SDCA SoundWire driver

Quoted 4 lines · qianghua wang

Add SoundWire SDCA driver for Senary SN624x multi-function codecs (jack, speaker amp, and DMIC). Extend the Senary MAINTAINERS entry for the new codec files only; Intel ACPI match tables remain under INTEL ASoC DRIVERS.

This changelog describes the series, not this patch which only adds the CODEC driver.

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 244

Quoted 8 lines
sound/soc/codecs/Kconfig +1 -0
@@ -238,6 +238,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT721_SDCA_SDW
 	imply SND_SOC_RT722_SDCA_SDW
+	imply SND_SOC_SN624X_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318

Please keep this, the Makefile and the Kconfig lexically sorted.

sound/soc/codecs/Kconfig config SND_SOC_RT722_SDCA_SDW · line 1977

Quoted 6 lines
sound/soc/codecs/Kconfig +6 -0
+config SND_SOC_SN624X_SDCA_SDW
+       tristate "Senary SN624x SDCA Codec - SDW"
+       depends on SOUNDWIRE
+       select REGMAP_SOUNDWIRE
+       select REGMAP_SOUNDWIRE_MBQ
+       help

This also depends on SDCA.

sound/soc/codecs/sn624x-sdca-sdw.c

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+/*
+ * Trace helper: load with trace=1 or:
+ *   echo 1 > /sys/module/snd_soc_sn624x_sdca/parameters/trace
+ * For finer logs without trace=1, enable dynamic_debug on this file.
+ */
+static bool sn624x_trace;
+module_param_named(trace, sn624x_trace, bool, 0644); 
+MODULE_PARM_DESC(trace,
+                "extra dev_dbg for probe, jack, SDW status (default 
+off)");

You probably want to look at tracepoints and trace_printk() here, these are much more flexible features and can be easily tweaked at runtime. In general it's probably better to skip all these module parameters for upstream, they all look like debugging stuff which should hopefully not be needed.

sound/soc/codecs/sn624x-sdca-sdw.c line 97

Quoted 9 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +9 -0
+static void sn624x_log_power_mode_once(struct device *dev,
+				       struct sn624x_sdca_priv *sn624x) {
+	unsigned int pm;
+	int ret;
+
+	if (!sn624x || !sn624x->regmap)
+		return;
+	if (atomic_xchg(&sn624x_power_mode_logged, 1) != 0)
+		return;

There doesn't seem to be any way to set this? Also consider printk_once().

sound/soc/codecs/sn624x-sdca-sdw.c line 1515

Quoted 7 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +6 -0
+static int sn624x_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
+				     struct snd_pcm_hw_params *params,
+				     struct snd_soc_dai *dai)
+{
 
+	stream_config.frame_rate = params_rate(params);
+	stream_config.ch_count = ch;

Do we need to configure SDCA clocking as well?

Quoted 4 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +4 -0
+static int sn624x_sdca_dev_system_suspend(struct device *dev) {
+	struct sn624x_sdca_priv *sn624x = dev_get_drvdata(dev);
+
+	if (!sn624x->first_hw_init)

sound/soc/codecs/sn624x-sdca-sdw.c

Quoted 10 lines
sound/soc/codecs/sn624x-sdca-sdw.c new file +10 -0
+		return 0;
+
+	cancel_delayed_work_sync(&sn624x->jack_detect_work);
+
+	mutex_lock(&sn624x->disable_irq_lock);
+	sn624x->disable_irq = true;
+	sn624x_sdca_jack_irq_mask(sn624x);
+	mutex_unlock(&sn624x->disable_irq_lock);
+
+	return sn624x_sdca_dev_suspend(dev); }

I'd expect the work to be cancelled after disabling the interrupt, otherwise the interrupt could schedule more work between the cancellation and the disable.

#6 lore raw

PATCH 2/3 ASoC: sdw_utils: add Senary SN624x helpers and codec_info

In reply to qianghua wang

From: "qianghua.wang" <[email protected]>

Register SN6242/6244/6247 in codec_info_list and add Senary-specific jack/amp/dmic rtd helpers used by the generic sof_sdw machine driver.

---
 include/sound/soc_sdw_utils.h                 |  20 ++
 sound/soc/sdw_utils/Makefile                  |   4 +-
 sound/soc/sdw_utils/soc_sdw_senary_amp.c      |  80 +++++++
 sound/soc/sdw_utils/soc_sdw_senary_dmic.c     |  49 +++++
 sound/soc/sdw_utils/soc_sdw_senary_sdca.c     |  63 ++++++
 .../soc_sdw_senary_sdca_jack_common.c         | 197 ++++++++++++++++++
 sound/soc/sdw_utils/soc_sdw_utils.c           | 166 +++++++++++++++
 7 files changed, 578 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_amp.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_dmic.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_sdca.c
 create mode 100644 sound/soc/sdw_utils/soc_sdw_senary_sdca_jack_common.c
include/sound/soc_sdw_utils.h +20 -0
index 79c21966220b..e8bdc20a75f6 100644
@@ -293,4 +293,24 @@ int asoc_sdw_es9356_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai
 int asoc_sdw_es9356_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
 int asoc_sdw_es9356_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
 
+/* Senary SN624x SDCA */
+int asoc_sdw_senary_sdca_jack_init(struct snd_soc_card *card,
+				   struct snd_soc_dai_link *dai_links,
+				   struct asoc_sdw_codec_info *info,
+				   bool playback);
+int asoc_sdw_senary_sdca_jack_exit(struct snd_soc_card *card,
+				   struct snd_soc_dai_link *dai_link);
+int asoc_sdw_senary_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd,
+				       struct snd_soc_dai *dai);
+int asoc_sdw_senary_amp_init(struct snd_soc_card *card,
+			     struct snd_soc_dai_link *dai_links,
+			     struct asoc_sdw_codec_info *info,
+			     bool playback);
+int asoc_sdw_senary_amp_exit(struct snd_soc_card *card,
+			     struct snd_soc_dai_link *dai_link);
+int asoc_sdw_senary_sdca_spk_rtd_init(struct snd_soc_pcm_runtime *rtd,
+				      struct snd_soc_dai *dai);
+int asoc_sdw_senary_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd,
+				  struct snd_soc_dai *dai);
+
 #endif
sound/soc/sdw_utils/Makefile +3 -1
index 5ae8c69b8b98..1dbc00a2d64a 100644
@@ -10,5 +10,7 @@ snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \
 		       soc_sdw_cs_amp.o					\
 		       soc_sdw_es9356.o					\
 		       soc_sdw_maxim.o \
-		       soc_sdw_ti_amp.o
+		       soc_sdw_ti_amp.o \
+		       soc_sdw_senary_sdca.o soc_sdw_senary_sdca_jack_common.o \
+		       soc_sdw_senary_amp.o soc_sdw_senary_dmic.o
 obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o
sound/soc/sdw_utils/soc_sdw_senary_amp.c new file +80 -0

80 lines not on this page · raw message

sound/soc/sdw_utils/soc_sdw_senary_dmic.c new file +49 -0

49 lines not on this page · raw message

sound/soc/sdw_utils/soc_sdw_senary_sdca.c new file +63 -0

63 lines not on this page · raw message

sound/soc/sdw_utils/soc_sdw_senary_sdca_jack_common.c new file +197 -0

197 lines not on this page · raw message

sound/soc/sdw_utils/soc_sdw_utils.c +166 -0

178 lines not on this page · raw message

Signature · 1 line
2.47.3
#7 lore raw

PATCH 3/3 ASoC: Intel: soc-acpi: add SN624x entries for PTL

In reply to qianghua wang

From: "qianghua.wang" <[email protected]>

Add Panther Lake SoundWire machine entries for Senary SN6242/6244/6247 on link 3, and select the SN624x SDCA codec from the SOF SoundWire machine Kconfig.

---
 sound/soc/intel/boards/Kconfig                |  1 +
 .../intel/common/soc-acpi-intel-ptl-match.c   | 81 +++++++++++++++++++
 2 files changed, 82 insertions(+)
sound/soc/intel/boards/Kconfig +1 -0
index cddbd2aa424e..2f2692cd8135 100644
@@ -519,6 +519,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
 	select SND_SOC_RT715_SDCA_SDW
 	select SND_SOC_RT721_SDCA_SDW
 	select SND_SOC_RT722_SDCA_SDW
+	select SND_SOC_SN624X_SDCA_SDW
 	select SND_SOC_RT1308_SDW
 	select SND_SOC_RT1308
 	select SND_SOC_RT1316_SDW
sound/soc/intel/common/soc-acpi-intel-ptl-match.c +81 -0

93 lines not on this page · raw message

Signature · 1 line
2.47.3
maintainer
#8 lore raw
In reply to qianghua wang
Quoted 4 lines · qianghua wang

From: "qianghua.wang" <[email protected]>

This series adds SoundWire SDCA support for Senary SN624x multi-function codecs (jack, speaker amp, DMIC) on Intel Panther Lake.

This doesn't apply against current code, please check and resend.

#9 lore raw

cover ASoC: add Senary SN624x SoundWire SDCA support

Hi Mark Brown:
My v1 was based on tiwai/sound.git commit f37c5691315d ("Merge
branch 'for-next'", 2026-08-10).
I will rebase onto the latest for-next and resend as v2.
Best regards
Qianghua Wang

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 4 lines · qianghua wang

From: "qianghua.wang" <[email protected]>

This series adds SoundWire SDCA support for Senary SN624x multi-function codecs (jack, speaker amp, DMIC) on Intel Panther Lake.

This doesn't apply against current code, please check and resend.