Merge branch 'sa11x0-lcd' into sa11x0
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 25 Mar 2012 22:55:54 +0000 (23:55 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 25 Mar 2012 22:55:54 +0000 (23:55 +0100)
Conflicts:
arch/arm/mach-sa1100/assabet.c

1  2 
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/generic.c
arch/arm/mach-sa1100/include/mach/SA-1100.h
arch/arm/mach-sa1100/shannon.c

index e2d411a8d4ce36db54246cfc48819a263b0a67c8,65b0a9a3fb9c9cb9740ef7b3cf71e9210f8add15..c3f5064df4bf9449756cb8856fe4eb1702aecc99
@@@ -197,15 -179,99 +172,108 @@@ static struct mcp_plat_data assabet_mcp
        .sclk_rate      = 11981000,
  };
  
+ static void assabet_lcd_set_visual(u32 visual)
+ {
+       u_int is_true_color = visual == FB_VISUAL_TRUECOLOR;
+       if (machine_is_assabet()) {
+ #if 1         // phase 4 or newer Assabet's
+               if (is_true_color)
+                       ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
+               else
+                       ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
+ #else
+               // older Assabet's
+               if (is_true_color)
+                       ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
+               else
+                       ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
+ #endif
+       }
+ }
+ #ifndef ASSABET_PAL_VIDEO
+ static void assabet_lcd_backlight_power(int on)
+ {
+       if (on)
+               ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
+       else
+               ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
+ }
+ /*
+  * Turn on/off the backlight.  When turning the backlight on, we wait
+  * 500us after turning it on so we don't cause the supplies to droop
+  * when we enable the LCD controller (and cause a hard reset.)
+  */
+ static void assabet_lcd_power(int on)
+ {
+       if (on) {
+               ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
+               udelay(500);
+       } else
+               ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
+ }
+ /*
+  * The assabet uses a sharp LQ039Q2DS54 LCD module.  It is actually
+  * takes an RGB666 signal, but we provide it with an RGB565 signal
+  * instead (def_rgb_16).
+  */
+ static struct sa1100fb_mach_info lq039q2ds54_info = {
+       .pixclock       = 171521,       .bpp            = 16,
+       .xres           = 320,          .yres           = 240,
+       .hsync_len      = 5,            .vsync_len      = 1,
+       .left_margin    = 61,           .upper_margin   = 3,
+       .right_margin   = 9,            .lower_margin   = 0,
+       .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       .lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+       .lccr3          = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+       .backlight_power = assabet_lcd_backlight_power,
+       .lcd_power = assabet_lcd_power,
+       .set_visual = assabet_lcd_set_visual,
+ };
+ #else
+ static void assabet_pal_backlight_power(int on)
+ {
+       ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
+ }
+ static void assabet_pal_power(int on)
+ {
+       ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
+ }
+ static struct sa1100fb_mach_info pal_info = {
+       .pixclock       = 67797,        .bpp            = 16,
+       .xres           = 640,          .yres           = 512,
+       .hsync_len      = 64,           .vsync_len      = 6,
+       .left_margin    = 125,          .upper_margin   = 70,
+       .right_margin   = 115,          .lower_margin   = 36,
+       .lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+       .lccr3          = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
+       .backlight_power = assabet_pal_backlight_power,
+       .lcd_power = assabet_pal_power,
+       .set_visual = assabet_lcd_set_visual,
+ };
+ #endif
 +#ifdef CONFIG_ASSABET_NEPONSET
 +static struct resource neponset_resources[] = {
 +      DEFINE_RES_MEM(0x10000000, 0x08000000),
 +      DEFINE_RES_MEM(0x18000000, 0x04000000),
 +      DEFINE_RES_MEM(0x40000000, SZ_8K),
 +      DEFINE_RES_IRQ(IRQ_GPIO25),
 +};
 +#endif
 +
  static void __init assabet_init(void)
  {
        /*
index dbe5cf719f7e3bb8cdadea16d46078c3e263c271,70f6cdc9e63d974987074cdcf32e9ef32d760974..841041e118152d3dee9fe77f68fa43f8f28a7aa9
@@@ -291,9 -305,27 +293,23 @@@ static struct flash_platform_data colli
  };
  
  static struct resource collie_flash_resources[] = {
 -      {
 -              .start  = SA1100_CS0_PHYS,
 -              .end    = SA1100_CS0_PHYS + SZ_32M - 1,
 -              .flags  = IORESOURCE_MEM,
 -      }
 +      DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M),
  };
  
+ static struct sa1100fb_mach_info collie_lcd_info = {
+       .pixclock       = 171521,       .bpp            = 16,
+       .xres           = 320,          .yres           = 240,
+       .hsync_len      = 5,            .vsync_len      = 1,
+       .left_margin    = 11,           .upper_margin   = 2,
+       .right_margin   = 30,           .lower_margin   = 0,
+       .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       .lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+       .lccr3          = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+ };
  static void __init collie_init(void)
  {
        int ret = 0;
index 01a20ea35b53b303620594f5285b3482c0d1068b,9cb4062b1e9bdd8bdd68f5f6c081b3d0bd94a7b3..0296d69622ace09b6f1368221d0f31a0537926c7
@@@ -319,9 -363,7 +326,8 @@@ static struct platform_device *sa11x0_d
        &sa11x0uart3_device,
        &sa11x0ssp_device,
        &sa11x0pcmcia_device,
-       &sa11x0fb_device,
        &sa11x0rtc_device,
 +      &sa11x0dma_device,
  };
  
  static int __init sa1100_init(void)
Simple merge