Skip to contentSkip to conversation

regmap/SoundWire/ASoC: Add SoundWire SDCA support

PATCH In review Bard Liao 5 participants 16 messages Dec 1, 2020 – Dec 3, 2020

Subsystems (6)
lore
Share & tools
lore

Bard Liao

author maintainer
#0 lore raw

v2 cover regmap/SoundWire/ASoC: Add SoundWire SDCA support

The MIPI SoundWire Device Class standard will define audio functionality beyond the scope of the existing SoundWire 1.2 standard, which is limited to the bus and interface.

The description is inspired by the USB Audio Class, with "functions", "entities", "control selectors", "audio clusters". The main difference with the USB Audio class is that the devices are typically on a motherboard and descriptors stored in platform firmware instead of being retrieved from the device.

The current set of devices managed in this patchset are conformant with the SDCA 0.6 specification and require dedicated drivers since the descriptors and platform firmware specification is not complete at this time. They do however rely on the hierarchical addressing required by the SDCA standard. Future devices conformant with SDCA 1.0 should rely on a class driver.

This series adds support for the hierarchical SDCA addressing and extends regmap. It then provides 3 codecs for RT711-sdca headset codec, RT1316 amplifier and RT715-scda microphone codec.

Note that the release of this code before the formal adoption of the SDCA 1.0 specification was formally endorsed by the MIPI Board to make sure there is no delay for Linux-based support of this specification.

v2:
- rt715-sdca: Use rt715_sdca prefix to avoid compiling issue.
- rt715-sdca: Merge multiple mute/volume operation into single mute/volume operation
- rt711-sdca: Initial ret = 0 as it could be used uninitialized.

Jack Yu (1):
ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec
driver

Pierre-Louis Bossart (2):
soundwire: SDCA: add helper macro to access controls regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ

Shuming Fan (2):
ASoC/SoundWire: rt1316: Add RT1316 SDCA vendor-specific driver ASoC/SoundWire: rt711-sdca: Add RT711 SDCA vendor-specific driver

 drivers/base/regmap/Kconfig             |    6 +-
 drivers/base/regmap/Makefile            |    1 +
 drivers/base/regmap/regmap-sdw-mbq.c    |  101 ++
 include/linux/regmap.h                  |   35 +
 include/linux/soundwire/sdw_registers.h |   32 +
 sound/soc/codecs/Kconfig                |   20 +
 sound/soc/codecs/Makefile               |    6 +
 sound/soc/codecs/rt1316-sdw.c           |  756 ++++++++++++
 sound/soc/codecs/rt1316-sdw.h           |  115 ++
 sound/soc/codecs/rt711-sdca-sdw.c       |  424 +++++++
 sound/soc/codecs/rt711-sdca-sdw.h       |  101 ++
 sound/soc/codecs/rt711-sdca.c           | 1482 +++++++++++++++++++++++
 sound/soc/codecs/rt711-sdca.h           |  246 ++++
 sound/soc/codecs/rt715-sdca-sdw.c       |  278 +++++
 sound/soc/codecs/rt715-sdca-sdw.h       |  170 +++
 sound/soc/codecs/rt715-sdca.c           |  947 +++++++++++++++
 sound/soc/codecs/rt715-sdca.h           |  124 ++
 17 files changed, 4843 insertions(+), 1 deletion(-)
 create mode 100644 drivers/base/regmap/regmap-sdw-mbq.c
 create mode 100644 sound/soc/codecs/rt1316-sdw.c
 create mode 100644 sound/soc/codecs/rt1316-sdw.h
 create mode 100644 sound/soc/codecs/rt711-sdca-sdw.c
 create mode 100644 sound/soc/codecs/rt711-sdca-sdw.h
 create mode 100644 sound/soc/codecs/rt711-sdca.c
 create mode 100644 sound/soc/codecs/rt711-sdca.h
 create mode 100644 sound/soc/codecs/rt715-sdca-sdw.c
 create mode 100644 sound/soc/codecs/rt715-sdca-sdw.h
 create mode 100644 sound/soc/codecs/rt715-sdca.c
 create mode 100644 sound/soc/codecs/rt715-sdca.h
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v2 1/5 soundwire: SDCA: add helper macro to access controls

From: Pierre-Louis Bossart <[email protected]>

The upcoming SDCA (SoundWire Device Class Audio) specification defines a hierarchical encoding to interface with Class-defined capabilities.

The specification is not yet accessible to the general public but this information is released with explicit permission from the MIPI Board to avoid delays with SDCA support on Linux platforms.

A block of 64 MBytes of register addresses are allocated to SDCA controls, starting at address 0x40000000. The 26 LSBs which identify individual controls are set based on the following variables:

- Function Number. An SCDA device can be split in up to 8 independent Functions. Each of these Functions is described in the SDCA specification, e.g. Smart Amplifier, Smart Microphone, Simple Microphone, Jack codec, HID, etc.

- Entity Number. Within each Function, an Entity is an identifiable
block. Up to 127 Entities are connected in a pre-defined
graph (similar to USB), with Entity0 reserved for Function-level configurations. In contrast to USB, the SDCA spec pre-defines Function Types, topologies, and allowed options, i.e. the degree of freedom is not unlimited to limit the possibility of errors in descriptors leading to software quirks.

- Control Selector. Within each Entity, the SDCA specification defines 48 controls such as Mute, Gain, AGC, etc, and 16 implementation defined ones. Some Control Selectors might be used for low-level platform setup, and other exposed to applications and users. Note that the same Control Selector capability, e.g. Latency control, might be located at different offsets in different entities, the Control Selector mapping is Entity-specific.

- Control Number. Some Control Selectors allow channel-specific values to be set, with up to 64 channels allowed. This is mostly used for volume control.

- Current/Next values. Some Control Selectors are 'Dual-Ranked'. Software may either update the Current value directly for immediate effect. Alternatively, software may write into the 'Next' values and update the SoundWire 1.2 'Commit Groups' register to copy 'Next' values into 'Current' ones in a synchronized manner. This is different from bank switching which is typically used to change the bus configuration only.

- MBQ. the Multi-Byte Quantity bit is used to provide atomic updates when accessing more that one byte, for example a 16-bit volume control would be updated consistently, the intermediate values mixing old MSB with new LSB are not applied.

These 6 parameters are used to build a 32-bit address to access the desired Controls. Because of address range, paging is required, but the most often used parameter values are placed in the lower 16 bits of the address. This helps to keep the paging registers constant while updating Controls for a specific Device/Function.

---
 include/linux/soundwire/sdw_registers.h | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
include/linux/soundwire/sdw_registers.h +32 -0
index 0cb1a22685b8..138bec908c40 100644
@@ -309,4 +309,36 @@
 #define SDW_CASC_PORT_MASK_INTSTAT3		1
 #define SDW_CASC_PORT_REG_OFFSET_INTSTAT3	2
 
+/*
+ * v1.2 device - SDCA address mapping
+ *
+ * Spec definition
+ *	Bits		Contents
+ *	31		0 (required by addressing range)
+ *	30:26		0b10000 (Control Prefix)
+ *	25		0 (Reserved)
+ *	24:22		Function Number [2:0]
+ *	21		Entity[6]
+ *	20:19		Control Selector[5:4]
+ *	18		0 (Reserved)
+ *	17:15		Control Number[5:3]
+ *	14		Next
+ *	13		MBQ
+ *	12:7		Entity[5:0]
+ *	6:3		Control Selector[3:0]
+ *	2:0		Control Number[2:0]
+ */
+
+#define SDW_SDCA_CTL(fun, ent, ctl, ch)		(BIT(30) |			\
+						 (((fun) & 0x7) << 22) |	\
+						 (((ent) & 0x40) << 15) |	\
+						 (((ent) & 0x3f) << 7) |	\
+						 (((ctl) & 0x30) << 15) |	\
+						 (((ctl) & 0x0f) << 3) |	\
+						 (((ch) & 0x38) << 12) |	\
+						 ((ch) & 0x07))
+
+#define SDW_SDCA_MBQ_CTL(reg)			((reg) | BIT(13))
+#define SDW_SDCA_NEXT_CTL(reg)			((reg) | BIT(14))
+
 #endif /* __SDW_REGISTERS_H */
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH v2 2/5 regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ

In reply to Bard Liao

From: Pierre-Louis Bossart <[email protected]>

The SoundWire 1.1 specification only allowed for reads and writes of bytes. The SoundWire 1.2 specification adds a new capability to transfer "Multi-Byte Quantities" (MBQ) across the bus. The transfers still happens one-byte-at-a-time, but the update is atomic.

For example when writing a 16-bit volume, the first byte transferred is only taken into account when the second byte is successfully transferred.

The mechanism is symmetrical for read and writes:
- On a read, the address of the last byte to be read is modified by setting the MBQ bit
- On a write, the address of all but the last byte to be written are modified by setting the MBQ bit. The address for the last byte relies on the MBQ bit being cleared.

The current definitions for MBQ-based controls in the SDCA draft standard are limited to 16 bits for volumes, so for now this is the only supported format. An update will be provided if and when support for 24-bit and 32-bit values is specified by the SDCA standard.

One possible objection is that this code could have been handled with regmap-sdw.c. However this is a new spec addition not handled by every SoundWire 1.1 and non-SDCA device, so there's no reason to load code that will never be used.

Also in practice it's extremely unlikely that CONFIG_REGMAP would not be selected with CONFIG_REGMAP_MBQ selected. However there's no functional dependency between the two modules so they can be selected separately.

---
 drivers/base/regmap/Kconfig          |   6 +-
 drivers/base/regmap/Makefile         |   1 +
 drivers/base/regmap/regmap-sdw-mbq.c | 101 +++++++++++++++++++++++++++
 include/linux/regmap.h               |  35 ++++++++++
 4 files changed, 142 insertions(+), 1 deletion(-)
 create mode 100644 drivers/base/regmap/regmap-sdw-mbq.c
drivers/base/regmap/Kconfig +5 -1
index bcb90d8c3960..50b1e2d06a25 100644
@@ -4,7 +4,7 @@
 # subsystems should select the appropriate symbols.
 
 config REGMAP
-	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM)
+	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SOUNDWIRE_MBQ || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM)
 	select IRQ_DOMAIN if REGMAP_IRQ
 	bool
 
@@ -46,6 +46,10 @@ config REGMAP_SOUNDWIRE
 	tristate
 	depends on SOUNDWIRE
 
+config REGMAP_SOUNDWIRE_MBQ
+	tristate
+	depends on SOUNDWIRE
+
 config REGMAP_SCCB
 	tristate
 	depends on I2C
drivers/base/regmap/Makefile +1 -0
index ac1b69ee4051..33f63adb5b3d 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_REGMAP_MMIO) += regmap-mmio.o
 obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
 obj-$(CONFIG_REGMAP_W1) += regmap-w1.o
 obj-$(CONFIG_REGMAP_SOUNDWIRE) += regmap-sdw.o
+obj-$(CONFIG_REGMAP_SOUNDWIRE_MBQ) += regmap-sdw-mbq.o
 obj-$(CONFIG_REGMAP_SCCB) += regmap-sccb.o
 obj-$(CONFIG_REGMAP_I3C) += regmap-i3c.o
 obj-$(CONFIG_REGMAP_SPI_AVMM) += regmap-spi-avmm.o
drivers/base/regmap/regmap-sdw-mbq.c new file +101 -0

101 lines not on this page · raw message

include/linux/regmap.h +35 -0
index e7834d98207f..a652d1474d6a 100644
@@ -570,6 +570,10 @@ struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,
 				 const struct regmap_config *config,
 				 struct lock_class_key *lock_key,
 				 const char *lock_name);
+struct regmap *__regmap_init_sdw_mbq(struct sdw_slave *sdw,
+				     const struct regmap_config *config,
+				     struct lock_class_key *lock_key,
+				     const char *lock_name);
 struct regmap *__regmap_init_spi_avmm(struct spi_device *spi,
 				      const struct regmap_config *config,
 				      struct lock_class_key *lock_key,
@@ -619,6 +623,10 @@ struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,
 				 const struct regmap_config *config,
 				 struct lock_class_key *lock_key,
 				 const char *lock_name);
+struct regmap *__devm_regmap_init_sdw_mbq(struct sdw_slave *sdw,
+					  const struct regmap_config *config,
+					  struct lock_class_key *lock_key,
+					  const char *lock_name);
 struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
 				 const struct regmap_config *config,
 				 struct lock_class_key *lock_key,
@@ -817,6 +825,19 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
 	__regmap_lockdep_wrapper(__regmap_init_sdw, #config,		\
 				sdw, config)
 
+/**
+ * regmap_init_sdw_mbq() - Initialise register map
+ *
+ * @sdw: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer to
+ * a struct regmap.
+ */
+#define regmap_init_sdw_mbq(sdw, config)					\
+	__regmap_lockdep_wrapper(__regmap_init_sdw_mbq, #config,		\
+				sdw, config)
+
 /**
  * regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
  * to AVMM Bus Bridge
@@ -989,6 +1010,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
 	__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config,	\
 				sdw, config)
 
+/**
+ * devm_regmap_init_sdw_mbq() - Initialise managed register map
+ *
+ * @sdw: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap. The regmap will be automatically freed by the
+ * device management code.
+ */
+#define devm_regmap_init_sdw_mbq(sdw, config)			\
+	__regmap_lockdep_wrapper(__devm_regmap_init_sdw_mbq, #config,   \
+				sdw, config)
+
 /**
  * devm_regmap_init_slimbus() - Initialise managed register map
  *
Signature · 1 line
2.17.1
maintainer
#3 lore raw

Re: [PATCH v2 2/5] regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ

Quoted 6 lines · Bard Liao

From: Pierre-Louis Bossart <[email protected]>

The SoundWire 1.1 specification only allowed for reads and writes of bytes. The SoundWire 1.2 specification adds a new capability to transfer "Multi-Byte Quantities" (MBQ) across the bus. The transfers still happens one-byte-at-a-time, but the update is atomic.

Please do not submit new versions of already applied patches, please submit incremental updates to the existing code. Modifying existing commits creates problems for other users building on top of those commits so it's best practice to only change pubished git commits if absolutely essential.

author maintainer
#4 lore raw

PATCH v2 3/5 ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec driver

In reply to Bard Liao

From: Jack Yu <[email protected]>

First version of rt715 sdw sdca codec driver.

---
 sound/soc/codecs/Kconfig          |   7 +
 sound/soc/codecs/Makefile         |   2 +
 sound/soc/codecs/rt715-sdca-sdw.c | 278 +++++++++
 sound/soc/codecs/rt715-sdca-sdw.h | 170 ++++++
 sound/soc/codecs/rt715-sdca.c     | 947 ++++++++++++++++++++++++++++++
 sound/soc/codecs/rt715-sdca.h     | 124 ++++
 6 files changed, 1528 insertions(+)
 create mode 100644 sound/soc/codecs/rt715-sdca-sdw.c
 create mode 100644 sound/soc/codecs/rt715-sdca-sdw.h
 create mode 100644 sound/soc/codecs/rt715-sdca.c
 create mode 100644 sound/soc/codecs/rt715-sdca.h
sound/soc/codecs/Kconfig +7 -0
index 34c6dd04b85a..e7797f08e057 100644
@@ -177,6 +177,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT700_SDW
 	imply SND_SOC_RT711_SDW
 	imply SND_SOC_RT715_SDW
+	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
 	imply SND_SOC_SGTL5000
 	imply SND_SOC_SI476X
@@ -1216,6 +1217,12 @@ config SND_SOC_RT715_SDW
 	select SND_SOC_RT715
 	select REGMAP_SOUNDWIRE
 
+config SND_SOC_RT715_SDCA_SDW
+	tristate "Realtek RT715 SDCA Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+
 #Freescale sgtl5000 codec
 config SND_SOC_SGTL5000
 	tristate "Freescale SGTL5000 CODEC"
sound/soc/codecs/Makefile +2 -0
index 11ce98c25d6c..b1683403afb3 100644
@@ -188,6 +188,7 @@ snd-soc-rt5682-i2c-objs := rt5682-i2c.o
 snd-soc-rt700-objs := rt700.o rt700-sdw.o
 snd-soc-rt711-objs := rt711.o rt711-sdw.o
 snd-soc-rt715-objs := rt715.o rt715-sdw.o
+snd-soc-rt715-sdca-objs := rt715-sdca.o rt715-sdca-sdw.o
 snd-soc-sgtl5000-objs := sgtl5000.o
 snd-soc-alc5623-objs := alc5623.o
 snd-soc-alc5632-objs := alc5632.o
@@ -498,6 +499,7 @@ obj-$(CONFIG_SND_SOC_RT5682_SDW)	+= snd-soc-rt5682-sdw.o
 obj-$(CONFIG_SND_SOC_RT700)     += snd-soc-rt700.o
 obj-$(CONFIG_SND_SOC_RT711)     += snd-soc-rt711.o
 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_SGTL5000)  += snd-soc-sgtl5000.o
 obj-$(CONFIG_SND_SOC_SIGMADSP)	+= snd-soc-sigmadsp.o
 obj-$(CONFIG_SND_SOC_SIGMADSP_I2C)	+= snd-soc-sigmadsp-i2c.o
sound/soc/codecs/rt715-sdca-sdw.c new file +278 -0

278 lines not on this page · raw message

sound/soc/codecs/rt715-sdca-sdw.h new file +170 -0

170 lines not on this page · raw message

sound/soc/codecs/rt715-sdca.c new file +947 -0

947 lines not on this page · raw message

sound/soc/codecs/rt715-sdca.h new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#5 lore raw

Re: [PATCH v2 3/5] ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec driver

Quoted 3 lines · Bard Liao

From: Jack Yu <[email protected]>

First version of rt715 sdw sdca codec driver.

This doesn't apply against the ASoC tree, please check and resend.

#6 lore raw

RE: [PATCH v2 3/5] ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec driver

Quoted 15 lines

-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Thursday, December 3, 2020 12:08 AM
To: Bard Liao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Kale, Sanyog R <[email protected]>; Liao, Bard <[email protected]>
Subject: Re: [PATCH v2 3/5] ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec driver

Quoted 6 lines
Quoted 3 lines · Bard Liao

From: Jack Yu <[email protected]>

First version of rt715 sdw sdca codec driver.

This doesn't apply against the ASoC tree, please check and resend.

Looks like the previous version is already in ASoC tree. I will resend the remaining patches on top of it.

author maintainer
#7 lore raw

PATCH v2 4/5 ASoC/SoundWire: rt1316: Add RT1316 SDCA vendor-specific driver

In reply to Bard Liao

From: Shuming Fan <[email protected]>

This is the initial amplifier driver for rt1316 SDCA version.

---
 sound/soc/codecs/Kconfig      |   6 +
 sound/soc/codecs/Makefile     |   2 +
 sound/soc/codecs/rt1316-sdw.c | 756 ++++++++++++++++++++++++++++++++++
 sound/soc/codecs/rt1316-sdw.h | 115 ++++++
 4 files changed, 879 insertions(+)
 create mode 100644 sound/soc/codecs/rt1316-sdw.c
 create mode 100644 sound/soc/codecs/rt1316-sdw.h
sound/soc/codecs/Kconfig +6 -0
index e7797f08e057..ebc124142f90 100644
@@ -179,6 +179,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT715_SDW
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
+	imply SND_SOC_RT1316_SDW
 	imply SND_SOC_SGTL5000
 	imply SND_SOC_SI476X
 	imply SND_SOC_SIMPLE_AMPLIFIER
@@ -1110,6 +1111,11 @@ config SND_SOC_RT1308_SDW
 	depends on I2C && SOUNDWIRE
 	select REGMAP_SOUNDWIRE
 
+config SND_SOC_RT1316_SDW
+	tristate "Realtek RT1316 Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+
 config SND_SOC_RT5514
 	tristate
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index b1683403afb3..601bbb8b46e7 100644
@@ -164,6 +164,7 @@ snd-soc-rt1015p-objs := rt1015p.o
 snd-soc-rt1305-objs := rt1305.o
 snd-soc-rt1308-objs := rt1308.o
 snd-soc-rt1308-sdw-objs := rt1308-sdw.o
+snd-soc-rt1316-sdw-objs := rt1316-sdw.o
 snd-soc-rt274-objs := rt274.o
 snd-soc-rt286-objs := rt286.o
 snd-soc-rt298-objs := rt298.o
@@ -474,6 +475,7 @@ obj-$(CONFIG_SND_SOC_RT1015P)	+= snd-soc-rt1015p.o
 obj-$(CONFIG_SND_SOC_RT1305)	+= snd-soc-rt1305.o
 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_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/rt1316-sdw.c new file +756 -0

756 lines not on this page · raw message

sound/soc/codecs/rt1316-sdw.h new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
2.17.1
author maintainer
#8 lore raw

PATCH v2 5/5 ASoC/SoundWire: rt711-sdca: Add RT711 SDCA vendor-specific driver

In reply to Bard Liao

From: Shuming Fan <[email protected]>

This is the initial codec driver for rt711 SDCA version.

---
 sound/soc/codecs/Kconfig          |    7 +
 sound/soc/codecs/Makefile         |    2 +
 sound/soc/codecs/rt711-sdca-sdw.c |  424 +++++++++
 sound/soc/codecs/rt711-sdca-sdw.h |  101 ++
 sound/soc/codecs/rt711-sdca.c     | 1482 +++++++++++++++++++++++++++++
 sound/soc/codecs/rt711-sdca.h     |  246 +++++
 6 files changed, 2262 insertions(+)
 create mode 100644 sound/soc/codecs/rt711-sdca-sdw.c
 create mode 100644 sound/soc/codecs/rt711-sdca-sdw.h
 create mode 100644 sound/soc/codecs/rt711-sdca.c
 create mode 100644 sound/soc/codecs/rt711-sdca.h
sound/soc/codecs/Kconfig +7 -0
index ebc124142f90..a9064f279d33 100644
@@ -176,6 +176,7 @@ config SND_SOC_ALL_CODECS
 	imply SND_SOC_RT5682_SDW
 	imply SND_SOC_RT700_SDW
 	imply SND_SOC_RT711_SDW
+	imply SND_SOC_RT711_SDCA_SDW
 	imply SND_SOC_RT715_SDW
 	imply SND_SOC_RT715_SDCA_SDW
 	imply SND_SOC_RT1308_SDW
@@ -1214,6 +1215,12 @@ config SND_SOC_RT711_SDW
 	select SND_SOC_RT711
 	select REGMAP_SOUNDWIRE
 
+config SND_SOC_RT711_SDCA_SDW
+	tristate "Realtek RT711 SDCA Codec - SDW"
+	depends on SOUNDWIRE
+	select REGMAP_SOUNDWIRE
+	select REGMAP_SOUNDWIRE_MBQ
+
 config SND_SOC_RT715
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 601bbb8b46e7..8bdd587bbd3b 100644
@@ -188,6 +188,7 @@ snd-soc-rt5682-sdw-objs := rt5682-sdw.o
 snd-soc-rt5682-i2c-objs := rt5682-i2c.o
 snd-soc-rt700-objs := rt700.o rt700-sdw.o
 snd-soc-rt711-objs := rt711.o rt711-sdw.o
+snd-soc-rt711-sdca-objs := rt711-sdca.o rt711-sdca-sdw.o
 snd-soc-rt715-objs := rt715.o rt715-sdw.o
 snd-soc-rt715-sdca-objs := rt715-sdca.o rt715-sdca-sdw.o
 snd-soc-sgtl5000-objs := sgtl5000.o
@@ -500,6 +501,7 @@ obj-$(CONFIG_SND_SOC_RT5682_I2C)	+= snd-soc-rt5682-i2c.o
 obj-$(CONFIG_SND_SOC_RT5682_SDW)	+= snd-soc-rt5682-sdw.o
 obj-$(CONFIG_SND_SOC_RT700)     += snd-soc-rt700.o
 obj-$(CONFIG_SND_SOC_RT711)     += snd-soc-rt711.o
+obj-$(CONFIG_SND_SOC_RT711_SDCA_SDW)     += snd-soc-rt711-sdca.o
 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_SGTL5000)  += snd-soc-sgtl5000.o
sound/soc/codecs/rt711-sdca-sdw.c new file +424 -0

424 lines not on this page · raw message

sound/soc/codecs/rt711-sdca-sdw.h new file +101 -0

101 lines not on this page · raw message

sound/soc/codecs/rt711-sdca.c new file +1482 -0

1,482 lines not on this page · raw message

sound/soc/codecs/rt711-sdca.h new file +246 -0

246 lines not on this page · raw message

Signature · 1 line
2.17.1
#9 lore raw
In reply to Bard Liao
Quoted 48 lines

-----Original Message-----
From: Bard Liao <[email protected]>
Sent: Monday, November 30, 2020 10:40 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; pierre- [email protected]; Kale, Sanyog R <[email protected]>; Liao, Bard <[email protected]>
Subject: [PATCH v2 0/5] regmap/SoundWire/ASoC: Add SoundWire SDCA support

The MIPI SoundWire Device Class standard will define audio functionality beyond the scope of the existing SoundWire 1.2 standard, which is limited to the bus and interface.

The description is inspired by the USB Audio Class, with "functions", "entities", "control selectors", "audio clusters". The main difference with the USB Audio class is that the devices are typically on a motherboard and descriptors stored in platform firmware instead of being retrieved from the device.

The current set of devices managed in this patchset are conformant with the SDCA 0.6 specification and require dedicated drivers since the descriptors and platform firmware specification is not complete at this time. They do however rely on the hierarchical addressing required by the SDCA standard. Future devices conformant with SDCA 1.0 should rely on a class driver.

This series adds support for the hierarchical SDCA addressing and extends regmap. It then provides 3 codecs for RT711-sdca headset codec, RT1316 amplifier and RT715-scda microphone codec.

Note that the release of this code before the formal adoption of the SDCA 1.0 specification was formally endorsed by the MIPI Board to make sure there is no delay for Linux-based support of this specification.

v2:
- rt715-sdca: Use rt715_sdca prefix to avoid compiling issue.
- rt715-sdca: Merge multiple mute/volume operation into single mute/volume
operation
- rt711-sdca: Initial ret = 0 as it could be used uninitialized.

Jack Yu (1):
ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec
driver

Quoted 8 lines

Pierre-Louis Bossart (2):
soundwire: SDCA: add helper macro to access controls regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ

Shuming Fan (2):
ASoC/SoundWire: rt1316: Add RT1316 SDCA vendor-specific driver ASoC/SoundWire: rt711-sdca: Add RT711 SDCA vendor-specific driver

Hi Vinod/Mark,

Could we take this series into Vinod's tree with Mark's Acked-by? It failed to build on Mark's tree.

Quoted 3 lines

--
2.17.1

maintainer
#10 lore raw
Quoted 4 lines · Bard

Hi Vinod/Mark,

Could we take this series into Vinod's tree with Mark's Acked-by? It failed to build on Mark's tree.

I see Mark has already applied 1-3 ..

Thanks

Signature · 1 line
~Vinod
#11 lore raw
Quoted 8 lines · Vinod Koul
Quoted 4 lines · Bard

Hi Vinod/Mark,

Could we take this series into Vinod's tree with Mark's Acked-by? It failed to build on Mark's tree.

I see Mark has already applied 1-3 ..

Sorry, I thought Mark had reversed the entire series.

Vinod, would you mind providing a tag for Mark then? The following commit is needed to compile:

b7cab9be7c161 ('soundwire: SDCA: detect sdca_cascade interrupt')

Thank you Sir!

maintainer
#12 lore raw
Quoted 5 lines · Pierre-Louis Bossart
Quoted 1 line · Vinod Koul

I see Mark has already applied 1-3 ..

Sorry, I thought Mark had reversed the entire series.

Yeah, I just backed out the one change for the driver.

Quoted 4 lines

Vinod, would you mind providing a tag for Mark then? The following commit is needed to compile:

b7cab9be7c161 ('soundwire: SDCA: detect sdca_cascade interrupt')

That'd work, looks like there's only one fix patch it's based off.

maintainer
#13 lore raw

Hi Mark,

Quoted 7 lines · Mark Brown
Quoted 5 lines · Pierre-Louis Bossart
Quoted 1 line · Vinod Koul

I see Mark has already applied 1-3 ..

Sorry, I thought Mark had reversed the entire series.

Quoted 8 lines

Yeah, I just backed out the one change for the driver.

Quoted 4 lines

Vinod, would you mind providing a tag for Mark then? The following commit is needed to compile:

b7cab9be7c161 ('soundwire: SDCA: detect sdca_cascade interrupt')

That'd work, looks like there's only one fix patch it's based off.

I have created the tag, please pull:

The following changes since commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec:

Linux 5.10-rc1 (2020-10-25 15:14:11 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git tags/soundwire-for-asoc-5.11

for you to fetch changes up to b7cab9be7c16128a0de21ed7ae67211838813437:

soundwire: SDCA: detect sdca_cascade interrupt (2020-11-24 14:09:31 +0530)

----------------------------------------------------------------
soundwire-for-asoc-5.11

Tag for asoc to resolve build dependency with commit b7cab9be7c16 ("soundwire: SDCA: detect sdca_cascade interrupt")

----------------------------------------------------------------
Pierre-Louis Bossart (1):
soundwire: SDCA: detect sdca_cascade interrupt

Srinivas Kandagatla (1):
soundwire: Fix DEBUG_LOCKS_WARN_ON for uninitialized attribute

 drivers/soundwire/bus.c             | 28 +++++++++++++++++++++++++++-
 drivers/soundwire/sysfs_slave_dpn.c |  1 +
 include/linux/soundwire/sdw.h       |  4 ++++
 3 files changed, 32 insertions(+), 1 deletion(-)
Signature · 1 line
~Vinod
maintainer
#14 lore raw
Quoted 9 lines · Vinod Koul

Linux 5.10-rc1 (2020-10-25 15:14:11 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git tags/soundwire-for-asoc-5.11

for you to fetch changes up to b7cab9be7c16128a0de21ed7ae67211838813437:

soundwire: SDCA: detect sdca_cascade interrupt (2020-11-24 14:09:31 +0530)

Pulled in, thanks.

maintainer
#15 lore raw

Re: (subset) [PATCH v2 0/5] regmap/SoundWire/ASoC: Add SoundWire SDCA support

In reply to Bard Liao
Quoted 11 lines · Bard Liao

The MIPI SoundWire Device Class standard will define audio functionality beyond the scope of the existing SoundWire 1.2 standard, which is limited to the bus and interface.

The description is inspired by the USB Audio Class, with "functions", "entities", "control selectors", "audio clusters". The main difference with the USB Audio class is that the devices are typically on a motherboard and descriptors stored in platform firmware instead of being retrieved from the device.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[3/5] ASoC/SoundWire: rt715-sdca: First version of rt715 sdw sdca codec driver

      commit: 6f4a038b99677f4db737841b81b9d45ed4b54966

[4/5] ASoC/SoundWire: rt1316: Add RT1316 SDCA vendor-specific driver
(no commit info)
[5/5] ASoC/SoundWire: rt711-sdca: Add RT711 SDCA vendor-specific driver
(no commit info)

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark