linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Rob Herring <robh@kernel.org>,
	Christian Lamparter <chunkeey@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCHv5 2/2] Add a GPIO driver for Altera FPGA Manager Fabric I/O
Date: Tue, 31 Oct 2017 11:04:15 +0100	[thread overview]
Message-ID: <CACRpkdaxh45e1V_xc6AdjmkAv12_AMuXb45+1b8nFOw3N3A3aA@mail.gmail.com> (raw)
In-Reply-To: <AM5PR0701MB26575D4E585B51AC8784E49BE4450@AM5PR0701MB2657.eurprd07.prod.outlook.com>

On Thu, Oct 26, 2017 at 5:28 PM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:

> This is an internal 32-bit input and 32-bit output port to the FPGA logic.
>
> Instantiate this in the device tree as:
>
>   gpio3: gpio@ff706010 {
>    #address-cells = <1>;
>    #size-cells = <0>;
>    compatible = "altr,fpgamgr-gpio";
>    reg = <0xff706010 0x8>;
>    status = "okay";
>
>    portd: gpio-controller@0 {
>     compatible = "altr,fpgamgr-gpio-output";
>     gpio-controller;
>     #gpio-cells = <2>;
>     reg = <0>;
>    };
>
>    porte: gpio-controller@1 {
>     compatible = "altr,fpgamgr-gpio-input";
>     gpio-controller;
>     #gpio-cells = <2>;
>     reg = <1>;
>    };
>   };
>
> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(...)
> +       err = bgpio_init(&port->bgc, gpio->dev, 4, dat, NULL, NULL,
> +                        NULL, NULL, pp->idx ? BGPIOF_NO_OUTPUT : 0);

Don't magically use the index to determine which block
us input-only.

Use the port-specific compatible string and match to
handle this using .data in the match.

Yours,
Linus Walleij

      reply	other threads:[~2017-10-31 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 15:28 [PATCHv5 2/2] Add a GPIO driver for Altera FPGA Manager Fabric I/O Bernd Edlinger
2017-10-31 10:04 ` Linus Walleij [this message]

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=CACRpkdaxh45e1V_xc6AdjmkAv12_AMuXb45+1b8nFOw3N3A3aA@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=bernd.edlinger@hotmail.de \
    --cc=chunkeey@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh@kernel.org \
    /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).