Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[pandora-kernel.git] / arch / arm / mach-omap2 / board-h4.c
index 16703fd..e09bd68 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <plat/control.h>
 #include <mach/gpio.h>
-#include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/board.h>
 #include <plat/common.h>
@@ -42,6 +41,8 @@
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 
+#include "mux.h"
+
 #define H4_FLASH_CS    0
 #define H4_SMC91X_CS   1
 
@@ -246,7 +247,7 @@ static inline void __init h4_init_debug(void)
 
        udelay(100);
 
-       omap_cfg_reg(M15_24XX_GPIO92);
+       omap_mux_init_gpio(92, 0);
        if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0)
                gpmc_cs_free(eth_cs);
 
@@ -272,27 +273,6 @@ static struct omap_lcd_config h4_lcd_config __initdata = {
 };
 
 static struct omap_usb_config h4_usb_config __initdata = {
-#ifdef CONFIG_MACH_OMAP2_H4_USB1
-       /* NOTE:  usb1 could also be used with 3 wire signaling */
-       .pins[1]        = 4,
-#endif
-
-#ifdef CONFIG_MACH_OMAP_H4_OTG
-       /* S1.10 ON -- USB OTG port
-        * usb0 switched to Mini-AB port and isp1301 transceiver;
-        * S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging
-        */
-       .otg            = 1,
-       .pins[0]        = 4,
-#ifdef CONFIG_USB_GADGET_OMAP
-       /* use OTG cable, or standard A-to-MiniB */
-       .hmc_mode       = 0x14, /* 0:dev/otg 1:host 2:disable */
-#elif  defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-       /* use OTG cable, or NONSTANDARD (B-to-MiniB) */
-       .hmc_mode       = 0x11, /* 0:host 1:host 2:disable */
-#endif /* XX */
-
-#else
        /* S1.10 OFF -- usb "download port"
         * usb0 switched to Mini-B port and isp1105 transceiver;
         * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
@@ -301,7 +281,6 @@ static struct omap_usb_config h4_usb_config __initdata = {
        .pins[0]        = 3,
 /*     .hmc_mode       = 0x14,*/       /* 0:dev 1:host 2:disable */
        .hmc_mode       = 0x00,         /* 0:dev|otg 1:disable 2:disable */
-#endif
 };
 
 static struct omap_board_config_kernel h4_config[] = {
@@ -338,31 +317,54 @@ static struct i2c_board_info __initdata h4_i2c_board_info[] = {
        },
 };
 
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+       { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#else
+#define board_mux      NULL
+#endif
+
 static void __init omap_h4_init(void)
 {
+       omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
+
        /*
         * Make sure the serial ports are muxed on at this point.
         * You have to mux them off in device drivers later on
         * if not needed.
         */
-#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
-       omap_cfg_reg(K15_24XX_UART3_TX);
-       omap_cfg_reg(K14_24XX_UART3_RX);
-#endif
 
 #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
+       omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP);
+       omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP);
+       omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP);
+       omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
        if (omap_has_menelaus()) {
+               omap_mux_init_signal("sdrc_a14.gpio0",
+                       OMAP_PULL_ENA | OMAP_PULL_UP);
+               omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
+               omap_mux_init_signal("gpio_98", 0);
                row_gpios[5] = 0;
                col_gpios[2] = 15;
                col_gpios[6] = 18;
+       } else {
+               omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP);
+               omap_mux_init_signal("gpio_100", 0);
+               omap_mux_init_signal("gpio_98", 0);
        }
+       omap_mux_init_signal("gpio_90", 0);
+       omap_mux_init_signal("gpio_91", 0);
+       omap_mux_init_signal("gpio_36", 0);
+       omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
+       omap_mux_init_signal("gpio_97", 0);
 #endif
 
        i2c_register_board_info(1, h4_i2c_board_info,
                        ARRAY_SIZE(h4_i2c_board_info));
 
        platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
-       omap_usb_init(&h4_usb_config);
+       omap2_usbfs_init(&h4_usb_config);
        omap_serial_init();
 }