Skip to contentSkip to conversation

ASoC: rt1320: Add RT1320 SDCA vendor-specific driver

PATCH Superseded [email protected] 2 participants 4 messages May 20, 2024

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ASoC: rt1320: Add RT1320 SDCA vendor-specific driver

From: Shuming Fan <[email protected]>

This is the initial amplifier driver for rt1320.

--
v2: add Capture DAI for AEC feedback
v3: add some comments for blind writes/patch_code/calling sdw_slave_read_prop
add class id 1

---
 sound/soc/codecs/Kconfig      |    7 +
 sound/soc/codecs/Makefile     |    2 +
 sound/soc/codecs/rt1320-sdw.c | 2256 +++++++++++++++++++++++++++++++++
 sound/soc/codecs/rt1320-sdw.h |   94 ++
 4 files changed, 2359 insertions(+)
 create mode 100644 sound/soc/codecs/rt1320-sdw.c
 create mode 100644 sound/soc/codecs/rt1320-sdw.h
sound/soc/codecs/Kconfig +7 -0
index 4afc43d3f71f..7502581d1631 100644
@@ -222,6 +222,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_RT1318_SDW
+	imply SND_SOC_RT1320_SDW
 	imply SND_SOC_RT9120
 	imply SND_SOC_RTQ9128
 	imply SND_SOC_SDW_MOCKUP
@@ -1575,6 +1576,12 @@ config SND_SOC_RT1318_SDW
 	depends on SOUNDWIRE
 	select REGMAP_SOUNDWIRE
 
+config SND_SOC_RT1320_SDW
+	tristate "Realtek RT1320 Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+
 config SND_SOC_RT5514
 	tristate
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index b4df22186e25..f9eb7c073a00 100644
@@ -222,6 +222,7 @@ snd-soc-rt1308-y := rt1308.o
 snd-soc-rt1308-sdw-y := rt1308-sdw.o
 snd-soc-rt1316-sdw-y := rt1316-sdw.o
 snd-soc-rt1318-sdw-y := rt1318-sdw.o
+snd-soc-rt1320-sdw-y := rt1320-sdw.o
 snd-soc-rt274-y := rt274.o
 snd-soc-rt286-y := rt286.o
 snd-soc-rt298-y := rt298.o
@@ -614,6 +615,7 @@ obj-$(CONFIG_SND_SOC_RT1308)	+= snd-soc-rt1308.o
 obj-$(CONFIG_SND_SOC_RT1308_SDW)	+= snd-soc-rt1308-sdw.o
 obj-$(CONFIG_SND_SOC_RT1316_SDW)	+= snd-soc-rt1316-sdw.o
 obj-$(CONFIG_SND_SOC_RT1318_SDW)	+= snd-soc-rt1318-sdw.o
+obj-$(CONFIG_SND_SOC_RT1320_SDW)	+= snd-soc-rt1320-sdw.o
 obj-$(CONFIG_SND_SOC_RT274)	+= snd-soc-rt274.o
 obj-$(CONFIG_SND_SOC_RT286)	+= snd-soc-rt286.o
 obj-$(CONFIG_SND_SOC_RT298)	+= snd-soc-rt298.o
sound/soc/codecs/rt1320-sdw.c new file +2256 -0

2,256 lines not on this page · raw message

sound/soc/codecs/rt1320-sdw.h new file +94 -0

94 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

sound/soc/codecs/rt1320-sdw.c line 2191

Quoted 5 lines
sound/soc/codecs/rt1320-sdw.c new file +4 -0
+static const struct sdw_device_id rt1320_id[] = {
+	SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x0, 0),
+	SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x1, 0),
+	{},

Sorry, not following why one of the two entries in the table is an SDCA class device and the other not - both rely on SDCA controls/entities/functions/etc. That doesn't really align with the notion that VA and VB only differ by their DSP capabilities, so not sure what the 0/1 difference means.

#2 lore raw
Quoted 9 lines

sound/soc/codecs/rt1320-sdw.c line 2191

Quoted 4 lines
sound/soc/codecs/rt1320-sdw.c new file +4 -0
+static const struct sdw_device_id rt1320_id[] = {
+     SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x0, 0),
+     SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x1, 0),
+     {},

Sorry, not following why one of the two entries in the table is an SDCA class device and the other not - both rely on SDCA controls/entities/functions/etc. That doesn't really align with the notion that VA and VB only differ by their DSP capabilities, so not sure what the 0/1 difference means.

VA/VB will use class id 0 because of the hardware issue. VC will fix this and use the class id 1.

#3 lore raw
Quoted 5 lines · Shuming [范書銘]
Quoted 5 lines
Quoted 4 lines
sound/soc/codecs/rt1320-sdw.c new file +4 -0
+static const struct sdw_device_id rt1320_id[] = {
+     SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x0, 0),
+     SDW_SLAVE_ENTRY_EXT(0x025d, 0x1320, 0x3, 0x1, 0),
+     {},
Quoted 7 lines
Quoted 4 lines

Sorry, not following why one of the two entries in the table is an SDCA class device and the other not - both rely on SDCA controls/entities/functions/etc. That doesn't really align with the notion that VA and VB only differ by their DSP capabilities, so not sure what the 0/1 difference means.

VA/VB will use class id 0 because of the hardware issue. VC will fix this and use the class id 1.

ok, a comment would help.