gpio: samsung: Remove remaining check for CONFIG_S5P_GPIO_DRVSTR
[sfrench/cifs-2.6.git] / drivers / gpio / gpio-samsung.c
index 07105ee5c9aea53dfb76e49096e0911dad36f5e4..7c288ba4dc87fe0ea9e6274be22d7c7719752142 100644 (file)
 
 #include <mach/map.h>
 #include <mach/regs-gpio.h>
-
-#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S3C64XX)
 #include <mach/gpio-samsung.h>
-#endif
 
 #include <plat/cpu.h>
 #include <plat/gpio-core.h>
@@ -358,47 +355,6 @@ static unsigned s3c24xx_gpio_getcfg_abank(struct samsung_gpio_chip *chip,
 }
 #endif
 
-#if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450)
-static int s5p64x0_gpio_setcfg_rbank(struct samsung_gpio_chip *chip,
-                                    unsigned int off, unsigned int cfg)
-{
-       void __iomem *reg = chip->base;
-       unsigned int shift;
-       u32 con;
-
-       switch (off) {
-       case 0:
-       case 1:
-       case 2:
-       case 3:
-       case 4:
-       case 5:
-               shift = (off & 7) * 4;
-               reg -= 4;
-               break;
-       case 6:
-               shift = ((off + 1) & 7) * 4;
-               reg -= 4;
-               break;
-       default:
-               shift = ((off + 1) & 7) * 4;
-               break;
-       }
-
-       if (samsung_gpio_is_cfg_special(cfg)) {
-               cfg &= 0xf;
-               cfg <<= shift;
-       }
-
-       con = __raw_readl(reg);
-       con &= ~(0xf << shift);
-       con |= cfg;
-       __raw_writel(con, reg);
-
-       return 0;
-}
-#endif
-
 static void __init samsung_gpiolib_set_cfg(struct samsung_gpio_cfg *chipcfg,
                                           int nr_chips)
 {
@@ -426,16 +382,6 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = {
 };
 #endif
 
-#if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450)
-static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = {
-       .cfg_eint       = 0x3,
-       .set_config     = s5p64x0_gpio_setcfg_rbank,
-       .get_config     = samsung_gpio_getcfg_4bit,
-       .set_pull       = samsung_gpio_setpull_updown,
-       .get_pull       = samsung_gpio_getpull_updown,
-};
-#endif
-
 static struct samsung_gpio_cfg samsung_gpio_cfgs[] = {
        [0] = {
                .cfg_eint       = 0x0,
@@ -708,91 +654,6 @@ static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip,
 }
 #endif
 
-/* The next set of routines are for the case of s5p64x0 bank r */
-
-static int s5p64x0_gpiolib_rbank_input(struct gpio_chip *chip,
-                                      unsigned int offset)
-{
-       struct samsung_gpio_chip *ourchip = to_samsung_gpio(chip);
-       void __iomem *base = ourchip->base;
-       void __iomem *regcon = base;
-       unsigned long con;
-       unsigned long flags;
-
-       switch (offset) {
-       case 6:
-               offset += 1;
-       case 0:
-       case 1:
-       case 2:
-       case 3:
-       case 4:
-       case 5:
-               regcon -= 4;
-               break;
-       default:
-               offset -= 7;
-               break;
-       }
-
-       samsung_gpio_lock(ourchip, flags);
-
-       con = __raw_readl(regcon);
-       con &= ~(0xf << con_4bit_shift(offset));
-       __raw_writel(con, regcon);
-
-       samsung_gpio_unlock(ourchip, flags);
-
-       return 0;
-}
-
-static int s5p64x0_gpiolib_rbank_output(struct gpio_chip *chip,
-                                       unsigned int offset, int value)
-{
-       struct samsung_gpio_chip *ourchip = to_samsung_gpio(chip);
-       void __iomem *base = ourchip->base;
-       void __iomem *regcon = base;
-       unsigned long con;
-       unsigned long dat;
-       unsigned long flags;
-       unsigned con_offset  = offset;
-
-       switch (con_offset) {
-       case 6:
-               con_offset += 1;
-       case 0:
-       case 1:
-       case 2:
-       case 3:
-       case 4:
-       case 5:
-               regcon -= 4;
-               break;
-       default:
-               con_offset -= 7;
-               break;
-       }
-
-       samsung_gpio_lock(ourchip, flags);
-
-       con = __raw_readl(regcon);
-       con &= ~(0xf << con_4bit_shift(con_offset));
-       con |= 0x1 << con_4bit_shift(con_offset);
-
-       dat = __raw_readl(base + GPIODAT_OFF);
-       if (value)
-               dat |= 1 << offset;
-       else
-               dat &= ~(1 << offset);
-
-       __raw_writel(con, regcon);
-       __raw_writel(dat, base + GPIODAT_OFF);
-
-       samsung_gpio_unlock(ourchip, flags);
-
-       return 0;
-}
-
 static void samsung_gpiolib_set(struct gpio_chip *chip,
                                unsigned offset, int value)
 {
@@ -999,20 +860,6 @@ static void __init samsung_gpiolib_add_4bit2_chips(struct samsung_gpio_chip *chi
        }
 }
 
-static void __init s5p64x0_gpiolib_add_rbank(struct samsung_gpio_chip *chip,
-                                            int nr_chips)
-{
-       for (; nr_chips > 0; nr_chips--, chip++) {
-               chip->chip.direction_input = s5p64x0_gpiolib_rbank_input;
-               chip->chip.direction_output = s5p64x0_gpiolib_rbank_output;
-
-               if (!chip->pm)
-                       chip->pm = __gpio_pm(&samsung_gpio_pm_4bit);
-
-               samsung_gpiolib_add(chip);
-       }
-}
-
 int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
        struct samsung_gpio_chip *samsung_chip = container_of(chip, struct samsung_gpio_chip, chip);
@@ -1319,864 +1166,52 @@ static struct samsung_gpio_chip s3c64xx_gpios_2bit[] = {
 #endif
 };
 
-/*
- * S5P6440 GPIO bank summary:
- *
- * Bank        GPIOs   Style   SlpCon  ExtInt Group
- * A   6       4Bit    Yes     1
- * B   7       4Bit    Yes     1
- * C   8       4Bit    Yes     2
- * F   2       2Bit    Yes     4 [1]
- * G   7       4Bit    Yes     5
- * H   10      4Bit[2] Yes     6
- * I   16      2Bit    Yes     None
- * J   12      2Bit    Yes     None
- * N   16      2Bit    No      IRQ_EINT
- * P   8       2Bit    Yes     8
- * R   15      4Bit[2] Yes     8
- */
-
-static struct samsung_gpio_chip s5p6440_gpios_4bit[] = {
-#ifdef CONFIG_CPU_S5P6440
-       {
-               .chip   = {
-                       .base   = S5P6440_GPA(0),
-                       .ngpio  = S5P6440_GPIO_A_NR,
-                       .label  = "GPA",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5P6440_GPB(0),
-                       .ngpio  = S5P6440_GPIO_B_NR,
-                       .label  = "GPB",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5P6440_GPC(0),
-                       .ngpio  = S5P6440_GPIO_C_NR,
-                       .label  = "GPC",
-               },
-       }, {
-               .base   = S5P64X0_GPG_BASE,
-               .chip   = {
-                       .base   = S5P6440_GPG(0),
-                       .ngpio  = S5P6440_GPIO_G_NR,
-                       .label  = "GPG",
-               },
-       },
-#endif
-};
+/* TODO: cleanup soc_is_* */
+static __init int samsung_gpiolib_init(void)
+{
+       /*
+        * Currently there are two drivers that can provide GPIO support for
+        * Samsung SoCs. For device tree enabled platforms, the new
+        * pinctrl-samsung driver is used, providing both GPIO and pin control
+        * interfaces. For legacy (non-DT) platforms this driver is used.
+        */
+       if (of_have_populated_dt())
+               return -ENODEV;
 
-static struct samsung_gpio_chip s5p6440_gpios_4bit2[] = {
-#ifdef CONFIG_CPU_S5P6440
-       {
-               .base   = S5P64X0_GPH_BASE + 0x4,
-               .chip   = {
-                       .base   = S5P6440_GPH(0),
-                       .ngpio  = S5P6440_GPIO_H_NR,
-                       .label  = "GPH",
-               },
-       },
-#endif
-};
+       samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs));
 
-static struct samsung_gpio_chip s5p6440_gpios_rbank[] = {
-#ifdef CONFIG_CPU_S5P6440
-       {
-               .base   = S5P64X0_GPR_BASE + 0x4,
-               .config = &s5p64x0_gpio_cfg_rbank,
-               .chip   = {
-                       .base   = S5P6440_GPR(0),
-                       .ngpio  = S5P6440_GPIO_R_NR,
-                       .label  = "GPR",
-               },
-       },
-#endif
-};
+       if (soc_is_s3c24xx()) {
+               s3c24xx_gpiolib_add_chips(s3c24xx_gpios,
+                               ARRAY_SIZE(s3c24xx_gpios), S3C24XX_VA_GPIO);
+       } else if (soc_is_s3c64xx()) {
+               samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit,
+                               ARRAY_SIZE(s3c64xx_gpios_2bit),
+                               S3C64XX_VA_GPIO + 0xE0, 0x20);
+               samsung_gpiolib_add_4bit_chips(s3c64xx_gpios_4bit,
+                               ARRAY_SIZE(s3c64xx_gpios_4bit),
+                               S3C64XX_VA_GPIO);
+               samsung_gpiolib_add_4bit2_chips(s3c64xx_gpios_4bit2,
+                               ARRAY_SIZE(s3c64xx_gpios_4bit2));
+       } else {
+               WARN(1, "Unknown SoC in gpio-samsung, no GPIOs added\n");
+               return -ENODEV;
+       }
 
-static struct samsung_gpio_chip s5p6440_gpios_2bit[] = {
-#ifdef CONFIG_CPU_S5P6440
-       {
-               .base   = S5P64X0_GPF_BASE,
-               .config = &samsung_gpio_cfgs[6],
-               .chip   = {
-                       .base   = S5P6440_GPF(0),
-                       .ngpio  = S5P6440_GPIO_F_NR,
-                       .label  = "GPF",
-               },
-       }, {
-               .base   = S5P64X0_GPI_BASE,
-               .config = &samsung_gpio_cfgs[4],
-               .chip   = {
-                       .base   = S5P6440_GPI(0),
-                       .ngpio  = S5P6440_GPIO_I_NR,
-                       .label  = "GPI",
-               },
-       }, {
-               .base   = S5P64X0_GPJ_BASE,
-               .config = &samsung_gpio_cfgs[4],
-               .chip   = {
-                       .base   = S5P6440_GPJ(0),
-                       .ngpio  = S5P6440_GPIO_J_NR,
-                       .label  = "GPJ",
-               },
-       }, {
-               .base   = S5P64X0_GPN_BASE,
-               .config = &samsung_gpio_cfgs[5],
-               .chip   = {
-                       .base   = S5P6440_GPN(0),
-                       .ngpio  = S5P6440_GPIO_N_NR,
-                       .label  = "GPN",
-               },
-       }, {
-               .base   = S5P64X0_GPP_BASE,
-               .config = &samsung_gpio_cfgs[6],
-               .chip   = {
-                       .base   = S5P6440_GPP(0),
-                       .ngpio  = S5P6440_GPIO_P_NR,
-                       .label  = "GPP",
-               },
-       },
-#endif
-};
+       return 0;
+}
+core_initcall(samsung_gpiolib_init);
 
-/*
- * S5P6450 GPIO bank summary:
- *
- * Bank        GPIOs   Style   SlpCon  ExtInt Group
- * A   6       4Bit    Yes     1
- * B   7       4Bit    Yes     1
- * C   8       4Bit    Yes     2
- * D   8       4Bit    Yes     None
- * F   2       2Bit    Yes     None
- * G   14      4Bit[2] Yes     5
- * H   10      4Bit[2] Yes     6
- * I   16      2Bit    Yes     None
- * J   12      2Bit    Yes     None
- * K   5       4Bit    Yes     None
- * N   16      2Bit    No      IRQ_EINT
- * P   11      2Bit    Yes     8
- * Q   14      2Bit    Yes     None
- * R   15      4Bit[2] Yes     None
- * S   8       2Bit    Yes     None
- *
- * [1] BANKF pins 14,15 do not form part of the external interrupt sources
- * [2] BANK has two control registers, GPxCON0 and GPxCON1
- */
+int s3c_gpio_cfgpin(unsigned int pin, unsigned int config)
+{
+       struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
+       unsigned long flags;
+       int offset;
+       int ret;
 
-static struct samsung_gpio_chip s5p6450_gpios_4bit[] = {
-#ifdef CONFIG_CPU_S5P6450
-       {
-               .chip   = {
-                       .base   = S5P6450_GPA(0),
-                       .ngpio  = S5P6450_GPIO_A_NR,
-                       .label  = "GPA",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5P6450_GPB(0),
-                       .ngpio  = S5P6450_GPIO_B_NR,
-                       .label  = "GPB",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5P6450_GPC(0),
-                       .ngpio  = S5P6450_GPIO_C_NR,
-                       .label  = "GPC",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5P6450_GPD(0),
-                       .ngpio  = S5P6450_GPIO_D_NR,
-                       .label  = "GPD",
-               },
-       }, {
-               .base   = S5P6450_GPK_BASE,
-               .chip   = {
-                       .base   = S5P6450_GPK(0),
-                       .ngpio  = S5P6450_GPIO_K_NR,
-                       .label  = "GPK",
-               },
-       },
-#endif
-};
+       if (!chip)
+               return -EINVAL;
 
-static struct samsung_gpio_chip s5p6450_gpios_4bit2[] = {
-#ifdef CONFIG_CPU_S5P6450
-       {
-               .base   = S5P64X0_GPG_BASE + 0x4,
-               .chip   = {
-                       .base   = S5P6450_GPG(0),
-                       .ngpio  = S5P6450_GPIO_G_NR,
-                       .label  = "GPG",
-               },
-       }, {
-               .base   = S5P64X0_GPH_BASE + 0x4,
-               .chip   = {
-                       .base   = S5P6450_GPH(0),
-                       .ngpio  = S5P6450_GPIO_H_NR,
-                       .label  = "GPH",
-               },
-       },
-#endif
-};
-
-static struct samsung_gpio_chip s5p6450_gpios_rbank[] = {
-#ifdef CONFIG_CPU_S5P6450
-       {
-               .base   = S5P64X0_GPR_BASE + 0x4,
-               .config = &s5p64x0_gpio_cfg_rbank,
-               .chip   = {
-                       .base   = S5P6450_GPR(0),
-                       .ngpio  = S5P6450_GPIO_R_NR,
-                       .label  = "GPR",
-               },
-       },
-#endif
-};
-
-static struct samsung_gpio_chip s5p6450_gpios_2bit[] = {
-#ifdef CONFIG_CPU_S5P6450
-       {
-               .base   = S5P64X0_GPF_BASE,
-               .config = &samsung_gpio_cfgs[6],
-               .chip   = {
-                       .base   = S5P6450_GPF(0),
-                       .ngpio  = S5P6450_GPIO_F_NR,
-                       .label  = "GPF",
-               },
-       }, {
-               .base   = S5P64X0_GPI_BASE,
-               .config = &samsung_gpio_cfgs[4],
-               .chip   = {
-                       .base   = S5P6450_GPI(0),
-                       .ngpio  = S5P6450_GPIO_I_NR,
-                       .label  = "GPI",
-               },
-       }, {
-               .base   = S5P64X0_GPJ_BASE,
-               .config = &samsung_gpio_cfgs[4],
-               .chip   = {
-                       .base   = S5P6450_GPJ(0),
-                       .ngpio  = S5P6450_GPIO_J_NR,
-                       .label  = "GPJ",
-               },
-       }, {
-               .base   = S5P64X0_GPN_BASE,
-               .config = &samsung_gpio_cfgs[5],
-               .chip   = {
-                       .base   = S5P6450_GPN(0),
-                       .ngpio  = S5P6450_GPIO_N_NR,
-                       .label  = "GPN",
-               },
-       }, {
-               .base   = S5P64X0_GPP_BASE,
-               .config = &samsung_gpio_cfgs[6],
-               .chip   = {
-                       .base   = S5P6450_GPP(0),
-                       .ngpio  = S5P6450_GPIO_P_NR,
-                       .label  = "GPP",
-               },
-       }, {
-               .base   = S5P6450_GPQ_BASE,
-               .config = &samsung_gpio_cfgs[5],
-               .chip   = {
-                       .base   = S5P6450_GPQ(0),
-                       .ngpio  = S5P6450_GPIO_Q_NR,
-                       .label  = "GPQ",
-               },
-       }, {
-               .base   = S5P6450_GPS_BASE,
-               .config = &samsung_gpio_cfgs[6],
-               .chip   = {
-                       .base   = S5P6450_GPS(0),
-                       .ngpio  = S5P6450_GPIO_S_NR,
-                       .label  = "GPS",
-               },
-       },
-#endif
-};
-
-/*
- * S5PC100 GPIO bank summary:
- *
- * Bank        GPIOs   Style   INT Type
- * A0  8       4Bit    GPIO_INT0
- * A1  5       4Bit    GPIO_INT1
- * B   8       4Bit    GPIO_INT2
- * C   5       4Bit    GPIO_INT3
- * D   7       4Bit    GPIO_INT4
- * E0  8       4Bit    GPIO_INT5
- * E1  6       4Bit    GPIO_INT6
- * F0  8       4Bit    GPIO_INT7
- * F1  8       4Bit    GPIO_INT8
- * F2  8       4Bit    GPIO_INT9
- * F3  4       4Bit    GPIO_INT10
- * G0  8       4Bit    GPIO_INT11
- * G1  3       4Bit    GPIO_INT12
- * G2  7       4Bit    GPIO_INT13
- * G3  7       4Bit    GPIO_INT14
- * H0  8       4Bit    WKUP_INT
- * H1  8       4Bit    WKUP_INT
- * H2  8       4Bit    WKUP_INT
- * H3  8       4Bit    WKUP_INT
- * I   8       4Bit    GPIO_INT15
- * J0  8       4Bit    GPIO_INT16
- * J1  5       4Bit    GPIO_INT17
- * J2  8       4Bit    GPIO_INT18
- * J3  8       4Bit    GPIO_INT19
- * J4  4       4Bit    GPIO_INT20
- * K0  8       4Bit    None
- * K1  6       4Bit    None
- * K2  8       4Bit    None
- * K3  8       4Bit    None
- * L0  8       4Bit    None
- * L1  8       4Bit    None
- * L2  8       4Bit    None
- * L3  8       4Bit    None
- */
-
-static struct samsung_gpio_chip s5pc100_gpios_4bit[] = {
-#ifdef CONFIG_CPU_S5PC100
-       {
-               .chip   = {
-                       .base   = S5PC100_GPA0(0),
-                       .ngpio  = S5PC100_GPIO_A0_NR,
-                       .label  = "GPA0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPA1(0),
-                       .ngpio  = S5PC100_GPIO_A1_NR,
-                       .label  = "GPA1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPB(0),
-                       .ngpio  = S5PC100_GPIO_B_NR,
-                       .label  = "GPB",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPC(0),
-                       .ngpio  = S5PC100_GPIO_C_NR,
-                       .label  = "GPC",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPD(0),
-                       .ngpio  = S5PC100_GPIO_D_NR,
-                       .label  = "GPD",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPE0(0),
-                       .ngpio  = S5PC100_GPIO_E0_NR,
-                       .label  = "GPE0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPE1(0),
-                       .ngpio  = S5PC100_GPIO_E1_NR,
-                       .label  = "GPE1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPF0(0),
-                       .ngpio  = S5PC100_GPIO_F0_NR,
-                       .label  = "GPF0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPF1(0),
-                       .ngpio  = S5PC100_GPIO_F1_NR,
-                       .label  = "GPF1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPF2(0),
-                       .ngpio  = S5PC100_GPIO_F2_NR,
-                       .label  = "GPF2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPF3(0),
-                       .ngpio  = S5PC100_GPIO_F3_NR,
-                       .label  = "GPF3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPG0(0),
-                       .ngpio  = S5PC100_GPIO_G0_NR,
-                       .label  = "GPG0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPG1(0),
-                       .ngpio  = S5PC100_GPIO_G1_NR,
-                       .label  = "GPG1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPG2(0),
-                       .ngpio  = S5PC100_GPIO_G2_NR,
-                       .label  = "GPG2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPG3(0),
-                       .ngpio  = S5PC100_GPIO_G3_NR,
-                       .label  = "GPG3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPI(0),
-                       .ngpio  = S5PC100_GPIO_I_NR,
-                       .label  = "GPI",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPJ0(0),
-                       .ngpio  = S5PC100_GPIO_J0_NR,
-                       .label  = "GPJ0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPJ1(0),
-                       .ngpio  = S5PC100_GPIO_J1_NR,
-                       .label  = "GPJ1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPJ2(0),
-                       .ngpio  = S5PC100_GPIO_J2_NR,
-                       .label  = "GPJ2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPJ3(0),
-                       .ngpio  = S5PC100_GPIO_J3_NR,
-                       .label  = "GPJ3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPJ4(0),
-                       .ngpio  = S5PC100_GPIO_J4_NR,
-                       .label  = "GPJ4",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPK0(0),
-                       .ngpio  = S5PC100_GPIO_K0_NR,
-                       .label  = "GPK0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPK1(0),
-                       .ngpio  = S5PC100_GPIO_K1_NR,
-                       .label  = "GPK1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPK2(0),
-                       .ngpio  = S5PC100_GPIO_K2_NR,
-                       .label  = "GPK2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPK3(0),
-                       .ngpio  = S5PC100_GPIO_K3_NR,
-                       .label  = "GPK3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPL0(0),
-                       .ngpio  = S5PC100_GPIO_L0_NR,
-                       .label  = "GPL0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPL1(0),
-                       .ngpio  = S5PC100_GPIO_L1_NR,
-                       .label  = "GPL1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPL2(0),
-                       .ngpio  = S5PC100_GPIO_L2_NR,
-                       .label  = "GPL2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPL3(0),
-                       .ngpio  = S5PC100_GPIO_L3_NR,
-                       .label  = "GPL3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PC100_GPL4(0),
-                       .ngpio  = S5PC100_GPIO_L4_NR,
-                       .label  = "GPL4",
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC00),
-               .irq_base = IRQ_EINT(0),
-               .chip   = {
-                       .base   = S5PC100_GPH0(0),
-                       .ngpio  = S5PC100_GPIO_H0_NR,
-                       .label  = "GPH0",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC20),
-               .irq_base = IRQ_EINT(8),
-               .chip   = {
-                       .base   = S5PC100_GPH1(0),
-                       .ngpio  = S5PC100_GPIO_H1_NR,
-                       .label  = "GPH1",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC40),
-               .irq_base = IRQ_EINT(16),
-               .chip   = {
-                       .base   = S5PC100_GPH2(0),
-                       .ngpio  = S5PC100_GPIO_H2_NR,
-                       .label  = "GPH2",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC60),
-               .irq_base = IRQ_EINT(24),
-               .chip   = {
-                       .base   = S5PC100_GPH3(0),
-                       .ngpio  = S5PC100_GPIO_H3_NR,
-                       .label  = "GPH3",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       },
-#endif
-};
-
-/*
- * Followings are the gpio banks in S5PV210/S5PC110
- *
- * The 'config' member when left to NULL, is initialized to the default
- * structure samsung_gpio_cfgs[3] in the init function below.
- *
- * The 'base' member is also initialized in the init function below.
- * Note: The initialization of 'base' member of samsung_gpio_chip structure
- * uses the above macro and depends on the banks being listed in order here.
- */
-
-static struct samsung_gpio_chip s5pv210_gpios_4bit[] = {
-#ifdef CONFIG_CPU_S5PV210
-       {
-               .chip   = {
-                       .base   = S5PV210_GPA0(0),
-                       .ngpio  = S5PV210_GPIO_A0_NR,
-                       .label  = "GPA0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPA1(0),
-                       .ngpio  = S5PV210_GPIO_A1_NR,
-                       .label  = "GPA1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPB(0),
-                       .ngpio  = S5PV210_GPIO_B_NR,
-                       .label  = "GPB",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPC0(0),
-                       .ngpio  = S5PV210_GPIO_C0_NR,
-                       .label  = "GPC0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPC1(0),
-                       .ngpio  = S5PV210_GPIO_C1_NR,
-                       .label  = "GPC1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPD0(0),
-                       .ngpio  = S5PV210_GPIO_D0_NR,
-                       .label  = "GPD0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPD1(0),
-                       .ngpio  = S5PV210_GPIO_D1_NR,
-                       .label  = "GPD1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPE0(0),
-                       .ngpio  = S5PV210_GPIO_E0_NR,
-                       .label  = "GPE0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPE1(0),
-                       .ngpio  = S5PV210_GPIO_E1_NR,
-                       .label  = "GPE1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPF0(0),
-                       .ngpio  = S5PV210_GPIO_F0_NR,
-                       .label  = "GPF0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPF1(0),
-                       .ngpio  = S5PV210_GPIO_F1_NR,
-                       .label  = "GPF1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPF2(0),
-                       .ngpio  = S5PV210_GPIO_F2_NR,
-                       .label  = "GPF2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPF3(0),
-                       .ngpio  = S5PV210_GPIO_F3_NR,
-                       .label  = "GPF3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPG0(0),
-                       .ngpio  = S5PV210_GPIO_G0_NR,
-                       .label  = "GPG0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPG1(0),
-                       .ngpio  = S5PV210_GPIO_G1_NR,
-                       .label  = "GPG1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPG2(0),
-                       .ngpio  = S5PV210_GPIO_G2_NR,
-                       .label  = "GPG2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPG3(0),
-                       .ngpio  = S5PV210_GPIO_G3_NR,
-                       .label  = "GPG3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPI(0),
-                       .ngpio  = S5PV210_GPIO_I_NR,
-                       .label  = "GPI",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPJ0(0),
-                       .ngpio  = S5PV210_GPIO_J0_NR,
-                       .label  = "GPJ0",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPJ1(0),
-                       .ngpio  = S5PV210_GPIO_J1_NR,
-                       .label  = "GPJ1",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPJ2(0),
-                       .ngpio  = S5PV210_GPIO_J2_NR,
-                       .label  = "GPJ2",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPJ3(0),
-                       .ngpio  = S5PV210_GPIO_J3_NR,
-                       .label  = "GPJ3",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_GPJ4(0),
-                       .ngpio  = S5PV210_GPIO_J4_NR,
-                       .label  = "GPJ4",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_MP01(0),
-                       .ngpio  = S5PV210_GPIO_MP01_NR,
-                       .label  = "MP01",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_MP02(0),
-                       .ngpio  = S5PV210_GPIO_MP02_NR,
-                       .label  = "MP02",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_MP03(0),
-                       .ngpio  = S5PV210_GPIO_MP03_NR,
-                       .label  = "MP03",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_MP04(0),
-                       .ngpio  = S5PV210_GPIO_MP04_NR,
-                       .label  = "MP04",
-               },
-       }, {
-               .chip   = {
-                       .base   = S5PV210_MP05(0),
-                       .ngpio  = S5PV210_GPIO_MP05_NR,
-                       .label  = "MP05",
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC00),
-               .irq_base = IRQ_EINT(0),
-               .chip   = {
-                       .base   = S5PV210_GPH0(0),
-                       .ngpio  = S5PV210_GPIO_H0_NR,
-                       .label  = "GPH0",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC20),
-               .irq_base = IRQ_EINT(8),
-               .chip   = {
-                       .base   = S5PV210_GPH1(0),
-                       .ngpio  = S5PV210_GPIO_H1_NR,
-                       .label  = "GPH1",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC40),
-               .irq_base = IRQ_EINT(16),
-               .chip   = {
-                       .base   = S5PV210_GPH2(0),
-                       .ngpio  = S5PV210_GPIO_H2_NR,
-                       .label  = "GPH2",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .base   = (S5P_VA_GPIO + 0xC60),
-               .irq_base = IRQ_EINT(24),
-               .chip   = {
-                       .base   = S5PV210_GPH3(0),
-                       .ngpio  = S5PV210_GPIO_H3_NR,
-                       .label  = "GPH3",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       },
-#endif
-};
-
-/* TODO: cleanup soc_is_* */
-static __init int samsung_gpiolib_init(void)
-{
-       struct samsung_gpio_chip *chip;
-       int i, nr_chips;
-       int group = 0;
-
-       /*
-        * Currently there are two drivers that can provide GPIO support for
-        * Samsung SoCs. For device tree enabled platforms, the new
-        * pinctrl-samsung driver is used, providing both GPIO and pin control
-        * interfaces. For legacy (non-DT) platforms this driver is used.
-        */
-       if (of_have_populated_dt())
-               return -ENODEV;
-
-       samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs));
-
-       if (soc_is_s3c24xx()) {
-               s3c24xx_gpiolib_add_chips(s3c24xx_gpios,
-                               ARRAY_SIZE(s3c24xx_gpios), S3C24XX_VA_GPIO);
-       } else if (soc_is_s3c64xx()) {
-               samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit,
-                               ARRAY_SIZE(s3c64xx_gpios_2bit),
-                               S3C64XX_VA_GPIO + 0xE0, 0x20);
-               samsung_gpiolib_add_4bit_chips(s3c64xx_gpios_4bit,
-                               ARRAY_SIZE(s3c64xx_gpios_4bit),
-                               S3C64XX_VA_GPIO);
-               samsung_gpiolib_add_4bit2_chips(s3c64xx_gpios_4bit2,
-                               ARRAY_SIZE(s3c64xx_gpios_4bit2));
-       } else if (soc_is_s5p6440()) {
-               samsung_gpiolib_add_2bit_chips(s5p6440_gpios_2bit,
-                               ARRAY_SIZE(s5p6440_gpios_2bit), NULL, 0x0);
-               samsung_gpiolib_add_4bit_chips(s5p6440_gpios_4bit,
-                               ARRAY_SIZE(s5p6440_gpios_4bit), S5P_VA_GPIO);
-               samsung_gpiolib_add_4bit2_chips(s5p6440_gpios_4bit2,
-                               ARRAY_SIZE(s5p6440_gpios_4bit2));
-               s5p64x0_gpiolib_add_rbank(s5p6440_gpios_rbank,
-                               ARRAY_SIZE(s5p6440_gpios_rbank));
-       } else if (soc_is_s5p6450()) {
-               samsung_gpiolib_add_2bit_chips(s5p6450_gpios_2bit,
-                               ARRAY_SIZE(s5p6450_gpios_2bit), NULL, 0x0);
-               samsung_gpiolib_add_4bit_chips(s5p6450_gpios_4bit,
-                               ARRAY_SIZE(s5p6450_gpios_4bit), S5P_VA_GPIO);
-               samsung_gpiolib_add_4bit2_chips(s5p6450_gpios_4bit2,
-                               ARRAY_SIZE(s5p6450_gpios_4bit2));
-               s5p64x0_gpiolib_add_rbank(s5p6450_gpios_rbank,
-                               ARRAY_SIZE(s5p6450_gpios_rbank));
-       } else if (soc_is_s5pc100()) {
-               group = 0;
-               chip = s5pc100_gpios_4bit;
-               nr_chips = ARRAY_SIZE(s5pc100_gpios_4bit);
-
-               for (i = 0; i < nr_chips; i++, chip++) {
-                       if (!chip->config) {
-                               chip->config = &samsung_gpio_cfgs[3];
-                               chip->group = group++;
-                       }
-               }
-               samsung_gpiolib_add_4bit_chips(s5pc100_gpios_4bit, nr_chips, S5P_VA_GPIO);
-#if defined(CONFIG_CPU_S5PC100) && defined(CONFIG_S5P_GPIO_INT)
-               s5p_register_gpioint_bank(IRQ_GPIOINT, 0, S5P_GPIOINT_GROUP_MAXNR);
-#endif
-       } else if (soc_is_s5pv210()) {
-               group = 0;
-               chip = s5pv210_gpios_4bit;
-               nr_chips = ARRAY_SIZE(s5pv210_gpios_4bit);
-
-               for (i = 0; i < nr_chips; i++, chip++) {
-                       if (!chip->config) {
-                               chip->config = &samsung_gpio_cfgs[3];
-                               chip->group = group++;
-                       }
-               }
-               samsung_gpiolib_add_4bit_chips(s5pv210_gpios_4bit, nr_chips, S5P_VA_GPIO);
-#if defined(CONFIG_CPU_S5PV210) && defined(CONFIG_S5P_GPIO_INT)
-               s5p_register_gpioint_bank(IRQ_GPIOINT, 0, S5P_GPIOINT_GROUP_MAXNR);
-#endif
-       } else {
-               WARN(1, "Unknown SoC in gpio-samsung, no GPIOs added\n");
-               return -ENODEV;
-       }
-
-       return 0;
-}
-core_initcall(samsung_gpiolib_init);
-
-int s3c_gpio_cfgpin(unsigned int pin, unsigned int config)
-{
-       struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
-       unsigned long flags;
-       int offset;
-       int ret;
-
-       if (!chip)
-               return -EINVAL;
-
-       offset = pin - chip->chip.base;
+       offset = pin - chip->chip.base;
 
        samsung_gpio_lock(chip, flags);
        ret = samsung_gpio_do_setcfg(chip, offset, config);
@@ -2274,56 +1309,6 @@ samsung_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
 }
 EXPORT_SYMBOL(s3c_gpio_getpull);
 
-#ifdef CONFIG_S5P_GPIO_DRVSTR
-s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
-{
-       struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
-       unsigned int off;
-       void __iomem *reg;
-       int shift;
-       u32 drvstr;
-
-       if (!chip)
-               return -EINVAL;
-
-       off = pin - chip->chip.base;
-       shift = off * 2;
-       reg = chip->base + 0x0C;
-
-       drvstr = __raw_readl(reg);
-       drvstr = drvstr >> shift;
-       drvstr &= 0x3;
-
-       return (__force s5p_gpio_drvstr_t)drvstr;
-}
-EXPORT_SYMBOL(s5p_gpio_get_drvstr);
-
-int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr)
-{
-       struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
-       unsigned int off;
-       void __iomem *reg;
-       int shift;
-       u32 tmp;
-
-       if (!chip)
-               return -EINVAL;
-
-       off = pin - chip->chip.base;
-       shift = off * 2;
-       reg = chip->base + 0x0C;
-
-       tmp = __raw_readl(reg);
-       tmp &= ~(0x3 << shift);
-       tmp |= drvstr << shift;
-
-       __raw_writel(tmp, reg);
-
-       return 0;
-}
-EXPORT_SYMBOL(s5p_gpio_set_drvstr);
-#endif /* CONFIG_S5P_GPIO_DRVSTR */
-
 #ifdef CONFIG_PLAT_S3C24XX
 unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)
 {