linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Christian Marangi" <ansuelsmth@gmail.com>,
	"Lee Jones" <lee@kernel.org>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Sean Wang" <sean.wang@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	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
Date: Thu, 10 Oct 2024 23:41:36 +0200	[thread overview]
Message-ID: <ZwhKECIpL7g7ZGEC@lore-desk> (raw)
In-Reply-To: <CACRpkdanpA-wq0sYv9HRF=uVeAX_mW4LaKhE8i6TgC9+0d7bCg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3479 bytes --]

> On Thu, Oct 10, 2024 at 12:14 PM Christian Marangi <ansuelsmth@gmail.com> wrote:
> 
> > mfd: system-controller@1fbf0200 {
> 
> 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.

> 
> >         compatible = "syscon", "simple-mfd";
> >         reg = <0x0 0x1fbf0200 0x0 0xc0>;
> >
> >         interrupt-parent = <&gic>;
> >         interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
> >
> >         gpio-controller;
> >         #gpio-cells = <2>;
> >
> >         interrupt-controller;
> >         #interrupt-cells = <2>;
> >
> >         gpio-ranges = <&mfd 0 13 47>;
> 
> I think you want a separate GPIO node inside the system controller:
> 
>   en7581_gpio: gpio {
>          compatible = "airhoa,en7581-gpio";
>          interrupt-parent = <&gic>;
>          interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
> 
>          gpio-controller;
>          #gpio-cells = <2>;
> 
>          interrupt-controller;
>          #interrupt-cells = <2>;
> 
>          gpio-ranges = <&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?

> 
> So users pick GPIOs:
> 
> foo-gpios = <&en7581_gpio ...>;
> 
> Notice that the gpio-ranges should refer to the pin controller
> node.
> 
> >
> >         #pwm-cells = <3>;
> 
> Shouldn't this be inside the pwm node?
> 
>          en7581_pwm: pwm {
>                  compatible = "airoha,en7581-pwm";
>                  #pwm-cells = <3>;
>          };
> 
> So PWM users can pick a PWM with pwms = <&en7581_pwm ...>;

ack, I am fine with it.

> 
> >         pio: pinctrl {
> 
> I would use the label en7581_pinctrl:

ack, I am fine with it.

> 
> >                 compatible = "airoha,en7581-pinctrl";
> >
> >                 mdio_pins: mdio-pins {
> >                         mux {
> >                                 function = "mdio";
> >                                 groups = "mdio";
> >                         };
> >
> >                         conf {
> >                                 pins = "gpio2";
> >                                 output-high;
> >                         };
> >                 };
> >
> >                 pcie0_rst_pins: pcie0-rst-pins {
> >                         conf {
> >                                 pins = "pcie_reset0";
> >                                 drive-open-drain = <1>;
> >                         };
> >                 };
> >
> >                 pcie1_rst_pins: pcie1-rst-pins {
> >                         conf {
> >                                 pins = "pcie_reset1";
> >                                 drive-open-drain = <1>;
> >                         };
> >                 };
> >         };
> >
> >         pwm {
> >                 compatible = "airoha,en7581-pwm";
> >         };
> > };
> 
> 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 en7581
pinctrl driver) and extend it to support irq_chip. I do not have a strong
opinion about it.

Regards,
Lorenzo

> 
> Yours,
> Linus Walleij

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-10-10 21:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 17:29 [PATCH v5 0/5] Add mfd, pinctrl and pwm support to EN7581 SoC Lorenzo Bianconi
2024-10-01 17:29 ` [PATCH v5 1/5] dt-bindings: arm: airoha: Add the chip-scu node for " Lorenzo Bianconi
2024-10-01 17:29 ` [PATCH v5 2/5] dt-bindings: mfd: Add support for Airoha EN7581 GPIO System Controller Lorenzo Bianconi
2024-10-01 17:29 ` [PATCH v5 3/5] mfd: airoha: Add support for Airoha EN7581 MFD Lorenzo Bianconi
2024-10-02 13:25   ` Lee Jones
2024-10-02 22:42     ` Christian Marangi
2024-10-08 22:04     ` Lorenzo Bianconi
2024-10-09 10:48       ` Lee Jones
2024-10-09 10:55         ` Lee Jones
2024-10-10 10:14           ` Christian Marangi
2024-10-10 10:41             ` Christian Marangi
2024-10-10 16:25             ` Lee Jones
2024-10-10 19:34             ` Linus Walleij
2024-10-10 21:41               ` Lorenzo Bianconi [this message]
2024-10-11  6:51                 ` Linus Walleij
2024-10-01 17:29 ` [PATCH v5 4/5] pinctrl: airoha: Add support for EN7581 SoC Lorenzo Bianconi
2024-10-02 13:27   ` Linus Walleij
2024-10-02 15:37     ` Lorenzo Bianconi
2024-10-01 17:29 ` [PATCH v5 5/5] pwm: " Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZwhKECIpL7g7ZGEC@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=ansuelsmth@gmail.com \
    --cc=benjamin.larsson@genexis.eu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sean.wang@kernel.org \
    --cc=ukleinek@kernel.org \
    --cc=upstream@airoha.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).