aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
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
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')
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c16
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c7
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c4
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c5
-rw-r--r--arch/arm/mach-at91/gpio.c13
7 files changed, 23 insertions, 31 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 4860918b411e..3f4bb58aea54 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/gpio/driver.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/i2c-gpio.h> 20#include <linux/i2c-gpio.h>
20 21
@@ -924,7 +925,6 @@ static struct resource dbgu_resources[] = {
924static struct atmel_uart_data dbgu_data = { 925static struct atmel_uart_data dbgu_data = {
925 .use_dma_tx = 0, 926 .use_dma_tx = 0,
926 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 927 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
927 .rts_gpio = -EINVAL,
928}; 928};
929 929
930static u64 dbgu_dmamask = DMA_BIT_MASK(32); 930static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -963,7 +963,14 @@ static struct resource uart0_resources[] = {
963static struct atmel_uart_data uart0_data = { 963static struct atmel_uart_data uart0_data = {
964 .use_dma_tx = 1, 964 .use_dma_tx = 1,
965 .use_dma_rx = 1, 965 .use_dma_rx = 1,
966 .rts_gpio = -EINVAL, 966};
967
968static struct gpiod_lookup_table uart0_gpios_table = {
969 .dev_id = "atmel_usart",
970 .table = {
971 GPIO_LOOKUP("pioA", 21, "rts", GPIO_ACTIVE_LOW),
972 { },
973 },
967}; 974};
968 975
969static u64 uart0_dmamask = DMA_BIT_MASK(32); 976static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -994,7 +1001,7 @@ static inline void configure_usart0_pins(unsigned pins)
994 * We need to drive the pin manually. The serial driver will driver 1001 * We need to drive the pin manually. The serial driver will driver
995 * this to high when initializing. 1002 * this to high when initializing.
996 */ 1003 */
997 uart0_data.rts_gpio = AT91_PIN_PA21; 1004 gpiod_add_lookup_table(&uart0_gpios_table);
998 } 1005 }
999} 1006}
1000 1007
@@ -1014,7 +1021,6 @@ static struct resource uart1_resources[] = {
1014static struct atmel_uart_data uart1_data = { 1021static struct atmel_uart_data uart1_data = {
1015 .use_dma_tx = 1, 1022 .use_dma_tx = 1,
1016 .use_dma_rx = 1, 1023 .use_dma_rx = 1,
1017 .rts_gpio = -EINVAL,
1018}; 1024};
1019 1025
1020static u64 uart1_dmamask = DMA_BIT_MASK(32); 1026static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1066,7 +1072,6 @@ static struct resource uart2_resources[] = {
1066static struct atmel_uart_data uart2_data = { 1072static struct atmel_uart_data uart2_data = {
1067 .use_dma_tx = 1, 1073 .use_dma_tx = 1,
1068 .use_dma_rx = 1, 1074 .use_dma_rx = 1,
1069 .rts_gpio = -EINVAL,
1070}; 1075};
1071 1076
1072static u64 uart2_dmamask = DMA_BIT_MASK(32); 1077static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1110,7 +1115,6 @@ static struct resource uart3_resources[] = {
1110static struct atmel_uart_data uart3_data = { 1115static struct atmel_uart_data uart3_data = {
1111 .use_dma_tx = 1, 1116 .use_dma_tx = 1,
1112 .use_dma_rx = 1, 1117 .use_dma_rx = 1,
1113 .rts_gpio = -EINVAL,
1114}; 1118};
1115 1119
1116static u64 uart3_dmamask = DMA_BIT_MASK(32); 1120static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index adcfb88a5d7d..ef88e0fe4e80 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -819,7 +819,6 @@ static struct resource dbgu_resources[] = {
819static struct atmel_uart_data dbgu_data = { 819static struct atmel_uart_data dbgu_data = {
820 .use_dma_tx = 0, 820 .use_dma_tx = 0,
821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
822 .rts_gpio = -EINVAL,
823}; 822};
824 823
825static u64 dbgu_dmamask = DMA_BIT_MASK(32); 824static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -858,7 +857,6 @@ static struct resource uart0_resources[] = {
858static struct atmel_uart_data uart0_data = { 857static struct atmel_uart_data uart0_data = {
859 .use_dma_tx = 1, 858 .use_dma_tx = 1,
860 .use_dma_rx = 1, 859 .use_dma_rx = 1,
861 .rts_gpio = -EINVAL,
862}; 860};
863 861
864static u64 uart0_dmamask = DMA_BIT_MASK(32); 862static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -910,7 +908,6 @@ static struct resource uart1_resources[] = {
910static struct atmel_uart_data uart1_data = { 908static struct atmel_uart_data uart1_data = {
911 .use_dma_tx = 1, 909 .use_dma_tx = 1,
912 .use_dma_rx = 1, 910 .use_dma_rx = 1,
913 .rts_gpio = -EINVAL,
914}; 911};
915 912
916static u64 uart1_dmamask = DMA_BIT_MASK(32); 913static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -954,7 +951,6 @@ static struct resource uart2_resources[] = {
954static struct atmel_uart_data uart2_data = { 951static struct atmel_uart_data uart2_data = {
955 .use_dma_tx = 1, 952 .use_dma_tx = 1,
956 .use_dma_rx = 1, 953 .use_dma_rx = 1,
957 .rts_gpio = -EINVAL,
958}; 954};
959 955
960static u64 uart2_dmamask = DMA_BIT_MASK(32); 956static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -998,7 +994,6 @@ static struct resource uart3_resources[] = {
998static struct atmel_uart_data uart3_data = { 994static struct atmel_uart_data uart3_data = {
999 .use_dma_tx = 1, 995 .use_dma_tx = 1,
1000 .use_dma_rx = 1, 996 .use_dma_rx = 1,
1001 .rts_gpio = -EINVAL,
1002}; 997};
1003 998
1004static u64 uart3_dmamask = DMA_BIT_MASK(32); 999static u64 uart3_dmamask = DMA_BIT_MASK(32);
@@ -1042,7 +1037,6 @@ static struct resource uart4_resources[] = {
1042static struct atmel_uart_data uart4_data = { 1037static struct atmel_uart_data uart4_data = {
1043 .use_dma_tx = 1, 1038 .use_dma_tx = 1,
1044 .use_dma_rx = 1, 1039 .use_dma_rx = 1,
1045 .rts_gpio = -EINVAL,
1046}; 1040};
1047 1041
1048static u64 uart4_dmamask = DMA_BIT_MASK(32); 1042static u64 uart4_dmamask = DMA_BIT_MASK(32);
@@ -1081,7 +1075,6 @@ static struct resource uart5_resources[] = {
1081static struct atmel_uart_data uart5_data = { 1075static struct atmel_uart_data uart5_data = {
1082 .use_dma_tx = 1, 1076 .use_dma_tx = 1,
1083 .use_dma_rx = 1, 1077 .use_dma_rx = 1,
1084 .rts_gpio = -EINVAL,
1085}; 1078};
1086 1079
1087static u64 uart5_dmamask = DMA_BIT_MASK(32); 1080static u64 uart5_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 43b21f456f6e..29baacb5c359 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -881,7 +881,6 @@ static struct resource dbgu_resources[] = {
881static struct atmel_uart_data dbgu_data = { 881static struct atmel_uart_data dbgu_data = {
882 .use_dma_tx = 0, 882 .use_dma_tx = 0,
883 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 883 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
884 .rts_gpio = -EINVAL,
885}; 884};
886 885
887static u64 dbgu_dmamask = DMA_BIT_MASK(32); 886static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -920,7 +919,6 @@ static struct resource uart0_resources[] = {
920static struct atmel_uart_data uart0_data = { 919static struct atmel_uart_data uart0_data = {
921 .use_dma_tx = 1, 920 .use_dma_tx = 1,
922 .use_dma_rx = 1, 921 .use_dma_rx = 1,
923 .rts_gpio = -EINVAL,
924}; 922};
925 923
926static u64 uart0_dmamask = DMA_BIT_MASK(32); 924static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -964,7 +962,6 @@ static struct resource uart1_resources[] = {
964static struct atmel_uart_data uart1_data = { 962static struct atmel_uart_data uart1_data = {
965 .use_dma_tx = 1, 963 .use_dma_tx = 1,
966 .use_dma_rx = 1, 964 .use_dma_rx = 1,
967 .rts_gpio = -EINVAL,
968}; 965};
969 966
970static u64 uart1_dmamask = DMA_BIT_MASK(32); 967static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1008,7 +1005,6 @@ static struct resource uart2_resources[] = {
1008static struct atmel_uart_data uart2_data = { 1005static struct atmel_uart_data uart2_data = {
1009 .use_dma_tx = 1, 1006 .use_dma_tx = 1,
1010 .use_dma_rx = 1, 1007 .use_dma_rx = 1,
1011 .rts_gpio = -EINVAL,
1012}; 1008};
1013 1009
1014static u64 uart2_dmamask = DMA_BIT_MASK(32); 1010static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 953616e5dbcb..309390d8e2f8 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -1326,7 +1326,6 @@ static struct resource dbgu_resources[] = {
1326static struct atmel_uart_data dbgu_data = { 1326static struct atmel_uart_data dbgu_data = {
1327 .use_dma_tx = 0, 1327 .use_dma_tx = 0,
1328 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 1328 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1329 .rts_gpio = -EINVAL,
1330}; 1329};
1331 1330
1332static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1331static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1365,7 +1364,6 @@ static struct resource uart0_resources[] = {
1365static struct atmel_uart_data uart0_data = { 1364static struct atmel_uart_data uart0_data = {
1366 .use_dma_tx = 1, 1365 .use_dma_tx = 1,
1367 .use_dma_rx = 1, 1366 .use_dma_rx = 1,
1368 .rts_gpio = -EINVAL,
1369}; 1367};
1370 1368
1371static u64 uart0_dmamask = DMA_BIT_MASK(32); 1369static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1409,7 +1407,6 @@ static struct resource uart1_resources[] = {
1409static struct atmel_uart_data uart1_data = { 1407static struct atmel_uart_data uart1_data = {
1410 .use_dma_tx = 1, 1408 .use_dma_tx = 1,
1411 .use_dma_rx = 1, 1409 .use_dma_rx = 1,
1412 .rts_gpio = -EINVAL,
1413}; 1410};
1414 1411
1415static u64 uart1_dmamask = DMA_BIT_MASK(32); 1412static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1453,7 +1450,6 @@ static struct resource uart2_resources[] = {
1453static struct atmel_uart_data uart2_data = { 1450static struct atmel_uart_data uart2_data = {
1454 .use_dma_tx = 1, 1451 .use_dma_tx = 1,
1455 .use_dma_rx = 1, 1452 .use_dma_rx = 1,
1456 .rts_gpio = -EINVAL,
1457}; 1453};
1458 1454
1459static u64 uart2_dmamask = DMA_BIT_MASK(32); 1455static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index d943363c1845..391ab6bb536a 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1528,7 +1528,6 @@ static struct resource dbgu_resources[] = {
1528static struct atmel_uart_data dbgu_data = { 1528static struct atmel_uart_data dbgu_data = {
1529 .use_dma_tx = 0, 1529 .use_dma_tx = 0,
1530 .use_dma_rx = 0, 1530 .use_dma_rx = 0,
1531 .rts_gpio = -EINVAL,
1532}; 1531};
1533 1532
1534static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1533static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1567,7 +1566,6 @@ static struct resource uart0_resources[] = {
1567static struct atmel_uart_data uart0_data = { 1566static struct atmel_uart_data uart0_data = {
1568 .use_dma_tx = 1, 1567 .use_dma_tx = 1,
1569 .use_dma_rx = 1, 1568 .use_dma_rx = 1,
1570 .rts_gpio = -EINVAL,
1571}; 1569};
1572 1570
1573static u64 uart0_dmamask = DMA_BIT_MASK(32); 1571static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1611,7 +1609,6 @@ static struct resource uart1_resources[] = {
1611static struct atmel_uart_data uart1_data = { 1609static struct atmel_uart_data uart1_data = {
1612 .use_dma_tx = 1, 1610 .use_dma_tx = 1,
1613 .use_dma_rx = 1, 1611 .use_dma_rx = 1,
1614 .rts_gpio = -EINVAL,
1615}; 1612};
1616 1613
1617static u64 uart1_dmamask = DMA_BIT_MASK(32); 1614static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1655,7 +1652,6 @@ static struct resource uart2_resources[] = {
1655static struct atmel_uart_data uart2_data = { 1652static struct atmel_uart_data uart2_data = {
1656 .use_dma_tx = 1, 1653 .use_dma_tx = 1,
1657 .use_dma_rx = 1, 1654 .use_dma_rx = 1,
1658 .rts_gpio = -EINVAL,
1659}; 1655};
1660 1656
1661static u64 uart2_dmamask = DMA_BIT_MASK(32); 1657static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1699,7 +1695,6 @@ static struct resource uart3_resources[] = {
1699static struct atmel_uart_data uart3_data = { 1695static struct atmel_uart_data uart3_data = {
1700 .use_dma_tx = 1, 1696 .use_dma_tx = 1,
1701 .use_dma_rx = 1, 1697 .use_dma_rx = 1,
1702 .rts_gpio = -EINVAL,
1703}; 1698};
1704 1699
1705static u64 uart3_dmamask = DMA_BIT_MASK(32); 1700static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 044ad8bc6963..0b1d71a7d9bf 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -993,7 +993,6 @@ static struct resource dbgu_resources[] = {
993static struct atmel_uart_data dbgu_data = { 993static struct atmel_uart_data dbgu_data = {
994 .use_dma_tx = 0, 994 .use_dma_tx = 0,
995 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 995 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
996 .rts_gpio = -EINVAL,
997}; 996};
998 997
999static u64 dbgu_dmamask = DMA_BIT_MASK(32); 998static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1032,7 +1031,6 @@ static struct resource uart0_resources[] = {
1032static struct atmel_uart_data uart0_data = { 1031static struct atmel_uart_data uart0_data = {
1033 .use_dma_tx = 1, 1032 .use_dma_tx = 1,
1034 .use_dma_rx = 1, 1033 .use_dma_rx = 1,
1035 .rts_gpio = -EINVAL,
1036}; 1034};
1037 1035
1038static u64 uart0_dmamask = DMA_BIT_MASK(32); 1036static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1084,7 +1082,6 @@ static struct resource uart1_resources[] = {
1084static struct atmel_uart_data uart1_data = { 1082static struct atmel_uart_data uart1_data = {
1085 .use_dma_tx = 1, 1083 .use_dma_tx = 1,
1086 .use_dma_rx = 1, 1084 .use_dma_rx = 1,
1087 .rts_gpio = -EINVAL,
1088}; 1085};
1089 1086
1090static u64 uart1_dmamask = DMA_BIT_MASK(32); 1087static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1128,7 +1125,6 @@ static struct resource uart2_resources[] = {
1128static struct atmel_uart_data uart2_data = { 1125static struct atmel_uart_data uart2_data = {
1129 .use_dma_tx = 1, 1126 .use_dma_tx = 1,
1130 .use_dma_rx = 1, 1127 .use_dma_rx = 1,
1131 .rts_gpio = -EINVAL,
1132}; 1128};
1133 1129
1134static u64 uart2_dmamask = DMA_BIT_MASK(32); 1130static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1172,7 +1168,6 @@ static struct resource uart3_resources[] = {
1172static struct atmel_uart_data uart3_data = { 1168static struct atmel_uart_data uart3_data = {
1173 .use_dma_tx = 1, 1169 .use_dma_tx = 1,
1174 .use_dma_rx = 1, 1170 .use_dma_rx = 1,
1175 .rts_gpio = -EINVAL,
1176}; 1171};
1177 1172
1178static u64 uart3_dmamask = DMA_BIT_MASK(32); 1173static u64 uart3_dmamask = DMA_BIT_MASK(32);
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{