n810: omapfb and keyboard fixes
[openwrt/svn-archive/archive.git] / target / linux / omap24xx / patches-2.6.37 / 300-nokia-board.patch
index e61212be489bea5b714c1cea978088b5ba16dc5e..f44716c1785625344e3c91d271793e6178f1daef 100644 (file)
@@ -12,7 +12,7 @@
 Index: linux-2.6.37-rc1/arch/arm/mach-omap1/board-nokia770.c
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap1/board-nokia770.c 2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap1/board-nokia770.c      2010-11-05 17:36:26.186000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap1/board-nokia770.c      2010-11-06 17:20:54.534000001 +0100
 @@ -36,6 +36,7 @@
  #include <plat/lcd_mipid.h>
  #include <plat/mmc.h>
@@ -48,7 +48,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap1/board-nokia770.c
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap2/board-n8x0.c     2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c  2010-11-05 17:37:40.169999973 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c  2010-11-06 17:26:56.824022830 +0100
 @@ -18,9 +18,13 @@
  #include <linux/io.h>
  #include <linux/stddef.h>
@@ -72,7 +72,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
  
  #include "mux.h"
  
-@@ -40,109 +46,156 @@
+@@ -40,109 +46,154 @@
  static int slot2_cover_open;
  static struct device *mmc_device;
  
@@ -92,11 +92,32 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 -static int tusb_set_power(int state)
 -{
 -      int i, retval = 0;
+-
+-      if (state) {
+-              gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
+-              msleep(1);
+-
+-              /* Wait until TUSB6010 pulls INT pin down */
+-              i = 100;
+-              while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
+-                      msleep(1);
+-                      i--;
+-              }
+-
+-              if (!i) {
+-                      printk(KERN_ERR "tusb: powerup failed\n");
+-                      retval = -ENODEV;
+-              }
+-      } else {
+-              gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
+-              msleep(10);
+-      }
+-
+-      return retval;
 +#define       RX51_TSC2005_RESET_GPIO 94
 +#define       RX51_TSC2005_IRQ_GPIO   106
 +#define OMAP_TAG_NOKIA_BT     0x4e01
 +
-+#if 0
 +static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
 +      [0x01] = KEY_Q,
 +      [0x02] = KEY_K,
@@ -170,11 +191,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 +      //.pwm1_name    = "n810::keyboard",
 +      //.pwm2_name    = "n810::cover",
 +};
-+#endif
--      if (state) {
--              gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
--              msleep(1);
++
 +struct omap_bluetooth_config {
 +      u8    chip_type;
 +      u8    bt_wakeup_gpio;
@@ -200,42 +217,16 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 +      n8x0_bt_device.dev.platform_data = (void *) bt_config;
 +      if (platform_device_register(&n8x0_bt_device) < 0)
 +              BUG();
-+}
--              /* Wait until TUSB6010 pulls INT pin down */
--              i = 100;
--              while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
--                      msleep(1);
--                      i--;
--              }
-+static struct omap2_mcspi_device_config mipid_mcspi_config = {
-+      .turbo_mode     = 0,
-+      .single_channel = 1,
-+};
--              if (!i) {
--                      printk(KERN_ERR "tusb: powerup failed\n");
--                      retval = -ENODEV;
--              }
--      } else {
--              gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
--              msleep(10);
--      }
-+static int slot1_cover_open;
-+static int slot2_cover_open;
-+static struct device *mmc_device;
--      return retval;
--}
+ }
  
 -static struct musb_hdrc_config musb_config = {
 -      .multipoint     = 1,
 -      .dyn_fifo       = 1,
 -      .num_eps        = 16,
 -      .ram_bits       = 12,
-+static struct omap2_mcspi_device_config p54spi_mcspi_config = {
++static struct omap2_mcspi_device_config mipid_mcspi_config = {
 +      .turbo_mode     = 0,
-+      .single_channel = 1,
++      .single_channel = 1,
  };
  
 -static struct musb_hdrc_platform_data tusb_data = {
@@ -245,20 +236,15 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 -      .mode           = MUSB_PERIPHERAL,
 -#else /* defined(CONFIG_USB_MUSB_HOST) */
 -      .mode           = MUSB_HOST,
-+#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
-+extern struct mipid_platform_data n8x0_mipid_platform_data;
- #endif
+-#endif
 -      .set_power      = tusb_set_power,
 -      .min_power      = 25,   /* x2 = 50 mA drawn from VBUS as peripheral */
 -      .power          = 100,  /* Max 100 mA VBUS for host mode */
 -      .config         = &musb_config,
 -};
+-
 -static void __init n8x0_usb_init(void)
-+#ifdef CONFIG_TOUCHSCREEN_TSC2005
-+static struct tsc2005_platform_data tsc2005_config;
-+static void rx51_tsc2005_set_reset(bool enable)
- {
+-{
 -      int ret = 0;
 -      static char     announce[] __initdata = KERN_INFO "TUSB 6010\n";
 -
@@ -272,25 +258,39 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 -      gpio_direction_output(TUSB6010_GPIO_ENABLE, 0);
 -
 -      tusb_set_power(0);
--
++static int slot1_cover_open;
++static int slot2_cover_open;
++static struct device *mmc_device;
 -      ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
 -                                      TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
 -                                      TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
 -      if (ret != 0)
 -              goto err;
--
 -      printk(announce);
--
++static struct omap2_mcspi_device_config p54spi_mcspi_config = {
++      .turbo_mode     = 0,
++      .single_channel = 1,
++};
 -      return;
--
++#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
++extern struct mipid_platform_data n8x0_mipid_platform_data;
++#endif
 -err:
 -      gpio_free(TUSB6010_GPIO_ENABLE);
++#ifdef CONFIG_TOUCHSCREEN_TSC2005
++static struct tsc2005_platform_data tsc2005_config;
++static void rx51_tsc2005_set_reset(bool enable)
++{
 +      gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
  }
 -#else
--static void __init n8x0_usb_init(void) {}
 -
+-static void __init n8x0_usb_init(void) {}
 -#endif /*CONFIG_USB_TUSB6010 */
 -
 -
@@ -315,7 +315,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
        {
                .modalias       = "p54spi",
                .bus_num        = 2,
-@@ -150,7 +203,71 @@
+@@ -150,8 +201,60 @@
                .max_speed_hz   = 48000000,
                .controller_data = &p54spi_mcspi_config,
        },
@@ -328,8 +328,8 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 +              .controller_data = &tsc2005_mcspi_config,
 +              .platform_data   = &tsc2005_config,
 +      },
-+};
-+
+ };
 +static void __init tsc2005_set_config(void)
 +{
 +      const struct omap_lcd_config *conf;
@@ -373,21 +373,10 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
 +      }
 +}
 +
-+#if 0
-+static struct i2c_board_info __initdata_or_module n8x0_i2c_board_info_2[] = {};
-+
-+static struct i2c_board_info __initdata_or_module n810_i2c_board_info_2[] = {
-+      {
-+              I2C_BOARD_INFO("lm8323", 0x45),
-+              .irq            = OMAP_GPIO_IRQ(109),
-+              .platform_data  = &lm8323_pdata,
-+      },
- };
-+#endif
  #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
        defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
-@@ -184,6 +301,20 @@
+@@ -184,6 +287,20 @@
        },
  };
  
@@ -408,7 +397,19 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
  static struct omap_onenand_platform_data board_onenand_data = {
        .cs             = 0,
        .gpio_irq       = 26,
-@@ -657,10 +788,62 @@
+@@ -626,6 +743,11 @@
+ static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
+       {
++              I2C_BOARD_INFO("lm8323", 0x45),
++              .irq            = OMAP_GPIO_IRQ(109),
++              .platform_data  = &lm8323_pdata,
++      },
++      {
+               I2C_BOARD_INFO("tlv320aic3x", 0x18),
+               .platform_data = &n810_aic33_data,
+       },
+@@ -657,10 +779,62 @@
  #define board_mux     NULL
  #endif
  
@@ -471,10 +472,21 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0.c
        spi_register_board_info(n800_spi_board_info,
                                ARRAY_SIZE(n800_spi_board_info));
        omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
+@@ -671,6 +845,10 @@
+                                       ARRAY_SIZE(n810_i2c_board_info_2));
+       omap_serial_init();
++
++      n8x0_mipid_init();
++      n8x0_blizzard_init();
++
+       n8x0_onenand_init();
+       n8x0_mmc_init();
+       n8x0_usb_init();
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-lcd.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-lcd.c      2010-11-05 17:36:45.209000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-lcd.c      2010-11-06 17:26:25.503999974 +0100
 @@ -0,0 +1,127 @@
 +/*
 + * linux/arch/arm/mach-omap2/board-n8x0.c
@@ -606,7 +618,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-lcd.c
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-usb.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-usb.c      2010-11-05 17:36:26.187000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-usb.c      2010-11-06 17:20:54.534000001 +0100
 @@ -0,0 +1,175 @@
 +/*
 + * linux/arch/arm/mach-omap2/board-n8x0-usb.c
@@ -786,7 +798,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/board-n8x0-usb.c
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/control.c
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap2/control.c        2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/control.c     2010-11-05 17:36:26.187000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/control.c     2010-11-06 17:20:54.534000001 +0100
 @@ -172,6 +172,7 @@
        return __raw_readw(OMAP_CTRL_REGADDR(offset));
  }
@@ -806,7 +818,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/control.c
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/Kconfig
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap2/Kconfig  2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/Kconfig       2010-11-05 17:36:26.187000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/Kconfig       2010-11-06 17:20:54.534000001 +0100
 @@ -210,6 +210,16 @@
        select MACH_NOKIA_N810
        select MACH_NOKIA_N810_WIMAX
@@ -827,7 +839,7 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/Kconfig
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/Makefile
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap2/Makefile 2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/Makefile      2010-11-05 17:36:26.187000001 +0100
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/Makefile      2010-11-06 17:20:54.534000001 +0100
 @@ -139,6 +139,8 @@
                                           hsmmc.o \
                                           board-flash.o
@@ -840,35 +852,30 @@ Index: linux-2.6.37-rc1/arch/arm/mach-omap2/Makefile
 Index: linux-2.6.37-rc1/arch/arm/mach-omap2/serial.c
 ===================================================================
 --- linux-2.6.37-rc1.orig/arch/arm/mach-omap2/serial.c 2010-11-01 12:54:12.000000000 +0100
-+++ linux-2.6.37-rc1/arch/arm/mach-omap2/serial.c      2010-11-05 17:36:26.187000001 +0100
-@@ -545,10 +545,10 @@
++++ linux-2.6.37-rc1/arch/arm/mach-omap2/serial.c      2010-11-06 17:20:54.535000001 +0100
+@@ -545,14 +545,17 @@
                uart->padconf = 0;
        }
  
--      uart->irqflags |= IRQF_SHARED;
-+/*    uart->irqflags |= IRQF_SHARED;
++#if 1
+       uart->irqflags |= IRQF_SHARED;
        ret = request_threaded_irq(uart->irq, NULL, omap_uart_interrupt,
                                   IRQF_SHARED, "serial idle", (void *)uart);
--      WARN_ON(ret);
-+      WARN_ON(ret); */
+       WARN_ON(ret);
++#endif
  }
  
  void omap_uart_enable_irqs(int enable)
-@@ -556,7 +556,7 @@
+ {
++#if 1
        int ret;
        struct omap_uart_state *uart;
  
--      list_for_each_entry(uart, &uart_list, node) {
-+/*    list_for_each_entry(uart, &uart_list, node) {
-               if (enable) {
-                       pm_runtime_put_sync(&uart->pdev->dev);
-                       ret = request_threaded_irq(uart->irq, NULL,
-@@ -568,7 +568,7 @@
-                       pm_runtime_get_noresume(&uart->pdev->dev);
+@@ -569,6 +572,7 @@
                        free_irq(uart->irq, (void *)uart);
                }
--      }
-+      } */
+       }
++#endif
  }
  
  static ssize_t sleep_timeout_show(struct device *dev,