omap24xx: Add n8x0 specific GPIO switch code
authorMichael Büsch <mb@bu3sch.de>
Sat, 18 Sep 2010 17:58:30 +0000 (17:58 +0000)
committerMichael Büsch <mb@bu3sch.de>
Sat, 18 Sep 2010 17:58:30 +0000 (17:58 +0000)
SVN-Revision: 23082

target/linux/omap24xx/patches-2.6.36/300-nokia-board.patch
target/linux/omap24xx/patches-2.6.36/900-n810-battery-management.patch

index 4bec75ec8b0ada026be907b6b5d40afb4911071a..825d8be0663a300a8d9e9a236d7798200896221d 100644 (file)
@@ -1,13 +1,13 @@
 ---
  arch/arm/mach-omap1/board-nokia770.c |   16 +
- arch/arm/mach-omap2/Kconfig          |   10 +
+ arch/arm/mach-omap2/Kconfig          |   10 
  arch/arm/mach-omap2/Makefile         |    2 
- arch/arm/mach-omap2/board-n8x0-lcd.c |  127 +++++++++++++
- arch/arm/mach-omap2/board-n8x0-usb.c |  175 +++++++++++++++++++
- arch/arm/mach-omap2/board-n8x0.c     |  318 +++++++++++++++++++++++++----------
+ arch/arm/mach-omap2/board-n8x0-lcd.c |  127 ++++++++++++
+ arch/arm/mach-omap2/board-n8x0-usb.c |  175 +++++++++++++++++
+ arch/arm/mach-omap2/board-n8x0.c     |  355 ++++++++++++++++++++++++++---------
  arch/arm/mach-omap2/control.c        |    2 
  arch/arm/mach-omap2/serial.c         |    8 
- 8 files changed, 571 insertions(+), 87 deletions(-)
+ 8 files changed, 608 insertions(+), 87 deletions(-)
 
 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap1/board-nokia770.c
 +++ linux-2.6.36-rc4/arch/arm/mach-omap1/board-nokia770.c
  
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
-@@ -32,6 +36,7 @@
+@@ -32,6 +36,8 @@
  #include <plat/onenand.h>
  #include <plat/mmc.h>
  #include <plat/serial.h>
 +#include <plat/cbus.h>
++#include <plat/gpio-switch.h>
  
  #include "mux.h"
  
-@@ -39,109 +44,154 @@ static int slot1_cover_open;
+@@ -39,109 +45,154 @@ static int slot1_cover_open;
  static int slot2_cover_open;
  static struct device *mmc_device;
  
        {
                .modalias       = "p54spi",
                .bus_num        = 2,
-@@ -149,6 +199,68 @@ static struct spi_board_info n800_spi_bo
+@@ -149,6 +200,68 @@ static struct spi_board_info n800_spi_bo
                .max_speed_hz   = 48000000,
                .controller_data = &p54spi_mcspi_config,
        },
  };
  
  #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
-@@ -183,6 +295,20 @@ static struct mtd_partition onenand_part
+@@ -183,6 +296,20 @@ static struct mtd_partition onenand_part
        },
  };
  
  static struct omap_onenand_platform_data board_onenand_data = {
        .cs             = 0,
        .gpio_irq       = 26,
-@@ -659,15 +785,41 @@ static struct omap_board_mux board_mux[]
+@@ -659,15 +786,77 @@ static struct omap_board_mux board_mux[]
  #define board_mux     NULL
  #endif
  
 +#endif
 +
 +extern void n8x0_usb_init(void);
++
++static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
++      {
++              .name                   = "headphone",
++              .gpio                   = -1,
++              .debounce_rising        = 200,
++              .debounce_falling       = 200,
++      }, {
++              .name                   = "cam_act",
++              .gpio                   = -1,
++              .debounce_rising        = 200,
++              .debounce_falling       = 200,
++      }, {
++              .name                   = "cam_turn",
++              .gpio                   = -1,
++              .debounce_rising        = 100,
++              .debounce_falling       = 100,
++      }, {
++              .name                   = "slide",
++              .gpio                   = -1,
++              .debounce_rising        = 200,
++              .debounce_falling       = 200,
++      }, {
++              .name                   = "kb_lock",
++              .gpio                   = -1,
++              .debounce_rising        = 200,
++              .debounce_falling       = 200,
++      },
++};
++
++static void __init n8x0_gpio_switches_init(void)
++{
++      /* The switches are actually registered through ATAG mechanism.
++       * This just updates the parameters (thus .gpio is -1) */
++      omap_register_gpio_switches(n8x0_gpio_switches,
++                                  ARRAY_SIZE(n8x0_gpio_switches));
++}
 +
  static void __init n8x0_init_machine(void)
  {
        omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
-+
++      n8x0_gpio_switches_init();
 +      platform_device_register(&n8x0_cbus_device);
-+
 +      n8x0_bt_init();
 +
        /* FIXME: add n810 spi devices */
index ea8f896c11552d2f0c321f78cd1ecd28551750d3..c3507fba992cd3ffbe6c1a16370a5a5afb66f087 100644 (file)
  int retu_request_irq(int id, void *irq_handler, unsigned long arg, char *name);
 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/board-n8x0.c
 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/board-n8x0.c
-@@ -795,6 +795,17 @@ extern void n8x0_blizzard_init(void);
- extern void n8x0_usb_init(void);
+@@ -833,6 +833,17 @@ static void __init n8x0_gpio_switches_in
+                                   ARRAY_SIZE(n8x0_gpio_switches));
+ }
  
 +static struct platform_device n810_bm_device = {
 +      .name           = "n810bm",
  static void __init n8x0_init_machine(void)
  {
        omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
-@@ -823,6 +834,8 @@ static void __init n8x0_init_machine(voi
+@@ -860,6 +871,8 @@ static void __init n8x0_init_machine(voi
        n8x0_onenand_init();
        n8x0_mmc_init();
        n8x0_usb_init();