ARM: Merge for-2635/gpio2
authorBen Dooks <ben-linux@fluff.org>
Wed, 19 May 2010 09:04:08 +0000 (18:04 +0900)
committerBen Dooks <ben-linux@fluff.org>
Wed, 19 May 2010 09:04:08 +0000 (18:04 +0900)
Merge branch 'for-2635/gpio2' into for-linus/samsung2

1  2 
arch/arm/mach-s3c2410/Kconfig
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2410/mach-n30.c
arch/arm/mach-s3c2412/mach-jive.c
arch/arm/mach-s3c2412/mach-smdk2413.c
arch/arm/mach-s3c2440/Kconfig

index 163b60e2af96cf6bec3287eec2425cc4bd9ad784,9e5e96f12d86501af095bd94571c57642c1be088..a4c0b3fcdbbafac95728bc9c5754a80f238ce5ac
@@@ -6,6 -6,7 +6,7 @@@ config CPU_S3C241
        bool
        depends on ARCH_S3C2410
        select CPU_ARM920T
+       select S3C_GPIO_PULL_UP
        select S3C2410_CLOCK
        select S3C2410_GPIO
        select CPU_LLSERIAL_S3C2410
@@@ -95,19 -96,12 +96,19 @@@ config PM_H194
  config MACH_N30
        bool "Acer N30 family"
        select CPU_S3C2410
 +      select MACH_N35
        select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
        help
          Say Y here if you want suppt for the Acer N30, Acer N35,
          Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
  
 +config MACH_N35
 +      bool
 +      help
 +        Internal node in order to enable support for Acer N35 if Acer N30 is
 +        selected.
 +
  config ARCH_BAST
        bool "Simtec Electronics BAST (EB2410ITX)"
        select CPU_S3C2410
        select MACH_BAST_IDE
        select S3C24XX_DCLK
        select ISA
 +      select S3C_DEV_HWMON
        select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
        help
index c8786df72b9ec9abb25a8f5e62470d5c30440fd9,b061ddcf306791c27256ba4cac397b0c8045148e..c1f90f6fab42c0d867ccfe25ffe7fbdee835fda8
@@@ -61,6 -61,7 +61,7 @@@
  #include <plat/devs.h>
  #include <plat/cpu.h>
  #include <plat/cpu-freq.h>
+ #include <plat/gpio-cfg.h>
  #include <plat/audio-simtec.h>
  
  #include "usb-simtec.h"
@@@ -216,15 -217,13 +217,13 @@@ static struct s3c2410_uartcfg bast_uart
  static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
  {
        /* ensure that an nRESET is not generated on resume. */
-       s3c2410_gpio_setpin(S3C2410_GPA(21), 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT);
+       gpio_direction_output(S3C2410_GPA(21), 1);
        return 0;
  }
  
  static int bast_pm_resume(struct sys_device *sd)
  {
-       s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
+       s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
        return 0;
  }
  
@@@ -634,7 -633,7 +633,7 @@@ static void __init bast_map_io(void
  
        s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
  
 -      s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
 +      s3c_hwmon_set_platdata(&bast_hwmon_info);
  
        s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
        s3c24xx_init_clocks(0);
@@@ -658,6 -657,8 +657,8 @@@ static void __init bast_init(void
        nor_simtec_init();
        simtec_audio_add(NULL, true, &bast_audio);
  
+       WARN_ON(gpio_request(S3C2410_GPA(21), "bast nreset"));
+       
        s3c_cpufreq_setboard(&bast_cpufreq);
  }
  
index 03028b98f3622536bd5cb799ab67d6825cdfb2e3,9531b4c41deb17b7c6b975d173a78b0b21422d53..d2a2fad7db974f0c0df3b23dc2c6cb178742188a
@@@ -50,6 -50,7 +50,7 @@@
  #include <plat/udc.h>
  #include <plat/iic.h>
  
+ #include <plat/gpio-cfg.h>
  #include <plat/clock.h>
  #include <plat/devs.h>
  #include <plat/cpu.h>
@@@ -162,8 -163,8 +163,8 @@@ static struct s3c2410fb_display h1940_l
        .xres =         240,
        .yres =         320,
        .bpp =          16,
 -      .left_margin =  20,
 -      .right_margin = 8,
 +      .left_margin =  8,
 +      .right_margin = 20,
        .hsync_len =    4,
        .upper_margin = 8,
        .lower_margin = 7,
@@@ -207,16 -208,16 +208,16 @@@ static int h1940_backlight_init(struct 
  {
        gpio_request(S3C2410_GPB(0), "Backlight");
  
-       s3c2410_gpio_setpin(S3C2410_GPB(0), 0);
-       s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
-       s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
+       gpio_direction_output(S3C2410_GPB(0), 0);
+       s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE);
+       s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
  
        return 0;
  }
  
  static void h1940_backlight_exit(struct device *dev)
  {
-       s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/);
+       gpio_direction_output(S3C2410_GPB(0), 1);
  }
  
  static struct platform_pwm_backlight_data backlight_data = {
@@@ -245,18 -246,18 +246,18 @@@ static void h1940_lcd_power_set(struct 
  
        if (!power) {
                /* set to 3ec */
-               s3c2410_gpio_setpin(S3C2410_GPC(0), 0);
+               gpio_direction_output(S3C2410_GPC(0), 0);
                /* wait for 3ac */
                do {
-                       value = s3c2410_gpio_getpin(S3C2410_GPC(6));
+                       value = gpio_get_value(S3C2410_GPC(6));
                } while (value);
                /* set to 38c */
-               s3c2410_gpio_setpin(S3C2410_GPC(5), 0);
+               gpio_direction_output(S3C2410_GPC(5), 0);
        } else {
                /* Set to 3ac */
-               s3c2410_gpio_setpin(S3C2410_GPC(5), 1);
+               gpio_direction_output(S3C2410_GPC(5), 1);
                /* Set to 3ad */
-               s3c2410_gpio_setpin(S3C2410_GPC(0), 1);
+               gpio_direction_output(S3C2410_GPC(0), 1);
        }
  }
  
@@@ -271,6 -272,7 +272,6 @@@ static struct platform_device h1940_lcd
  };
  
  static struct platform_device *h1940_devices[] __initdata = {
 -      &s3c_device_ts,
        &s3c_device_ohci,
        &s3c_device_lcd,
        &s3c_device_wdt,
        &s3c_device_timer[0],
        &h1940_backlight,
        &h1940_lcd_powerdev,
 +      &s3c_device_adc,
 +      &s3c_device_ts,
  };
  
  static void __init h1940_map_io(void)
@@@ -333,12 -333,13 +334,13 @@@ static void __init h1940_init(void
        gpio_request(S3C2410_GPC(5), "LCD power");
        gpio_request(S3C2410_GPC(6), "LCD power");
  
+       gpio_direction_input(S3C2410_GPC(6));
  
        platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
  }
  
  MACHINE_START(H1940, "IPAQ-H1940")
 -      /* Maintainer: Ben Dooks <ben@fluff.org> */
 +      /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 9e2565ad973d125e8a65d317856e3a29126e09f3,75a9fd37a4675d5d7bb57ccb099e84d4c33c9bc3..41f299d983eb0a06a8c9e6b64e660963b871431b
@@@ -26,7 -26,6 +26,7 @@@
  #include <linux/serial_core.h>
  #include <linux/timer.h>
  #include <linux/io.h>
 +#include <linux/mmc/host.h>
  
  #include <mach/hardware.h>
  #include <asm/irq.h>
@@@ -47,7 -46,6 +47,7 @@@
  #include <plat/clock.h>
  #include <plat/cpu.h>
  #include <plat/devs.h>
 +#include <plat/mci.h>
  #include <plat/s3c2410.h>
  #include <plat/udc.h>
  
@@@ -174,10 -172,8 +174,10 @@@ static struct gpio_keys_button n35_butt
        {
                .gpio           = S3C2410_GPF(0),
                .code           = KEY_POWER,
 +              .type           = EV_PWR,
                .desc           = "Power",
                .active_low     = 0,
 +              .wakeup         = 1,
        },
        {
                .gpio           = S3C2410_GPG(9),
@@@ -268,14 -264,6 +268,14 @@@ static struct s3c24xx_led_platdata n30_
        .def_trigger    = "",
  };
  
 +/* This is the blue LED on the device. Originaly used to indicate GPS activity
 + * by flashing. */
 +static struct s3c24xx_led_platdata n35_blue_led_pdata = {
 +      .name           = "blue_led",
 +      .gpio           = S3C2410_GPD(8),
 +      .def_trigger    = "",
 +};
 +
  /* This LED is driven by the battery microcontroller, and is blinking
   * red, blinking green or solid green when the battery is low,
   * charging or full respectively.  By driving GPD9 low, it's possible
@@@ -287,13 -275,6 +287,13 @@@ static struct s3c24xx_led_platdata n30_
        .def_trigger    = "",
  };
  
 +static struct s3c24xx_led_platdata n35_warning_led_pdata = {
 +      .name           = "warning_led",
 +      .flags          = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
 +      .gpio           = S3C2410_GPD(9),
 +      .def_trigger    = "",
 +};
 +
  static struct platform_device n30_blue_led = {
        .name           = "s3c24xx_led",
        .id             = 1,
        },
  };
  
 +static struct platform_device n35_blue_led = {
 +      .name           = "s3c24xx_led",
 +      .id             = 1,
 +      .dev            = {
 +              .platform_data  = &n35_blue_led_pdata,
 +      },
 +};
 +
  static struct platform_device n30_warning_led = {
        .name           = "s3c24xx_led",
        .id             = 2,
        },
  };
  
 +static struct platform_device n35_warning_led = {
 +      .name           = "s3c24xx_led",
 +      .id             = 2,
 +      .dev            = {
 +              .platform_data  = &n35_warning_led_pdata,
 +      },
 +};
 +
  static struct s3c2410fb_display n30_display __initdata = {
        .type           = S3C2410_LCDCON1_TFT,
        .width          = 240,
@@@ -352,36 -317,13 +352,36 @@@ static struct s3c2410fb_mach_info n30_f
        .lpcsel         = 0x06,
  };
  
 +static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
 +{
 +      switch (power_mode) {
 +      case MMC_POWER_ON:
 +      case MMC_POWER_UP:
 +              gpio_set_value(S3C2410_GPG(4), 1);
 +              break;
 +      case MMC_POWER_OFF:
 +      default:
 +              gpio_set_value(S3C2410_GPG(4), 0);
 +              break;
 +      }
 +}
 +
 +static struct s3c24xx_mci_pdata n30_mci_cfg __initdata = {
 +      .gpio_detect    = S3C2410_GPF(1),
 +      .gpio_wprotect  = S3C2410_GPG(10),
 +      .ocr_avail      = MMC_VDD_32_33,
 +      .set_power      = n30_sdi_set_power,
 +};
 +
  static struct platform_device *n30_devices[] __initdata = {
        &s3c_device_lcd,
        &s3c_device_wdt,
        &s3c_device_i2c0,
        &s3c_device_iis,
        &s3c_device_ohci,
 +      &s3c_device_rtc,
        &s3c_device_usbgadget,
 +      &s3c_device_sdi,
        &n30_button_device,
        &n30_blue_led,
        &n30_warning_led,
@@@ -392,12 -334,8 +392,12 @@@ static struct platform_device *n35_devi
        &s3c_device_wdt,
        &s3c_device_i2c0,
        &s3c_device_iis,
 +      &s3c_device_rtc,
        &s3c_device_usbgadget,
 +      &s3c_device_sdi,
        &n35_button_device,
 +      &n35_blue_led,
 +      &n35_warning_led,
  };
  
  static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
@@@ -552,15 -490,17 +552,15 @@@ static void __init n30_map_io(void
        s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
  }
  
 -static void __init n30_init_irq(void)
 -{
 -      s3c24xx_init_irq();
 -}
 -
  /* GPB3 is the line that controls the pull-up for the USB D+ line */
  
  static void __init n30_init(void)
  {
 +      WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power"));
 +
        s3c24xx_fb_set_platdata(&n30_fb_info);
        s3c24xx_udc_set_platdata(&n30_udc_cfg);
 +      s3c24xx_mci_set_platdata(&n30_mci_cfg);
        s3c_i2c0_set_platdata(&n30_i2ccfg);
  
        /* Turn off suspend on both USB ports, and switch the
                s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
                                      S3C2410_MISCCR_USBSUSPND0 |
                                      S3C2410_MISCCR_USBSUSPND1,
 -                                    S3C2410_MISCCR_USBSUSPND1);
 +                                    S3C2410_MISCCR_USBSUSPND0);
  
                platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices));
        }
+       WARN_ON(gpio_request(S3C2410_GPB(3), "udc pup"));
+       gpio_direction_output(S3C2410_GPB(3), 0);
  }
  
  MACHINE_START(N30, "Acer-N30")
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
        .timer          = &s3c24xx_timer,
        .init_machine   = n30_init,
 -      .init_irq       = n30_init_irq,
 +      .init_irq       = s3c24xx_init_irq,
        .map_io         = n30_map_io,
  MACHINE_END
  
@@@ -619,6 -562,6 +622,6 @@@ MACHINE_START(N35, "Acer-N35"
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
        .timer          = &s3c24xx_timer,
        .init_machine   = n30_init,
 -      .init_irq       = n30_init_irq,
 +      .init_irq       = s3c24xx_init_irq,
        .map_io         = n30_map_io,
  MACHINE_END
index 20647f09aed6c238e45c1cfde8251c4f2f0f754e,43160183571a59bb8d8d5b1ecb2771f81ce39637..478f4b4606c2bd024c4209a4f59cc8c301542b46
@@@ -48,6 -48,7 +48,7 @@@
  #include <linux/mtd/nand_ecc.h>
  #include <linux/mtd/partitions.h>
  
+ #include <plat/gpio-cfg.h>
  #include <plat/clock.h>
  #include <plat/devs.h>
  #include <plat/cpu.h>
@@@ -357,8 -358,7 +358,7 @@@ static void jive_lcm_reset(unsigned in
  {
        printk(KERN_DEBUG "%s(%d)\n", __func__, set);
  
-       s3c2410_gpio_setpin(S3C2410_GPG(13), set);
-       s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT);
+       gpio_set_value(S3C2410_GPG(13), set);
  }
  
  #undef LCD_UPPER_MARGIN
@@@ -391,7 -391,7 +391,7 @@@ static struct ili9320_platdata jive_lcm
  
  static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs)
  {
-       s3c2410_gpio_setpin(S3C2410_GPB(7), cs ? 0 : 1);
+       gpio_set_value(S3C2410_GPB(7), cs ? 0 : 1);
  }
  
  static struct s3c2410_spigpio_info jive_lcd_spi = {
@@@ -413,7 -413,7 +413,7 @@@ static struct platform_device jive_devi
  
  static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs)
  {
-       s3c2410_gpio_setpin(S3C2410_GPH(10), cs ? 0 : 1);
+       gpio_set_value(S3C2410_GPH(10), cs ? 0 : 1);
  }
  
  static struct s3c2410_spigpio_info jive_wm8750_spi = {
@@@ -531,7 -531,7 +531,7 @@@ static void jive_power_off(void
        printk(KERN_INFO "powering system down...\n");
  
        s3c2410_gpio_setpin(S3C2410_GPC(5), 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT);
+       s3c_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT);
  }
  
  static void __init jive_machine_init(void)
  
        /* initialise the spi */
  
-       s3c2410_gpio_setpin(S3C2410_GPG(13), 0);
-       s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT);
+       gpio_request(S3C2410_GPG(13), "lcm reset");
+       gpio_direction_output(S3C2410_GPG(13), 0);
  
-       s3c2410_gpio_setpin(S3C2410_GPB(7), 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPB(7), S3C2410_GPIO_OUTPUT);
+       gpio_request(S3C2410_GPB(7), "jive spi");
+       gpio_direction_output(S3C2410_GPB(7), 1);
  
        s3c2410_gpio_setpin(S3C2410_GPB(6), 0);
-       s3c2410_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
+       s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
  
        s3c2410_gpio_setpin(S3C2410_GPG(8), 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT);
+       s3c_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT);
  
        /* initialise the WM8750 spi */
  
-       s3c2410_gpio_setpin(S3C2410_GPH(10), 1);
-       s3c2410_gpio_cfgpin(S3C2410_GPH(10), S3C2410_GPIO_OUTPUT);
+       gpio_request(S3C2410_GPH(10), "jive wm8750 spi");
+       gpio_direction_output(S3C2410_GPH(10), 1);
  
        /* Turn off suspend on both USB ports, and switch the
         * selectable USB port to USB device mode. */
  }
  
  MACHINE_START(JIVE, "JIVE")
 -      /* Maintainer: Ben Dooks <ben@fluff.org> */
 +      /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 3d41aa74c362888086fda104b33fe4380a628498,faddb36ed23b5b33fdd82a92004ab0b32739de0c..ba93a356a83998a2b6e0ab2dfc83be7945321345
@@@ -85,10 -85,10 +85,10 @@@ static void smdk2413_udc_pullup(enum s3
        switch (cmd)
        {
                case S3C2410_UDC_P_ENABLE :
-                       s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
+                       gpio_set_value(S3C2410_GPF(2), 1);
                        break;
                case S3C2410_UDC_P_DISABLE :
-                       s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
+                       gpio_set_value(S3C2410_GPF(2), 0);
                        break;
                case S3C2410_UDC_P_RESET :
                        break;
@@@ -134,8 -134,8 +134,8 @@@ static void __init smdk2413_machine_ini
  {     /* Turn off suspend on both USB ports, and switch the
         * selectable USB port to USB device mode. */
  
-       s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
-       s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
+       WARN_ON(gpio_request(S3C2410_GPF(2), "udc pull"));
+       gpio_direction_output(S3C2410_GPF(2), 0);
  
        s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
                              S3C2410_MISCCR_USBSUSPND0 |
  }
  
  MACHINE_START(S3C2413, "S3C2413")
 -      /* Maintainer: Ben Dooks <ben@fluff.org> */
 +      /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
  MACHINE_END
  
  MACHINE_START(SMDK2412, "SMDK2412")
 -      /* Maintainer: Ben Dooks <ben@fluff.org> */
 +      /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
  MACHINE_END
  
  MACHINE_START(SMDK2413, "SMDK2413")
 -      /* Maintainer: Ben Dooks <ben@fluff.org> */
 +      /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index a6c5df6d41efc05dcd5cc2e71d9d5daf320cffdd,9d102b9120913d9a6c3210b1c0542c18b6a3282b..cd8e7de388f0c32b5828d268894b512aa53f45f6
@@@ -6,6 -6,7 +6,7 @@@ config CPU_S3C244
        bool
        depends on ARCH_S3C2410
        select CPU_ARM920T
+       select S3C_GPIO_PULL_UP
        select S3C2410_CLOCK
        select S3C2410_PM if PM
        select S3C2410_GPIO
@@@ -187,17 -188,4 +188,17 @@@ config MACH_MINI244
          Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
          available via various sources. It can come with a 3.5" or 7" touch LCD.
  
 +config MACH_RX1950
 +      bool "HP iPAQ rx1950"
 +      select CPU_S3C2442
 +      select S3C24XX_DCLK
 +      select PM_H1940 if PM
 +      select I2C
 +      select S3C2410_PWM
 +      select S3C_DEV_NAND
 +      select S3C2410_IOTIMING if S3C2440_CPUFREQ
 +      select S3C2440_XTAL_16934400
 +      help
 +         Say Y here if you're using HP iPAQ rx1950
 +
  endmenu