diff mbox series

[3/4] soundwire: intel_ace2.x: add support for DODSE property

Message ID 20240429004321.2399754-4-yung-chuan.liao@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series SoundWire: intel_ace2x: read DOAIS and DODS from _DSD properties | expand

Commit Message

Bard Liao April 29, 2024, 12:43 a.m. UTC
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Extend previous patches with the DODSE field and property.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 drivers/soundwire/intel.h           | 1 +
 drivers/soundwire/intel_ace2x.c     | 3 +++
 drivers/soundwire/intel_auxdevice.c | 7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h
index b36d46319f0f..f58860f192f9 100644
--- a/drivers/soundwire/intel.h
+++ b/drivers/soundwire/intel.h
@@ -60,6 +60,7 @@  struct sdw_intel {
 
 struct sdw_intel_prop {
 	u16 doais;
+	u16 dodse;
 	u16 dods;
 };
 
diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c
index 917cc79d4d85..a07fd4a79f00 100644
--- a/drivers/soundwire/intel_ace2x.c
+++ b/drivers/soundwire/intel_ace2x.c
@@ -28,15 +28,18 @@  static void intel_shim_vs_init(struct sdw_intel *sdw)
 	struct sdw_bus *bus = &sdw->cdns.bus;
 	struct sdw_intel_prop *intel_prop;
 	u16 doais;
+	u16 dodse;
 	u16 dods;
 	u16 act;
 
 	intel_prop = bus->vendor_specific_prop;
 	doais = intel_prop->doais;
+	dodse = intel_prop->dodse;
 	dods = intel_prop->dods;
 
 	act = intel_readw(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL);
 	u16p_replace_bits(&act, doais, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS);
+	u16p_replace_bits(&act, dodse, SDW_SHIM2_INTEL_VS_ACTMCTL_DODSE);
 	u16p_replace_bits(&act, dods, SDW_SHIM2_INTEL_VS_ACTMCTL_DODS);
 	act |= SDW_SHIM2_INTEL_VS_ACTMCTL_DACTQE;
 	intel_writew(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL, act);
diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index 697d64070794..7310441050b1 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -160,18 +160,23 @@  static int sdw_master_read_intel_prop(struct sdw_bus *bus)
 
 	/* initialize with hardware defaults, in case the properties are not found */
 	intel_prop->doais = 0x3;
+	intel_prop->dodse  = 0x0;
 	intel_prop->dods  = 0x1;
 
 	fwnode_property_read_u16(link,
 				 "intel-sdw-doais",
 				 &intel_prop->doais);
+	fwnode_property_read_u16(link,
+				 "intel-sdw-dodse",
+				 &intel_prop->dodse);
 	fwnode_property_read_u16(link,
 				 "intel-sdw-dods",
 				 &intel_prop->dods);
 	bus->vendor_specific_prop = intel_prop;
 
-	dev_dbg(bus->dev, "doais %#x dods %#x\n",
+	dev_dbg(bus->dev, "doais %#x dodse %#x dods %#x\n",
 		intel_prop->doais,
+		intel_prop->dodse,
 		intel_prop->dods);
 
 	return 0;