aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 12:01:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 12:01:02 -0400
commit49eb7b0750d9483c74e9c14ae6ea1e9d62481c3c (patch)
tree68f76b18328d070a4b5182f9ed82c2134cae16d2 /arch/arm/mach-at91/gpio.c
parent5142c33ed86acbcef5c63a63d2b7384b9210d39f (diff)
parent9ce4f8f3f45443922c98e25133b8c9790fc7949a (diff)
Merge tag 'tty-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty into next
Pull tty/serial driver updates from Greg KH: "Here is the big tty / serial driver pull request for 3.16-rc1. A variety of different serial driver fixes and updates and additions, nothing huge, and no real major core tty changes at all. All have been in linux-next for a while" * tag 'tty-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (84 commits) Revert "serial: imx: remove the DMA wait queue" serial: kgdb_nmi: Improve console integration with KDB I/O serial: kgdb_nmi: Switch from tasklets to real timers serial: kgdb_nmi: Use container_of() to locate private data serial: cpm_uart: No LF conversion in put_poll_char() serial: sirf: Fix compilation failure console: Remove superfluous readonly check console: Use explicit pointer type for vc_uni_pagedir* fields vgacon: Fix & cleanup refcounting ARM: tty: Move HVC DCC assembly to arch/arm tty/hvc/hvc_console: Fix wakeup of HVC thread on hvc_kick() drivers/tty/n_hdlc.c: replace kmalloc/memset by kzalloc vt: emulate 8- and 24-bit colour codes. printk/of_serial: fix serial console cessation part way through boot. serial: 8250_dma: check the result of TX buffer mapping serial: uart: add hw flow control support configuration tty/serial: at91: add interrupts for modem control lines tty/serial: at91: use mctrl_gpio helpers tty/serial: Add GPIOLIB helpers for controlling modem lines ARM: at91: gpio: implement get_direction ...
Diffstat (limited to 'arch/arm/mach-at91/gpio.c')
-rw-r--r--arch/arm/mach-at91/gpio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index 12ed05bbdc5c..d3f05aaad8ba 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -50,6 +50,7 @@ static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset);
50static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip); 50static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip);
51static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val); 51static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val);
52static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset); 52static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset);
53static int at91_gpiolib_get_direction(struct gpio_chip *chip, unsigned offset);
53static int at91_gpiolib_direction_output(struct gpio_chip *chip, 54static int at91_gpiolib_direction_output(struct gpio_chip *chip,
54 unsigned offset, int val); 55 unsigned offset, int val);
55static int at91_gpiolib_direction_input(struct gpio_chip *chip, 56static int at91_gpiolib_direction_input(struct gpio_chip *chip,
@@ -61,6 +62,7 @@ static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset);
61 .chip = { \ 62 .chip = { \
62 .label = name, \ 63 .label = name, \
63 .request = at91_gpiolib_request, \ 64 .request = at91_gpiolib_request, \
65 .get_direction = at91_gpiolib_get_direction, \
64 .direction_input = at91_gpiolib_direction_input, \ 66 .direction_input = at91_gpiolib_direction_input, \
65 .direction_output = at91_gpiolib_direction_output, \ 67 .direction_output = at91_gpiolib_direction_output, \
66 .get = at91_gpiolib_get, \ 68 .get = at91_gpiolib_get, \
@@ -800,6 +802,17 @@ static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset)
800 return 0; 802 return 0;
801} 803}
802 804
805static int at91_gpiolib_get_direction(struct gpio_chip *chip, unsigned offset)
806{
807 struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
808 void __iomem *pio = at91_gpio->regbase;
809 unsigned mask = 1 << offset;
810 u32 osr;
811
812 osr = __raw_readl(pio + PIO_OSR);
813 return !(osr & mask);
814}
815
803static int at91_gpiolib_direction_input(struct gpio_chip *chip, 816static int at91_gpiolib_direction_input(struct gpio_chip *chip,
804 unsigned offset) 817 unsigned offset)
805{ 818{