diff options
author | Jeff Hatch <jhatch@multitech.com> | 2017-02-13 14:34:15 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2017-06-09 09:09:19 -0500 |
commit | cc54a92a36f5fcd65e69f51060c4147286d22b62 (patch) | |
tree | 528e8c203b35f37d71fefb49b396b2a721980daa /recipes-kernel/linux/linux-3.12.70/linux-3.12-at91-gpio-pullup.patch | |
parent | 8ed17578476277bad96ae473bb7d533a97cc9d46 (diff) | |
download | meta-multitech-cc54a92a36f5fcd65e69f51060c4147286d22b62.tar.gz meta-multitech-cc54a92a36f5fcd65e69f51060c4147286d22b62.tar.bz2 meta-multitech-cc54a92a36f5fcd65e69f51060c4147286d22b62.zip |
Initial commit of Yocto 2.1 changes
Diffstat (limited to 'recipes-kernel/linux/linux-3.12.70/linux-3.12-at91-gpio-pullup.patch')
-rw-r--r-- | recipes-kernel/linux/linux-3.12.70/linux-3.12-at91-gpio-pullup.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.12.70/linux-3.12-at91-gpio-pullup.patch b/recipes-kernel/linux/linux-3.12.70/linux-3.12-at91-gpio-pullup.patch new file mode 100644 index 0000000..583a205 --- /dev/null +++ b/recipes-kernel/linux/linux-3.12.70/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); |