コード例 #1
0
void __init usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata)
{
	platform_device_add_data(&ohci_device, pdata, sizeof(*pdata));
	if (cpu_is_omap34xx()) {
		ohci_resources[0].start	= OMAP34XX_OHCI_BASE;
		ohci_resources[0].end	= OMAP34XX_OHCI_BASE + SZ_1K - 1;
		ohci_resources[1].start	= OMAP34XX_UHH_CONFIG_BASE;
		ohci_resources[1].end	= OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
		ohci_resources[2].start	= OMAP34XX_USBTLL_BASE;
		ohci_resources[2].end	= OMAP34XX_USBTLL_BASE + SZ_4K - 1;
		ohci_resources[3].start = INT_34XX_OHCI_IRQ;
		setup_ohci_io_mux(pdata->port_mode);
	} else if (cpu_is_omap44xx()) {
		ohci_resources[0].start	= OMAP44XX_HSUSB_OHCI_BASE;
		ohci_resources[0].end	= OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
		ohci_resources[1].start	= OMAP44XX_UHH_CONFIG_BASE;
		ohci_resources[1].end	= OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
		ohci_resources[2].start	= OMAP44XX_USBTLL_BASE;
		ohci_resources[2].end	= OMAP44XX_USBTLL_BASE + SZ_4K - 1;
#define OMAP44XX_IRQ_OHCI INT_44XX_USB_IRQ_NISO
		ohci_resources[3].start = OMAP44XX_IRQ_OHCI;
		setup_4430ohci_io_mux(pdata->port_mode);
	}

	if (platform_device_register(&ohci_device) < 0) {
		pr_err("Unable to register FS-USB (OHCI) device\n");
		return;
	}
}
コード例 #2
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;
	}
}
コード例 #3
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;
}
コード例 #4
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;
    }
}