All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: NeilBrown <neil@brown.name>
Cc: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org
Subject: Re: [PATCH 4/5] dt-bindings: gpio: add documentation for mt7621-gpio
Date: Tue, 15 May 2018 06:53:59 +0200	[thread overview]
Message-ID: <20180515045359.GA17051@foobar> (raw)
In-Reply-To: <87k1s57lyn.fsf@notabene.neil.brown.name>

On Tue, May 15, 2018 at 11:21:20AM +1000, NeilBrown wrote:
> On Mon, May 14 2018, Sergio Paracuellos wrote:
> 
> > This commit add missing dt bindings documentation for mt7621-gpio
> > driver. After this checkpatch script complain about this
> > issue dissapears.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  .../devicetree/bindings/gpio/mtk,mt7621-gpio.txt   | 51 ++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpio/mtk,mt7621-gpio.txt
> >
> > diff --git a/Documentation/devicetree/bindings/gpio/mtk,mt7621-gpio.txt b/Documentation/devicetree/bindings/gpio/mtk,mt7621-gpio.txt
> > new file mode 100644
> > index 0000000..5fe4bb5
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpio/mtk,mt7621-gpio.txt
> > @@ -0,0 +1,51 @@
> > +Mediatek SoC GPIO controller bindings
> > +
> > +The IP core used inside these SoCs has 3 banks of 32 GPIOs each.
> > +The registers of all the banks are interwoven inside one single IO range.
> > +We load one GPIO controller instance per bank. To make this possible
> > +we support 2 types of nodes. The parent node defines the memory I/O range and
> > +has 3 children each describing a single bank.
> > +
> > +Required properties for the top level node:
> > +- compatible:
> > +  - "mtk,mt7621-gpio" for Mediatek controllers
> > +- reg : Physical base address and length of the controller's registers
> > +
> > +Required properties for the GPIO bank node:
> > +- compatible:
> > +  - "mtk,mt7621-gpio-bank" for Mediatek banks
> > +- #gpio-cells : Should be two.
> > +  - first cell is the pin number
> > +  - second cell is used to specify optional parameters (unused)
> > +- gpio-controller : Marks the device node as a GPIO controller
> > +- reg : The id of the bank that the node describes.
> 
> This is really good, but not quite complete.
> Searching for "of_" in gpio-mt7621.c I find code handling everything
> you've described, but also:
> 
> 	mediatek_gpio_irq = irq_of_parse_and_map(np, 0);
> 	if (mediatek_gpio_irq) {
> 		mediatek_gpio_irq_domain = irq_domain_add_linear(np,
> 
> The GPIO controller can receive interrupts on any of the GPIOs,
> either edge or level.  It then interrupts the CPU using GIC INT12.
> 
> so
>     interrupt-parent = <&gic>;
>     interrupts = <GIC_SHARED 12 IRQ_TYPE_LEVEL_HIGH>
> (I think).
> Then you need whatever irq_domain_add_linear() expects.
> I don't know what that is...  I tried following through
> code and got lost in little twisty mazes.
> 
> So if you change this patch to add the file to
> drivers/staging/mt7621-gpio
> then I can give it
>   Reviewed-by: NeilBrown <neil@brown.name>

I moved this to the driver directory as it is because dtsi is not
including yet stuff about gpio interrupts. This should be added when
make sure that interrupt works and gtsi will be updated.

> 
> and then we can fix it when an understanding of the interrupts is
> available.
> But I cannot approve it for Documentation/devicetree/bindings yet.
> 
> Thanks a lot,
> NeilBrown
>

Best regards,
    Sergio PAracuellos 
> 
> > +
> > +Example:
> > +	gpio@600 {
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +
> > +		compatible = "mtk,mt7621-gpio";
> > +		reg = <0x600 0x100>;
> > +
> > +		gpio0: bank@0 {
> > +			reg = <0>;
> > +			compatible = "mtk,mt7621-gpio-bank";
> > +			gpio-controller;
> > +			#gpio-cells = <2>;
> > +		};
> > +
> > +		gpio1: bank@1 {
> > +			reg = <1>;
> > +			compatible = "mtk,mt7621-gpio-bank";
> > +			gpio-controller;
> > +			#gpio-cells = <2>;
> > +		};
> > +
> > +		gpio2: bank@2 {
> > +			reg = <2>;
> > +			compatible = "mtk,mt7621-gpio-bank";
> > +			gpio-controller;
> > +			#gpio-cells = <2>;
> > +		};
> > +	};
> > -- 
> > 2.7.4


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2018-05-15  4:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 14:02 [PATCH 0/5] staging: mt7621-gpio: some driver cleanups Sergio Paracuellos
2018-05-14 14:02 ` [PATCH 1/5] staging: mt7621-gpio: fix some warnings because of lines exceded 80 characters Sergio Paracuellos
2018-05-14 14:02 ` [PATCH 2/5] staging: mt7621-gpio: add SPDX identifier Sergio Paracuellos
2018-05-14 14:02 ` [PATCH 3/5] dt-bindings: add compatible string for 'mtk' MediaTek Sergio Paracuellos
2018-05-15  7:24   ` Greg KH
2018-05-15  8:22     ` Sergio Paracuellos
2018-05-14 14:02 ` [PATCH 4/5] dt-bindings: gpio: add documentation for mt7621-gpio Sergio Paracuellos
2018-05-15  1:21   ` NeilBrown
2018-05-15  4:53     ` Sergio Paracuellos [this message]
2018-05-15  7:25   ` Greg KH
2018-05-15  8:22     ` Sergio Paracuellos
2018-05-14 14:02 ` [PATCH 5/5] staging: mt7621-gpio: remove device tree related stuff from TODO file Sergio Paracuellos
2018-05-15  1:26   ` NeilBrown
2018-05-15  4:55     ` Sergio Paracuellos
2018-05-15  1:01 ` [PATCH 0/5] staging: mt7621-gpio: some driver cleanups NeilBrown
2018-05-15  4:57   ` Sergio Paracuellos

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=20180515045359.GA17051@foobar \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=neil@brown.name \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.