From 12b7397667cdb406b5785e0600a90622865bfd23 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Mon, 3 Oct 2011 12:20:15 -0500 Subject: linux-2.6.35: add at91-gpio-pullup patch for mtcdp --- .../linux-2.6.35.14-at91-gpio-pullup.patch | 43 ++++++++++++++++++++++ .../linux-2.6.35.14-at91-gpio-pullup.patch | 43 ---------------------- multitech/recipes/linux/linux_2.6.35.bbappend | 3 +- 3 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 multitech/recipes/linux/linux-2.6.35/linux-2.6.35.14-at91-gpio-pullup.patch delete mode 100644 multitech/recipes/linux/linux-2.6.35/mt100eocg/linux-2.6.35.14-at91-gpio-pullup.patch diff --git a/multitech/recipes/linux/linux-2.6.35/linux-2.6.35.14-at91-gpio-pullup.patch b/multitech/recipes/linux/linux-2.6.35/linux-2.6.35.14-at91-gpio-pullup.patch new file mode 100644 index 0000000..d967838 --- /dev/null +++ b/multitech/recipes/linux/linux-2.6.35/linux-2.6.35.14-at91-gpio-pullup.patch @@ -0,0 +1,43 @@ +Index: linux-2.6.35/arch/arm/mach-at91/gpio.c +=================================================================== +--- linux-2.6.35.orig/arch/arm/mach-at91/gpio.c 2011-09-27 14:36:06.587267689 -0500 ++++ linux-2.6.35/arch/arm/mach-at91/gpio.c 2011-09-27 14:42:50.997576753 -0500 +@@ -202,6 +202,26 @@ + } + 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-2.6.35/arch/arm/mach-at91/include/mach/gpio.h +=================================================================== +--- linux-2.6.35.orig/arch/arm/mach-at91/include/mach/gpio.h ++++ linux-2.6.35/arch/arm/mach-at91/include/mach/gpio.h +@@ -194,6 +194,7 @@ extern int __init_or_module at91_set_A_p + extern int __init_or_module at91_set_B_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_multi_drive(unsigned pin, int is_on); + diff --git a/multitech/recipes/linux/linux-2.6.35/mt100eocg/linux-2.6.35.14-at91-gpio-pullup.patch b/multitech/recipes/linux/linux-2.6.35/mt100eocg/linux-2.6.35.14-at91-gpio-pullup.patch deleted file mode 100644 index d967838..0000000 --- a/multitech/recipes/linux/linux-2.6.35/mt100eocg/linux-2.6.35.14-at91-gpio-pullup.patch +++ /dev/null @@ -1,43 +0,0 @@ -Index: linux-2.6.35/arch/arm/mach-at91/gpio.c -=================================================================== ---- linux-2.6.35.orig/arch/arm/mach-at91/gpio.c 2011-09-27 14:36:06.587267689 -0500 -+++ linux-2.6.35/arch/arm/mach-at91/gpio.c 2011-09-27 14:42:50.997576753 -0500 -@@ -202,6 +202,26 @@ - } - 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-2.6.35/arch/arm/mach-at91/include/mach/gpio.h -=================================================================== ---- linux-2.6.35.orig/arch/arm/mach-at91/include/mach/gpio.h -+++ linux-2.6.35/arch/arm/mach-at91/include/mach/gpio.h -@@ -194,6 +194,7 @@ extern int __init_or_module at91_set_A_p - extern int __init_or_module at91_set_B_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_multi_drive(unsigned pin, int is_on); - diff --git a/multitech/recipes/linux/linux_2.6.35.bbappend b/multitech/recipes/linux/linux_2.6.35.bbappend index a256488..6a6286a 100644 --- a/multitech/recipes/linux/linux_2.6.35.bbappend +++ b/multitech/recipes/linux/linux_2.6.35.bbappend @@ -1,13 +1,14 @@ FILESEXTRA := "${THISDIR}" FILESPATHBASE =. "${FILESEXTRA}:" -PR .= ".corecdp4" +PR .= ".corecdp5" STABLEV = "14" SRC_URI_mtcdp = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/longterm/v${PV}/patch-${PV}.${STABLEV}.bz2;apply=yes;name=stablepatch \ file://defconfig \ file://linux-2.6.35.14-mach-at91.patch \ + file://linux-2.6.35.14-at91-gpio-pullup.patch \ file://linux-2.6.35-sierra-1.7.40.patch \ file://linux-2.6.32.3-atmel_spi.patch \ file://linux-2.6.32.3-at25.patch \ -- cgit v1.2.3