Message ID | 20230328094901.50763-1-cristian.ciocaltea@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2097230vqo; Tue, 28 Mar 2023 03:06:12 -0700 (PDT) X-Google-Smtp-Source: AKy350Yz+10MWJQtDGNFBJUpU+4UAhRM3HrFPUYZL6n6BiSuOOvVplYdy4KKO1duaCj3p2/L0Vij X-Received: by 2002:a17:906:144a:b0:944:394:93f7 with SMTP id q10-20020a170906144a00b00944039493f7mr8688708ejc.61.1679997972518; Tue, 28 Mar 2023 03:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679997972; cv=none; d=google.com; s=arc-20160816; b=VAGeW0peUjAIV8gicwG01W8wdv3PuxbNRj3ZiAUIHvLNfC0p7eCsceTLNgJ3vvGTw3 2xNBrQ2+bS2Skf1UR1j8iSr61/rQDecnU13KlTphE9Gc3qwvstCe05Nen7clYPcDjl58 MSs09x79HHvSj4tHTWXzKk7uRiBHMYOuVXJRvyFVfwYJsm+9+5bRyGP+kvJV5dtMZ3Vt tCdMYz9Vz3CKEZ5pyWl3wC0d5LZO0qy3c6WYHs8rRC9MFqSJKaoe2WBPdHU3NtSiDUA+ pYCxoWSKHZAvreZVsFD1AU7H4C4j389PxisokF4SSRNghxaISM725XSku7Fz3Zf7NG2P /9lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vhePFVqXOVqunZri9AjD1dJuToYnCj7tIFWvW7blzMI=; b=pWVZzb/FbSGzyEqlzvJe0RRapkku4i85/TR2RK0KAfnMhwNXBFsxHmKA95twKyQf3O dx8qFfnDGe5DokIiZYsapS2ieG3A2pNxrGHwzsSp5G57XtYcpjPjBliCamVyuSs7+6x7 WhxKAufsdkZtth0Vz827uw0ojC66W2yyMWcQdq5MAVvz1XCz/07r2EpL7Fup4OsS+Y1c +KsV2nli7aGtXiiyl99Sx6Prtq8+UVfJyGj8BfQmzvjbmB54h2GihStJQMAbWDO9Jb4Y 5RVGn/VWQp/+f6mPq5zeLa0Qlmv+vB0/htrVwhUL22dTRxbf3BAL67iGSGi6Uc1RgxEH uKPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VcXeONKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a17090611c600b008c7986cbd76si27781336eja.745.2023.03.28.03.05.49; Tue, 28 Mar 2023 03:06:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VcXeONKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233009AbjC1Jue (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 28 Mar 2023 05:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbjC1JuE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Mar 2023 05:50:04 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A2B6A62 for <linux-kernel@vger.kernel.org>; Tue, 28 Mar 2023 02:49:08 -0700 (PDT) Received: from localhost (unknown [188.24.133.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madras.collabora.co.uk (Postfix) with ESMTPSA id 099B9660313B; Tue, 28 Mar 2023 10:49:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1679996946; bh=tvwdoB9D+B+grzUkDaRMsZodsfqatGfdvkJIH90Q3x0=; h=From:To:Cc:Subject:Date:From; b=VcXeONKxGtgjVV1ohFWVXUPTtzQgKtyRCQY0iyS/y2g3wxS7Xj08zPk+gUfPV/jPw 2VzpE4j2GzbRQJeC/NjxDebmBf/mEhiazT6g22hKAJbK3kavZ3/uuX3QToEHV0pP5p hfpg+oY0mlsJsSsmulZZM12RPD7KzAp//VkXiV77GJ3Q92131OvaANhPHvdOVJHqdz 4aXWsjKVE3tWI3gOPeRPqZ2H+i1hlh1S0ueHfZoJBp0cFt6ei69MyUgzCON28NhPlI 2LlxjGvZ/wUW6yGkqwpQ602BXSDzIF3YZrDEeTL08RSO/UgSvLriZ3cBf8LtTd9jIU zVovuvuPORC6A== From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Hans de Goede <hdegoede@redhat.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH] ASoC: es8316: Handle optional IRQ assignment Date: Tue, 28 Mar 2023 12:49:01 +0300 Message-Id: <20230328094901.50763-1-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761605554289122552?= X-GMAIL-MSGID: =?utf-8?q?1761605554289122552?= |
Series |
ASoC: es8316: Handle optional IRQ assignment
|
|
Commit Message
Cristian Ciocaltea
March 28, 2023, 9:49 a.m. UTC
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>
---
sound/soc/codecs/es8316.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
Comments
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,
On Tue, 28 Mar 2023 12:49:01 +0300, 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: > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: es8316: Handle optional IRQ assignment commit: 39db65a0a17b54915b269d3685f253a4731f344c All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
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,