* [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path
@ 2026-11-17 9:44 Jelly Jia
2026-11-17 9:44 ` [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller Jelly Jia
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu
Hello,
This series adds the CIX Sky1 AUDSS DMA-350 interrupt path through the
audio subsystem CRU and restricts DMA channel registration using the
optional dma-channel-mask property. No audio client drivers are added.
DTS enablement is kept separate from this revision.
It depends on the companion v7 series, "dmaengine: arm-dma350: Add slave
support and Sky1 integration". Apply that series first.
The CRU gates eight DMA channel inputs onto a shared GIC interrupt.
Implement the irqchip as an auxiliary driver under drivers/irqchip/,
following the existing reset auxiliary device pattern. It shares the
parent regmap and the same CRU DT node; no new hardware node is needed.
The existing reset driver is unchanged.
There is no per-channel pending status in the gate register. Poll enabled
children using level flow handling with IRQ_IS_POLLED, retaining masking
for disabled and oneshot-threaded children. The domain's PM device is
the IRQ child. Its PM callbacks quiesce the parent IRQ around parent CRU
power transitions; shared clock, reset and register context remain with
the CRU driver. Use noirq ordering for system sleep and dispose mappings
before removing the domain. No sleepable resume runs in hard IRQ context.
Changes since v3:
- Move the IRQ implementation out of the clock subsystem into a separate
auxiliary irqchip driver; keep the parent-side registration and shared
CRU context in the clock driver. (Brian.)
- Simplify the interrupt-controller dependency with dependentRequired
and drop the redundant conditional #interrupt-cells requirement.
(Krzysztof.)
- Retain the channel-mask binding and its Reviewed-by; collect Frank's
Reviewed-by for the unchanged mask behaviour.
Previous version:
https://lore.kernel.org/r/20261106013520.1134450-1-Jelly.Jia@cixtech.com
Jelly Jia (5):
dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller
irqchip: Add the Sky1 AUDSS auxiliary interrupt controller
clk: cix: Register the Sky1 AUDSS IRQ auxiliary device
dt-bindings: dma: arm,dma-350: Document dma-channel-mask
dmaengine: arm-dma350: Honour dma-channel-mask
.../devicetree/bindings/dma/arm,dma-350.yaml | 3 +
.../bindings/soc/cix/cix,sky1-audss-cru.yaml | 31 ++-
MAINTAINERS | 1 +
drivers/clk/cix/clk-sky1-audss.c | 37 ++-
drivers/dma/arm-dma350.c | 16 +-
drivers/irqchip/Kconfig | 16 ++
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-sky1-audss.c | 255 ++++++++++++++++++
8 files changed, 354 insertions(+), 6 deletions(-)
create mode 100644 drivers/irqchip/irq-sky1-audss.c
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prerequisite-patch-id: aad1bc3c30a4825048143a3e0395e696201548e9
prerequisite-patch-id: 2e9d1a314d10e25bcd4e2285b36471200a9f17e6
prerequisite-patch-id: cf5b4f0b15f7e217ded422fa78c169653004d70b
prerequisite-patch-id: b1a307c60ed1189999dbae31770cc5e4afe569e0
prerequisite-patch-id: b78624ba53dce6857d20b65d3393ca5c77fd2c6e
prerequisite-patch-id: d19a15bf5a6aed8ab078eab07594dbdfd81bbcaf
prerequisite-patch-id: ac650cba94ae1fc52c25e6e1cf67e3af38cf92fa
prerequisite-patch-id: 53807c6c2b9d9deef242023baf70ac7e9f73a87b
prerequisite-patch-id: 62385082b538a0f354f44a70c2c251771238e047
prerequisite-patch-id: caf492d9e693ce5901d8c4512906258607b435a6
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
@ 2026-11-17 9:44 ` Jelly Jia
2026-11-17 9:44 ` [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller Jelly Jia
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu
The AUDSS CRU contains a separate AP interrupt gate for each of the eight
DMA-350 channels. The enabled inputs are combined onto one GIC interrupt.
These gates are part of the CRU register block, not the DMA controller.
Describe the CRU as an interrupt-controller in addition to its clock and
reset functions. A child interrupt specifier contains the DMA channel
index, matching the corresponding gate bit; the parent interrupt is the
combined GIC line.
Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
---
.../bindings/soc/cix/cix,sky1-audss-cru.yaml | 31 +++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/cix/cix,sky1-audss-cru.yaml b/Documentation/devicetree/bindings/soc/cix/cix,sky1-audss-cru.yaml
index 50dd0593e1d9..01fa22a5dd72 100644
--- a/Documentation/devicetree/bindings/soc/cix/cix,sky1-audss-cru.yaml
+++ b/Documentation/devicetree/bindings/soc/cix/cix,sky1-audss-cru.yaml
@@ -28,6 +28,12 @@ description: |
The SoC syscon NoC (or bus) reset is described via resets. The audio
subsystem power domain is described via power-domains.
+ The same register block contains the eight DMA-350 channel interrupt
+ gates at offset 0x54. When the node is an interrupt-controller, the
+ cell is the DMA channel index (0 through 7). The corresponding gate
+ bit is unmasked while that interrupt is requested, and the eight
+ inputs are combined onto the parent GIC interrupt.
+
properties:
compatible:
const: cix,sky1-audss-cru
@@ -45,6 +51,18 @@ properties:
description:
Reset indices are defined in include/dt-bindings/reset/cix,sky1-audss-cru.h.
+ interrupt-controller: true
+
+ '#interrupt-cells':
+ const: 1
+ description:
+ The cell is the DMA-350 channel index, 0 through 7.
+
+ interrupts:
+ maxItems: 1
+ description:
+ Combined DMA-350 channel interrupt after the CRU gates.
+
clocks:
items:
- description: I2S parent clock for sampling rates multiple of 8kHz.
@@ -75,18 +93,27 @@ required:
- power-domains
- resets
+dependentRequired:
+ interrupt-controller: [ interrupts ]
+
additionalProperties: false
examples:
- |
- audss_cru: clock-controller@7110000 {
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ clock-controller@7110000 {
compatible = "cix,sky1-audss-cru";
reg = <0x7110000 0x10000>;
#clock-cells = <1>;
- #reset-cells = <1>;
clocks = <&scmi_clk 76>, <&scmi_clk 78>,
<&scmi_clk 70>, <&scmi_clk 71>;
clock-names = "x8k", "x11k", "sys", "48m";
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ interrupts = <GIC_SPI 230 IRQ_TYPE_LEVEL_HIGH 0>;
power-domains = <&smc_devpd 0>;
+ #reset-cells = <1>;
resets = <&s5_syscon 31>;
};
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
2026-11-17 9:44 ` [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller Jelly Jia
@ 2026-11-17 9:44 ` Jelly Jia
2026-11-17 9:44 ` [PATCH v4 3/5] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device Jelly Jia
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu
The AUDSS CRU gates eight DMA channel interrupts onto a shared parent line.
Implement its irqchip, domain and chained handler in an auxiliary driver
under drivers/irqchip rather than the clock subsystem.
Reuse the parent CRU regmap and firmware node. Retain level/polled child
flow, explicit disable masking, mapping disposal and powered teardown. Keep
clock/reset control in the parent. Coordinate the parent IRQ's quiescing
with runtime PM and noirq system sleep, keeping sleepable power management
out of hard IRQ callbacks.
Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
---
MAINTAINERS | 1 +
drivers/irqchip/Kconfig | 16 ++
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-sky1-audss.c | 255 +++++++++++++++++++++++++++++++
4 files changed, 273 insertions(+)
create mode 100644 drivers/irqchip/irq-sky1-audss.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 93abbb315065..bd966600deb0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2904,6 +2904,7 @@ T: git https://github.com/cixtech/linux-mainline.git
F: Documentation/devicetree/bindings/arm/cix.yaml
F: Documentation/devicetree/bindings/mailbox/cix,sky1-mbox.yaml
F: arch/arm64/boot/dts/cix/
+F: drivers/irqchip/irq-sky1-audss.c
F: drivers/mailbox/cix-mailbox.c
K: \bcix\b
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 136bab41f801..1275622851c1 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -233,6 +233,22 @@ config LAN966X_OIC
config MADERA_IRQ
tristate
+config IRQ_SKY1_AUDSS
+ tristate "CIX Sky1 AUDSS DMA interrupt controller"
+ depends on ARCH_CIX || COMPILE_TEST
+ depends on OF
+ select AUXILIARY_BUS
+ select IRQ_DOMAIN
+ select REGMAP
+ default CLK_SKY1_AUDSS
+ help
+ Support the DMA channel interrupt gates in the CIX Sky1 audio
+ subsystem CRU. This auxiliary driver shares the clock controller's
+ register map and combines the channel interrupts onto a parent IRQ.
+
+ To compile this driver as a module, choose M here: the module will
+ be called irq-sky1-audss.
+
config IRQ_MIPS_CPU
bool
select GENERIC_IRQ_CHIP
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 16a5fd126c9a..2862a0335082 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_IRQCHIP) += irqchip.o
+obj-$(CONFIG_IRQ_SKY1_AUDSS) += irq-sky1-audss.o
obj-$(CONFIG_AL_FIC) += irq-al-fic.o
obj-$(CONFIG_ALPINE_MSI) += irq-alpine-msi.o
diff --git a/drivers/irqchip/irq-sky1-audss.c b/drivers/irqchip/irq-sky1-audss.c
new file mode 100644
index 000000000000..df2063f0d771
--- /dev/null
+++ b/drivers/irqchip/irq-sky1-audss.c
@@ -0,0 +1,255 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright 2026 Cix Technology Group Co., Ltd. */
+
+#include <linux/auxiliary_bus.h>
+#include <linux/bitops.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/irqdomain.h>
+#include <linux/module.h>
+#include <linux/of_irq.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/slab.h>
+
+#define INFO_AP_IRQC 0x54
+#define INFO_AP_IRQC_DMAC_MASK GENMASK(7, 0)
+#define SKY1_AUDSS_DMAC_IRQS 8
+
+struct sky1_audss_irq {
+ struct regmap *regmap;
+ struct irq_domain *domain;
+ int parent_irq;
+};
+
+static void sky1_audss_irq_mask(struct irq_data *d)
+{
+ struct sky1_audss_irq *priv = irq_data_get_irq_chip_data(d);
+
+ regmap_update_bits(priv->regmap, INFO_AP_IRQC, BIT(d->hwirq), 0);
+}
+
+static void sky1_audss_irq_unmask(struct irq_data *d)
+{
+ struct sky1_audss_irq *priv = irq_data_get_irq_chip_data(d);
+
+ regmap_update_bits(priv->regmap, INFO_AP_IRQC,
+ BIT(d->hwirq), BIT(d->hwirq));
+}
+
+static int sky1_audss_irq_request_resources(struct irq_data *d)
+{
+ return try_module_get(THIS_MODULE) ? 0 : -ENODEV;
+}
+
+static void sky1_audss_irq_release_resources(struct irq_data *d)
+{
+ module_put(THIS_MODULE);
+}
+
+static struct irq_chip sky1_audss_irq_chip = {
+ .name = "sky1-audss-dmac",
+ .irq_mask = sky1_audss_irq_mask,
+ .irq_unmask = sky1_audss_irq_unmask,
+ .irq_disable = sky1_audss_irq_mask,
+ .irq_request_resources = sky1_audss_irq_request_resources,
+ .irq_release_resources = sky1_audss_irq_release_resources,
+ .flags = IRQCHIP_SKIP_SET_WAKE,
+};
+
+static int sky1_audss_irq_map(struct irq_domain *d, unsigned int irq,
+ irq_hw_number_t hwirq)
+{
+ if (hwirq >= SKY1_AUDSS_DMAC_IRQS)
+ return -EINVAL;
+
+ irq_set_chip_data(irq, d->host_data);
+ irq_set_chip_and_handler(irq, &sky1_audss_irq_chip, handle_level_irq);
+ /*
+ * There is no per-channel pending status in the CRU. Poll enabled
+ * children without spurious-IRQ accounting, but retain level flow
+ * control so disabled and oneshot-threaded children stay masked.
+ */
+ irq_set_status_flags(irq, IRQ_LEVEL | IRQ_IS_POLLED);
+ irq_set_noprobe(irq);
+
+ return 0;
+}
+
+static const struct irq_domain_ops sky1_audss_irq_ops = {
+ .map = sky1_audss_irq_map,
+ .xlate = irq_domain_xlate_onecell,
+};
+
+static void sky1_audss_irq_handler(struct irq_desc *desc)
+{
+ struct sky1_audss_irq *priv = irq_desc_get_handler_data(desc);
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+ unsigned long enabled;
+ unsigned int hwirq;
+ u32 val;
+
+ chained_irq_enter(chip, desc);
+
+ if (!regmap_read(priv->regmap, INFO_AP_IRQC, &val)) {
+ enabled = val & INFO_AP_IRQC_DMAC_MASK;
+ for_each_set_bit(hwirq, &enabled, SKY1_AUDSS_DMAC_IRQS)
+ generic_handle_domain_irq(priv->domain, hwirq);
+ }
+
+ chained_irq_exit(chip, desc);
+}
+
+static int sky1_audss_irq_runtime_suspend(struct device *dev)
+{
+ struct sky1_audss_irq *priv = dev_get_drvdata(dev);
+
+ /* The parent CRU may turn its clocks off after the child suspends. */
+ disable_irq(priv->parent_irq);
+
+ return 0;
+}
+
+static int sky1_audss_irq_runtime_resume(struct device *dev)
+{
+ struct sky1_audss_irq *priv = dev_get_drvdata(dev);
+
+ /* Parent resume has already restored the CRU registers. */
+ enable_irq(priv->parent_irq);
+
+ return 0;
+}
+
+static const struct dev_pm_ops sky1_audss_irq_pm_ops = {
+ RUNTIME_PM_OPS(sky1_audss_irq_runtime_suspend,
+ sky1_audss_irq_runtime_resume, NULL)
+ NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+ pm_runtime_force_resume)
+};
+
+static int sky1_audss_irq_probe(struct auxiliary_device *adev,
+ const struct auxiliary_device_id *id)
+{
+ struct device *dev = &adev->dev;
+ struct sky1_audss_irq *priv;
+ int ret;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->regmap = dev_get_regmap(dev->parent, NULL);
+ if (!priv->regmap)
+ return dev_err_probe(dev, -ENODEV, "failed to get CRU regmap\n");
+
+ priv->parent_irq = of_irq_get(dev->of_node, 0);
+ if (priv->parent_irq < 0)
+ return dev_err_probe(dev, priv->parent_irq,
+ "failed to get parent IRQ\n");
+ if (!priv->parent_irq)
+ return -EINVAL;
+
+ ret = pm_runtime_resume_and_get(dev->parent);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to resume CRU\n");
+
+ ret = regmap_update_bits(priv->regmap, INFO_AP_IRQC,
+ INFO_AP_IRQC_DMAC_MASK, 0);
+ if (ret)
+ goto out_put_parent;
+
+ dev_set_drvdata(dev, priv);
+ pm_runtime_get_noresume(dev);
+ ret = pm_runtime_set_active(dev);
+ if (ret)
+ goto out_put_child;
+ pm_runtime_enable(dev);
+
+ priv->domain = irq_domain_create_linear(dev_fwnode(dev),
+ SKY1_AUDSS_DMAC_IRQS,
+ &sky1_audss_irq_ops, priv);
+ if (!priv->domain) {
+ ret = -ENOMEM;
+ goto out_disable_pm;
+ }
+ irq_domain_set_pm_device(priv->domain, dev);
+
+ /* A chained handler cannot implement lazy-disable masking. */
+ irq_set_status_flags(priv->parent_irq, IRQ_DISABLE_UNLAZY);
+ irq_set_chained_handler_and_data(priv->parent_irq,
+ sky1_audss_irq_handler, priv);
+
+ pm_runtime_put_sync(dev);
+ pm_runtime_put_sync(dev->parent);
+
+ return 0;
+
+out_disable_pm:
+ pm_runtime_disable(dev);
+ pm_runtime_set_suspended(dev);
+out_put_child:
+ pm_runtime_put_noidle(dev);
+out_put_parent:
+ pm_runtime_put_sync(dev->parent);
+ return ret;
+}
+
+static void sky1_audss_irq_remove(struct auxiliary_device *adev)
+{
+ struct device *dev = &adev->dev;
+ struct sky1_audss_irq *priv = dev_get_drvdata(dev);
+ unsigned int hwirq;
+ unsigned int virq;
+ int ret;
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ dev_warn(dev, "failed to resume CRU for IRQ teardown: %d\n", ret);
+
+ disable_irq(priv->parent_irq);
+ if (ret >= 0)
+ regmap_update_bits(priv->regmap, INFO_AP_IRQC,
+ INFO_AP_IRQC_DMAC_MASK, 0);
+ irq_set_chained_handler_and_data(priv->parent_irq, NULL, NULL);
+ synchronize_irq(priv->parent_irq);
+ irq_clear_status_flags(priv->parent_irq, IRQ_DISABLE_UNLAZY);
+
+ for (hwirq = 0; hwirq < SKY1_AUDSS_DMAC_IRQS; hwirq++) {
+ virq = irq_find_mapping(priv->domain, hwirq);
+ if (!virq)
+ continue;
+
+ /* Disassociation must not access an unpowered CRU either. */
+ if (ret < 0)
+ irq_set_chip(virq, NULL);
+ irq_dispose_mapping(virq);
+ }
+ irq_domain_remove(priv->domain);
+
+ pm_runtime_disable(dev);
+ if (ret >= 0)
+ pm_runtime_put_noidle(dev);
+ pm_runtime_set_suspended(dev);
+}
+
+static const struct auxiliary_device_id sky1_audss_irq_ids[] = {
+ { .name = "clk_sky1_audss.irq" },
+ { }
+};
+MODULE_DEVICE_TABLE(auxiliary, sky1_audss_irq_ids);
+
+static struct auxiliary_driver sky1_audss_irq_driver = {
+ .probe = sky1_audss_irq_probe,
+ .remove = sky1_audss_irq_remove,
+ .id_table = sky1_audss_irq_ids,
+ .driver = {
+ .pm = pm_ptr(&sky1_audss_irq_pm_ops),
+ .suppress_bind_attrs = true,
+ },
+};
+module_auxiliary_driver(sky1_audss_irq_driver);
+
+MODULE_AUTHOR("Jelly Jia <Jelly.Jia@cixtech.com>");
+MODULE_DESCRIPTION("CIX Sky1 AUDSS DMA interrupt controller");
+MODULE_LICENSE("GPL");
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 3/5] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
2026-11-17 9:44 ` [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller Jelly Jia
2026-11-17 9:44 ` [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller Jelly Jia
@ 2026-11-17 9:44 ` Jelly Jia
2026-11-17 9:44 ` [PATCH v4 4/5] dt-bindings: dma: arm,dma-350: Document dma-channel-mask Jelly Jia
2026-11-17 9:44 ` [PATCH v4 5/5] dmaengine: arm-dma350: Honour dma-channel-mask Jelly Jia
4 siblings, 0 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu
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 and preserve gate/reset context while powering
down the CRU. Restore the parent before child IRQ delivery resumes using
noirq system-sleep ordering.
The existing reset-sky1-audss.c is unchanged. Auxiliary child teardown must
run before parent regmap/runtime-PM cleanup.
Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
---
drivers/clk/cix/clk-sky1-audss.c | 37 +++++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/cix/clk-sky1-audss.c b/drivers/clk/cix/clk-sky1-audss.c
index e096b8121df3..fa51cdf4f4bd 100644
--- a/drivers/clk/cix/clk-sky1-audss.c
+++ b/drivers/clk/cix/clk-sky1-audss.c
@@ -2,6 +2,7 @@
// Copyright 2026 Cix Technology Group Co., Ltd.
#include <linux/auxiliary_bus.h>
+#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/device.h>
@@ -18,7 +19,9 @@
#define INFO_CLK_GATE 0x10
#define INFO_CLK_DIV 0x14
#define INFO_CLK_MUX 0x18
+#define INFO_AP_IRQC 0x54
#define INFO_MCLK 0x70
+#define INFO_SW_RESETN 0x78
#define SKY1_AUDSS_CLK_PARENTS_CNT 4
#define SKY1_AUDSS_NUM_CLKS (CLK_MCLK4 + 1)
@@ -28,7 +31,9 @@ static u32 sky1_reg_save[][2] = {
{ INFO_CLK_GATE, 0 },
{ INFO_CLK_DIV, 0 },
{ INFO_CLK_MUX, 0 },
+ { INFO_AP_IRQC, 0 },
{ INFO_MCLK, 0 },
+ { INFO_SW_RESETN, 0 },
};
static const char * const sky1_audss_clk_names[SKY1_AUDSS_CLK_PARENTS_CNT] = {
@@ -519,6 +524,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 {
@@ -928,6 +934,21 @@ static int sky1_audss_clks_enable(struct sky1_audss_clks_priv *priv)
return err;
}
+static int sky1_audss_irq_controller_register(struct device *dev)
+{
+ struct auxiliary_device *adev;
+
+ if (!IS_ENABLED(CONFIG_IRQ_SKY1_AUDSS) ||
+ !of_property_present(dev->of_node, "interrupt-controller"))
+ return 0;
+
+ adev = devm_auxiliary_device_create(dev, "irq", NULL);
+ if (!adev)
+ return -ENODEV;
+
+ return 0;
+}
+
static void sky1_audss_clks_disable(struct sky1_audss_clks_priv *priv)
{
const struct sky1_audss_clks_devtype_data *devtype_data = priv->devtype_data;
@@ -1110,6 +1131,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;
@@ -1125,6 +1153,7 @@ static int __maybe_unused sky1_audss_clk_runtime_suspend(struct device *dev)
const struct sky1_audss_clks_devtype_data *devtype_data = priv->devtype_data;
unsigned long flags;
int i;
+ int ret;
spin_lock_irqsave(&priv->lock, flags);
for (i = 0; i < devtype_data->reg_save_size; i++)
@@ -1132,7 +1161,9 @@ static int __maybe_unused sky1_audss_clk_runtime_suspend(struct device *dev)
devtype_data->reg_save[i][0], &devtype_data->reg_save[i][1]);
spin_unlock_irqrestore(&priv->lock, flags);
- reset_control_assert(priv->rst_noc);
+ ret = reset_control_assert(priv->rst_noc);
+ if (ret)
+ return ret;
sky1_audss_clks_disable(priv);
@@ -1170,8 +1201,8 @@ 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)
+ SET_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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 4/5] dt-bindings: dma: arm,dma-350: Document dma-channel-mask
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
` (2 preceding siblings ...)
2026-11-17 9:44 ` [PATCH v4 3/5] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device Jelly Jia
@ 2026-11-17 9:44 ` Jelly Jia
2026-11-17 9:44 ` [PATCH v4 5/5] dmaengine: arm-dma350: Honour dma-channel-mask Jelly Jia
4 siblings, 0 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu,
Krzysztof Kozlowski
Some DMA-350 integrations reserve channels for firmware or another
processor. Allow the standard dma-channel-mask property so firmware can
describe which channels Linux may use.
DMA-350 implements at most eight channels, so one 32-bit cell is enough;
limit the property to a single cell.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
---
Documentation/devicetree/bindings/dma/arm,dma-350.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/dma/arm,dma-350.yaml b/Documentation/devicetree/bindings/dma/arm,dma-350.yaml
index eab3b31aeba7..59f3b59b47f5 100644
--- a/Documentation/devicetree/bindings/dma/arm,dma-350.yaml
+++ b/Documentation/devicetree/bindings/dma/arm,dma-350.yaml
@@ -47,6 +47,9 @@ properties:
description:
Optional reset line, where the integration exposes one.
+ dma-channel-mask:
+ maxItems: 1
+
required:
- compatible
- reg
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 5/5] dmaengine: arm-dma350: Honour dma-channel-mask
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
` (3 preceding siblings ...)
2026-11-17 9:44 ` [PATCH v4 4/5] dt-bindings: dma: arm,dma-350: Document dma-channel-mask Jelly Jia
@ 2026-11-17 9:44 ` Jelly Jia
4 siblings, 0 replies; 6+ messages in thread
From: Jelly Jia @ 2026-11-17 9:44 UTC (permalink / raw)
To: vkoul, Frank.Li, robh, krzk+dt, conor+dt, robin.murphy, sboyd,
bmasney+clk, jbrunet+clk, tglx
Cc: devicetree, cix-kernel-upstream, dmaengine, linux-arm-kernel,
linux-kernel, Jelly.Jia, linux-clk, joakim.zhang, radu, Frank Li
DMA-350 channels may be reserved for firmware or another processor.
Read the optional dma-channel-mask property and register only the channels
whose bits are set. If the property is absent, preserve the existing
behaviour and expose every hardware channel.
Skip masked channels before accessing their channel registers or
initializing their interrupts and virt-dma state. This avoids clearing
or configuring channels reserved for firmware or another processor.
DMA-350 supports at most eight channels, so a single u32 covers every
hardware channel without an additional 32-channel guard.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Jelly Jia <Jelly.Jia@cixtech.com>
---
drivers/dma/arm-dma350.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
index ab68213d0bbb..4d3391248378 100644
--- a/drivers/dma/arm-dma350.c
+++ b/drivers/dma/arm-dma350.c
@@ -18,6 +18,7 @@
#include <linux/of_dma.h>
#include <linux/overflow.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/reset.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
@@ -1276,9 +1277,10 @@ static int d350_probe(struct platform_device *pdev)
struct clk *clk;
struct d350 *dmac;
void __iomem *base;
+ u32 chan_mask = U32_MAX;
u32 reg;
int ret, nchan, dw, aw, r, p;
- bool coherent, memset;
+ bool coherent, has_chan_mask, memset;
clk = devm_clk_get_optional_enabled(dev, NULL);
if (IS_ERR(clk))
@@ -1351,6 +1353,15 @@ static int d350_probe(struct platform_device *pdev)
dmac->dma.device_caps = d350_device_caps;
INIT_LIST_HEAD(&dmac->dma.channels);
+ /* Firmware-reserved channels must not be accessed or registered. */
+ has_chan_mask = device_property_present(dev, "dma-channel-mask");
+ if (has_chan_mask) {
+ ret = device_property_read_u32(dev, "dma-channel-mask", &chan_mask);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to read dma-channel-mask\n");
+ }
+
reg = readl_relaxed(base + DMANSECCTRL + NSEC_CTRL);
writel_relaxed(reg | INTREN_ANYCHINTR_EN,
base + DMANSECCTRL + NSEC_CTRL);
@@ -1360,6 +1371,9 @@ static int d350_probe(struct platform_device *pdev)
for (int i = 0; i < nchan; i++) {
struct d350_chan *dch = &dmac->channels[i];
+ if (has_chan_mask && !(chan_mask & BIT(i)))
+ continue;
+
dch->base = base + DMACH(i);
writel_relaxed(CH_CMD_CLEAR, dch->base + CH_CMD);
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-17 9:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
2026-11-17 9:44 ` [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller Jelly Jia
2026-11-17 9:44 ` [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller Jelly Jia
2026-11-17 9:44 ` [PATCH v4 3/5] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device Jelly Jia
2026-11-17 9:44 ` [PATCH v4 4/5] dt-bindings: dma: arm,dma-350: Document dma-channel-mask Jelly Jia
2026-11-17 9:44 ` [PATCH v4 5/5] dmaengine: arm-dma350: Honour dma-channel-mask Jelly Jia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®