Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: es8316: Handle optional IRQ assignment

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>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230328094901.50763-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Cristian Ciocaltea and committed by
Mark Brown
39db65a0 d23d50de

+8 -6
+8 -6
sound/soc/codecs/es8316.c
··· 842 842 es8316->irq = i2c_client->irq; 843 843 mutex_init(&es8316->lock); 844 844 845 - ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq, 846 - IRQF_TRIGGER_HIGH | IRQF_ONESHOT | IRQF_NO_AUTOEN, 847 - "es8316", es8316); 848 - if (ret) { 849 - dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret); 850 - es8316->irq = -ENXIO; 845 + if (es8316->irq > 0) { 846 + ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq, 847 + IRQF_TRIGGER_HIGH | IRQF_ONESHOT | IRQF_NO_AUTOEN, 848 + "es8316", es8316); 849 + if (ret) { 850 + dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret); 851 + es8316->irq = -ENXIO; 852 + } 851 853 } 852 854 853 855 return devm_snd_soc_register_component(&i2c_client->dev,