ARM: EXYNOS4: Add EXYNOS4 CPU initialization support
[pandora-kernel.git] / arch / arm / mach-exynos4 / gpiolib.c
similarity index 58%
rename from arch/arm/mach-s5pv310/gpiolib.c
rename to arch/arm/mach-exynos4/gpiolib.c
index 55217b8..c46fdc5 100644 (file)
@@ -1,9 +1,9 @@
-/* linux/arch/arm/mach-s5pv310/gpiolib.c
+/* linux/arch/arm/mach-exynos4/gpiolib.c
  *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
  *             http://www.samsung.com
  *
- * S5PV310 - GPIOlib support
+ * EXYNOS4 - GPIOlib support
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -43,159 +43,159 @@ static struct s3c_gpio_cfg gpio_cfg_noint = {
  * Note: The initialization of 'base' member of s3c_gpio_chip structure
  * uses the above macro and depends on the banks being listed in order here.
  */
-static struct s3c_gpio_chip s5pv310_gpio_part1_4bit[] = {
+static struct s3c_gpio_chip exynos4_gpio_part1_4bit[] = {
        {
                .chip   = {
-                       .base   = S5PV310_GPA0(0),
-                       .ngpio  = S5PV310_GPIO_A0_NR,
+                       .base   = EXYNOS4_GPA0(0),
+                       .ngpio  = EXYNOS4_GPIO_A0_NR,
                        .label  = "GPA0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPA1(0),
-                       .ngpio  = S5PV310_GPIO_A1_NR,
+                       .base   = EXYNOS4_GPA1(0),
+                       .ngpio  = EXYNOS4_GPIO_A1_NR,
                        .label  = "GPA1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPB(0),
-                       .ngpio  = S5PV310_GPIO_B_NR,
+                       .base   = EXYNOS4_GPB(0),
+                       .ngpio  = EXYNOS4_GPIO_B_NR,
                        .label  = "GPB",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPC0(0),
-                       .ngpio  = S5PV310_GPIO_C0_NR,
+                       .base   = EXYNOS4_GPC0(0),
+                       .ngpio  = EXYNOS4_GPIO_C0_NR,
                        .label  = "GPC0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPC1(0),
-                       .ngpio  = S5PV310_GPIO_C1_NR,
+                       .base   = EXYNOS4_GPC1(0),
+                       .ngpio  = EXYNOS4_GPIO_C1_NR,
                        .label  = "GPC1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPD0(0),
-                       .ngpio  = S5PV310_GPIO_D0_NR,
+                       .base   = EXYNOS4_GPD0(0),
+                       .ngpio  = EXYNOS4_GPIO_D0_NR,
                        .label  = "GPD0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPD1(0),
-                       .ngpio  = S5PV310_GPIO_D1_NR,
+                       .base   = EXYNOS4_GPD1(0),
+                       .ngpio  = EXYNOS4_GPIO_D1_NR,
                        .label  = "GPD1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPE0(0),
-                       .ngpio  = S5PV310_GPIO_E0_NR,
+                       .base   = EXYNOS4_GPE0(0),
+                       .ngpio  = EXYNOS4_GPIO_E0_NR,
                        .label  = "GPE0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPE1(0),
-                       .ngpio  = S5PV310_GPIO_E1_NR,
+                       .base   = EXYNOS4_GPE1(0),
+                       .ngpio  = EXYNOS4_GPIO_E1_NR,
                        .label  = "GPE1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPE2(0),
-                       .ngpio  = S5PV310_GPIO_E2_NR,
+                       .base   = EXYNOS4_GPE2(0),
+                       .ngpio  = EXYNOS4_GPIO_E2_NR,
                        .label  = "GPE2",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPE3(0),
-                       .ngpio  = S5PV310_GPIO_E3_NR,
+                       .base   = EXYNOS4_GPE3(0),
+                       .ngpio  = EXYNOS4_GPIO_E3_NR,
                        .label  = "GPE3",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPE4(0),
-                       .ngpio  = S5PV310_GPIO_E4_NR,
+                       .base   = EXYNOS4_GPE4(0),
+                       .ngpio  = EXYNOS4_GPIO_E4_NR,
                        .label  = "GPE4",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPF0(0),
-                       .ngpio  = S5PV310_GPIO_F0_NR,
+                       .base   = EXYNOS4_GPF0(0),
+                       .ngpio  = EXYNOS4_GPIO_F0_NR,
                        .label  = "GPF0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPF1(0),
-                       .ngpio  = S5PV310_GPIO_F1_NR,
+                       .base   = EXYNOS4_GPF1(0),
+                       .ngpio  = EXYNOS4_GPIO_F1_NR,
                        .label  = "GPF1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPF2(0),
-                       .ngpio  = S5PV310_GPIO_F2_NR,
+                       .base   = EXYNOS4_GPF2(0),
+                       .ngpio  = EXYNOS4_GPIO_F2_NR,
                        .label  = "GPF2",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPF3(0),
-                       .ngpio  = S5PV310_GPIO_F3_NR,
+                       .base   = EXYNOS4_GPF3(0),
+                       .ngpio  = EXYNOS4_GPIO_F3_NR,
                        .label  = "GPF3",
                },
        },
 };
 
-static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
+static struct s3c_gpio_chip exynos4_gpio_part2_4bit[] = {
        {
                .chip   = {
-                       .base   = S5PV310_GPJ0(0),
-                       .ngpio  = S5PV310_GPIO_J0_NR,
+                       .base   = EXYNOS4_GPJ0(0),
+                       .ngpio  = EXYNOS4_GPIO_J0_NR,
                        .label  = "GPJ0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPJ1(0),
-                       .ngpio  = S5PV310_GPIO_J1_NR,
+                       .base   = EXYNOS4_GPJ1(0),
+                       .ngpio  = EXYNOS4_GPIO_J1_NR,
                        .label  = "GPJ1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPK0(0),
-                       .ngpio  = S5PV310_GPIO_K0_NR,
+                       .base   = EXYNOS4_GPK0(0),
+                       .ngpio  = EXYNOS4_GPIO_K0_NR,
                        .label  = "GPK0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPK1(0),
-                       .ngpio  = S5PV310_GPIO_K1_NR,
+                       .base   = EXYNOS4_GPK1(0),
+                       .ngpio  = EXYNOS4_GPIO_K1_NR,
                        .label  = "GPK1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPK2(0),
-                       .ngpio  = S5PV310_GPIO_K2_NR,
+                       .base   = EXYNOS4_GPK2(0),
+                       .ngpio  = EXYNOS4_GPIO_K2_NR,
                        .label  = "GPK2",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPK3(0),
-                       .ngpio  = S5PV310_GPIO_K3_NR,
+                       .base   = EXYNOS4_GPK3(0),
+                       .ngpio  = EXYNOS4_GPIO_K3_NR,
                        .label  = "GPK3",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPL0(0),
-                       .ngpio  = S5PV310_GPIO_L0_NR,
+                       .base   = EXYNOS4_GPL0(0),
+                       .ngpio  = EXYNOS4_GPIO_L0_NR,
                        .label  = "GPL0",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPL1(0),
-                       .ngpio  = S5PV310_GPIO_L1_NR,
+                       .base   = EXYNOS4_GPL1(0),
+                       .ngpio  = EXYNOS4_GPIO_L1_NR,
                        .label  = "GPL1",
                },
        }, {
                .chip   = {
-                       .base   = S5PV310_GPL2(0),
-                       .ngpio  = S5PV310_GPIO_L2_NR,
+                       .base   = EXYNOS4_GPL2(0),
+                       .ngpio  = EXYNOS4_GPIO_L2_NR,
                        .label  = "GPL2",
                },
        }, {
@@ -203,8 +203,8 @@ static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
                .config = &gpio_cfg_noint,
                .irq_base = IRQ_EINT(0),
                .chip   = {
-                       .base   = S5PV310_GPX0(0),
-                       .ngpio  = S5PV310_GPIO_X0_NR,
+                       .base   = EXYNOS4_GPX0(0),
+                       .ngpio  = EXYNOS4_GPIO_X0_NR,
                        .label  = "GPX0",
                        .to_irq = samsung_gpiolib_to_irq,
                },
@@ -213,8 +213,8 @@ static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
                .config = &gpio_cfg_noint,
                .irq_base = IRQ_EINT(8),
                .chip   = {
-                       .base   = S5PV310_GPX1(0),
-                       .ngpio  = S5PV310_GPIO_X1_NR,
+                       .base   = EXYNOS4_GPX1(0),
+                       .ngpio  = EXYNOS4_GPIO_X1_NR,
                        .label  = "GPX1",
                        .to_irq = samsung_gpiolib_to_irq,
                },
@@ -223,8 +223,8 @@ static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
                .config = &gpio_cfg_noint,
                .irq_base = IRQ_EINT(16),
                .chip   = {
-                       .base   = S5PV310_GPX2(0),
-                       .ngpio  = S5PV310_GPIO_X2_NR,
+                       .base   = EXYNOS4_GPX2(0),
+                       .ngpio  = EXYNOS4_GPIO_X2_NR,
                        .label  = "GPX2",
                        .to_irq = samsung_gpiolib_to_irq,
                },
@@ -233,25 +233,25 @@ static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
                .config = &gpio_cfg_noint,
                .irq_base = IRQ_EINT(24),
                .chip   = {
-                       .base   = S5PV310_GPX3(0),
-                       .ngpio  = S5PV310_GPIO_X3_NR,
+                       .base   = EXYNOS4_GPX3(0),
+                       .ngpio  = EXYNOS4_GPIO_X3_NR,
                        .label  = "GPX3",
                        .to_irq = samsung_gpiolib_to_irq,
                },
        },
 };
 
-static struct s3c_gpio_chip s5pv310_gpio_part3_4bit[] = {
+static struct s3c_gpio_chip exynos4_gpio_part3_4bit[] = {
        {
                .chip   = {
-                       .base   = S5PV310_GPZ(0),
-                       .ngpio  = S5PV310_GPIO_Z_NR,
+                       .base   = EXYNOS4_GPZ(0),
+                       .ngpio  = EXYNOS4_GPIO_Z_NR,
                        .label  = "GPZ",
                },
        },
 };
 
-static __init int s5pv310_gpiolib_init(void)
+static __init int exynos4_gpiolib_init(void)
 {
        struct s3c_gpio_chip *chip;
        int i;
@@ -259,8 +259,8 @@ static __init int s5pv310_gpiolib_init(void)
 
        /* GPIO part 1 */
 
-       chip = s5pv310_gpio_part1_4bit;
-       nr_chips = ARRAY_SIZE(s5pv310_gpio_part1_4bit);
+       chip = exynos4_gpio_part1_4bit;
+       nr_chips = ARRAY_SIZE(exynos4_gpio_part1_4bit);
 
        for (i = 0; i < nr_chips; i++, chip++) {
                if (chip->config == NULL)
@@ -269,12 +269,12 @@ static __init int s5pv310_gpiolib_init(void)
                        chip->base = S5P_VA_GPIO1 + (i) * 0x20;
        }
 
-       samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part1_4bit, nr_chips);
+       samsung_gpiolib_add_4bit_chips(exynos4_gpio_part1_4bit, nr_chips);
 
        /* GPIO part 2 */
 
-       chip = s5pv310_gpio_part2_4bit;
-       nr_chips = ARRAY_SIZE(s5pv310_gpio_part2_4bit);
+       chip = exynos4_gpio_part2_4bit;
+       nr_chips = ARRAY_SIZE(exynos4_gpio_part2_4bit);
 
        for (i = 0; i < nr_chips; i++, chip++) {
                if (chip->config == NULL)
@@ -283,12 +283,12 @@ static __init int s5pv310_gpiolib_init(void)
                        chip->base = S5P_VA_GPIO2 + (i) * 0x20;
        }
 
-       samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part2_4bit, nr_chips);
+       samsung_gpiolib_add_4bit_chips(exynos4_gpio_part2_4bit, nr_chips);
 
        /* GPIO part 3 */
 
-       chip = s5pv310_gpio_part3_4bit;
-       nr_chips = ARRAY_SIZE(s5pv310_gpio_part3_4bit);
+       chip = exynos4_gpio_part3_4bit;
+       nr_chips = ARRAY_SIZE(exynos4_gpio_part3_4bit);
 
        for (i = 0; i < nr_chips; i++, chip++) {
                if (chip->config == NULL)
@@ -297,8 +297,8 @@ static __init int s5pv310_gpiolib_init(void)
                        chip->base = S5P_VA_GPIO3 + (i) * 0x20;
        }
 
-       samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part3_4bit, nr_chips);
+       samsung_gpiolib_add_4bit_chips(exynos4_gpio_part3_4bit, nr_chips);
 
        return 0;
 }
-core_initcall(s5pv310_gpiolib_init);
+core_initcall(exynos4_gpiolib_init);