]> err.no Git - linux-2.6/blobdiff - arch/arm/mach-omap1/board-osk.c
Merge branches 'omap1-upstream' and 'omap2-upstream' into devel
[linux-2.6] / arch / arm / mach-omap1 / board-osk.c
index 91933301bb73268325f46152cefc358a279b732a..1825781f4354468b3ef6893943fd39f36e1accfc 100644 (file)
@@ -29,7 +29,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -266,9 +268,11 @@ static const int osk_keymap[] = {
 };
 
 static struct omap_kp_platform_data osk_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = (int *) osk_keymap,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = (int *) osk_keymap,
+       .keymapsize     = ARRAY_SIZE(osk_keymap),
+       .delay          = 9,
 };
 
 static struct resource osk5912_kp_resources[] = {
@@ -289,6 +293,18 @@ static struct platform_device osk5912_kp_device = {
        .resource       = osk5912_kp_resources,
 };
 
+static struct omap_backlight_config mistral_bl_data = {
+       .default_intensity      = 0xa0,
+};
+
+static struct platform_device mistral_bl_device = {
+       .name           = "omap-bl",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &mistral_bl_data,
+       },
+};
+
 static struct platform_device osk5912_lcd_device = {
        .name           = "lcd_osk",
        .id             = -1,
@@ -296,6 +312,7 @@ static struct platform_device osk5912_lcd_device = {
 
 static struct platform_device *mistral_devices[] __initdata = {
        &osk5912_kp_device,
+       &mistral_bl_device,
        &osk5912_lcd_device,
 };
 
@@ -325,7 +342,7 @@ static struct spi_board_info __initdata mistral_boardinfo[] = { {
 
 #ifdef CONFIG_PM
 static irqreturn_t
-osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
+osk_mistral_wake_interrupt(int irq, void *ignored)
 {
        return IRQ_HANDLED;
 }
@@ -339,6 +356,38 @@ static void __init osk_mistral_init(void)
         * can't talk to the ads or even the i2c eeprom.
         */
 
+       /* parallel camera interface */
+       omap_cfg_reg(J15_1610_CAM_LCLK);
+       omap_cfg_reg(J18_1610_CAM_D7);
+       omap_cfg_reg(J19_1610_CAM_D6);
+       omap_cfg_reg(J14_1610_CAM_D5);
+       omap_cfg_reg(K18_1610_CAM_D4);
+       omap_cfg_reg(K19_1610_CAM_D3);
+       omap_cfg_reg(K15_1610_CAM_D2);
+       omap_cfg_reg(K14_1610_CAM_D1);
+       omap_cfg_reg(L19_1610_CAM_D0);
+       omap_cfg_reg(L18_1610_CAM_VS);
+       omap_cfg_reg(L15_1610_CAM_HS);
+       omap_cfg_reg(M19_1610_CAM_RSTZ);
+       omap_cfg_reg(Y15_1610_CAM_OUTCLK);
+
+       /* serial camera interface */
+       omap_cfg_reg(H19_1610_CAM_EXCLK);
+       omap_cfg_reg(W13_1610_CCP_CLKM);
+       omap_cfg_reg(Y12_1610_CCP_CLKP);
+       /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
+       // omap_cfg_reg(Y14_1610_CCP_DATAM);
+       omap_cfg_reg(W14_1610_CCP_DATAP);
+
+       /* CAM_PWDN */
+       if (omap_request_gpio(11) == 0) {
+               omap_cfg_reg(N20_1610_GPIO11);
+               omap_set_gpio_direction(11, 0 /* out */);
+               omap_set_gpio_dataout(11, 0 /* off */);
+       } else
+               pr_debug("OSK+Mistral: CAM_PWDN is awol\n");
+
+
        // omap_cfg_reg(P19_1610_GPIO6);        // BUSY
        omap_cfg_reg(P20_1610_GPIO4);   // PENIRQ
        set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
@@ -357,7 +406,7 @@ static void __init osk_mistral_init(void)
                 */
                ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
                                &osk_mistral_wake_interrupt,
-                               SA_SHIRQ, "mistral_wakeup",
+                               IRQF_SHARED, "mistral_wakeup",
                                &osk_mistral_wake_interrupt);
                if (ret != 0) {
                        omap_free_gpio(OMAP_MPUIO(2));
@@ -369,6 +418,15 @@ static void __init osk_mistral_init(void)
        } else
                printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
 
+       /* LCD:  backlight, and power; power controls other devices on the
+        * board, like the touchscreen, EEPROM, and wakeup (!) switch.
+        */
+       omap_cfg_reg(PWL);
+       if (omap_request_gpio(2) == 0) {
+               omap_set_gpio_direction(2, 0 /* out */);
+               omap_set_gpio_dataout(2, 1 /* on */);
+       }
+
        platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
 }
 #else
@@ -382,7 +440,7 @@ static void __init osk_init(void)
        /* Workaround for wrong CS3 (NOR flash) timing
         * There are some U-Boot versions out there which configure
         * wrong CS3 memory timings. This mainly leads to CRC
-        * or similiar errors if you use NOR flash (e.g. with JFFS2)
+        * or similar errors if you use NOR flash (e.g. with JFFS2)
         */
        if (EMIFS_CCS(3) != EMIFS_CS3_VAL)
                EMIFS_CCS(3) = EMIFS_CS3_VAL;