Merge branch 'next-s3c64xx-device' into next-merged
authorBen Dooks <ben-linux@fluff.org>
Thu, 18 Dec 2008 16:17:37 +0000 (16:17 +0000)
committerBen Dooks <ben-linux@fluff.org>
Thu, 18 Dec 2008 16:17:37 +0000 (16:17 +0000)
Conflicts:

arch/arm/mach-s3c2440/mach-at2440evb.c

1  2 
arch/arm/mach-s3c2412/mach-jive.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-at2440evb.c
arch/arm/mach-s3c6410/mach-smdk6410.c
arch/arm/plat-s3c/Kconfig
arch/arm/plat-s3c24xx/Makefile
arch/arm/plat-s3c24xx/devs.c

index 5e758cf8bf826ec04d3c77a22663e44aefc0a2da,e08a0f06224e841a9ae313d7fbcf6963078c459c..2cd4044797cfe6cf333f2ea837f60d82635b4222
@@@ -53,6 -53,7 +53,7 @@@
  #include <plat/cpu.h>
  #include <plat/pm.h>
  #include <plat/udc.h>
+ #include <plat/iic.h>
  
  static struct map_desc jive_iodesc[] __initdata = {
  };
@@@ -398,12 -399,11 +399,12 @@@ static struct s3c2410_spigpio_info jive
        .bus_num        = 1,
        .pin_clk        = S3C2410_GPG8,
        .pin_mosi       = S3C2410_GPB8,
 +      .num_chipselect = 1,
        .chip_select    = jive_lcd_spi_chipselect,
  };
  
  static struct platform_device jive_device_lcdspi = {
 -      .name           = "s3c24xx-spi-gpio",
 +      .name           = "spi_s3c24xx_gpio",
        .id             = 1,
        .num_resources  = 0,
        .dev.platform_data = &jive_lcd_spi,
@@@ -420,12 -420,11 +421,12 @@@ static struct s3c2410_spigpio_info jive
        .bus_num        = 2,
        .pin_clk        = S3C2410_GPB4,
        .pin_mosi       = S3C2410_GPB9,
 +      .num_chipselect = 1,
        .chip_select    = jive_wm8750_chipselect,
  };
  
  static struct platform_device jive_device_wm8750 = {
 -      .name           = "s3c24xx-spi-gpio",
 +      .name           = "spi_s3c24xx_gpio",
        .id             = 2,
        .num_resources  = 0,
        .dev.platform_data = &jive_wm8750_spi,
@@@ -452,14 -451,14 +453,14 @@@ static struct spi_board_info __initdat
  
  /* I2C bus and device configuration. */
  
- static struct s3c2410_platform_i2c jive_i2c_cfg = {
+ static struct s3c2410_platform_i2c jive_i2c_cfg __initdata = {
        .max_freq       = 80 * 1000,
        .bus_freq       = 50 * 1000,
        .flags          = S3C_IICFLG_FILTER,
        .sda_delay      = 2,
  };
  
- static struct i2c_board_info jive_i2c_devs[] = {
+ static struct i2c_board_info jive_i2c_devs[] __initdata = {
        [0] = {
                I2C_BOARD_INFO("lis302dl", 0x1c),
                .irq    = IRQ_EINT14,
@@@ -472,7 -471,7 +473,7 @@@ static struct platform_device *jive_dev
        &s3c_device_usb,
        &s3c_device_rtc,
        &s3c_device_wdt,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_lcd,
        &jive_device_lcdspi,
        &jive_device_wm8750,
@@@ -665,7 -664,7 +666,7 @@@ static void __init jive_machine_init(vo
  
        spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
  
-       s3c_device_i2c.dev.platform_data = &jive_i2c_cfg;
+       s3c_i2c0_set_platdata(&jive_i2c_cfg);
        i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
  
        pm_power_off = jive_power_off;
index f151f8939929c936be7cbb16820d58ebefe1a69d,a9bbc41c4568a293094555f341841c8add3acf5d..b05d56e230a1338c2c965499547f8e56247a34ba
@@@ -40,6 -40,7 +40,7 @@@
  #include <mach/regs-mem.h>
  #include <mach/regs-lcd.h>
  #include <plat/nand.h>
+ #include <plat/iic.h>
  
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/nand.h>
@@@ -366,8 -367,6 +367,8 @@@ static struct sm501_initdata anubis_sm5
                .mask   = 0,
        },
  
 +      .devices        = SM501_USE_GPIO,
 +
        /* set the SDRAM and bus clocks */
        .mclk           = 72 * MHZ,
        .m1xclk         = 144 * MHZ,
  
  static struct sm501_platdata_gpio_i2c anubis_sm501_gpio_i2c[] = {
        [0] = {
 +              .bus_num        = 1,
                .pin_scl        = 44,
                .pin_sda        = 45,
        },
        [1] = {
 +              .bus_num        = 2,
                .pin_scl        = 40,
                .pin_sda        = 41,
        },
  
  static struct sm501_platdata anubis_sm501_platdata = {
        .init           = &anubis_sm501_initdata,
 +      .gpio_base      = -1,
        .gpio_i2c       = anubis_sm501_gpio_i2c,
        .gpio_i2c_nr    = ARRAY_SIZE(anubis_sm501_gpio_i2c),
  };
@@@ -409,7 -405,7 +410,7 @@@ static struct platform_device *anubis_d
        &s3c_device_usb,
        &s3c_device_wdt,
        &s3c_device_adc,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_rtc,
        &s3c_device_nand,
        &anubis_device_ide0,
@@@ -473,6 -469,7 +474,7 @@@ static void __init anubis_map_io(void
  
  static void __init anubis_init(void)
  {
+       s3c_i2c0_set_platdata(NULL);
        platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
  
        i2c_register_board_info(0, anubis_i2c_devs,
index 4539b1d958775e9946b68963ea29e5cdf3360f87,55e07ae5ab8c0368aeef7953e9a1992bc9b69812..0a6d0a5d961b10a6ce76aae9dcd0945262910626
@@@ -28,7 -28,6 +28,7 @@@
  #include <asm/mach/irq.h>
  
  #include <mach/hardware.h>
 +#include <mach/fb.h>
  #include <asm/irq.h>
  #include <asm/mach-types.h>
  
@@@ -37,6 -36,7 +37,7 @@@
  #include <mach/regs-mem.h>
  #include <mach/regs-lcd.h>
  #include <plat/nand.h>
+ #include <plat/iic.h>
  
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/nand.h>
@@@ -46,7 -46,6 +47,7 @@@
  #include <plat/clock.h>
  #include <plat/devs.h>
  #include <plat/cpu.h>
 +#include <asm/plat-s3c24xx/mci.h>
  
  static struct map_desc at2440evb_iodesc[] __initdata = {
        /* Nothing here */
@@@ -164,60 -163,19 +165,60 @@@ static struct platform_device at2440evb
        },
  };
  
 +static struct s3c24xx_mci_pdata at2440evb_mci_pdata = {
 +      .gpio_detect    = S3C2410_GPG10,
 +};
 +
 +/* 7" LCD panel */
 +
 +static struct s3c2410fb_display at2440evb_lcd_cfg __initdata = {
 +
 +      .lcdcon5        = S3C2410_LCDCON5_FRM565 |
 +                        S3C2410_LCDCON5_INVVLINE |
 +                        S3C2410_LCDCON5_INVVFRAME |
 +                        S3C2410_LCDCON5_PWREN |
 +                        S3C2410_LCDCON5_HWSWP,
 +
 +      .type           = S3C2410_LCDCON1_TFT,
 +
 +      .width          = 800,
 +      .height         = 480,
 +
 +      .pixclock       = 33333, /* HCLK 60 MHz, divisor 2 */
 +      .xres           = 800,
 +      .yres           = 480,
 +      .bpp            = 16,
 +      .left_margin    = 88,
 +      .right_margin   = 40,
 +      .hsync_len      = 128,
 +      .upper_margin   = 32,
 +      .lower_margin   = 11,
 +      .vsync_len      = 2,
 +};
 +
 +static struct s3c2410fb_mach_info at2440evb_fb_info __initdata = {
 +      .displays       = &at2440evb_lcd_cfg,
 +      .num_displays   = 1,
 +      .default_display = 0,
 +};
 +
  static struct platform_device *at2440evb_devices[] __initdata = {
        &s3c_device_usb,
        &s3c_device_wdt,
        &s3c_device_adc,
-       &s3c_device_i2c,
+       &s3c_device_i2c0,
        &s3c_device_rtc,
        &s3c_device_nand,
 +      &s3c_device_sdi,
 +      &s3c_device_lcd,
        &at2440evb_device_eth,
  };
  
  static void __init at2440evb_map_io(void)
  {
        s3c_device_nand.dev.platform_data = &at2440evb_nand_info;
 +      s3c_device_sdi.name = "s3c2440-sdi";
 +      s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
  
        s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
        s3c24xx_init_clocks(16934400);
  
  static void __init at2440evb_init(void)
  {
 +      s3c24xx_fb_set_platdata(&at2440evb_fb_info);
+       s3c_i2c0_set_platdata(NULL);
++
        platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
  }
  
index 9213a8ba283b1b1c52ffe1c71fde0b445cbd36e9,ae3bd5c2b8c63e6c5af6761cd861e810ee6ddd3c..3c4d47145c832bd5ce75a7b7689242e052177684
  #include <linux/serial_core.h>
  #include <linux/platform_device.h>
  #include <linux/io.h>
+ #include <linux/i2c.h>
+ #include <linux/fb.h>
+ #include <linux/gpio.h>
+ #include <linux/delay.h>
+ #include <video/platform_lcd.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
  
  #include <mach/hardware.h>
+ #include <mach/regs-fb.h>
  #include <mach/map.h>
  
  #include <asm/irq.h>
  #include <asm/mach-types.h>
  
  #include <plat/regs-serial.h>
+ #include <plat/iic.h>
+ #include <plat/fb.h>
  
  #include <plat/s3c6410.h>
  #include <plat/clock.h>
@@@ -59,11 -68,93 +68,91 @@@ static struct s3c2410_uartcfg smdk6410_
        },
  };
  
+ /* framebuffer and LCD setup. */
+ /* GPF15 = LCD backlight control
+  * GPF13 => Panel power
+  * GPN5 = LCD nRESET signal
+  * PWM_TOUT1 => backlight brightness
+  */
+ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
+                                  unsigned int power)
+ {
+       if (power) {
+               gpio_direction_output(S3C64XX_GPF(13), 1);
+               gpio_direction_output(S3C64XX_GPF(15), 1);
+               /* fire nRESET on power up */
+               gpio_direction_output(S3C64XX_GPN(5), 0);
+               msleep(10);
+               gpio_direction_output(S3C64XX_GPN(5), 1);
+               msleep(1);
+       } else {
+               gpio_direction_output(S3C64XX_GPF(15), 0);
+               gpio_direction_output(S3C64XX_GPF(13), 0);
+       }
+ }
+ static struct plat_lcd_data smdk6410_lcd_power_data = {
+       .set_power      = smdk6410_lcd_power_set,
+ };
+ static struct platform_device smdk6410_lcd_powerdev = {
+       .name                   = "platform-lcd",
+       .dev.parent             = &s3c_device_fb.dev,
+       .dev.platform_data      = &smdk6410_lcd_power_data,
+ };
+ static struct s3c_fb_pd_win smdk6410_fb_win0 = {
+       /* this is to ensure we use win0 */
+       .win_mode       = {
+               .pixclock       = 41094,
+               .left_margin    = 8,
+               .right_margin   = 13,
+               .upper_margin   = 7,
+               .lower_margin   = 5,
+               .hsync_len      = 3,
+               .vsync_len      = 1,
+               .xres           = 800,
+               .yres           = 480,
+       },
+       .max_bpp        = 32,
+       .default_bpp    = 16,
+ };
+ /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
+ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
+       .setup_gpio     = s3c64xx_fb_gpio_setup_24bpp,
+       .win[0]         = &smdk6410_fb_win0,
+       .vidcon0        = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+       .vidcon1        = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
+ };
  struct map_desc smdk6410_iodesc[] = {};
  
  static struct platform_device *smdk6410_devices[] __initdata = {
+ #ifdef CONFIG_SMDK6410_SD_CH0
+       &s3c_device_hsmmc0,
+ #endif
+ #ifdef CONFIG_SMDK6410_SD_CH1
+       &s3c_device_hsmmc1,
+ #endif
+       &s3c_device_i2c0,
+       &s3c_device_i2c1,
+       &s3c_device_fb,
+       &smdk6410_lcd_powerdev,
+ };
+ static struct i2c_board_info i2c_devs0[] __initdata = {
+       { I2C_BOARD_INFO("24c08", 0x50), },
+       { I2C_BOARD_INFO("WM8580", 0X1b), },
+ };
+ static struct i2c_board_info i2c_devs1[] __initdata = {
+       { I2C_BOARD_INFO("24c128", 0x57), },    /* Samsung S524AD0XD1 */
  };
  
 -extern void s3c64xx_init_io(struct map_desc *, int);
 -
  static void __init smdk6410_map_io(void)
  {
        s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
  
  static void __init smdk6410_machine_init(void)
  {
+       s3c_i2c0_set_platdata(NULL);
+       s3c_i2c1_set_platdata(NULL);
+       s3c_fb_set_platdata(&smdk6410_lcd_pdata);
+       i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
+       i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
        platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
  }
  
index adb9060ec91022fcbdfd85f8d64e524d0744ead5,e80a32822d883b259d8530ff1107974612198159..def0bb457ca3b549dcc18b7f4dc3a758ccd5d9af
@@@ -57,14 -57,6 +57,14 @@@ config S3C_BOOT_ERROR_RESE
          Say y here to use the watchdog to reset the system if the
          kernel decompressor detects an error during decompression.
  
 +config S3C_BOOT_UART_FORCE_FIFO
 +       bool "Force UART FIFO on during boot process"
 +       depends on PLAT_S3C
 +       default y
 +       help
 +         Say Y here to force the UART FIFOs on during the kernel
 +       uncompressor
 +
  comment "Power management"
  
  config S3C2410_PM_DEBUG
@@@ -110,3 -102,73 +110,73 @@@ config S3C_LOWLEVEL_UART_POR
          such as the `Uncompressing...` at start time. The value of
          this configuration should be between zero and two. The port
          must have been initialised by the boot-loader before use.
+ # options for gpiolib support
+ config S3C_GPIO_SPACE
+       int "Space between gpio banks"
+       default 0
+       help
+         Add a number of spare GPIO entries between each bank for debugging
+         purposes. This allows any problems where an counter overflows from
+         one bank to another to be caught, at the expense of using a little
+         more memory.
+ config S3C_GPIO_TRACK
+       bool
+       help
+         Internal configuration option to enable the s3c specific gpio
+         chip tracking if the platform requires it.
+ config S3C_GPIO_PULL_UPDOWN
+       bool
+       help
+         Internal configuration to enable the correct GPIO pull helper
+ config S3C_GPIO_PULL_DOWN
+       bool
+       help
+         Internal configuration to enable the correct GPIO pull helper
+ config S3C_GPIO_PULL_UP
+       bool
+       help
+         Internal configuration to enable the correct GPIO pull helper
+ config S3C_GPIO_CFG_S3C24XX
+       bool
+       help
+         Internal configuration to enable S3C24XX style GPIO configuration
+         functions.
+ config S3C_GPIO_CFG_S3C64XX
+       bool
+       help
+         Internal configuration to enable S3C64XX style GPIO configuration
+         functions.
+ # device definitions to compile in
+ config S3C_DEV_HSMMC
+       bool
+       depends on PLAT_S3C
+       help
+         Compile in platform device definitions for HSMMC code
+ config S3C_DEV_HSMMC1
+       bool
+       depends on PLAT_S3C
+       help
+         Compile in platform device definitions for HSMMC channel 1
+ config S3C_DEV_I2C1
+       bool
+       depends on PLAT_S3C
+       help
+         Compile in platform device definitions for I2C channel 1
+ config S3C_DEV_FB
+       bool
+       depends on PLAT_S3C
+       help
+         Compile in platform device definition for framebuffer
index a8cfdefc29e9101b3a2ad67e44f34c191d1cf956,763d3444048b7035693cdda3c6e665719602435c..1e0767b266b8e9d6963bb390a02b1bf203b9b801
@@@ -31,8 -31,10 +31,11 @@@ obj-$(CONFIG_PM)            += sleep.
  obj-$(CONFIG_HAVE_PWM)                += pwm.o
  obj-$(CONFIG_S3C2410_CLOCK)   += s3c2410-clock.o
  obj-$(CONFIG_S3C2410_DMA)     += dma.o
 +obj-$(CONFIG_S3C24XX_ADC)     += adc.o
  
+ # device specific setup and/or initialisation
+ obj-$(CONFIG_ARCH_S3C2410)    += setup-i2c.o
  # SPI gpio central GPIO functions
  
  obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
index 9826efb91e48db859602f4d60b05fe0edfeacd90,3cb07b6a0e4c0edbb9466d127e762f429e871828..14d4f0bc12539faa70d909784f4bc7ca7c86093f
@@@ -271,31 -271,6 +271,6 @@@ struct platform_device s3c_device_wdt 
  
  EXPORT_SYMBOL(s3c_device_wdt);
  
- /* I2C */
- static struct resource s3c_i2c_resource[] = {
-       [0] = {
-               .start = S3C24XX_PA_IIC,
-               .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_IIC,
-               .end   = IRQ_IIC,
-               .flags = IORESOURCE_IRQ,
-       }
- };
- struct platform_device s3c_device_i2c = {
-       .name             = "s3c2410-i2c",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_i2c_resource),
-       .resource         = s3c_i2c_resource,
- };
- EXPORT_SYMBOL(s3c_device_i2c);
  /* IIS */
  
  static struct resource s3c_iis_resource[] = {
@@@ -372,20 -347,12 +347,20 @@@ static struct resource s3c_adc_resource
  };
  
  struct platform_device s3c_device_adc = {
 -      .name             = "s3c2410-adc",
 +      .name             = "s3c24xx-adc",
        .id               = -1,
        .num_resources    = ARRAY_SIZE(s3c_adc_resource),
        .resource         = s3c_adc_resource,
  };
  
 +/* HWMON */
 +
 +struct platform_device s3c_device_hwmon = {
 +      .name           = "s3c24xx-hwmon",
 +      .id             = -1,
 +      .dev.parent     = &s3c_device_adc.dev,
 +};
 +
  /* SDI */
  
  static struct resource s3c_sdi_resource[] = {
@@@ -411,36 -378,6 +386,6 @@@ struct platform_device s3c_device_sdi 
  
  EXPORT_SYMBOL(s3c_device_sdi);
  
- /* High-speed MMC/SD */
- static struct resource s3c_hsmmc_resource[] = {
-       [0] = {
-               .start = S3C2443_PA_HSMMC,
-               .end   = S3C2443_PA_HSMMC + S3C2443_SZ_HSMMC - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start = IRQ_S3C2443_HSMMC,
-               .end   = IRQ_S3C2443_HSMMC,
-               .flags = IORESOURCE_IRQ,
-       }
- };
- static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
- struct platform_device s3c_device_hsmmc = {
-       .name             = "s3c-sdhci",
-       .id               = -1,
-       .num_resources    = ARRAY_SIZE(s3c_hsmmc_resource),
-       .resource         = s3c_hsmmc_resource,
-       .dev              = {
-               .dma_mask = &s3c_device_hsmmc_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
- };
  /* SPI (0) */
  
  static struct resource s3c_spi0_resource[] = {