linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API
@ 2010-10-21  8:04 Kukjin Kim
  2010-10-21 17:47 ` Sergei Shtylyov
  2010-10-21 22:17 ` Ben Dooks
  0 siblings, 2 replies; 5+ messages in thread
From: Kukjin Kim @ 2010-10-21  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Daein Moon <moon9124@samsung.com>

This patch adds the s3c_gpio_getpull() API that has been missed in the
plat-samsung/gpio-config.c and actullay there is its extern declaration
in plat/gpio-cfg.h.

Signed-off-by: Daein Moon <moon9124@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
NOTE:
- already issued about this

 arch/arm/plat-samsung/gpio-config.c                |   19 +++++++++++++++++++
 .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    6 ++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 8a37211..b732b77 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -111,6 +111,25 @@ int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull)
 }
 EXPORT_SYMBOL(s3c_gpio_setpull);
 
+s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
+{
+	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
+	unsigned long flags;
+	int offset;
+	u32 pup = 0;
+
+	if (chip) {
+		offset = pin - chip->chip.base;
+
+		s3c_gpio_lock(chip, flags);
+		pup = s3c_gpio_do_getpull(chip, offset);
+		s3c_gpio_unlock(chip, flags);
+	}
+
+	return (__force s3c_gpio_pull_t)pup;
+}
+EXPORT_SYMBOL(s3c_gpio_getpull);
+
 #ifdef CONFIG_S3C_GPIO_CFG_S3C24XX
 int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
 			      unsigned int off, unsigned int cfg)
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
index 3e21c75..c417f85 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
@@ -42,6 +42,12 @@ static inline int s3c_gpio_do_setpull(struct s3c_gpio_chip *chip,
 	return (chip->config->set_pull)(chip, off, pull);
 }
 
+static inline unsigned s3c_gpio_do_getpull(struct s3c_gpio_chip *chip,
+					   unsigned int off)
+{
+	return (chip->config->get_pull)(chip, off);
+}
+
 /**
  * s3c_gpio_setcfg_s3c24xx - S3C24XX style GPIO configuration.
  * @chip: The gpio chip that is being configured.
-- 
1.6.3.3

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

* [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API
  2010-10-21  8:04 [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API Kukjin Kim
@ 2010-10-21 17:47 ` Sergei Shtylyov
  2010-10-22  8:05   ` Kukjin Kim
  2010-10-21 22:17 ` Ben Dooks
  1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2010-10-21 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 21-10-2010 12:04, Kukjin Kim wrote:

> From: Daein Moon<moon9124@samsung.com>

> This patch adds the s3c_gpio_getpull() API that has been missed in the
> plat-samsung/gpio-config.c and actullay there is its extern declaration
> in plat/gpio-cfg.h.

> Signed-off-by: Daein Moon<moon9124@samsung.com>
> Cc: Ben Dooks<ben-linux@fluff.org>
> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> ---
> NOTE:
> - already issued about this

>   arch/arm/plat-samsung/gpio-config.c                |   19 +++++++++++++++++++
>   .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    6 ++++++
>   2 files changed, 25 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
> index 8a37211..b732b77 100644
> --- a/arch/arm/plat-samsung/gpio-config.c
> +++ b/arch/arm/plat-samsung/gpio-config.c
[...]
> diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> index 3e21c75..c417f85 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> @@ -42,6 +42,12 @@ static inline int s3c_gpio_do_setpull(struct s3c_gpio_chip *chip,
>   	return (chip->config->set_pull)(chip, off, pull);
>   }
>
> +static inline unsigned s3c_gpio_do_getpull(struct s3c_gpio_chip *chip,
> +					   unsigned int off)
> +{
> +	return (chip->config->get_pull)(chip, off);

    Parens are not necessary here.

> +}
> +

WBR, Sergei

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

* [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API
  2010-10-21  8:04 [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API Kukjin Kim
  2010-10-21 17:47 ` Sergei Shtylyov
@ 2010-10-21 22:17 ` Ben Dooks
  2010-10-22  5:22   ` Kukjin Kim
  1 sibling, 1 reply; 5+ messages in thread
From: Ben Dooks @ 2010-10-21 22:17 UTC (permalink / raw)
  To: linux-arm-kernel

On 21/10/10 09:04, Kukjin Kim wrote:
> From: Daein Moon <moon9124@samsung.com>
> 
> This patch adds the s3c_gpio_getpull() API that has been missed in the
> plat-samsung/gpio-config.c and actullay there is its extern declaration
> in plat/gpio-cfg.h.
> 
> Signed-off-by: Daein Moon <moon9124@samsung.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> NOTE:
> - already issued about this
> 
>  arch/arm/plat-samsung/gpio-config.c                |   19 +++++++++++++++++++
>  .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    6 ++++++
>  2 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
> index 8a37211..b732b77 100644
> --- a/arch/arm/plat-samsung/gpio-config.c
> +++ b/arch/arm/plat-samsung/gpio-config.c
> @@ -111,6 +111,25 @@ int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull)
>  }
>  EXPORT_SYMBOL(s3c_gpio_setpull);
>  
> +s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
> +{
> +	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
> +	unsigned long flags;
> +	int offset;
> +	u32 pup = 0;

would the result of s3c_gpio_do_getpull() should be a s3c_gpio_pull_t?

> +	if (chip) {
> +		offset = pin - chip->chip.base;
> +
> +		s3c_gpio_lock(chip, flags);
> +		pup = s3c_gpio_do_getpull(chip, offset);
> +		s3c_gpio_unlock(chip, flags);
> +	}
> +
> +	return (__force s3c_gpio_pull_t)pup;
> +}
> +EXPORT_SYMBOL(s3c_gpio_getpull);

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

* [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API
  2010-10-21 22:17 ` Ben Dooks
@ 2010-10-22  5:22   ` Kukjin Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Kukjin Kim @ 2010-10-22  5:22 UTC (permalink / raw)
  To: linux-arm-kernel

Ben Dooks wrote:
> 
> On 21/10/10 09:04, Kukjin Kim wrote:
> > From: Daein Moon <moon9124@samsung.com>
> >
> > This patch adds the s3c_gpio_getpull() API that has been missed in the
> > plat-samsung/gpio-config.c and actullay there is its extern declaration
> > in plat/gpio-cfg.h.
> >
> > Signed-off-by: Daein Moon <moon9124@samsung.com>
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> > ---
> > NOTE:
> > - already issued about this
> >
> >  arch/arm/plat-samsung/gpio-config.c                |   19
> +++++++++++++++++++
> >  .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    6 ++++++
> >  2 files changed, 25 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-
> samsung/gpio-config.c
> > index 8a37211..b732b77 100644
> > --- a/arch/arm/plat-samsung/gpio-config.c
> > +++ b/arch/arm/plat-samsung/gpio-config.c
> > @@ -111,6 +111,25 @@ int s3c_gpio_setpull(unsigned int pin,
s3c_gpio_pull_t
> pull)
> >  }
> >  EXPORT_SYMBOL(s3c_gpio_setpull);
> >
> > +s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
> > +{
> > +	struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
> > +	unsigned long flags;
> > +	int offset;
> > +	u32 pup = 0;
> 
> would the result of s3c_gpio_do_getpull() should be a s3c_gpio_pull_t?
> 
Yes, righit.

Mr. Moon,
Could you please update your patch as per Ben's comment?

> > +	if (chip) {
> > +		offset = pin - chip->chip.base;
> > +
> > +		s3c_gpio_lock(chip, flags);
> > +		pup = s3c_gpio_do_getpull(chip, offset);
> > +		s3c_gpio_unlock(chip, flags);
> > +	}
> > +
> > +	return (__force s3c_gpio_pull_t)pup;
> > +}
> > +EXPORT_SYMBOL(s3c_gpio_getpull);

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: SAMSUNG: Add the missed s3c_gpio_getpull() API
  2010-10-21 17:47 ` Sergei Shtylyov
@ 2010-10-22  8:05   ` Kukjin Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Kukjin Kim @ 2010-10-22  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Sergei Shtylyov wrote:
> 
> Hello.
> 
Hi,

> On 21-10-2010 12:04, Kukjin Kim wrote:
> 
> > From: Daein Moon<moon9124@samsung.com>
> 
> > This patch adds the s3c_gpio_getpull() API that has been missed in the
> > plat-samsung/gpio-config.c and actullay there is its extern declaration
> > in plat/gpio-cfg.h.
> 
> > Signed-off-by: Daein Moon<moon9124@samsung.com>
> > Cc: Ben Dooks<ben-linux@fluff.org>
> > Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> > ---
> > NOTE:
> > - already issued about this
> 
> >   arch/arm/plat-samsung/gpio-config.c                |   19
> +++++++++++++++++++
> >   .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    6 ++++++
> >   2 files changed, 25 insertions(+), 0 deletions(-)
> 
> > diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-
> samsung/gpio-config.c
> > index 8a37211..b732b77 100644
> > --- a/arch/arm/plat-samsung/gpio-config.c
> > +++ b/arch/arm/plat-samsung/gpio-config.c
> [...]
> > diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> > index 3e21c75..c417f85 100644
> > --- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> > +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> > @@ -42,6 +42,12 @@ static inline int s3c_gpio_do_setpull(struct
> s3c_gpio_chip *chip,
> >   	return (chip->config->set_pull)(chip, off, pull);
> >   }
> >
> > +static inline unsigned s3c_gpio_do_getpull(struct s3c_gpio_chip *chip,
> > +					   unsigned int off)
> > +{
> > +	return (chip->config->get_pull)(chip, off);
> 
>     Parens are not necessary here.
> 
Thanks for your pointing out :-)
Will fix it.

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

end of thread, other threads:[~2010-10-22  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21  8:04 [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API Kukjin Kim
2010-10-21 17:47 ` Sergei Shtylyov
2010-10-22  8:05   ` Kukjin Kim
2010-10-21 22:17 ` Ben Dooks
2010-10-22  5:22   ` Kukjin Kim

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