[PATCH v5 4/6] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device

Jelly Jia Jelly.Jia at cixtech.com
Thu Nov 19 21:35:27 PST 2026


Register an auxiliary IRQ device for CRU nodes declaring an interrupt
controller, following the existing reset device pattern. Share a raw-lock
regmap with the IRQ driver so its hard IRQ callbacks can access the CRU.

Restore the parent before child IRQ delivery resumes using noirq
system-sleep ordering. Use the same PM callback macros as the IRQ driver.
Auxiliary child teardown must run before parent regmap/runtime-PM cleanup.
The existing reset-sky1-audss.c is unchanged.

Signed-off-by: Jelly Jia <Jelly.Jia at cixtech.com>
---
 drivers/clk/cix/clk-sky1-audss.c | 45 +++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/cix/clk-sky1-audss.c b/drivers/clk/cix/clk-sky1-audss.c
index 1da86f6def4f..34edd19bb95f 100644
--- a/drivers/clk/cix/clk-sky1-audss.c
+++ b/drivers/clk/cix/clk-sky1-audss.c
@@ -523,6 +523,7 @@ static const struct regmap_config sky1_audss_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
+	.use_raw_spinlock = true,
 };
 
 struct sky1_audss_clks_priv {
@@ -932,6 +933,31 @@ static int sky1_audss_clks_enable(struct sky1_audss_clks_priv *priv)
 	return err;
 }
 
+#if IS_ENABLED(CONFIG_IRQ_SKY1_AUDSS)
+
+static int sky1_audss_irq_controller_register(struct device *dev)
+{
+	struct auxiliary_device *adev;
+
+	if (!of_property_present(dev->of_node, "interrupt-controller"))
+		return 0;
+
+	adev = devm_auxiliary_device_create(dev, "irq", NULL);
+	if (!adev)
+		return -ENODEV;
+
+	return 0;
+}
+
+#else
+
+static int sky1_audss_irq_controller_register(struct device *dev)
+{
+	return 0;
+}
+
+#endif /* CONFIG_IRQ_SKY1_AUDSS */
+
 static void sky1_audss_clks_disable(struct sky1_audss_clks_priv *priv)
 {
 	const struct sky1_audss_clks_devtype_data *devtype_data = priv->devtype_data;
@@ -1114,6 +1140,13 @@ static int sky1_audss_clk_probe(struct platform_device *pdev)
 		goto fail_pm;
 	}
 
+	/* Remove auxiliary children before the parent runtime-PM cleanup. */
+	ret = sky1_audss_irq_controller_register(dev);
+	if (ret) {
+		dev_err_probe(dev, ret, "failed to set up AUDSS DMA IRQs\n");
+		goto fail_pm;
+	}
+
 	pm_runtime_put_sync(dev);
 
 	return 0;
@@ -1123,7 +1156,7 @@ static int sky1_audss_clk_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int __maybe_unused sky1_audss_clk_runtime_suspend(struct device *dev)
+static int sky1_audss_clk_runtime_suspend(struct device *dev)
 {
 	struct sky1_audss_clks_priv *priv = dev_get_drvdata(dev);
 	const struct sky1_audss_clks_devtype_data *devtype_data = priv->devtype_data;
@@ -1143,7 +1176,7 @@ static int __maybe_unused sky1_audss_clk_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused sky1_audss_clk_runtime_resume(struct device *dev)
+static int sky1_audss_clk_runtime_resume(struct device *dev)
 {
 	struct sky1_audss_clks_priv *priv = dev_get_drvdata(dev);
 	const struct sky1_audss_clks_devtype_data *devtype_data = priv->devtype_data;
@@ -1172,10 +1205,10 @@ static int __maybe_unused sky1_audss_clk_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops sky1_audss_clk_pm_ops = {
-	SET_RUNTIME_PM_OPS(sky1_audss_clk_runtime_suspend,
-			   sky1_audss_clk_runtime_resume, NULL)
-	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				pm_runtime_force_resume)
+	RUNTIME_PM_OPS(sky1_audss_clk_runtime_suspend,
+		       sky1_audss_clk_runtime_resume, NULL)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				  pm_runtime_force_resume)
 };
 
 static const struct sky1_audss_clks_devtype_data sky1_devtype_data = {
-- 
2.54.0




More information about the linux-arm-kernel mailing list