linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / arm / mach-realview / core.c
index da02869..4303d98 100644 (file)
@@ -18,6 +18,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
@@ -201,6 +202,11 @@ struct clk realview_clcd_clk = {
 /*
  * CLCD support.
  */
+#define SYS_CLCD_MODE_MASK     (3 << 0)
+#define SYS_CLCD_MODE_888      (0 << 0)
+#define SYS_CLCD_MODE_5551     (1 << 0)
+#define SYS_CLCD_MODE_565_RLSB (2 << 0)
+#define SYS_CLCD_MODE_565_BLSB (3 << 0)
 #define SYS_CLCD_NLCDIOON      (1 << 2)
 #define SYS_CLCD_VDDPOSSWITCH  (1 << 3)
 #define SYS_CLCD_PWR3V5SWITCH  (1 << 4)
@@ -354,10 +360,29 @@ static void realview_clcd_enable(struct clcd_fb *fb)
        void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
        u32 val;
 
+       val = readl(sys_clcd);
+       val &= ~SYS_CLCD_MODE_MASK;
+
+       switch (fb->fb.var.green.length) {
+       case 5:
+               val |= SYS_CLCD_MODE_5551;
+               break;
+       case 6:
+               val |= SYS_CLCD_MODE_565_RLSB;
+               break;
+       case 8:
+               val |= SYS_CLCD_MODE_888;
+               break;
+       }
+
        /*
-        * Enable the PSUs
+        * Set the MUX
+        */
+       writel(val, sys_clcd);
+
+       /*
+        * And now enable the PSUs
         */
-       val = readl(sys_clcd);
        val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
        writel(val, sys_clcd);
 }
@@ -536,7 +561,7 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_reg
 
 static struct irqaction realview_timer_irq = {
        .name           = "RealView Timer Tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .flags          = SA_INTERRUPT | SA_TIMER,
        .handler        = realview_timer_interrupt,
 };