From: Hans de Goede <hdegoede@redhat.com>
To: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
kernel@collabora.com
Subject: Re: [PATCH] ASoC: es8316: Handle optional IRQ assignment
Date: Tue, 28 Mar 2023 12:15:02 +0200 [thread overview]
Message-ID: <ae65a407-9c39-c48a-0cb9-44b3eacda410@redhat.com> (raw)
In-Reply-To: <20230328094901.50763-1-cristian.ciocaltea@collabora.com>
Hi,
On 3/28/23 11:49, Cristian Ciocaltea wrote:
> The driver is able to work fine without relying on a mandatory interrupt
> being assigned to the I2C device. This is only needed when making use of
> the jack-detect support.
>
> However, the following warning message is always emitted when there is
> no such interrupt available:
>
> es8316 0-0011: Failed to get IRQ 0: -22
>
> Do not attempt to request an IRQ if it is not available/valid. This also
> ensures the rather misleading message is not displayed anymore.
>
> Also note the IRQ validation relies on commit dab472eb931bc291 ("i2c /
> ACPI: Use 0 to indicate that device does not have interrupt assigned").
>
> Fixes: 822257661031 ("ASoC: es8316: Add jack-detect support")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> sound/soc/codecs/es8316.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
> index 056c3082fe02..f7d7a9c91e04 100644
> --- a/sound/soc/codecs/es8316.c
> +++ b/sound/soc/codecs/es8316.c
> @@ -842,12 +842,14 @@ static int es8316_i2c_probe(struct i2c_client *i2c_client)
> es8316->irq = i2c_client->irq;
> mutex_init(&es8316->lock);
>
> - ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq,
> - IRQF_TRIGGER_HIGH | IRQF_ONESHOT | IRQF_NO_AUTOEN,
> - "es8316", es8316);
> - if (ret) {
> - dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret);
> - es8316->irq = -ENXIO;
> + if (es8316->irq > 0) {
> + ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq,
> + IRQF_TRIGGER_HIGH | IRQF_ONESHOT | IRQF_NO_AUTOEN,
> + "es8316", es8316);
> + if (ret) {
> + dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret);
> + es8316->irq = -ENXIO;
> + }
> }
>
> return devm_snd_soc_register_component(&i2c_client->dev,
next prev parent reply other threads:[~2023-03-28 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 9:49 Cristian Ciocaltea
2023-03-28 10:15 ` Hans de Goede [this message]
2023-03-28 15:52 ` Mark Brown
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=ae65a407-9c39-c48a-0cb9-44b3eacda410@redhat.com \
--to=hdegoede@redhat.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cristian.ciocaltea@collabora.com \
--cc=kernel@collabora.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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 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®