From: "Shuming [范書銘]" <shumingf@realtek.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"Flove(HsinFu)" <flove@realtek.com>,
"Oder Chiou" <oder_chiou@realtek.com>,
"Jack Yu" <jack.yu@realtek.com>,
"Derek [方德義]" <derek.fang@realtek.com>,
"pierre-louis.bossart@linux.dev" <pierre-louis.bossart@linux.dev>
Subject: RE: [PATCH v4] ASoC: rt766: add RT766/RT767 SDCA driver
Date: Tue, 4 Aug 2026 10:42:22 +0000 [thread overview]
Message-ID: <388eb77fd7144ba28ccb02d54e5ec5c9@realtek.com> (raw)
In-Reply-To: <anG/WjB5sCbaEEFC@opensource.cirrus.com>
> > This patch adds the initial SDCA multi-function codec driver for the RT766
> and RT767.
> >
> > Signed-off-by: Shuming Fan <shumingf@realtek.com>
> > ---
> > +static int rt766_sdca_irq_ctl(struct rt766_sdca_priv *rt766,
> > + struct
> sdca_function_data *function,
> > + struct
> snd_soc_component *component,
> > + struct
> sdca_interrupt_info *info,
> > + bool
> enabled)
> > +{
> > + struct device *dev = &rt766->slave->dev;
> > + struct sdca_interrupt *interrupt;
> > + struct sdca_control *control;
> > + struct sdca_entity *entity;
> > + irq_handler_t handler;
> > + int i, j, irq, ret;
> > +
> > + for (i = 0; i < function->num_entities; i++) {
> > + entity = &function->entities[i];
> > +
> > + for (j = 0; j < entity->num_controls; j++) {
> > + control = &entity->controls[j];
> > + irq = control->interrupt_position;
> > +
> > + switch (SDCA_CTL_TYPE(entity->type,
> control->sel)) {
> > + case SDCA_CTL_TYPE_S(GE, DETECTED_MODE):
> > + handler = rt766_sdca_irq_jd_handler;
> > + break;
> > + case SDCA_CTL_TYPE_S(HIDE,
> HIDTX_CURRENTOWNER):
> > + handler = rt766_sdca_irq_btn_handler;
> > + break;
> > + default:
> > + continue;
> > + }
> > +
> > + interrupt = &info->irqs[irq];
> > +
> > + if (enabled) {
> > + ret = sdca_irq_data_populate(dev,
> rt766->regmap, component,
> > +
> function, entity, control,
> > +
> interrupt);
> > + if (ret)
> > + return ret;
> > +
> > + interrupt->priv = rt766;
> > + ret = sdca_irq_request(dev, info, irq,
> interrupt->name,
> > +
> handler, interrupt);
> > + if (ret) {
> > + dev_err(dev, "failed to
> request irq %s: %d\n",
> > + interrupt->name,
> ret);
> > + sdca_irq_cleanup_late(dev,
> function, info);
> > + return ret;
> > + }
> > + dev_dbg(dev, "Requesting IRQ %d
> InterruptName=%s\n", irq, interrupt->name);
> > + } else {
> > + sdca_irq_free(dev, info, irq,
> interrupt->name, interrupt);
> > + dev_dbg(dev, "Freeing IRQ %d\n", irq);
>
> You can still leak the name here, if the machine driver was to
> call:
>
> rt766_sdca_set_jack_detect(component, jack, data);
> rt766_sdca_set_jack_detect(component, NULL, NULL);
> rt766_sdca_set_jack_detect(component, jack, data);
>
> I mean if we are happy that will never happen I guess its fine, but given we
> allow the machine driver to clear the IRQ seems wise to allow it to re-allocate
> it too.
Will fix, thanks for pointing it out.
> Thanks,
> Charles
prev parent reply other threads:[~2026-08-04 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 9:03 [PATCH v4] ASoC: rt766: add RT766/RT767 SDCA driver shumingf
2026-08-04 10:30 ` Charles Keepax
2026-08-04 10:42 ` Shuming [范書銘] [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=388eb77fd7144ba28ccb02d54e5ec5c9@realtek.com \
--to=shumingf@realtek.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=pierre-louis.bossart@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.