summaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91rm9200/gpio.c
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-02-22 21:23:35 (GMT)
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-02-22 21:23:35 (GMT)
commitdf666b9c510fd27fd3b1afd9ddfa1eaa62ce12b3 (patch)
tree825879502f74636641a86724514f2ea4e3c9c240 /arch/arm/mach-at91rm9200/gpio.c
parent43cc19816b3fc5286258e6f5e43ef4ead458f9a3 (diff)
downloadlinux-fsl-qoriq-df666b9c510fd27fd3b1afd9ddfa1eaa62ce12b3.tar.xz
[ARM] 3325/2: GPIO function to control multi-drive (open collector) capability
Patch from Andrew Victor This patch adds the at91_set_multi_drive() function to enable/disable the multi-drive (open collector) pin capability on the AT91RM9200 processor. This is necessary to fix the UDC (USB Gadget) driver for the AT91RM9200 board as it will not allow the board reset line to be pulled low if the pullup is not driven as an open collector output as the boards are wired to the USB connector on both the DK/EK. This version of the patch updates it to 2.6.16-rc4. Orignal patch by Jeff Warren. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91rm9200/gpio.c')
-rw-r--r--arch/arm/mach-at91rm9200/gpio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c
index 2fd2ef5..a9f718b 100644
--- a/arch/arm/mach-at91rm9200/gpio.c
+++ b/arch/arm/mach-at91rm9200/gpio.c
@@ -159,6 +159,23 @@ int __init_or_module at91_set_deglitch(unsigned pin, int is_on)
}
EXPORT_SYMBOL(at91_set_deglitch);
+/*
+ * enable/disable the multi-driver; This is only valid for output and
+ * allows the output pin to run as an open collector output.
+ */
+int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
+{
+ void __iomem *pio = pin_to_controller(pin);
+ unsigned mask = pin_to_mask(pin);
+
+ if (!pio)
+ return -EINVAL;
+
+ __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
+ return 0;
+}
+EXPORT_SYMBOL(at91_set_multi_drive);
+
/*--------------------------------------------------------------------------*/