Skip to contentSkip to conversation

soundwire: SDCA: add helper macro to access controls

PATCH Superseded Bard Liao 1 participant 1 message Aug 14, 2020 SoundWire

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Bard Liao

author maintainer
#0 lore raw

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

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

The upcoming SDCA (SoundWire Device Class Audio) specification defines a hiearchical encoding to interface with Class-defined capabilities, based on which audio function, entity, control and channel being used.

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.

---
 include/linux/soundwire/sdw_registers.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/linux/soundwire/sdw_registers.h +10 -0
index 5d3c271af7d1..3ca09a02b9fc 100644
@@ -305,4 +305,14 @@
 #define SDW_CASC_PORT_MASK_INTSTAT3		1
 #define SDW_CASC_PORT_REG_OFFSET_INTSTAT3	2
 
+/* v1.2 device - SDCA address mapping */
+#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))
+
 #endif /* __SDW_REGISTERS_H */
Signature · 1 line
2.17.1