]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Add FDL-specific IRQ processing
authorMaciej Strozek <mstrozek@opensource.cirrus.com>
Mon, 20 Oct 2025 15:55:08 +0000 (16:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 27 Oct 2025 15:31:25 +0000 (15:31 +0000)
Hookup the XU IRQs required for the FDL process.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20251020155512.353774-16-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_interrupts.c

index d0894c8e0552c1303152249e6fe41f20583e266a..3a3b966b5782bdd03e1fb67d245678428557e5cf 100644 (file)
 #include <linux/soundwire/sdw.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <sound/sdca.h>
+#include <sound/sdca_fdl.h>
 #include <sound/sdca_function.h>
 #include <sound/sdca_interrupts.h>
+#include <sound/sdca_ump.h>
 #include <sound/soc-component.h>
 #include <sound/soc.h>
 
@@ -245,6 +247,29 @@ error:
        return irqret;
 }
 
+static irqreturn_t fdl_owner_handler(int irq, void *data)
+{
+       struct sdca_interrupt *interrupt = data;
+       struct device *dev = interrupt->dev;
+       irqreturn_t irqret = IRQ_NONE;
+       int ret;
+
+       ret = pm_runtime_get_sync(dev);
+       if (ret < 0) {
+               dev_err(dev, "failed to resume for fdl: %d\n", ret);
+               goto error;
+       }
+
+       ret = sdca_fdl_process(interrupt);
+       if (ret)
+               goto error;
+
+       irqret = IRQ_HANDLED;
+error:
+       pm_runtime_put(dev);
+       return irqret;
+}
+
 static int sdca_irq_request_locked(struct device *dev,
                                   struct sdca_interrupt_info *info,
                                   int sdca_irq, const char *name,
@@ -423,6 +448,15 @@ int sdca_irq_populate(struct sdca_function_data *function,
                                if (control->sel == SDCA_CTL_GE_DETECTED_MODE)
                                        handler = detected_mode_handler;
                                break;
+                       case SDCA_ENTITY_TYPE_XU:
+                               if (control->sel == SDCA_CTL_XU_FDL_CURRENTOWNER) {
+                                       ret = sdca_fdl_alloc_state(interrupt);
+                                       if (ret)
+                                               return ret;
+
+                                       handler = fdl_owner_handler;
+                               }
+                               break;
                        default:
                                break;
                        }