From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC629606A31C for ; Mon, 30 Nov 2026 10:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PE1TaxXw; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WXZc5bhV DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc: Subject:To:From:Message-Id:Date:Content-Type:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=RJVqPwfH0V6MNKESCcza2PUwWtFY0Dqfzqs5OJmtKqM=; b=PE1TaxXwg9KJslCzuu7o7uFFe5 ammwO9nly/N9TICP6ooXgZOsWSyrl1ROCGyAltvMCv7sja4ecTyxE64dBUjnf9KgQgTlMt5PawYWL fj92DC+UGMhU1/oyKvxT000QcyyNc04byrrb74BISzMuHe0Hhw4JsN12mnuDTcbnXHLhykin8vfO+ fVJv7hthAhUG6Zu/YBZA3ywB4NXgCsNs0kfc3lswp6SBfPcaGcn/oOgwWVYR+3npt7Jp4veSSXF/J goS5Gjc5u9h5he5tvTAuv1ZCt/oHUb0IKWnHz5IUcuW7zBtIg7yAOo3G8By61vh3wZhG7Wjn6sm1c Fldk1UxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXyjs-00000004A9w-0sbs; Mon, 30 Nov 2026 10:36:04 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXyjr-00000004A9a-0Y9v for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 10:36:03 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with UTF8SMTP id 680E061EDF; Mon, 30 Nov 2026 10:36:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id C56E51F000C1; Mon, 30 Nov 2026 10:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796034962; bh=RJVqPwfH0V6MNKESCcza2PUwWtFY0Dqfzqs5OJmtKqM=; h=Date:From:To:Subject:Cc:References:In-Reply-To; b=WXZc5bhVkcsuOGK3vFwmFqj2p5c/wZSCEEr39O9uEzuX4QR1vZirGUSTF5/ithdG9 9x2vu+3SwW3qqeeJsCPY5fvLdK3RFRaG6PQ00Q/zcMGBQgca8PE02eV8Qw0ktGCrik DnEEbQ9I84dyXSqxqN8U+jftdDDGdVYsrqpVpEQHyHmaotXYc+lNkAMaND0fZ1xX8z n+gMgwVXD7iISy8RVcSb8J5ugACfiBA11AOvWM1JQG4JfCfF0ipsIuM7f7nL5XYrFt kwnlkJpsLgfebRPBREMGsSSsgMiYQyqfN5aKqc8rF87SHiK3FD3usC9NlAOOAuOeia 1bp7P8uWPco8A== X-Archived-By: Mime-Version: 1.0 Content-Type: multipart/signed; boundary=8789af8415f64d92d48d85fd37b7de8097c6a0011b6dc32573a7b6db8117; micalg=pgp-sha384; protocol="application/pgp-signature" Date: Mon, 30 Nov 2026 11:35:58 +0100 Message-Id: From: "Michael Walle" To: "Andy Shevchenko" Subject: Re: [RFT PATCH v2 06/14] gpio: regmap: add helpers to add a regmap-irq chip Cc: "William Breathitt Gray" , "Linus Walleij" , "Bartosz Golaszewski" , "Petar Stepanovic" , "SriNavmani A" , "Prasad Bolisetty" , "Tzu-Hao Wei" , "Karthikeyan Mitran" , "Mathieu Dubois-Briand" , "Lee Jones" , "Long Zhao" , "Joseph Telaak" , , X-Mailer: aerc 0.20.0 References: <20261127145232.814492-1-mwalle@kernel.org> <20261127145232.814492-7-mwalle@kernel.org> In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --8789af8415f64d92d48d85fd37b7de8097c6a0011b6dc32573a7b6db8117 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Fri Nov 27, 2026 at 7:43 PM CET, Andy Shevchenko wrote: > On Fri, Nov 27, 2026 at 03:52:23PM +0100, Michael Walle wrote: >> The most common use-case is to use regmap-irq together with gpio-regmap. >> To make life easier for that and to avoid code duplication, add helpers >> to create and attach a regmap-irq domain. These helpers are intended to >> be called by the new .create_irq_domain() callback. >>=20 >> gpio_regmap_add_irq_chip() locks the GPIO line while its interrupt is >> requested. This assumes that the hwirq numbers match the GPIO offsets. >> If a driver doesn't follow that, there is one without the locking called >> gpio_regmap_add_irq_chip_nolock(). > > Hmm... Can't we simply have a boolean flag instead in GPIO regmap configu= ration > and just distinguish it inside the common helper? Not sure about that, it has nothing to do with the gpio regmap itself and would even be ignored if these helpers are not used. So I'd like to keep it out of the config. We could use a boolean argument for the gpio_regmap_add_irq_chip(), but then you can't use a function pointer. Thinking further, there might be some driver data just setting this callback. Who knows. Thus, I've gone that route. > ... > >> +/** >> + * gpio_regmap_add_irq_chip_nolock() - Add a regmap-irq chip without li= ne locking >> + * @gpio: gpio_regmap device >> + * @irq: the parent interrupt >> + * @irq_flags: the IRQF_ flags to use for @irq >> + * @chip: the regmap-irq chip description >> + * >> + * Same as gpio_regmap_add_irq_chip() but doesn't lock the GPIO lines. >> + * Can be used if the hwirq numbers of the regmap-irq chip don't match >> + * the GPIO offsets. >> + * >> + * Return: irq_domain or an ERR_PTR() error value. > > Okay, this might justify returning error pointer, but irq_domain_create_*= () > shadows that with NULL, which questions the usefulness of it (the error c= ode). > I'm fine with either approach but still tend towards using > irq_domain_create_*() helpers instead their open coded variants. I'll go with the irq_domain_create_ helper, but I'm unsure if we want to drop the ERR_PTR here and instead just return NULL. I'd keep the ERR_PTR here just in case someone will do more than just call the domain creation helper. -michael > On the other hand there is no much win, especially if you replace > > info =3D {}; > > info.XXX =3D ...; > > ... =3D irq_domain_instantiate(&info); > > with direct assignment as it's done inside irq_domain_create_*(), > >> + */ --8789af8415f64d92d48d85fd37b7de8097c6a0011b6dc32573a7b6db8117 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iKgEABMJADAWIQTIVZIcOo5wfU/AngkSJzzuPgIf+AUCaw1RjhIcbXdhbGxlQGtl cm5lbC5vcmcACgkQEic87j4CH/hIuQF/X/+p/xEUXf9VjzdQ3mIyXF4E4jnUfkp0 meAuFCCmKRI9BjOsBihBc0b6njS+l0hWAX9gbRa9+tx+qBhSrr80uinsYnp4JaZX bQifRIM8yI8lljpSXHxLWU2RAlysfA5MdvQ= =KYH2 -----END PGP SIGNATURE----- --8789af8415f64d92d48d85fd37b7de8097c6a0011b6dc32573a7b6db8117--