From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796034962; b=WPz1hJ+blmy1RhBSKtwAS9BDxdwNcRSL5o2hY5cEdZNE5hbAaTJTZMzx6/bHz747p9ZS dWQ0ENclhiCJg5RYZ84PRMIQ4TBqQRodu5oGI/VcQF66B/sKHeswtGYU7Se/51inurddR 7TOcQWWYao5L2C5IJB3COn69wT/vi0onRmb54vgt/S79qNI57AydH5vv0pdMCGcSGXGc/ VKJGOAbtoDGaGeL1WF+mLuiOPImHbgHWOLgZKRvdqSCDD5mZVElrdhYNad5VzHy1sFfpg PW+oLsnR3EtKhUId7qSuE1XVPQye6N4XUyEsvaOHNgPuurcOnhtgtNBBaoRTMuuGISA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796034962; h=Received:DKIM-Signature:Mime-Version:Content-Type:Date:Message-Id: From:To:Subject:Cc:X-Mailer:References:In-Reply-To; bh=RJVqPwfH0V6MNKESCcza2PUwWtFY0Dqfzqs5OJmtKqM=; b=hinSKOPLERH92nGwPqvLf/qRKL9eQwygCzGawbkPpdq8WdkeODhRNuNedQIcSpQc5HUs et0cE682HDX87T3L1bJbtDq9j3+Fl3qVaVx4FVFJnsoduclrDwI/G2h9pdMDKgQ/eD0rv 5zM+ZG4Ro31+xPnRhY+n/lyAIDQLt713Q4y15suva43O8xWVL8zD69IOQhYWmX1omecGc /zAb3RIDMKuxiA2OFk+QilfnmCfTTFyV20muH8YJ+msxkBQr2TfOIl7teACm2jZZtmvKi 8NCx4T7/hMxuN/4Bi2wf0Z8+Zro7d0qYcI3nJOZOktpveCWgB48LSaDujhy15pSB8tQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WXZc5bhV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 79673606A31C for ; Mon, 30 Nov 2026 10:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WXZc5bhV 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-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: --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--