linux-ti33x-psp 3.2: fix buttons on LCD capes
authorKoen Kooi <koen@dominion.thruhere.net>
Thu, 7 Jun 2012 15:40:41 +0000 (17:40 +0200)
committerDenys Dmytriyenko <denys@ti.com>
Mon, 11 Jun 2012 20:59:07 +0000 (16:59 -0400)
One patch to add button layout for the a1 revision of the 3.5" LCD cape and
another patch to stop spidev from loading when SPI1_D1 is used as gpio

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0069-beaglebone-add-support-for-LCD3-rev-A1.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0070-beaglebone-fix-buttons-spidev-clash-when-using-mcasp.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp_3.2.bb

diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0069-beaglebone-add-support-for-LCD3-rev-A1.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0069-beaglebone-add-support-for-LCD3-rev-A1.patch
new file mode 100644 (file)
index 0000000..d9bc2b5
--- /dev/null
@@ -0,0 +1,132 @@
+From b61b89f98ac85ccd8d503a902bad208343ed0aba Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Mon, 4 Jun 2012 14:38:02 +0200
+Subject: [PATCH] beaglebone: add support for LCD3 rev A1
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |   94 +++++++++++++++++++++++++++++----
+ 1 files changed, 83 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index bb6049a..51bfa8b 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -1136,7 +1136,7 @@ static struct pinmux_config lcd3_keys_pin_mux[] = {
+       {NULL, 0},
+ };
+-/* Configure GPIOs for lcd3 keys */
++/* Configure GPIOs for lcd3 rev A or earlier keys */
+ static struct gpio_keys_button beaglebone_lcd3_gpio_keys[] = {
+       {
+               .code                   = KEY_LEFT,
+@@ -1193,14 +1193,72 @@ static struct platform_device beaglebone_lcd3_keys = {
+       },
+ };
+-static void beaglebone_lcd3_keys_init(int evm_id, int profile)
+-{
+-      int err;
+-      setup_pin_mux(lcd3_keys_pin_mux);
+-      err = platform_device_register(&beaglebone_lcd3_keys);
+-      if (err)
+-              pr_err("failed to register gpio keys for LCD3 cape\n");
+-}
++/* pinmux for lcd3 A1 or newer keys */
++static struct pinmux_config lcd3a1_keys_pin_mux[] = {
++      {"gpmc_a0.gpio1_16",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, // Left
++      {"gpmc_a1.gpio1_17",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //Right
++      {"gpmc_a3.gpio1_19", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // Up
++      {"mcasp0_axr0.gpio3_16",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //Down
++      {"mcasp0_fsr.gpio3_19",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, // Enter
++      {NULL, 0},
++};
++
++/* Configure GPIOs for lcd3 rev A1 or newer keys */
++static struct gpio_keys_button lcd3a1_gpio_keys[] = {
++      {
++              .code                   = KEY_LEFT,
++              .gpio                   = GPIO_TO_PIN(1, 16),
++              .active_low             = true,
++              .desc                   = "left",
++              .type                   = EV_KEY,
++              .wakeup                 = 1,
++      },
++      {
++              .code                   = KEY_RIGHT,
++              .gpio                   = GPIO_TO_PIN(1, 17),
++              .active_low             = true,
++              .desc                   = "right",
++              .type                   = EV_KEY,
++              .wakeup                 = 1,
++      },
++      {
++              .code                   = KEY_UP,
++              .gpio                   = GPIO_TO_PIN(1, 19),
++              .active_low             = true,
++              .desc                   = "up",
++              .type                   = EV_KEY,
++              .wakeup                 = 1,
++      },
++      {
++              .code                   = KEY_DOWN,
++              .gpio                   = GPIO_TO_PIN(3, 16),
++              .active_low             = true,
++              .desc                   = "down",
++              .type                   = EV_KEY,
++              .wakeup                 = 1,
++      },
++      {
++              .code                   = KEY_ENTER,
++              .gpio                   = GPIO_TO_PIN(3, 19),
++              .active_low             = true,
++              .desc                   = "enter",
++              .type                   = EV_KEY,
++              .wakeup                 = 1,
++      },
++};
++
++static struct gpio_keys_platform_data lcd3a1_gpio_key_info = {
++      .buttons        = lcd3a1_gpio_keys,
++      .nbuttons       = ARRAY_SIZE(lcd3a1_gpio_keys),
++};
++
++static struct platform_device lcd3a1_keys = {
++      .name   = "gpio-keys",
++      .id     = -1,
++      .dev    = {
++              .platform_data  = &lcd3a1_gpio_key_info,
++      },
++};
+ /*
+ * @evm_id - evm id which needs to be configured
+@@ -2691,8 +2749,22 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+               pr_info("BeagleBone cape: initializing LCD cape touchscreen\n");
+               tsc_init(0,0);
+               beaglebone_tsadcpins_free = 0;
+-              pr_info("BeagleBone cape: Registering gpio-keys for LCD cape\n");
+-              beaglebone_lcd3_keys_init(0,0);
++              
++              if (!strncmp("00A0", cape_config.version, 4)) {
++                      pr_info("BeagleBone cape: Registering gpio-keys for LCD3 rev A or earlier cape\n");
++                      int err;
++                      setup_pin_mux(lcd3_keys_pin_mux);
++                      err = platform_device_register(&beaglebone_lcd3_keys);
++                      if (err)
++                              pr_err("failed to register gpio keys for LCD3 rev A or earlier cape\n");
++              } else {
++                      pr_info("BeagleBone cape: Registering gpio-keys for LCD rev A1 or later cape\n");
++                      int err;
++                      setup_pin_mux(lcd3a1_keys_pin_mux);
++                      err = platform_device_register(&lcd3a1_keys);
++                      if (err)
++                              pr_err("failed to register gpio keys for LCD3 rev A1 or later cape\n");
++              }
+               beaglebone_leds_free = 0;
+               lcd3leds_init(0,0);
+       }
+-- 
+1.7.7.6
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0070-beaglebone-fix-buttons-spidev-clash-when-using-mcasp.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0070-beaglebone-fix-buttons-spidev-clash-when-using-mcasp.patch
new file mode 100644 (file)
index 0000000..ae277fa
--- /dev/null
@@ -0,0 +1,52 @@
+From d99bad03ee2f3cc3d9a61879e53e4795a05eaed3 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 6 Jun 2012 11:20:21 +0200
+Subject: [PATCH 70/70] beaglebone: fix buttons/spidev clash when using
+ mcasp0_axr0.gpio3_16
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |   13 +++++++------
+ 1 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index 51bfa8b..7fd611f 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -1051,12 +1051,11 @@ static void volume_keys_init(int evm_id, int profile)
+ /* pinmux for lcd7 keys */
+ static struct pinmux_config lcd7_keys_pin_mux[] = {
+-      {"gpmc_a0.gpio1_16",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+-      {"gpmc_a1.gpio1_17",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+-      {"gpmc_a3.gpio1_19",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+-      {"mcasp0_axr0.gpio3_16",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+-      {"mcasp0_fsr.gpio3_19",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+-      {"gpmc_ben1.gpio1_28",    OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
++      {"gpmc_a0.gpio1_16",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //left
++      {"gpmc_a1.gpio1_17",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //right
++      {"gpmc_a3.gpio1_19",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //up
++      {"mcasp0_axr0.gpio3_16",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //down
++      {"mcasp0_fsr.gpio3_19",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, //enter
+       {NULL, 0},
+ };
+@@ -2738,6 +2737,7 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+               pr_info("BeagleBone cape: Registering gpio-keys for LCD cape\n");
+               beaglebone_lcd7_keys_init(0,0);
+               
++              beaglebone_spi1_free = 0;
+               // A1 or newer
+               beaglebone_leds_free = 0;
+               lcd7leds_init(0,0);
+@@ -2765,6 +2765,7 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+                       if (err)
+                               pr_err("failed to register gpio keys for LCD3 rev A1 or later cape\n");
+               }
++              beaglebone_spi1_free = 0;
+               beaglebone_leds_free = 0;
+               lcd3leds_init(0,0);
+       }
+-- 
+1.7.7.6
+
index e3a427bcdf30a01e1f5d17689259fae47f28bd76..f279b24a4a25db04ebd7983c00cc104de971addc 100644 (file)
@@ -15,7 +15,7 @@ PV = "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "3.2", "3.2.18", d)}"
 
 BRANCH = "v3.2-staging"
 SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01"
-MACHINE_KERNEL_PR_append = "e+gitr${SRCREV}"
+MACHINE_KERNEL_PR_append = "g+gitr${SRCREV}"
 
 COMPATIBLE_MACHINE = "(ti33x)"
 
@@ -1228,4 +1228,6 @@ PATCHES_OVER_PSP = " \
        file://beaglebone/0066-beaglebone-disable-OPP-for-275MHz-due-to-silicon-err.patch \
        file://beaglebone/0067-video-da8xx-fb-Add-Newhaven-LCD-Panel-details.patch \
        file://beaglebone/0068-beaglebone-add-support-for-the-4.3-lcd-cape-with-res.patch \
+       file://beaglebone/0069-beaglebone-add-support-for-LCD3-rev-A1.patch \
+       file://beaglebone/0070-beaglebone-fix-buttons-spidev-clash-when-using-mcasp.patch \
 "