linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
Date: Tue, 7 Jun 2011 11:10:30 -0600	[thread overview]
Message-ID: <20110607171030.GE17754@ponder.secretlab.ca> (raw)
In-Reply-To: <BANLkTi=YeOyK1WX61NtyprYdUyNmSo1sTw@mail.gmail.com>

On Tue, Jun 07, 2011 at 05:42:47PM +0900, Kyungmin Park wrote:
> On Tue, Jun 7, 2011 at 5:34 PM, Thomas Abraham <thomas.ab@samsung.com> wrote:
> > The S3C_GPIO_PULL_UP macro value incorrectly maps to a reserved setting of GPIO
> > pull up/down registers on Exynos4 platform. Fix this incorrect mapping by adding
> > wrappers to the s3c_gpio_setpull_updown and s3c_gpio_getpull_updown functions.
> 
> Personally I like to use the variable instead of function hooking.
> set the correct variable at cpu dection and use it
> then these thing make a single generic function and each gpio_cfg use
> the same thing.
> 
> Anyway it's next step. current fix the bug first.
> 
> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>

Applied, thanks.

g.

> 
> >
> > Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> > ---
> > ?drivers/gpio/gpio-exynos4.c | ? 29 +++++++++++++++++++++++++----
> > ?1 files changed, 25 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-exynos4.c b/drivers/gpio/gpio-exynos4.c
> > index d54ca6a..9029835 100644
> > --- a/drivers/gpio/gpio-exynos4.c
> > +++ b/drivers/gpio/gpio-exynos4.c
> > @@ -21,16 +21,37 @@
> > ?#include <plat/gpio-cfg.h>
> > ?#include <plat/gpio-cfg-helpers.h>
> >
> > +int s3c_gpio_setpull_exynos4(struct s3c_gpio_chip *chip,
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned int off, s3c_gpio_pull_t pull)
> > +{
> > + ? ? ? if (pull == S3C_GPIO_PULL_UP)
> > + ? ? ? ? ? ? ? pull = 3;
> > +
> > + ? ? ? return s3c_gpio_setpull_updown(chip, off, pull);
> > +}
> static?
> > +
> > +s3c_gpio_pull_t s3c_gpio_getpull_exynos4(struct s3c_gpio_chip *chip,
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned int off)
> > +{
> > + ? ? ? s3c_gpio_pull_t pull;
> > +
> > + ? ? ? pull = s3c_gpio_getpull_updown(chip, off);
> > + ? ? ? if (pull == 3)
> > + ? ? ? ? ? ? ? pull = S3C_GPIO_PULL_UP;
> > +
> > + ? ? ? return pull;
> > +}
> ditto.
> > +
> > ?static struct s3c_gpio_cfg gpio_cfg = {
> > ? ? ? ?.set_config ? ? = s3c_gpio_setcfg_s3c64xx_4bit,
> > - ? ? ? .set_pull ? ? ? = s3c_gpio_setpull_updown,
> > - ? ? ? .get_pull ? ? ? = s3c_gpio_getpull_updown,
> > + ? ? ? .set_pull ? ? ? = s3c_gpio_setpull_exynos4,
> > + ? ? ? .get_pull ? ? ? = s3c_gpio_getpull_exynos4,
> > ?};
> >
> > ?static struct s3c_gpio_cfg gpio_cfg_noint = {
> > ? ? ? ?.set_config ? ? = s3c_gpio_setcfg_s3c64xx_4bit,
> > - ? ? ? .set_pull ? ? ? = s3c_gpio_setpull_updown,
> > - ? ? ? .get_pull ? ? ? = s3c_gpio_getpull_updown,
> > + ? ? ? .set_pull ? ? ? = s3c_gpio_setpull_exynos4,
> > + ? ? ? .get_pull ? ? ? = s3c_gpio_getpull_exynos4,
> > ?};
> >
> > ?/*
> > --
> > 1.6.6.rc2
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >

  reply	other threads:[~2011-06-07 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07  8:34 [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting Thomas Abraham
2011-06-07  8:42 ` Kyungmin Park
2011-06-07 17:10   ` Grant Likely [this message]
2011-06-09 22:16     ` Kukjin Kim
2011-06-10  5:06       ` Grant Likely

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=20110607171030.GE17754@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --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).