From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Dooks Subject: Re: [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API Date: Thu, 21 Oct 2010 23:17:45 +0100 Message-ID: <4CC0BC09.5090803@fluff.org> References: <1287648286-7202-1-git-send-email-kgene.kim@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from dsl78-143-211-26.in-addr.fast.co.uk ([78.143.211.26]:42521 "EHLO ben-laptop" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752053Ab0JUWRu (ORCPT ); Thu, 21 Oct 2010 18:17:50 -0400 In-Reply-To: <1287648286-7202-1-git-send-email-kgene.kim@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Daein Moon , ben-linux@fluff.org On 21/10/10 09:04, Kukjin Kim wrote: > From: Daein Moon > > 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 > Cc: Ben Dooks > Signed-off-by: Kukjin Kim > --- > 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); From mboxrd@z Thu Jan 1 00:00:00 1970 From: ben-linux@fluff.org (Ben Dooks) Date: Thu, 21 Oct 2010 23:17:45 +0100 Subject: [PATCH] ARM: SAMSUNG: Add the missed s3c_gpio_getpull() API In-Reply-To: <1287648286-7202-1-git-send-email-kgene.kim@samsung.com> References: <1287648286-7202-1-git-send-email-kgene.kim@samsung.com> Message-ID: <4CC0BC09.5090803@fluff.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 21/10/10 09:04, Kukjin Kim wrote: > From: Daein Moon > > 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 > Cc: Ben Dooks > Signed-off-by: Kukjin Kim > --- > 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);