[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.2-135-gdba083e
Brought to you by:
sszy
|
From: Gwenhael Goavec-M. <gwe...@us...> - 2013-01-27 14:09:14
|
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 dba083e544a2699bb0a71978ddf6f40f743c97f5 (commit)
from d923f5351dc0ba6793842022e95a226ac3597387 (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 dba083e544a2699bb0a71978ddf6f40f743c97f5
Author: Gwenhael Goavec-Merou <gw...@tr...>
Date: Sun Jan 27 15:08:23 2013 +0100
[LINUX][3.8] mxs: gpio-mxs: Add IRQ_TYPE_EDGE_BOTH support
-----------------------------------------------------------------------
Summary of changes:
...o-mxs-add_support_for_both_edge_interrupt.patch | 77 ++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
create mode 100644 patches/linux/3.8/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
diff --git a/patches/linux/3.8/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch b/patches/linux/3.8/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
new file mode 100644
index 0000000..01a5955
--- /dev/null
+++ b/patches/linux/3.8/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
@@ -0,0 +1,77 @@
+This patch adds support for IRQ_TYPE_EDGE_BOTH needed for some driver
+(gpio-keys).
+Inspired to gpio-mxc.c
+
+Signed-off-by: Gwenhael Goavec-Merou <gwe...@ar...>
+---
+
+Index: linux-3.8-rc5/drivers/gpio/gpio-mxs.c
+===================================================================
+--- linux-3.8-rc5.orig/drivers/gpio/gpio-mxs.c
++++ linux-3.8-rc5/drivers/gpio/gpio-mxs.c
+@@ -65,6 +65,7 @@ struct mxs_gpio_port {
+ struct irq_domain *domain;
+ struct bgpio_chip bgc;
+ enum mxs_gpio_id devid;
++ u32 both_edges;
+ };
+
+ static inline int is_imx23_gpio(struct mxs_gpio_port *port)
+@@ -81,13 +82,24 @@ static inline int is_imx28_gpio(struct m
+
+ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
+ {
++ u32 val;
+ u32 pin_mask = 1 << d->hwirq;
++ u32 gpio_idx = d->hwirq;
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct mxs_gpio_port *port = gc->private;
+ void __iomem *pin_addr;
+ int edge;
+
++ port->both_edges &= ~(1 << gpio_idx);
+ switch (type) {
++ case IRQ_TYPE_EDGE_BOTH:
++ val = gpio_get_value(port->bgc.gc.base + gpio_idx);
++ if (val)
++ edge = GPIO_INT_LOW_LEV;
++ else
++ edge = GPIO_INT_HIGH_LEV;
++ port->both_edges |= 1 << gpio_idx;
++ break;
+ case IRQ_TYPE_EDGE_RISING:
+ edge = GPIO_INT_RISE_EDGE;
+ break;
+@@ -123,6 +135,22 @@ static int mxs_gpio_set_irq_type(struct
+
+ return 0;
+ }
++static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
++{
++ u32 bit, val, edge;
++ void __iomem *pin_addr;
++
++ bit = 1<<gpio;
++
++ pin_addr = port->base + PINCTRL_IRQPOL(port);
++ val = readl(pin_addr);
++ edge = val&bit;
++
++ if (edge)
++ writel(bit, pin_addr + MXS_CLR);
++ else
++ writel(bit, pin_addr + MXS_SET);
++}
+
+ /* MXS has one interrupt *per* gpio port */
+ static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+@@ -137,6 +165,9 @@ static void mxs_gpio_irq_handler(u32 irq
+
+ while (irq_stat != 0) {
+ int irqoffset = fls(irq_stat) - 1;
++ if (port->both_edges & (1 << irqoffset))
++ mxs_flip_edge(port, irqoffset);
++
+ generic_handle_irq(irq_find_mapping(port->domain, irqoffset));
+ irq_stat &= ~(1 << irqoffset);
+ }
hooks/post-receive
--
armadeus
|