From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: linux-arm-kernel@lists.infradead.org
Cc: devicetree-discuss@lists.ozlabs.org,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Subject: [PATCH 03/16] ARM: at91: gpio: implement request
Date: Mon, 17 Sep 2012 17:27:00 +0200 [thread overview]
Message-ID: <1347895633-1763-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1347895633-1763-1-git-send-email-plagnioj@jcrosoft.com>
Configure the pin as pio when requested.
It is needed to configure the pin as PIO at "request time" when we are
using DT. Indeed, the muxing via old AT91 API is not allowed anymore if
we are using the plain gpiolib.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/mach-at91/gpio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index be42cf0..3b8f463 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -46,6 +46,7 @@ struct at91_gpio_chip {
#define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip)
+static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset);
static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip);
static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val);
static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset);
@@ -59,6 +60,7 @@ static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset);
{ \
.chip = { \
.label = name, \
+ .request = at91_gpiolib_request, \
.direction_input = at91_gpiolib_direction_input, \
.direction_output = at91_gpiolib_direction_output, \
.get = at91_gpiolib_get, \
@@ -862,6 +864,16 @@ void __init at91_gpio_irq_setup(void)
}
/* gpiolib support */
+static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset)
+{
+ struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
+ void __iomem *pio = at91_gpio->regbase;
+ unsigned mask = 1 << offset;
+
+ __raw_writel(mask, pio + PIO_PER);
+ return 0;
+}
+
static int at91_gpiolib_direction_input(struct gpio_chip *chip,
unsigned offset)
{
--
1.7.10.4
next prev parent reply other threads:[~2012-09-17 15:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120917140423.GA17667@game.jcrosoft.org>
2012-09-17 15:26 ` [PATCH 01/16] ARM: at91: fix missing #interrupt-cells on gpio-controller Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:26 ` [PATCH 02/16] arm: at91: use macro to declare soc boot data Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
[not found] ` <1347895633-1763-1-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2012-09-17 15:27 ` [PATCH 04/16] at91: regroup gpio and pinctrl under the same ranges Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 05/16] arm: at91: at91sam9x5: fix gpio number per bank Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 06/16] ARM: at91: add dummies pinctrl for non dt platform Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 07/16] ARM: at91: add pinctrl support Jean-Christophe PLAGNIOL-VILLARD
[not found] ` <1347895633-1763-7-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2012-09-25 14:59 ` Nicolas Ferre
2012-09-17 15:27 ` [PATCH 08/16] arm: at91: dt: at91sam9 " Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 09/16] arm: at91: dt: at91sam9 add serial " Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 10/16] tty: atmel_serial: add " Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 11/16] arm: at91: dt: sam9m10g45ek: use rts/cts pinctrl group for uart1 Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 12/16] arm: at91: dt: sam9263ek: use rts/cts pinctrl group for uart0 Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 13/16] arm: at91: dt: sam9g20ek: use rts/cts/dtr/dsr/dcd/ri " Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 14/16] MTD: atmel nand: fix gpio missing request Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 15/16] arm: at91: dt: at91sam9 add nand pinctrl support Jean-Christophe PLAGNIOL-VILLARD
2012-09-17 15:27 ` [PATCH 16/16] MTD: atmel_nand: add pinctrl consumer support Jean-Christophe PLAGNIOL-VILLARD
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=1347895633-1763-3-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--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).