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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5CF4D24459 for ; Thu, 10 Oct 2024 22:46:30 +0000 (UTC) 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:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KXxh95N88qWLEx/TECXzHuyg9VNoozrMJ9+s2vMfAuI=; b=WSRkandfTD3Yx0EkV38rst/9ha AFGEF83a0o2VClVJlVJh5Va9kp/96DxuMWdp/R9qO63D7dYeuthqdYfYUA8xjSHKce/eRqiBz9WMv EYwp4j3eUTQekwblAB8B7cxLGn/OZuohpO/wWtDGc+cs8HEUzCyidP8ArPAGDkpTY3p8vw23NN07f ck+kyr/iAStZKR8ShUh8wsLcGrccLO6eJczg7jUVOwcEv4bqnv5l0SMR/FOVYmJ1MwX6aG3lOqDKE ldMFZAQ/Jlrca10KL8aEmkieZtV66v6bdJqGQU5xyg88SWMydK2iXsd/CHCHgcZN7WcsyNo5wPmYl dCo6Lfqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sz1vS-0000000Ea6p-0ySe; Thu, 10 Oct 2024 22:46:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sz0uo-0000000ER2L-1pi3; Thu, 10 Oct 2024 21:41:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KXxh95N88qWLEx/TECXzHuyg9VNoozrMJ9+s2vMfAuI=; b=e5pr5tvRZOcDsY0x7j0GhLxvEk QeYakEDiuGQDDP+TUIECjTCL2cjl5vBfF6AZ1CTRzLTgIPI1nTvM9L5UdkcDUHvdulS8kXjtf1PGT I486F25YDYh5BIDpIAWgSBYOR7FcizGxaP8rzL0NlCSsUBSgoBisul+549C/AplkXygISGh1yI7NI dYtWXKdUY/d3ut2q/eg2VRYbplKA5fw3vTN5PGrQUpFBzxvlKiUAfKhyQ4UFOzcztFR7fmOWKHGG1 YlyhyPRg4BARiLhWghUdDb4cg57DIakDZBKK/Wites/DtomK+Kqh9O9OBHLUnhjyLNihGghSZaQPH fighPrOw==; Received: from nyc.source.kernel.org ([147.75.193.91]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sz0uk-00000005g8o-3tRe; Thu, 10 Oct 2024 21:41:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 37F57A44D0D; Thu, 10 Oct 2024 21:41:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A19DC4CEC5; Thu, 10 Oct 2024 21:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728596498; bh=Q3NSqYisG8WYYrz9LbzVCsdGWId+yQgVgrE9CldSbWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ff4smxCowyQsOzSZBcDuIyVWqWv/61X1uavBKz8DJUX8cXkv5+Mx3jGn8sbcG38EP 4fRAu7327zqxPs02gP0WqVovMYHXhL4/1XG3ck/E2sXzoWygvrJLe4pJxdskmMmggb OcR53YMM6BpHNp5pgxfil2lMD8PpEcKDVI/zvObcCJrfrHZIKhwpk2SDazat7jCQ4m uuaUReEE9U3KB1VxljIDS2k2i2iZu2Q0XV4+eJAUbI5SO1sDG73k6bDyl4bUSBQkyq s6TlXLpKUc9wiG2DPyyVafAuPndNXHQorowMctwTQ+9B2igTSUjmoo2xTB210y1KYJ n6/47pTrMCMoA== Date: Thu, 10 Oct 2024 23:41:36 +0200 From: Lorenzo Bianconi To: Linus Walleij Cc: Christian Marangi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, upstream@airoha.com, benjamin.larsson@genexis.eu, linux-pwm@vger.kernel.org Subject: Re: [PATCH v5 3/5] mfd: airoha: Add support for Airoha EN7581 MFD Message-ID: References: <20241001-en7581-pinctrl-v5-0-dc1ce542b6c6@kernel.org> <20241001-en7581-pinctrl-v5-3-dc1ce542b6c6@kernel.org> <20241002132518.GD7504@google.com> <20241009104821.GF276481@google.com> <20241009105550.GG276481@google.com> <6707a8ec.df0a0220.376450.293e@mx.google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3Fg0vtOBpPK/9AuB" Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_224143_412269_BBEA780F X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org --3Fg0vtOBpPK/9AuB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Thu, Oct 10, 2024 at 12:14=E2=80=AFPM Christian Marangi wrote: >=20 > > mfd: system-controller@1fbf0200 { >=20 > Drop the mfd: thing, you probably don't want to reference the syscon > node directly > in the device tree. If you still give it a label just say > en7581_syscon: system-controller... ack, I am fine with it. >=20 > > compatible =3D "syscon", "simple-mfd"; > > reg =3D <0x0 0x1fbf0200 0x0 0xc0>; > > > > interrupt-parent =3D <&gic>; > > interrupts =3D ; > > > > gpio-controller; > > #gpio-cells =3D <2>; > > > > interrupt-controller; > > #interrupt-cells =3D <2>; > > > > gpio-ranges =3D <&mfd 0 13 47>; >=20 > I think you want a separate GPIO node inside the system controller: >=20 > en7581_gpio: gpio { > compatible =3D "airhoa,en7581-gpio"; > interrupt-parent =3D <&gic>; > interrupts =3D ; >=20 > gpio-controller; > #gpio-cells =3D <2>; >=20 > interrupt-controller; > #interrupt-cells =3D <2>; >=20 > gpio-ranges =3D <&en7581_pinctrl 0 13 47>; > }; So far I implemented the gpio functionalities in the en7581 pinctrl driver (as it is done for other mtk pinctrl drivers) but I am fine to reuse the gpio-en7523 driver for it. Do you prefer this second approach? >=20 > So users pick GPIOs: >=20 > foo-gpios =3D <&en7581_gpio ...>; >=20 > Notice that the gpio-ranges should refer to the pin controller > node. >=20 > > > > #pwm-cells =3D <3>; >=20 > Shouldn't this be inside the pwm node? >=20 > en7581_pwm: pwm { > compatible =3D "airoha,en7581-pwm"; > #pwm-cells =3D <3>; > }; >=20 > So PWM users can pick a PWM with pwms =3D <&en7581_pwm ...>; ack, I am fine with it. >=20 > > pio: pinctrl { >=20 > I would use the label en7581_pinctrl: ack, I am fine with it. >=20 > > compatible =3D "airoha,en7581-pinctrl"; > > > > mdio_pins: mdio-pins { > > mux { > > function =3D "mdio"; > > groups =3D "mdio"; > > }; > > > > conf { > > pins =3D "gpio2"; > > output-high; > > }; > > }; > > > > pcie0_rst_pins: pcie0-rst-pins { > > conf { > > pins =3D "pcie_reset0"; > > drive-open-drain =3D <1>; > > }; > > }; > > > > pcie1_rst_pins: pcie1-rst-pins { > > conf { > > pins =3D "pcie_reset1"; > > drive-open-drain =3D <1>; > > }; > > }; > > }; > > > > pwm { > > compatible =3D "airoha,en7581-pwm"; > > }; > > }; >=20 > This will make subdevices probe and you can put the pure GPIO > driver in drivers/gpio/gpio-en7581.c We could actually reuse gpio-en7523 driver (removing the gpio part from en7= 581 pinctrl driver) and extend it to support irq_chip. I do not have a strong opinion about it. Regards, Lorenzo >=20 > Yours, > Linus Walleij --3Fg0vtOBpPK/9AuB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZwhKDwAKCRA6cBh0uS2t rImsAP9+SEsCTPYOJYMr4ud8qWMHenJk1t0UVS3lUEut+um/GAD+NxbBrcxxZ9S+ X5f21EFnXDysNRmyWuVjeQzkIJdZ6A0= =CX97 -----END PGP SIGNATURE----- --3Fg0vtOBpPK/9AuB--