Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] soundwire: cadence: programming flow corrections
@ 2024-10-03  9:48 Bard Liao
  2024-10-03  9:48 ` [PATCH 1/2] soundwire: cadence: add soft-reset on startup Bard Liao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bard Liao @ 2024-10-03  9:48 UTC (permalink / raw)
  To: linux-sound, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

To follow the recommended programming flows.

Pierre-Louis Bossart (2):
  soundwire: cadence: add soft-reset on startup
  soundwire: cadence: clear MCP BLOCK_WAKEUP in init

 drivers/soundwire/cadence_master.c   | 30 ++++++++++++++++++++++++++++
 drivers/soundwire/cadence_master.h   |  1 +
 drivers/soundwire/intel_bus_common.c |  6 ++++++
 3 files changed, 37 insertions(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] soundwire: cadence: add soft-reset on startup
  2024-10-03  9:48 [PATCH 0/2] soundwire: cadence: programming flow corrections Bard Liao
@ 2024-10-03  9:48 ` Bard Liao
  2024-10-03  9:48 ` [PATCH 2/2] soundwire: cadence: clear MCP BLOCK_WAKEUP in init Bard Liao
  2024-10-10 12:16 ` [PATCH 0/2] soundwire: cadence: programming flow corrections Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Bard Liao @ 2024-10-03  9:48 UTC (permalink / raw)
  To: linux-sound, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Follow the recommended programming flows.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 drivers/soundwire/cadence_master.c   | 25 +++++++++++++++++++++++++
 drivers/soundwire/cadence_master.h   |  1 +
 drivers/soundwire/intel_bus_common.c |  6 ++++++
 3 files changed, 32 insertions(+)

diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 05652e983539..7c8c977a923a 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -1377,6 +1377,31 @@ static void cdns_init_clock_ctrl(struct sdw_cdns *cdns)
 	cdns_writel(cdns, CDNS_MCP_SSP_CTRL1, ssp_interval);
 }
 
+/**
+ * sdw_cdns_soft_reset() - Cadence soft-reset
+ * @cdns: Cadence instance
+ */
+int sdw_cdns_soft_reset(struct sdw_cdns *cdns)
+{
+	int ret;
+
+	cdns_updatel(cdns, CDNS_MCP_CONTROL, CDNS_MCP_CONTROL_SOFT_RST,
+		     CDNS_MCP_CONTROL_SOFT_RST);
+
+	ret = cdns_config_update(cdns);
+	if (ret < 0) {
+		dev_err(cdns->dev, "%s: config update failed\n", __func__);
+		return ret;
+	}
+
+	ret = cdns_set_wait(cdns, CDNS_MCP_CONTROL, CDNS_MCP_CONTROL_SOFT_RST, 0);
+	if (ret < 0)
+		dev_err(cdns->dev, "%s: Soft Reset timed out\n", __func__);
+
+	return ret;
+}
+EXPORT_SYMBOL(sdw_cdns_soft_reset);
+
 /**
  * sdw_cdns_init() - Cadence initialization
  * @cdns: Cadence instance
diff --git a/drivers/soundwire/cadence_master.h b/drivers/soundwire/cadence_master.h
index e1d7969ba48a..c34fb050fe4f 100644
--- a/drivers/soundwire/cadence_master.h
+++ b/drivers/soundwire/cadence_master.h
@@ -168,6 +168,7 @@ int sdw_cdns_probe(struct sdw_cdns *cdns);
 irqreturn_t sdw_cdns_irq(int irq, void *dev_id);
 irqreturn_t sdw_cdns_thread(int irq, void *dev_id);
 
+int sdw_cdns_soft_reset(struct sdw_cdns *cdns);
 int sdw_cdns_init(struct sdw_cdns *cdns);
 int sdw_cdns_pdi_init(struct sdw_cdns *cdns,
 		      struct sdw_cdns_stream_config config);
diff --git a/drivers/soundwire/intel_bus_common.c b/drivers/soundwire/intel_bus_common.c
index d3ff6c65b64c..ad1f8ebdbfc9 100644
--- a/drivers/soundwire/intel_bus_common.c
+++ b/drivers/soundwire/intel_bus_common.c
@@ -16,6 +16,12 @@ int intel_start_bus(struct sdw_intel *sdw)
 	struct sdw_bus *bus = &cdns->bus;
 	int ret;
 
+	ret = sdw_cdns_soft_reset(cdns);
+	if (ret < 0) {
+		dev_err(dev, "%s: unable to soft-reset Cadence IP: %d\n", __func__, ret);
+		return ret;
+	}
+
 	/*
 	 * follow recommended programming flows to avoid timeouts when
 	 * gsync is enabled
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] soundwire: cadence: clear MCP BLOCK_WAKEUP in init
  2024-10-03  9:48 [PATCH 0/2] soundwire: cadence: programming flow corrections Bard Liao
  2024-10-03  9:48 ` [PATCH 1/2] soundwire: cadence: add soft-reset on startup Bard Liao
@ 2024-10-03  9:48 ` Bard Liao
  2024-10-10 12:16 ` [PATCH 0/2] soundwire: cadence: programming flow corrections Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Bard Liao @ 2024-10-03  9:48 UTC (permalink / raw)
  To: linux-sound, vkoul
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Follow recommended programming flows.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 drivers/soundwire/cadence_master.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 7c8c977a923a..f367670ea991 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -1425,6 +1425,11 @@ int sdw_cdns_init(struct sdw_cdns *cdns)
 	cdns_ip_updatel(cdns, CDNS_IP_MCP_CONTROL, CDNS_IP_MCP_CONTROL_CMD_ACCEPT,
 			CDNS_IP_MCP_CONTROL_CMD_ACCEPT);
 
+	/* disable wakeup */
+	cdns_ip_updatel(cdns, CDNS_IP_MCP_CONTROL,
+			CDNS_IP_MCP_CONTROL_BLOCK_WAKEUP,
+			0);
+
 	/* Configure mcp config */
 	val = cdns_readl(cdns, CDNS_MCP_CONFIG);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] soundwire: cadence: programming flow corrections
  2024-10-03  9:48 [PATCH 0/2] soundwire: cadence: programming flow corrections Bard Liao
  2024-10-03  9:48 ` [PATCH 1/2] soundwire: cadence: add soft-reset on startup Bard Liao
  2024-10-03  9:48 ` [PATCH 2/2] soundwire: cadence: clear MCP BLOCK_WAKEUP in init Bard Liao
@ 2024-10-10 12:16 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2024-10-10 12:16 UTC (permalink / raw)
  To: linux-sound, Bard Liao
  Cc: vinod.koul, linux-kernel, pierre-louis.bossart, bard.liao


On Thu, 03 Oct 2024 17:48:28 +0800, Bard Liao wrote:
> To follow the recommended programming flows.
> 
> Pierre-Louis Bossart (2):
>   soundwire: cadence: add soft-reset on startup
>   soundwire: cadence: clear MCP BLOCK_WAKEUP in init
> 
> drivers/soundwire/cadence_master.c   | 30 ++++++++++++++++++++++++++++
>  drivers/soundwire/cadence_master.h   |  1 +
>  drivers/soundwire/intel_bus_common.c |  6 ++++++
>  3 files changed, 37 insertions(+)
> 
> [...]

Applied, thanks!

[1/2] soundwire: cadence: add soft-reset on startup
      commit: 6124a4063b8083e4d973f60c09ddb7abdbabe57f
[2/2] soundwire: cadence: clear MCP BLOCK_WAKEUP in init
      commit: 830f1aa53c0287eae667fa5f0a690bec34a10a3f

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-10 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  9:48 [PATCH 0/2] soundwire: cadence: programming flow corrections Bard Liao
2024-10-03  9:48 ` [PATCH 1/2] soundwire: cadence: add soft-reset on startup Bard Liao
2024-10-03  9:48 ` [PATCH 2/2] soundwire: cadence: clear MCP BLOCK_WAKEUP in init Bard Liao
2024-10-10 12:16 ` [PATCH 0/2] soundwire: cadence: programming flow corrections Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox