From: shc_work@mail.ru (Alexander Shiyan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] GPIO: Add support for GPIO on CLPS711X-target platform
Date: Mon, 24 Sep 2012 21:49:57 +0400 [thread overview]
Message-ID: <20120924214957.6999df72.shc_work@mail.ru> (raw)
In-Reply-To: <CACRpkdZEh1sg5h5-uzpsYwxYM5W47q-1hk4sS3=dQQLaVUC1Vw@mail.gmail.com>
On Sat, 1 Sep 2012 00:44:10 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> > ...
> >> > +static int gpio_clps711x_get(struct gpio_chip *chip, unsigned offset)
> >> > +{
> >> > + int ret;
> >> > + struct clps711x_gpio *gpio = dev_get_drvdata(chip->dev);
> >> > +
> >> > + mutex_lock(&gpio->lock);
> >> > + ret = clps_readb(gpio_clps711x_port_dataaddr(chip)) & (1 << offset);
> >> > + mutex_unlock(&gpio->lock);
> >> > +
> >> > + return !!ret;
> >> > +}
...
> > This will break the whole concept of this platform. All the CPU registers
> > are in one particular area, and therefore access to the registers of all
> > the drivers performed using the macro.
> > Maybe just add a short comment?
> It does not break if you pass the offset CLPS711X_VIRT_BASE as
> a memory resource and reference from that, e.g.:
...
> If you do this, you should no longer need to include
> <mach/hardware.h> (or something more is wrong...)
I plan in the future to remove the macros clps_read/write, and while the time
to do an override for ports in the header mach/gpio.h.
Passing of resources to the driver still seems superfluous, in any case
I changed the code, so please comment on the new version, which will post today.
> BTW I cannot see where this patch adds the platform device
> named "gpio-clps711x"? Are you intending to do this later?
Yes, I forgot about it in the previous version. The new version of the code
is different and it is no longer necessary.
--
Alexander Shiyan <shc_work@mail.ru>
prev parent reply other threads:[~2012-09-24 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 11:36 [PATCH] GPIO: Add support for GPIO on CLPS711X-target platform Alexander Shiyan
2012-08-23 22:08 ` Linus Walleij
2012-08-24 3:45 ` Alexander Shiyan
2012-08-31 22:44 ` Linus Walleij
2012-09-24 17:49 ` Alexander Shiyan [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=20120924214957.6999df72.shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=linux-arm-kernel@lists.infradead.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).