From: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Andrew Bresticker
<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] pinctrl: as3722: fix handling of GPIO invert bit
Date: Thu, 17 Apr 2014 15:18:11 +0530 [thread overview]
Message-ID: <534FA35B.6060005@nvidia.com> (raw)
In-Reply-To: <1397611505-17917-1-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Hi Andrew,
On Wednesday 16 April 2014 06:55 AM, Andrew Bresticker wrote:
> diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
> index 92ed4b2..c862f9c0 100644
> --- a/drivers/pinctrl/pinctrl-as3722.c
> +++ b/drivers/pinctrl/pinctrl-as3722.c
> @@ -64,7 +64,6 @@ struct as3722_pin_function {
> };
>
> struct as3722_gpio_pin_control {
> - bool enable_gpio_invert;
> unsigned mode_prop;
> int io_function;
> };
Instead of removing this flag and calling read of register on every
gpio set, better if we update this flag on probe once and use this for
entire life.
So adding the code in probe() as
for (i = 0; i < ARRAY_SIZE(as3722_pingroups); ++i) {
int gpio_cntr_reg = AS3722_GPIOn_CONTROL_REG(i);
u32 val;
ret = as3722_read(as3722, gpio_cntr_reg, &val);
if (!ret)
as_pci->gpio_control[i].enable_gpio_invert =
!!(val & AS3722_GPIO_INV);
}
Thanks,
Laxman
next prev parent reply other threads:[~2014-04-17 9:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 1:25 [PATCH] pinctrl: as3722: fix handling of GPIO invert bit Andrew Bresticker
2014-04-16 16:21 ` Stephen Warren
2014-04-16 20:29 ` Andrew Bresticker
[not found] ` <1397611505-17917-1-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-04-16 20:40 ` [PATCH v2] " Andrew Bresticker
[not found] ` <1397680817-28470-1-git-send-email-abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-04-22 15:05 ` Linus Walleij
2014-04-17 9:48 ` Laxman Dewangan [this message]
[not found] ` <534FA35B.6060005-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-04-17 16:43 ` [PATCH] " Andrew Bresticker
[not found] ` <CAL1qeaG+MBmBZ3dD6LZwV5mh5A=u+0N7Obt43UwhViaBYpXxpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-17 17:24 ` Laxman Dewangan
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=534FA35B.6060005@nvidia.com \
--to=ldewangan-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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