[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.1-299-gfd18e0d
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2012-05-11 13:10:04
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via fd18e0d5ef2517e6208997666d137786ab7c7533 (commit)
from d0272270eb76595069eb68c8c223fb60730e4b60 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fd18e0d5ef2517e6208997666d137786ab7c7533
Author: Eric Jarrige <eri...@ar...>
Date: Fri May 11 15:09:38 2012 +0200
[linux] apf28: Support dual edge GPIO interrupts, GPIO_LEDs and GPIO_KEYS
-----------------------------------------------------------------------
Summary of changes:
...1-armadeus-add_apf28dev_baseboard_support.patch | 83 ++++++++++++-----
...eus-mx28_support_gpio_both_edge_interrupt.patch | 97 ++++++++++++++++++++
2 files changed, 157 insertions(+), 23 deletions(-)
create mode 100644 patches/linux/2.6.35/454-armadeus-mx28_support_gpio_both_edge_interrupt.patch
diff --git a/patches/linux/2.6.35/451-armadeus-add_apf28dev_baseboard_support.patch b/patches/linux/2.6.35/451-armadeus-add_apf28dev_baseboard_support.patch
index 6d8c4c0..6871627 100644
--- a/patches/linux/2.6.35/451-armadeus-add_apf28dev_baseboard_support.patch
+++ b/patches/linux/2.6.35/451-armadeus-add_apf28dev_baseboard_support.patch
@@ -45,7 +45,7 @@ Index: linux-2.6.35.3/arch/arm/mach-mx28/apf28dev.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.35.3/arch/arm/mach-mx28/apf28dev.c 2012-02-15 15:51:09.000000000 +0100
-@@ -0,0 +1,344 @@
+@@ -0,0 +1,381 @@
+/*
+ * Copyright (C) 2012 Armadeus systems
+ *
@@ -72,6 +72,9 @@ Index: linux-2.6.35.3/arch/arm/mach-mx28/apf28dev.c
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/clk.h>
++#include <linux/gpio_keys.h>
++#include <linux/input.h>
++#include <linux/leds.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+
@@ -349,35 +352,69 @@ Index: linux-2.6.35.3/arch/arm/mach-mx28/apf28dev.c
+ .drive = 1,
+ .pull = 0,
+ },
++};
++
++#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
++static struct gpio_keys_button apf28dev_gpio_keys[] = {
+ {
-+ .name = "BT0",
-+ .id = PINID_GPMI_CE1N,
-+ .fun = PIN_GPIO,
-+ .strength = PAD_4MA,
-+ .voltage = PAD_3_3V,
-+ .pullup = 0,
-+ .drive = !0,
-+ .pull = 0,
-+ .output = 0,
++ .code = BTN_EXTRA, /* See include/linux/input.h */
++ .gpio = MXS_PIN_TO_GPIO(PINID_GPMI_CE1N), /* GPIO number */
++ .active_low = 1,
++ .desc = "user", /* Button description*/
++ .wakeup = 0, /* no wakeup possible with this button */
+ },
++};
++
++static struct gpio_keys_platform_data apf28dev_gpio_keys_data = {
++ .buttons = apf28dev_gpio_keys,
++ .nbuttons = ARRAY_SIZE(apf28dev_gpio_keys),
++};
++
++static struct platform_device apf28dev_gpio_keys_device = {
++ .name = "gpio-keys",
++ .id = -1,
++ .dev = {
++ .platform_data = &apf28dev_gpio_keys_data,
++ },
++};
++#endif /* CONFIG_KEYBOARD_GPIO */
++
++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
++static struct gpio_led apf28dev_led[] = {
+ {
-+ .name = "LED",
-+ .id = PINID_GPMI_RDY1,
-+ .fun = PIN_GPIO,
-+ .strength = PAD_4MA,
-+ .voltage = PAD_3_3V,
-+ .pullup = 0,
-+ .drive = !0,
-+ .pull = 0,
-+ .output = 1,
-+ .data = 1,
++ .name = "apf28dev:green:led",
++ .default_trigger = "heartbeat",
++ .gpio = MXS_PIN_TO_GPIO(PINID_GPMI_RDY1),
+ },
+};
+
++static struct gpio_led_platform_data apf28dev_led_data = {
++ .num_leds = ARRAY_SIZE(apf28dev_led),
++ .leds = apf28dev_led
++};
++
++static struct platform_device apf28dev_led_dev = {
++ .name = "leds-gpio",
++ .id = -1,
++ .dev = {
++ .platform_data = &apf28dev_led_data,
++ },
++};
++#endif /* CONFIG_LEDS_GPIO */
++
++static struct platform_device *apf28dev_platform_devices[] __initdata = {
++#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
++ &apf28dev_gpio_keys_device,
++#endif
++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
++ &apf28dev_led_dev
++#endif
++};
++
+static void __init apf28dev_device_init(void)
+{
+ /* Add apf28dev special code */
-+ ;
++ platform_add_devices(apf28dev_platform_devices, ARRAY_SIZE(apf28dev_platform_devices));
+}
+
+extern void __init apf28_init_pin_group(struct pin_desc *pins, unsigned count);
diff --git a/patches/linux/2.6.35/454-armadeus-mx28_support_gpio_both_edge_interrupt.patch b/patches/linux/2.6.35/454-armadeus-mx28_support_gpio_both_edge_interrupt.patch
new file mode 100644
index 0000000..1ee59e5
--- /dev/null
+++ b/patches/linux/2.6.35/454-armadeus-mx28_support_gpio_both_edge_interrupt.patch
@@ -0,0 +1,97 @@
+Fix gpio driver to support raising and falling edge interrupts -
+used by some drivers like gpio-keys, matrix keypad, USB Vbus...
+
+Signed-off-by: Eric Jarrige <eri...@ar...>
+---
+--- a/arch/arm/plat-mxs/include/mach/gpio.h
++++ b/arch/arm/plat-mxs/include/mach/gpio.h
+@@ -41,6 +41,7 @@ struct mxs_gpio_chip {
+ void (*unmask_irq) (struct mxs_gpio_port *, int);
+ void (*mask_irq) (struct mxs_gpio_port *, int);
+ void (*ack_irq) (struct mxs_gpio_port *, int);
++ void (*flip_edge_irq) (struct mxs_gpio_port *, int);
+ };
+
+ struct mxs_gpio_port {
+@@ -49,6 +50,7 @@ struct mxs_gpio_port {
+ int child_irq;
+ struct mxs_gpio_chip *chip;
+ struct gpio_chip port;
++ u32 both_edges;
+ };
+
+ extern int mxs_add_gpio_port(struct mxs_gpio_port *port);
+--- a/arch/arm/plat-mxs/gpio.c
++++ b/arch/arm/plat-mxs/gpio.c
+@@ -114,12 +114,20 @@ static void mxs_gpio_irq_handler(u32 irq
+ struct mxs_gpio_port *port = get_irq_data(irq);
+ int gpio_irq = port->child_irq;
+ u32 irq_stat = port->chip->get_irq_stat(port);
++ int pin;
+
+ desc->chip->mask(irq);
+
+ while (irq_stat) {
+- if (irq_stat & 1)
++ if (irq_stat & 1) {
++
++ pin = GPIO_TO_PINS(irq_to_gpio(gpio_irq));
++ if ((port->both_edges & (1 << pin))
++ &&(port->chip->flip_edge_irq))
++ port->chip->flip_edge_irq(port, pin);
++
+ generic_handle_irq(gpio_irq);
++ }
+ gpio_irq++;
+ irq_stat >>= 1;
+ }
+--- a/arch/arm/mach-mx28/gpio.c
++++ b/arch/arm/mach-mx28/gpio.c
+@@ -72,6 +72,7 @@ mx28_gpio_set_irq_type(struct mxs_gpio_p
+ {
+ unsigned int level, pol;
+ void __iomem *base = PINCTRL_BASE_ADDR + 0x10 * port->id;
++ u32 val;
+ switch (type) {
+ case IRQ_TYPE_EDGE_RISING:
+ level = 0;
+@@ -81,6 +82,18 @@ mx28_gpio_set_irq_type(struct mxs_gpio_p
+ level = 0;
+ pol = 0;
+ break;
++ case IRQ_TYPE_EDGE_BOTH:
++ val = mx28_gpio_get(port, pin);
++ level = 1;
++ if (val) {
++ pol = 0;
++ pr_debug("mx28: set pin %d on port %d to low trigger\n", pin, port->id);
++ } else {
++ level = 1;
++ pr_debug("mx28: set pin %d on port %d to high trigger\n", pin, port->id);
++ }
++ port->both_edges |= 1 << pin;
++ break;
+ case IRQ_TYPE_LEVEL_HIGH:
+ level = 1;
+ pol = 1;
+@@ -108,6 +121,12 @@ mx28_gpio_set_irq_type(struct mxs_gpio_p
+ return 0;
+ }
+
++static void mx28_flip_edge_irq(struct mxs_gpio_port *port, int pin)
++{
++ void __iomem *base = PINCTRL_BASE_ADDR + 0x10 * port->id;
++ __raw_writel(1 << pin, base + HW_PINCTRL_IRQPOL0_TOG);
++}
++
+ static void mx28_gpio_unmask_irq(struct mxs_gpio_port *port, int pin)
+ {
+ void __iomem *base = PINCTRL_BASE_ADDR + 0x10 * port->id;
+@@ -156,6 +175,7 @@ static struct mxs_gpio_chip mx28_gpio_ch
+ .unmask_irq = mx28_gpio_unmask_irq,
+ .mask_irq = mx28_gpio_mask_irq,
+ .ack_irq = mx28_gpio_ack_irq,
++ .flip_edge_irq = mx28_flip_edge_irq,
+ };
+
+ int __init mx28_gpio_init(void)
hooks/post-receive
--
armadeus
|