ARM: S5PV210: Add support for GPIO Interrupt
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 1 Oct 2010 02:16:44 +0000 (11:16 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Wed, 20 Oct 2010 22:54:56 +0000 (07:54 +0900)
S5PV210/S5PC110 can use common S5P GPIO interrupt code.
This patch adds required defines and code to make use of it.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[kgene.kim@samsung.com: minor title fixes]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s5pv210/gpiolib.c
arch/arm/mach-s5pv210/include/mach/irqs.h

index 0d459112d0396645f2c2a391de89662bd43120db..29dfb894d4f4c1e172680c373ec830195e594ca9 100644 (file)
@@ -150,6 +150,7 @@ static struct s3c_gpio_chip s5pv210_gpio_4bit[] = {
                        .label  = "GPG3",
                },
        }, {
+               .config = &gpio_cfg_noint,
                .chip   = {
                        .base   = S5PV210_GPI(0),
                        .ngpio  = S5PV210_GPIO_I_NR,
@@ -259,11 +260,14 @@ static __init int s5pv210_gpiolib_init(void)
 {
        struct s3c_gpio_chip *chip = s5pv210_gpio_4bit;
        int nr_chips = ARRAY_SIZE(s5pv210_gpio_4bit);
+       int gpioint_group = 0;
        int i = 0;
 
        for (i = 0; i < nr_chips; i++, chip++) {
-               if (chip->config == NULL)
+               if (chip->config == NULL) {
                        chip->config = &gpio_cfg;
+                       chip->group = gpioint_group++;
+               }
                if (chip->base == NULL)
                        chip->base = S5PV210_BANK_BASE(i);
        }
index cdb8ae41512419405d9cc4247892f80605a47210..bb7f277c1fa3a0d6df5dc658a4839624d57e57bb 100644 (file)
 #define S5P_EINT_BASE1         (S5P_IRQ_VIC0(0))
 #define S5P_EINT_BASE2         (IRQ_VIC_END + 1)
 
+/* GPIO interrupt */
+#define S5P_GPIOINT_BASE       (IRQ_EINT(31) + 1)
+#define S5P_GPIOINT_GROUP_MAXNR        22
+
 /* Set the default NR_IRQS */
-#define NR_IRQS                        (IRQ_EINT(31) + 1)
+#define NR_IRQS                        (IRQ_EINT(31) + S5P_GPIOINT_COUNT + 1)
 
 /* Compatibility */
 #define IRQ_LCD_FIFO           IRQ_LCD0