From: Linus Walleij <linus.walleij@linaro.org>
To: Dong Aisheng <aisheng.dong@nxp.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Shawn Guo <shawnguo@kernel.org>, Stefan Agner <stefan@agner.ch>,
Bai Ping <ping.bai@nxp.com>, Andy Duan <fugang.duan@nxp.com>,
Peter Chen <peter.chen@nxp.com>,
Dong Aisheng <dongas86@gmail.com>,
Sascha Hauer <kernel@pengutronix.de>,
Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [PATCH RESEND 2/2] gpio: gpio-vf610: add imx7ulp support
Date: Tue, 1 Aug 2017 14:03:52 +0200 [thread overview]
Message-ID: <CACRpkdYjkaEzuqvtryCwfAWPHhsP3wD8_U3M7kaO7cbCmj5rZg@mail.gmail.com> (raw)
In-Reply-To: <1500990438-3894-3-git-send-email-aisheng.dong@nxp.com>
On Tue, Jul 25, 2017 at 3:47 PM, Dong Aisheng <aisheng.dong@nxp.com> wrote:
> The Rapid General-Purpose Input and Output with 2 Ports (RGPIO2P)
> on MX7ULP is similar to GPIO on Vibrid. But unlike Vibrid, the
> RGPIO2P has an extra Port Data Direction Register (PDDR) used
> to configure the individual port pins for input or output.
>
> We introduce a FSL_GPIO_HAVE_PDDR with fsl_gpio_soc_data data
> to distinguish this differences. And we support getting the output
> status by checking the GPIO direction in PDDR.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fugang Duan <fugang.duan@nxp.com>
> Cc: Peter Chen <peter.chen@nxp.com>
> Acked-by: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
This is mostly OK but I want a change.
> +struct fsl_gpio_soc_data {
> + u32 flags;
> +};
Why introduce complex things like bitwise flags. That looks
like premature optimization and trying to outsmart the compiler,
don't do that.
Add a bool have_paddr;
simply, and use that in the code.
Apart from that it is fine.
Yours,
Linus Walleij
next prev parent reply other threads:[~2017-08-01 12:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 13:47 [PATCH RESEND 0/2] gpio: add imx7ulp gpio support Dong Aisheng
2017-07-25 13:47 ` [PATCH RESEND 1/2] dt-bindings: gpio-vf610: add imx7ulp support Dong Aisheng
2017-08-01 12:01 ` Linus Walleij
2017-07-25 13:47 ` [PATCH RESEND 2/2] gpio: " Dong Aisheng
2017-08-01 12:03 ` Linus Walleij [this message]
2017-08-01 13:48 ` A.s. Dong
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=CACRpkdYjkaEzuqvtryCwfAWPHhsP3wD8_U3M7kaO7cbCmj5rZg@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=aisheng.dong@nxp.com \
--cc=dongas86@gmail.com \
--cc=fugang.duan@nxp.com \
--cc=gnurou@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=peter.chen@nxp.com \
--cc=ping.bai@nxp.com \
--cc=shawnguo@kernel.org \
--cc=stefan@agner.ch \
/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).