linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
@ 2011-06-07  8:34 Thomas Abraham
  2011-06-07  8:42 ` Kyungmin Park
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Abraham @ 2011-06-07  8:34 UTC (permalink / raw)
  To: linux-arm-kernel

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.

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);
+}
+
+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;
+}
+
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Kyungmin Park @ 2011-06-07  8:42 UTC (permalink / raw)
  To: linux-arm-kernel

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>

>
> 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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
  2011-06-07  8:42 ` Kyungmin Park
@ 2011-06-07 17:10   ` Grant Likely
  2011-06-09 22:16     ` Kukjin Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2011-06-07 17:10 UTC (permalink / raw)
  To: linux-arm-kernel

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
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
  2011-06-07 17:10   ` Grant Likely
@ 2011-06-09 22:16     ` Kukjin Kim
  2011-06-10  5:06       ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: Kukjin Kim @ 2011-06-09 22:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/07/11 10:10, Grant Likely wrote:
> 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:

(snip)

> Applied, thanks.
>
> g.

Hi Grant, sorry for late response.

Could you please add my ack on this?

Acked-by: Kukjin Kim <kgene.kim@samsung.com>

>>> Signed-off-by: Thomas Abraham<thomas.ab@samsung.com>

(snip)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: EXYNOS4: Fix incorrect mapping of gpio pull-up macro to register setting
  2011-06-09 22:16     ` Kukjin Kim
@ 2011-06-10  5:06       ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2011-06-10  5:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 9, 2011 at 4:16 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> On 06/07/11 10:10, Grant Likely wrote:
>>
>> 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:
>
> (snip)
>
>> Applied, thanks.
>>
>> g.
>
> Hi Grant, sorry for late response.
>
> Could you please add my ack on this?
>
> Acked-by: Kukjin Kim <kgene.kim@samsung.com>

Unfortunately that would require me to rebase my tree, which I'm
trying really hard to avoid.

g.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-10  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-06-09 22:16     ` Kukjin Kim
2011-06-10  5:06       ` Grant Likely

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).