コード例 #1
0
void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)
{
	platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
 
	/* Setup Pin IO MUX for EHCI */
	if (cpu_is_omap34xx()) {
		ehci_resources[0].start	= OMAP34XX_EHCI_BASE;
		ehci_resources[0].end	= OMAP34XX_EHCI_BASE + SZ_1K - 1;
		ehci_resources[1].start	= OMAP34XX_UHH_CONFIG_BASE;
		ehci_resources[1].end	= OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
		ehci_resources[2].start	= OMAP34XX_USBTLL_BASE;
		ehci_resources[2].end	= OMAP34XX_USBTLL_BASE + SZ_4K - 1;
		ehci_resources[3].start = INT_34XX_EHCI_IRQ;
		setup_ehci_io_mux(pdata->port_mode);
	} else if (cpu_is_omap44xx()) {
		ehci_resources[0].start	= OMAP44XX_HSUSB_EHCI_BASE;
		ehci_resources[0].end	= OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
		ehci_resources[1].start	= OMAP44XX_UHH_CONFIG_BASE;
		ehci_resources[1].end	= OMAP44XX_UHH_CONFIG_BASE + SZ_2K - 1;
		ehci_resources[2].start	= OMAP44XX_USBTLL_BASE;
		ehci_resources[2].end	= OMAP44XX_USBTLL_BASE + SZ_4K - 1;
		ehci_resources[3].start = OMAP44XX_IRQ_EHCI;
		setup_4430ehci_io_mux(pdata->port_mode);
	}

	if (platform_device_register(&ehci_device) < 0) {
		printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
		return;
	}
}
コード例 #2
0
void __init usb_ehci_init(void)
{
	/* Setup Pin IO MUX for EHCI */
	if (cpu_is_omap34xx())
		setup_ehci_io_mux();

	if (platform_device_register(&ehci_device) < 0) {
		printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
		return;
	}
}
コード例 #3
0
void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
{
	platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));

	/* Setup Pin IO MUX for EHCI */
	if (cpu_is_omap34xx())
		setup_ehci_io_mux(pdata->port_data);

	if (platform_device_register(&ehci_device) < 0) {
		printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
		return;
	}
}
コード例 #4
0
void __init archos_usb_ehci_init(void)
{
	const struct archos_usb_config *usb_cfg;
	usb_cfg = omap_get_config( ARCHOS_TAG_USB, struct archos_usb_config );
	if (usb_cfg == NULL) {
		printk(KERN_DEBUG "%s: no board configuration found\n", __FUNCTION__);
		return;
	}
	if ( hardware_rev >= usb_cfg->nrev ) {
		printk(KERN_DEBUG "%s: hardware_rev (%i) >= nrev (%i)\n",
			__FUNCTION__, hardware_rev, usb_cfg->nrev);
		return;
	}

	if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_usb_hub) != 0 ) {
		gio_hub_enable = usb_cfg->rev[hardware_rev].enable_usb_hub;
		archos_gpio_init_output(&gio_hub_enable, "hub enable");
	}

	if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_5v) != 0 ) {
		gio_5v_enable = usb_cfg->rev[hardware_rev].enable_5v;
		archos_gpio_init_output(&gio_5v_enable, "5v enable");
	}

	if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_usb_ehci) != 0 ) {

		gio_ehci_enable = usb_cfg->rev[hardware_rev].enable_usb_ehci;

		archos_gpio_init_output(&gio_ehci_enable, "ehci enable");

		archos_enable_ehci( 0 );

		setup_ehci_io_mux();
	}

#if     defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
	if (platform_device_register(&ehci_device) < 0) {
		printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
		return;
	}
#endif

	if (platform_device_register(&archos_ehci_device) < 0)
		printk(KERN_ERR "Unable to register Archos EHCI device\n");

	device_create_file(&archos_ehci_device.dev, &dev_attr_ehci_enable);
	device_create_file(&archos_ehci_device.dev, &dev_attr_hub_enable);

	platform_driver_register(&archos_ehci_driver);

}
コード例 #5
0
ファイル: usb-host.c プロジェクト: Broadcom/stblinux-3.3
void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{
	struct omap_hwmod	*oh[2];
	struct platform_device	*pdev;
	int			bus_id = -1;
	int			i;

	for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
		usbhs_data.port_mode[i] = pdata->port_mode[i];
		ohci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
		ehci_data.regulator[i] = pdata->regulator[i];
	}
	ehci_data.phy_reset = pdata->phy_reset;
	ohci_data.es2_compatibility = pdata->es2_compatibility;
	usbhs_data.ehci_data = &ehci_data;
	usbhs_data.ohci_data = &ohci_data;

	if (cpu_is_omap34xx()) {
		setup_ehci_io_mux(pdata->port_mode);
		setup_ohci_io_mux(pdata->port_mode);
	} else if (cpu_is_omap44xx()) {
		setup_4430ehci_io_mux(pdata->port_mode);
		setup_4430ohci_io_mux(pdata->port_mode);
	}

	oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
	if (!oh[0]) {
		pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
		return;
	}

	oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
	if (!oh[1]) {
		pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
		return;
	}

	pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,
				(void *)&usbhs_data, sizeof(usbhs_data),
				omap_uhhtll_latency,
				ARRAY_SIZE(omap_uhhtll_latency), false);
	if (IS_ERR(pdev)) {
		pr_err("Could not build hwmod devices %s,%s\n",
			USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);
		return;
	}
}
コード例 #6
0
void __init usb_ehci_init(void)
{

#if     defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)

	/* Setup Pin IO MUX for EHCI */
	if (cpu_is_omap34xx())
		setup_ehci_io_mux();

	if (platform_device_register(&ehci_device) < 0) {
		printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
		return;
	}
#endif

}
コード例 #7
0
ファイル: usb-host.c プロジェクト: andi34/Dhollmen_Kernel
void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{
	struct omap_hwmod	*oh[4];
	struct omap_device	*od;
	int			bus_id = -1;
	int			i;

	for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
		usbhs_data.port_mode[i] = pdata->port_mode[i];
		ohci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
		ehci_data.regulator[i] = pdata->regulator[i];
		ehci_data.transceiver_clk[i] = pdata->transceiver_clk[i];
	}
	ehci_data.phy_reset = pdata->phy_reset;
	ohci_data.es2_compatibility = pdata->es2_compatibility;
	usbhs_data.ehci_data = &ehci_data;
	usbhs_data.ohci_data = &ohci_data;

	oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
	if (!oh[0]) {
		pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
		return;
	}

	oh[1] = omap_hwmod_lookup(USBHS_OHCI_HWMODNAME);
	if (!oh[1]) {
		pr_err("Could not look up %s\n", USBHS_OHCI_HWMODNAME);
		return;
	}

	oh[2] = omap_hwmod_lookup(USBHS_EHCI_HWMODNAME);
	if (!oh[2]) {
		pr_err("Could not look up %s\n", USBHS_EHCI_HWMODNAME);
		return;
	}

	oh[3] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
	if (!oh[3]) {
		pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
		return;
	}

	if (cpu_is_omap34xx()) {
		setup_ehci_io_mux(pdata->port_mode);
		setup_ohci_io_mux(pdata->port_mode);
	} else if (cpu_is_omap44xx()) {
		oh[2]->mux = setup_4430ehci_io_mux(pdata->port_mode);
		if (oh[2]->mux)
			omap_hwmod_mux(oh[2]->mux, _HWMOD_STATE_ENABLED);
		oh[1]->mux = setup_4430ohci_io_mux(pdata->port_mode);
		if (oh[1]->mux)
			omap_hwmod_mux(oh[1]->mux, _HWMOD_STATE_ENABLED);
	}

	od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 4,
				(void *)&usbhs_data, sizeof(usbhs_data),
				omap_uhhtll_latency,
				ARRAY_SIZE(omap_uhhtll_latency), false);

	if (IS_ERR(od)) {
		pr_err("Could not build hwmod devices %s, %s\n",
			USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);
		return;
	}

	usbhs_wake = kmalloc(sizeof(*usbhs_wake), GFP_KERNEL);
	if (!usbhs_wake) {
		pr_err("Could not allocate usbhs_wake\n");
		return;
	}

	INIT_WORK(&usbhs_wake->wakeup_work, usbhs_resume_work);
	usbhs_wake->oh_ehci = oh[2];
	usbhs_wake->oh_ohci = oh[1];
	usbhs_wake->dev = &od->pdev.dev;
}
コード例 #8
0
ファイル: usb-host.c プロジェクト: twobrokenshoes/linux-3.8
void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{
    struct omap_hwmod	*uhh_hwm, *tll_hwm;
    struct platform_device	*pdev;
    int			bus_id = -1;
    int			i;

    for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
        usbhs_data.port_mode[i] = pdata->port_mode[i];
        usbtll_data.port_mode[i] = pdata->port_mode[i];
        ohci_data.port_mode[i] = pdata->port_mode[i];
        ehci_data.port_mode[i] = pdata->port_mode[i];
        ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
        ehci_data.regulator[i] = pdata->regulator[i];
    }
    ehci_data.phy_reset = pdata->phy_reset;
    ohci_data.es2_compatibility = pdata->es2_compatibility;
    usbhs_data.ehci_data = &ehci_data;
    usbhs_data.ohci_data = &ohci_data;

    if (cpu_is_omap34xx()) {
        setup_ehci_io_mux(pdata->port_mode);
        setup_ohci_io_mux(pdata->port_mode);

        if (omap_rev() <= OMAP3430_REV_ES2_1)
            usbhs_data.single_ulpi_bypass = true;

    } else if (cpu_is_omap44xx()) {
        setup_4430ehci_io_mux(pdata->port_mode);
        setup_4430ohci_io_mux(pdata->port_mode);
    }

    uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
    if (!uhh_hwm) {
        pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
        return;
    }

    tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
    if (!tll_hwm) {
        pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
        return;
    }

    pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
                             &usbtll_data, sizeof(usbtll_data),
                             omap_uhhtll_latency,
                             ARRAY_SIZE(omap_uhhtll_latency), false);
    if (IS_ERR(pdev)) {
        pr_err("Could not build hwmod device %s\n",
               USBHS_TLL_HWMODNAME);
        return;
    }

    pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
                             &usbhs_data, sizeof(usbhs_data),
                             omap_uhhtll_latency,
                             ARRAY_SIZE(omap_uhhtll_latency), false);
    if (IS_ERR(pdev)) {
        pr_err("Could not build hwmod devices %s\n",
               USBHS_UHH_HWMODNAME);
        return;
    }
}
コード例 #9
0
ファイル: usb-host.c プロジェクト: SciAps/android-kernel
void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{
	struct omap_hwmod	*uhh_hwm, *tll_hwm;
	struct platform_device	*pdev;
	int			bus_id = -1;
	int			i;

	for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
		usbhs_data.port_mode[i] = pdata->port_mode[i];
		usbtll_data.port_mode[i] = pdata->port_mode[i];
		ohci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.port_mode[i] = pdata->port_mode[i];
		ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
		ehci_data.regulator[i] = pdata->regulator[i];
	}
	ehci_data.phy_reset = pdata->phy_reset;
	ehci_data.phy_clk = pdata->phy_clk;
	ohci_data.es2_compatibility = pdata->es2_compatibility;
	ehci_data.usbhs_update_sar = &usbhs_update_sar;
	ohci_data.usbhs_update_sar = &usbhs_update_sar;
	usbhs_data.ehci_data = &ehci_data;
	usbhs_data.ohci_data = &ohci_data;

	uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
	if (!uhh_hwm) {
		pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
		return;
	}

	tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
	if (!tll_hwm) {
		pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
		return;
	}

	l3init_clkdm = clkdm_lookup("l3_init_clkdm");
	if (!l3init_clkdm) {
		pr_err("Failed to get l3_init_clkdm\n");
	}

	pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
				(void *)&usbtll_data, sizeof(usbtll_data),
				omap_uhhtll_latency,
				ARRAY_SIZE(omap_uhhtll_latency), false);
	if (IS_ERR(pdev)) {
		pr_err("Could not build hwmod device %s\n",
			USBHS_TLL_HWMODNAME);
		return;
	}

	pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
				(void *)&usbhs_data, sizeof(usbhs_data),
				omap_uhhtll_latency,
				ARRAY_SIZE(omap_uhhtll_latency), false);
	if (IS_ERR(pdev)) {
		pr_err("Could not build hwmod devices %s\n",
			USBHS_UHH_HWMODNAME);
		return;
	}

	pdev_usbhs = pdev;

	if (cpu_is_omap34xx()) {
		setup_ehci_io_mux(pdata->port_mode);
		setup_ohci_io_mux(pdata->port_mode);
	} else if (cpu_is_omap44xx() || cpu_is_omap54xx())
		uhh_hwm->mux = setup_4430_usbhs_io_mux(pdev, pdata->port_mode);
}