From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A4F7C433DB for ; Mon, 18 Jan 2021 13:04:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EEFD522B49 for ; Mon, 18 Jan 2021 13:04:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEFD522B49 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3DC3F17F6; Mon, 18 Jan 2021 14:03:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3DC3F17F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1610975047; bh=RbUnzS/4nrd4iAPnXubrFVzey/trFbxTEw8uynBL4vo=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=foKSummemBHQ7Vlnsx4q8++4Nf6jVRaPzwRNq0+Mt7A/bcv5srIrqUu6N2+/qNbgy 7FypZWArRfs9caMJIPh+00/TVsH8RGUfQc7KjffEVvmiTmm+O8pqHYiRKYNNigjypj OFvPA+BZWkPslP4xHCeeZu6OYzDn1Vr3G8CxgAYc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B518FF80166; Mon, 18 Jan 2021 14:03:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29653F80166; Mon, 18 Jan 2021 14:03:15 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 63EBAF800C0 for ; Mon, 18 Jan 2021 14:03:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 63EBAF800C0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="URept8pF" Received: by mail.kernel.org (Postfix) with ESMTPSA id E0B2722571; Mon, 18 Jan 2021 13:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610974984; bh=RbUnzS/4nrd4iAPnXubrFVzey/trFbxTEw8uynBL4vo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=URept8pFVDB9rwLoEwDMKPFgawKQQErcGW+41JY9ajp9+488Qm62OqabuqQXQayyM AWv1aDQVmufIWjRqhW6SYCN1zq+Z/RMy1S+5tfVEZwFv6MGqVCSqPlFLE1DzKSNqct gTErdRypZnsa4alg1jpx5XVVP0zUGUjXEuLthu8jLLhsQkoAee1gMh9oOGsD/VT2US DqDxxdD6BrDsHt+Y8dO9xNnFATFZpRVgHLW50hDgslMDU2rnAtTHvklw544Q8xCq84 IJDPbfbAcynYwCtHLwv6hLnvKIblOsY7+ASWQxUZ1g1nQmrjyBMxrB2DBGQqAFXFyv 50n/WYEB4CCaQ== Date: Mon, 18 Jan 2021 13:02:27 +0000 From: Mark Brown To: Hans de Goede Subject: Re: [PATCH v3 3/5] mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI Message-ID: <20210118130227.GI4455@sirena.org.uk> References: <20210117212252.206115-1-hdegoede@redhat.com> <20210117212252.206115-4-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CNK/L7dwKXQ4Ub8J" Content-Disposition: inline In-Reply-To: <20210117212252.206115-4-hdegoede@redhat.com> X-Cookie: Huh? User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Cezary Rojewski , Charles Keepax , Christian Hartmann , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, Jie Yang , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Liam Girdwood , Andy Shevchenko , Lee Jones X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" --CNK/L7dwKXQ4Ub8J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 17, 2021 at 10:22:50PM +0100, Hans de Goede wrote: > + /* > + * Some DSDTs wrongly declare the IRQ trigger-type as IRQF_TRIGGER_FALL= ING > + * The IRQ line will stay low when a new IRQ event happens between read= ing > + * the IRQ status flags and acknowledging them. When the IRQ line stays > + * low like this the IRQ will never trigger again when its type is set > + * to IRQF_TRIGGER_FALLING. Correct the IRQ trigger-type to fix this. > + */ > + arizona->pdata.irq_flags =3D IRQF_TRIGGER_LOW; Are you sure that all the relevant interrupt controllers support active low interrupts? There were issues on some systems with missing support for active low interrupts (see the bodge in wm8994-irq.c to work around them) - it's entirely likely that there are DSDTs that are just plain buggy here but if someone's copying and pasting it smells like there may be some systems that actually need an edge triggered interrupt that they're getting it from. > + > + /* Wait 200 ms after jack insertion */ > + arizona->pdata.micd_detect_debounce =3D 200; > + > + /* Use standard AOSP values for headset-button mappings */ > + arizona->pdata.micd_ranges =3D arizona_micd_aosp_ranges; > + arizona->pdata.num_micd_ranges =3D ARRAY_SIZE(arizona_micd_aosp_ranges); > + > + return 0; > +} > + > +static const struct acpi_device_id arizona_acpi_match[] =3D { > + { > + .id =3D "WM510204", > + .driver_data =3D WM5102, > + }, > + { > + .id =3D "WM510205", > + .driver_data =3D WM5102, > + }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, arizona_acpi_match); > +#else > +static int arizona_spi_acpi_probe(struct arizona *arizona) > +{ > + return -ENODEV; > +} > +#endif > + > static int arizona_spi_probe(struct spi_device *spi) > { > const struct spi_device_id *id =3D spi_get_device_id(spi); > @@ -77,6 +191,12 @@ static int arizona_spi_probe(struct spi_device *spi) > arizona->dev =3D &spi->dev; > arizona->irq =3D spi->irq; > =20 > + if (has_acpi_companion(&spi->dev)) { > + ret =3D arizona_spi_acpi_probe(arizona); > + if (ret) > + return ret; > + } > + > return arizona_dev_init(arizona); > } > =20 > @@ -104,6 +224,7 @@ static struct spi_driver arizona_spi_driver =3D { > .name =3D "arizona", > .pm =3D &arizona_pm_ops, > .of_match_table =3D of_match_ptr(arizona_of_match), > + .acpi_match_table =3D ACPI_PTR(arizona_acpi_match), > }, > .probe =3D arizona_spi_probe, > .remove =3D arizona_spi_remove, > --=20 > 2.28.0 >=20 --CNK/L7dwKXQ4Ub8J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmAFhuIACgkQJNaLcl1U h9DDuQf+K/1+R35NC7d0uVDYwSsGKNopg9Q3xtbFzKERm2cKHfqao/bdeSkrbhhD kSUm+L9X1I/LHkGzdao5920MXJ9gmzbIeolpSH6ygVv8KZ7odJPV+H+Bkly+ZTe7 ZRAoBiuUFSVpe/3lZV7YBMlbH1j8U8lIeJ3SFPzz0dokrgezToTeBJopK/kI1z7k 7GHKPF00b/CDy2A5abeXIE7pn2fUwVascc95pz9aVgtO638joDZiczuKmlrOiv/v g83/Wc36+jmZqVR7ptTGKXK6KyQzScNYlTWCnZBeWzkhx3KE0PAe1Ez2kyozu6Vw wG3vYuzhX/7yelouc25AU/i3lruPkQ== =lhY6 -----END PGP SIGNATURE----- --CNK/L7dwKXQ4Ub8J-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1890C433E0 for ; Mon, 18 Jan 2021 13:06:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A68C922BF3 for ; Mon, 18 Jan 2021 13:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404156AbhARNG2 (ORCPT ); Mon, 18 Jan 2021 08:06:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:57632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391961AbhARNDp (ORCPT ); Mon, 18 Jan 2021 08:03:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0B2722571; Mon, 18 Jan 2021 13:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610974984; bh=RbUnzS/4nrd4iAPnXubrFVzey/trFbxTEw8uynBL4vo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=URept8pFVDB9rwLoEwDMKPFgawKQQErcGW+41JY9ajp9+488Qm62OqabuqQXQayyM AWv1aDQVmufIWjRqhW6SYCN1zq+Z/RMy1S+5tfVEZwFv6MGqVCSqPlFLE1DzKSNqct gTErdRypZnsa4alg1jpx5XVVP0zUGUjXEuLthu8jLLhsQkoAee1gMh9oOGsD/VT2US DqDxxdD6BrDsHt+Y8dO9xNnFATFZpRVgHLW50hDgslMDU2rnAtTHvklw544Q8xCq84 IJDPbfbAcynYwCtHLwv6hLnvKIblOsY7+ASWQxUZ1g1nQmrjyBMxrB2DBGQqAFXFyv 50n/WYEB4CCaQ== Date: Mon, 18 Jan 2021 13:02:27 +0000 From: Mark Brown To: Hans de Goede Cc: Lee Jones , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Andy Shevchenko , Charles Keepax , alsa-devel@alsa-project.org, Christian Hartmann Subject: Re: [PATCH v3 3/5] mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI Message-ID: <20210118130227.GI4455@sirena.org.uk> References: <20210117212252.206115-1-hdegoede@redhat.com> <20210117212252.206115-4-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CNK/L7dwKXQ4Ub8J" Content-Disposition: inline In-Reply-To: <20210117212252.206115-4-hdegoede@redhat.com> X-Cookie: Huh? User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CNK/L7dwKXQ4Ub8J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 17, 2021 at 10:22:50PM +0100, Hans de Goede wrote: > + /* > + * Some DSDTs wrongly declare the IRQ trigger-type as IRQF_TRIGGER_FALL= ING > + * The IRQ line will stay low when a new IRQ event happens between read= ing > + * the IRQ status flags and acknowledging them. When the IRQ line stays > + * low like this the IRQ will never trigger again when its type is set > + * to IRQF_TRIGGER_FALLING. Correct the IRQ trigger-type to fix this. > + */ > + arizona->pdata.irq_flags =3D IRQF_TRIGGER_LOW; Are you sure that all the relevant interrupt controllers support active low interrupts? There were issues on some systems with missing support for active low interrupts (see the bodge in wm8994-irq.c to work around them) - it's entirely likely that there are DSDTs that are just plain buggy here but if someone's copying and pasting it smells like there may be some systems that actually need an edge triggered interrupt that they're getting it from. > + > + /* Wait 200 ms after jack insertion */ > + arizona->pdata.micd_detect_debounce =3D 200; > + > + /* Use standard AOSP values for headset-button mappings */ > + arizona->pdata.micd_ranges =3D arizona_micd_aosp_ranges; > + arizona->pdata.num_micd_ranges =3D ARRAY_SIZE(arizona_micd_aosp_ranges); > + > + return 0; > +} > + > +static const struct acpi_device_id arizona_acpi_match[] =3D { > + { > + .id =3D "WM510204", > + .driver_data =3D WM5102, > + }, > + { > + .id =3D "WM510205", > + .driver_data =3D WM5102, > + }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, arizona_acpi_match); > +#else > +static int arizona_spi_acpi_probe(struct arizona *arizona) > +{ > + return -ENODEV; > +} > +#endif > + > static int arizona_spi_probe(struct spi_device *spi) > { > const struct spi_device_id *id =3D spi_get_device_id(spi); > @@ -77,6 +191,12 @@ static int arizona_spi_probe(struct spi_device *spi) > arizona->dev =3D &spi->dev; > arizona->irq =3D spi->irq; > =20 > + if (has_acpi_companion(&spi->dev)) { > + ret =3D arizona_spi_acpi_probe(arizona); > + if (ret) > + return ret; > + } > + > return arizona_dev_init(arizona); > } > =20 > @@ -104,6 +224,7 @@ static struct spi_driver arizona_spi_driver =3D { > .name =3D "arizona", > .pm =3D &arizona_pm_ops, > .of_match_table =3D of_match_ptr(arizona_of_match), > + .acpi_match_table =3D ACPI_PTR(arizona_acpi_match), > }, > .probe =3D arizona_spi_probe, > .remove =3D arizona_spi_remove, > --=20 > 2.28.0 >=20 --CNK/L7dwKXQ4Ub8J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmAFhuIACgkQJNaLcl1U h9DDuQf+K/1+R35NC7d0uVDYwSsGKNopg9Q3xtbFzKERm2cKHfqao/bdeSkrbhhD kSUm+L9X1I/LHkGzdao5920MXJ9gmzbIeolpSH6ygVv8KZ7odJPV+H+Bkly+ZTe7 ZRAoBiuUFSVpe/3lZV7YBMlbH1j8U8lIeJ3SFPzz0dokrgezToTeBJopK/kI1z7k 7GHKPF00b/CDy2A5abeXIE7pn2fUwVascc95pz9aVgtO638joDZiczuKmlrOiv/v g83/Wc36+jmZqVR7ptTGKXK6KyQzScNYlTWCnZBeWzkhx3KE0PAe1Ez2kyozu6Vw wG3vYuzhX/7yelouc25AU/i3lruPkQ== =lhY6 -----END PGP SIGNATURE----- --CNK/L7dwKXQ4Ub8J--