summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2014-11-04 11:23:21 -0600
committerJesse Gilles <jgilles@multitech.com>2014-11-04 11:23:21 -0600
commit812befa503067ad2bae5de58962ff38321c369ca (patch)
treeb472b5118f62e97f760a5b23f3a72130e5ce235b /recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch
downloadmeta-multitech-812befa503067ad2bae5de58962ff38321c369ca.tar.gz
meta-multitech-812befa503067ad2bae5de58962ff38321c369ca.tar.bz2
meta-multitech-812befa503067ad2bae5de58962ff38321c369ca.zip
initial commit with MTCDT support
Diffstat (limited to 'recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch')
-rw-r--r--recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch b/recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch
new file mode 100644
index 0000000..583a205
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.12.27/linux-3.12-at91-gpio-pullup.patch
@@ -0,0 +1,42 @@
+Index: linux-3.12.13/arch/arm/mach-at91/gpio.c
+===================================================================
+--- linux-3.12.13.orig/arch/arm/mach-at91/gpio.c 2014-02-22 15:32:50.000000000 -0600
++++ linux-3.12.13/arch/arm/mach-at91/gpio.c 2014-03-07 09:13:09.931501303 -0600
+@@ -294,6 +294,25 @@
+ }
+ EXPORT_SYMBOL(at91_set_gpio_output);
+
++/*
++ * configure pin for output and enable/disable pullup
++ */
++int __init_or_module at91_set_gpio_output_with_pullup(unsigned pin, int value, int use_pullup)
++{
++ void __iomem *pio = pin_to_controller(pin);
++ unsigned mask = pin_to_mask(pin);
++
++ if (!pio)
++ return -EINVAL;
++
++ __raw_writel(mask, pio + PIO_IDR);
++ __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
++ __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
++ __raw_writel(mask, pio + PIO_OER);
++ __raw_writel(mask, pio + PIO_PER);
++ return 0;
++}
++EXPORT_SYMBOL(at91_set_gpio_output_with_pullup);
+
+ /*
+ * enable/disable the glitch filter; mostly used with IRQ handling.
+Index: linux-3.12.13/arch/arm/mach-at91/include/mach/gpio.h
+===================================================================
+--- linux-3.12.13.orig/arch/arm/mach-at91/include/mach/gpio.h 2014-02-22 15:32:50.000000000 -0600
++++ linux-3.12.13/arch/arm/mach-at91/include/mach/gpio.h 2014-03-07 09:13:39.331501866 -0600
+@@ -195,6 +195,7 @@
+ extern int __init_or_module at91_set_D_periph(unsigned pin, int use_pullup);
+ extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
+ extern int __init_or_module at91_set_gpio_output(unsigned pin, int value);
++extern int __init_or_module at91_set_gpio_output_with_pullup(unsigned pin, int value, int use_pullup);
+ extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on);
+ extern int __init_or_module at91_set_debounce(unsigned pin, int is_on, int div);
+ extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on);