omap: mux: Replace omap_cfg_reg() with new style signal or gpio functions
[linux-2.6-block.git] / arch / arm / mach-omap2 / board-omap3beagle.c
index 08b0816afa61ef4f9373ccffa518b9f0214cc06d..9e606b107ee68d6d362c4986e98081909ccc1326 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 
-#include <mach/board.h>
-#include <mach/common.h>
-#include <mach/gpmc.h>
-#include <mach/nand.h>
-#include <mach/mux.h>
-#include <mach/usb.h>
-#include <mach/timer-gp.h>
-
+#include <plat/board.h>
+#include <plat/common.h>
+#include <plat/gpmc.h>
+#include <plat/nand.h>
+#include <plat/mux.h>
+#include <plat/usb.h>
+#include <plat/timer-gp.h>
+
+#include "mux.h"
 #include "mmc-twl4030.h"
 
 #define GPMC_CS0_BASE  0x60
@@ -140,10 +141,10 @@ static int beagle_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
 {
        if (system_rev >= 0x20 && system_rev <= 0x34301000) {
-               omap_cfg_reg(AG9_34XX_GPIO23);
+               omap_mux_init_gpio(23, OMAP_PIN_INPUT);
                mmc[0].gpio_wp = 23;
        } else {
-               omap_cfg_reg(AH8_34XX_GPIO29);
+               omap_mux_init_gpio(29, OMAP_PIN_INPUT);
        }
        /* gpio + 0 is "mmc0_cd" (input/IRQ) */
        mmc[0].gpio_cd = gpio + 0;
@@ -254,6 +255,15 @@ static struct twl4030_usb_data beagle_usb_data = {
        .usb_mode       = T2_USB_MODE_ULPI,
 };
 
+static struct twl4030_codec_audio_data beagle_audio_data = {
+       .audio_mclk = 26000000,
+};
+
+static struct twl4030_codec_data beagle_codec_data = {
+       .audio_mclk = 26000000,
+       .audio = &beagle_audio_data,
+};
+
 static struct twl4030_platform_data beagle_twldata = {
        .irq_base       = TWL4030_IRQ_BASE,
        .irq_end        = TWL4030_IRQ_END,
@@ -261,6 +271,7 @@ static struct twl4030_platform_data beagle_twldata = {
        /* platform_data for children goes here */
        .usb            = &beagle_usb_data,
        .gpio           = &beagle_gpio_data,
+       .codec          = &beagle_codec_data,
        .vmmc1          = &beagle_vmmc1,
        .vsim           = &beagle_vsim,
        .vdac           = &beagle_vdac,
@@ -400,24 +411,46 @@ static void __init omap3beagle_flash_init(void)
        }
 }
 
+static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+
+       .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
+       .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
+       .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
+
+       .phy_reset  = true,
+       .reset_gpio_port[0]  = -EINVAL,
+       .reset_gpio_port[1]  = 147,
+       .reset_gpio_port[2]  = -EINVAL
+};
+
+#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 omap3_beagle_init(void)
 {
+       omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap3_beagle_i2c_init();
        platform_add_devices(omap3_beagle_devices,
                        ARRAY_SIZE(omap3_beagle_devices));
        omap_serial_init();
 
-       omap_cfg_reg(J25_34XX_GPIO170);
+       omap_mux_init_gpio(170, OMAP_PIN_INPUT);
        gpio_request(170, "DVI_nPD");
        /* REVISIT leave DVI powered down until it's needed ... */
        gpio_direction_output(170, true);
 
        usb_musb_init();
+       usb_ehci_init(&ehci_pdata);
        omap3beagle_flash_init();
 
        /* Ensure SDRC pins are mux'd for self-refresh */
-       omap_cfg_reg(H16_34XX_SDRC_CKE0);
-       omap_cfg_reg(H17_34XX_SDRC_CKE1);
+       omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+       omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
 }
 
 static void __init omap3_beagle_map_io(void)
@@ -429,7 +462,7 @@ static void __init omap3_beagle_map_io(void)
 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
        .phys_io        = 0x48000000,
-       .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
+       .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap3_beagle_map_io,
        .init_irq       = omap3_beagle_init_irq,