ARM: S5P: Unify defines for both gpio interrupt types
authorMarek Szyprowski <m.szyprowski@samsung.com>
Sat, 2 Oct 2010 02:48:09 +0000 (11:48 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Wed, 20 Oct 2010 22:54:57 +0000 (07:54 +0900)
Samsung S5P SoCs have the same interrupt type defines for both
external interrupts and gpio interrupts. This patch removes all
duplicates from S5PC100 and S5PV210 specific includes as well as
gpio interrupt code and put a common defines to plat/irqs.h
NOTE: Do not use this for S5P6440 and S5P6450.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[kgene.kim@samsung.com: add note for S5P64X0]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s5pc100/include/mach/regs-gpio.h
arch/arm/mach-s5pv210/include/mach/regs-gpio.h
arch/arm/plat-s5p/include/plat/irqs.h
arch/arm/plat-s5p/irq-eint.c
arch/arm/plat-s5p/irq-gpioint.c

index 6abe481e248df952f4e33466ef77185c25d37ac5..8c47536b117bd01c851103b8aa045ae915e0c573 100644 (file)
 
 #define eint_irq_to_bit(irq)           (1 << (EINT_OFFSET(irq) & 0x7))
 
-/* values for S5P_EXTINT0 */
-#define S5P_EXTINT_LOWLEV              (0x00)
-#define S5P_EXTINT_HILEV               (0x01)
-#define S5P_EXTINT_FALLEDGE            (0x02)
-#define S5P_EXTINT_RISEEDGE            (0x03)
-#define S5P_EXTINT_BOTHEDGE            (0x04)
-
 #define EINT_MODE              S3C_GPIO_SFN(0x2)
 
 #define EINT_GPIO_0(x)         S5PC100_GPH0(x)
index 49e029b4978ab552a210c5dcee3a94d980777345..de0c89976078a768fc02e1d7c631268397bfd5ee 100644 (file)
 
 #define eint_irq_to_bit(irq)           (1 << (EINT_OFFSET(irq) & 0x7))
 
-/* values for S5P_EXTINT0 */
-#define S5P_EXTINT_LOWLEV              (0x00)
-#define S5P_EXTINT_HILEV               (0x01)
-#define S5P_EXTINT_FALLEDGE            (0x02)
-#define S5P_EXTINT_RISEEDGE            (0x03)
-#define S5P_EXTINT_BOTHEDGE            (0x04)
-
 #define EINT_MODE              S3C_GPIO_SFN(0xf)
 
 #define EINT_GPIO_0(x)         S5PV210_GPH0(x)
index 23603c7f194350fda8d74d8e396b8a08350b2876..7f653bce3c1371dccba6308674dffb9fadea4b39 100644 (file)
 #define S5P_GPIOINT_GROUP_SIZE 8
 #define S5P_GPIOINT_COUNT      (S5P_GPIOINT_GROUP_COUNT * S5P_GPIOINT_GROUP_SIZE)
 
+/* IRQ types common for all s5p platforms */
+#define S5P_IRQ_TYPE_LEVEL_LOW         (0x00)
+#define S5P_IRQ_TYPE_LEVEL_HIGH                (0x01)
+#define S5P_IRQ_TYPE_EDGE_FALLING      (0x02)
+#define S5P_IRQ_TYPE_EDGE_RISING       (0x03)
+#define S5P_IRQ_TYPE_EDGE_BOTH         (0x04)
+
 #endif /* __ASM_PLAT_S5P_IRQS_H */
index f36cd3327025ad1788cd6e163e94c069b4a77718..752f1a645f9dcfad3c69e7d0c5ca8ddf71dc5d45 100644 (file)
@@ -67,23 +67,23 @@ static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type)
 
        switch (type) {
        case IRQ_TYPE_EDGE_RISING:
-               newvalue = S5P_EXTINT_RISEEDGE;
+               newvalue = S5P_IRQ_TYPE_EDGE_RISING;
                break;
 
        case IRQ_TYPE_EDGE_FALLING:
-               newvalue = S5P_EXTINT_FALLEDGE;
+               newvalue = S5P_IRQ_TYPE_EDGE_FALLING;
                break;
 
        case IRQ_TYPE_EDGE_BOTH:
-               newvalue = S5P_EXTINT_BOTHEDGE;
+               newvalue = S5P_IRQ_TYPE_EDGE_BOTH;
                break;
 
        case IRQ_TYPE_LEVEL_LOW:
-               newvalue = S5P_EXTINT_LOWLEV;
+               newvalue = S5P_IRQ_TYPE_LEVEL_LOW;
                break;
 
        case IRQ_TYPE_LEVEL_HIGH:
-               newvalue = S5P_EXTINT_HILEV;
+               newvalue = S5P_IRQ_TYPE_LEVEL_HIGH;
                break;
 
        default:
index 768fd39a3a98a30a2a350b27e5887be973ace65d..0e5dc8cbf5e3f9524cbb2cc6ad179143129cf475 100644 (file)
 #define GPIOINT_MASK_OFFSET            0x900
 #define GPIOINT_PEND_OFFSET            0xA00
 
-#define GPIOINT_LEVEL_LOW              0x0
-#define GPIOINT_LEVEL_HIGH             0x1
-#define GPIOINT_EDGE_FALLING           0x2
-#define GPIOINT_EDGE_RISING            0x3
-#define GPIOINT_EDGE_BOTH              0x4
-
 static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR];
 
 static int s5p_gpioint_get_group(unsigned int irq)
@@ -118,19 +112,19 @@ static int s5p_gpioint_set_type(unsigned int irq, unsigned int type)
 
        switch (type) {
        case IRQ_TYPE_EDGE_RISING:
-               type = GPIOINT_EDGE_RISING;
+               type = S5P_IRQ_TYPE_EDGE_RISING;
                break;
        case IRQ_TYPE_EDGE_FALLING:
-               type = GPIOINT_EDGE_FALLING;
+               type = S5P_IRQ_TYPE_EDGE_FALLING;
                break;
        case IRQ_TYPE_EDGE_BOTH:
-               type = GPIOINT_EDGE_BOTH;
+               type = S5P_IRQ_TYPE_EDGE_BOTH;
                break;
        case IRQ_TYPE_LEVEL_HIGH:
-               type = GPIOINT_LEVEL_HIGH;
+               type = S5P_IRQ_TYPE_LEVEL_HIGH;
                break;
        case IRQ_TYPE_LEVEL_LOW:
-               type = GPIOINT_LEVEL_LOW;
+               type = S5P_IRQ_TYPE_LEVEL_LOW;
                break;
        case IRQ_TYPE_NONE:
        default: