]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: make Mistral support explicit
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 26 Jul 2005 12:36:18 +0000 (05:36 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 26 Jul 2005 12:36:18 +0000 (05:36 -0700)
This starts packaging support for the Mistral board and its devices
separately from OSK framebuffer support, and supports the "wakeup"
button (SW1) on that board.  This involved some mux fixes, both for
the MicroWire stuff (!) and for MPUIO2.

There's still a lot more to be done ... currently the board-specific
setup for the LCD, keypad, touchscreen, and so forth is scattered
throughout several drivers, rather than gathered in one place where
it's more naturally updated to match board revisions (or replaced
for folk using different UI boards).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/leds-osk.c
arch/arm/mach-omap1/leds.c
drivers/input/touchscreen/omap/ts_osk.c
drivers/ssi/omap-uwire.c
include/asm-arm/arch-omap/mux.h

index e09dba6cbd3c4438851c1d109631b71fe9a57ed1..76a10d36dc402adf5cb2558659ac5f4f526c2563 100644 (file)
@@ -47,6 +47,14 @@ config MACH_OMAP_OSK
          TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
           if you have such a board.
 
+config OMAP_OSK_MISTRAL
+       bool "Mistral QVGA board Support"
+       depends on MACH_OMAP_OSK
+       help
+         The OSK supports an optional add-on board with a Quarter-VGA
+         touchscreen, PDA-ish buttons, a resume button, bicolor LED,
+         and camera connector.  Say Y here if you have this board.
+
 config MACH_OMAP_PERSEUS2
        bool "TI Perseus2"
        depends on ARCH_OMAP1 && ARCH_OMAP730
index 722ff95c041f1f5e3703a71d7dd528b3d9037800..56634f1bdabce2753b325dad63824a3b5140cbd1 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/interrupt.h>
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 
@@ -189,6 +191,54 @@ static struct omap_board_config_kernel osk_config[] = {
        { OMAP_TAG_USB,           &osk_usb_config },
 };
 
+#ifdef CONFIG_OMAP_OSK_MISTRAL
+
+#ifdef CONFIG_PM
+static irqreturn_t
+osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
+{
+       return IRQ_HANDLED;
+}
+#endif
+
+static void __init osk_mistral_init(void)
+{
+       /* FIXME here's where to feed in framebuffer, touchpad, and
+        * keyboard setup ...  not in the drivers for those devices!
+        *
+        * NOTE:  we could actually tell if there's a Mistral board
+        * attached, e.g. by trying to read something from the ads7846.
+        * But this is too early for that...
+        */
+
+       /* the sideways button (SW1) is for use as a "wakeup" button */
+       omap_cfg_reg(N15_1610_MPUIO2);
+       if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
+               int ret = 0;
+               omap_set_gpio_direction(OMAP_MPUIO(2), 1);
+               set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);
+#ifdef CONFIG_PM
+               /* share the IRQ in case someone wants to use the
+                * button for more than wakeup from system sleep.
+                */
+               ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
+                               &osk_mistral_wake_interrupt,
+                               SA_SHIRQ, "mistral_wakeup",
+                               &osk_mistral_wake_interrupt);
+               if (ret != 0) {
+                       omap_free_gpio(OMAP_MPUIO(2));
+                       printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
+                               ret);
+               } else
+                       enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));
+#endif
+       } else
+               printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
+}
+#else
+static void __init osk_mistral_init(void) { }
+#endif
+
 static void __init osk_init(void)
 {
        osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
@@ -197,6 +247,8 @@ static void __init osk_init(void)
        omap_board_config = osk_config;
        omap_board_config_size = ARRAY_SIZE(osk_config);
        USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
+
+       osk_mistral_init();
 }
 
 static void __init osk_map_io(void)
index 4a0e8b9d4fc37d5748e067c01ff0b84a59d1e1d2..5be1a396d1720fb3375cf354e185f604544cef9c 100644 (file)
@@ -64,7 +64,7 @@ static void tps_work(void *unused)
 
 static DECLARE_WORK(work, tps_work, NULL);
 
-#ifdef CONFIG_FB_OMAP
+#ifdef CONFIG_OMAP_OSK_MISTRAL
 
 /* For now, all system indicators require the Mistral board, since that
  * LED can be manipulated without a task context.  This LED is either red,
@@ -127,7 +127,7 @@ void osk_leds_event(led_event_t evt)
                hw_led_state = 0;
                break;
 
-#ifdef CONFIG_FB_OMAP
+#ifdef CONFIG_OMAP_OSK_MISTRAL
 
        case led_timer:
                hw_led_state ^= TIMER_LED;
@@ -144,7 +144,7 @@ void osk_leds_event(led_event_t evt)
                mistral_setled();
                break;
 
-#endif /* CONFIG_FB_OMAP */
+#endif /* CONFIG_OMAP_OSK_MISTRAL */
 
        /* "green" == tps LED1 (leftmost, normally power-good)
         * works only with DC adapter, not on battery power!
index 967bf2df060f8e61dcadecfe734ebf6451209948..694d8d990c39457f1ba785e89656ddb14db9f4b1 100644 (file)
@@ -34,7 +34,10 @@ omap_leds_init(void)
        if (machine_is_omap_h2()
                        || machine_is_omap_h3()
                        || machine_is_omap_perseus2()
-                       || machine_is_omap_osk()) {
+#ifdef CONFIG_OMAP_OSK_MISTRAL
+                       || machine_is_omap_osk()
+#endif
+                       ) {
 
                /* LED1/LED2 pins can be used as GPIO (as done here), or by
                 * the LPG (works even in deep sleep!), to drive a bicolor
index ab4b1c713683b445fcd8e89db608e4d03b971924..45b4eb9a3786d39365595000df62fce99bab4510 100644 (file)
@@ -83,6 +83,7 @@ static int osk_ts_penup(void)
 
 static int  __init osk_ts_probe(struct omap_ts_t *ts)
 {
+#ifdef CONFIG_OMAP_OSK_MISTRAL
        if (!machine_is_omap_osk())
                return -ENODEV;
 
@@ -99,8 +100,16 @@ static int  __init osk_ts_probe(struct omap_ts_t *ts)
                                                    UWIRE_WRITE_RISING_EDGE |
                                                    UWIRE_CS_ACTIVE_LOW |
                                                    UWIRE_FREQ_DIV_2);
-       
+
+       /* FIXME verify there's really a Mistral board:
+        * see if the AD7846 chip responds.
+        */
+
+       /* NOTE:  no VREF; must ignore the temp, VBAT, and AUX sensors */
        return 0;
+#else
+       return -ENODEV;
+#endif
 }
 
 static void osk_ts_read(u16 *data)
index b9e182a2b5eb9a914241983862c61671df3e2f46..61b3ca16257e0fd2af63ce60851761ee6f91702d 100644 (file)
@@ -200,11 +200,18 @@ static int __init omap_uwire_init(void)
                uwire_idx_shift = 2;
 
        uwire_write_reg(UWIRE_SR3, 1);
-       if (machine_is_omap_h2() || machine_is_omap_osk()) {
+       if (machine_is_omap_h2()) {
                /* defaults: W21 SDO, U18 SDI, V19 SCL */
                omap_cfg_reg(N14_1610_UWIRE_CS0);
                omap_cfg_reg(N15_1610_UWIRE_CS1);
        }
+       if (machine_is_omap_osk()) {
+               /* this is the standard expansion connector usage, with
+                * the other chipselect pins for MPUIO2 and MPUIO4.
+                */
+               omap_cfg_reg(N14_1610_UWIRE_CS0);
+               omap_cfg_reg(P15_1610_UWIRE_CS3);
+       }
        if (machine_is_omap_perseus2()) {
                /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */
                int val = omap_readl(OMAP730_IO_CONF_9) & ~0x00EEE000;
index 10dea4df9012a2ecf0e4b4c76e9d0189b09ee00f..1b1ad410534908a013515b737a7065c66d51b3bc 100644 (file)
@@ -185,6 +185,7 @@ typedef enum {
 
        /* MPUIO */
        MPUIO2,
+       N15_1610_MPUIO2,
        MPUIO4,
        MPUIO5,
        T20_1610_MPUIO5,
@@ -252,7 +253,7 @@ typedef enum {
        U18_1610_UWIRE_SDI,
        W21_1610_UWIRE_SDO,
        N14_1610_UWIRE_CS0,
-       P15_1610_UWIRE_CS0,
+       P15_1610_UWIRE_CS3,
        N15_1610_UWIRE_CS1,
 
        /* OMAP-1610 Flash */
@@ -413,7 +414,8 @@ MUX_CFG("N21_1710_GPIO14",       6,    9,    0,   1,   1,   1,    1,     1,  1)
 MUX_CFG("W15_1710_GPIO40",       9,   27,    7,   2,   5,   1,    2,     1,  1)
 
 /* MPUIO */
-MUX_CFG("MPUIO2",               7,   18,    0,   1,   1,   1,   NA,     0,  1)
+MUX_CFG("MPUIO2",               7,   18,    0,   1,  14,   1,   NA,     0,  1)
+MUX_CFG("N15_1610_MPUIO2",      7,   18,    0,   1,  14,   1,    1,     0,  1)
 MUX_CFG("MPUIO4",               7,   15,    0,   1,  13,   1,   NA,     0,  1)
 MUX_CFG("MPUIO5",               7,   12,    0,   1,  12,   1,   NA,     0,  1)