Re: [PATCH v3 2/4] ASoC: SDCA: Populate IRQ data earlier

From: Mark Brown

Date: Sun Jul 19 2026 - 09:24:38 EST


On Thu, Jul 16, 2026 at 03:26:37PM +0100, Charles Keepax wrote:
> Currently, the IRQ data (attached Entity/Control/etc) is populated
> as the IRQ is requested. However, this can cause issues as
> occasionally the setup process wants to access specifics of
> an IRQ before the IRQ is actually enabled. To facilitate this
> cache all the IRQ data during sdca_irq_populate_early() and make
> sdca_irq_populate() simply request the outstanding IRQs. This
> also has the advantage that sdca_irq_populate() can now just
> iterate through the IRQ array which is much smaller/faster than
> going through every Entity in the Function for Controls.

> --- a/sound/soc/sdca/sdca_interrupts.c
> +++ b/sound/soc/sdca/sdca_interrupts.c
> @@ -375,7 +375,7 @@ int sdca_irq_data_populate(struct device *dev, struct regmap *regmap,
> if (!dev)
> return -ENODEV;
>
> - name = kasprintf(GFP_KERNEL, "%s %s", entity->label, control->label);
> + name = devm_kasprintf(dev, GFP_KERNEL, "%s %s", entity->label, control->label);
> if (!name)
> return -ENOMEM;
>

Moving to devm_ makes me a bit nervous.

> @@ -448,21 +448,34 @@ int sdca_irq_populate_early(struct device *dev, struct regmap *regmap,

> + case SDCA_CTL_TYPE_S(GE, DETECTED_MODE):
> + ret = sdca_jack_alloc_state(interrupt);
> if (ret)
> return ret;
>
> + interrupt->handler = detected_mode_handler;
> + break;

> struct sdca_interrupt_info *info)
>

I'm a bit surprised there's no corresponding change in the cleanup path,
we're moving the allocation to the device driver not the card but the
card may be bound and unbound from the device. Perhaps I'm missing
something?

Attachment: signature.asc
Description: PGP signature