Пример #1
0
void __init omap_usb_init(struct omap_usb_config *pdata)
{
	if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx())
		omap_otg_init(pdata);
	else if (cpu_is_omap15xx())
		omap_1510_usb_init(pdata);
	else
		printk(KERN_ERR "USB: No init for your chip yet\n");
}
Пример #2
0
static void tahvo_usb_become_peripheral(struct tahvo_usb *tu)
{
	/* Clear system and transceiver controlled bits
	 * and enable ID to mark peripheral mode and
	 * BSESSEND to mark no Vbus */
	omap_otg_init();
	OTG_CTRL_REG = (OTG_CTRL_REG & ~(OTG_CTRL_XCVR_MASK|OTG_CTRL_SYS_MASK|OTG_BSESSVLD))
		| OTG_ID | OTG_BSESSEND;

	/* Power up transceiver and set it in USB perhiperal mode */
	tahvo_write_reg(TAHVO_REG_USBR, USBR_SLAVE_CONTROL | USBR_REGOUT | USBR_NSUSPEND | USBR_SLAVE_SW);
	tu->otg.state = OTG_STATE_B_IDLE;

	check_vbus_state(tu);
}
Пример #3
0
static int omap_otg_probe(struct device *dev)
{
	int ret;

	tahvo_otg_dev = to_platform_device(dev);
	ret = omap_otg_init();
	if (ret != 0) {
		printk(KERN_ERR "tahvo-usb: omap_otg_init failed\n");
		return ret;
	}

	return request_irq(tahvo_otg_dev->resource[1].start,
			   omap_otg_irq, IRQF_DISABLED, DRIVER_NAME,
			   &tahvo_usb_device);
}
Пример #4
0
static void tahvo_usb_become_host(struct tahvo_usb *tu)
{
	u32 l;

	/* Clear system and transceiver controlled bits
	 * also mark the A-session is always valid */
	omap_otg_init();

	l = OTG_CTRL_REG;
	l &= ~(OTG_CTRL_XCVR_MASK|OTG_CTRL_SYS_MASK);
	l |= OTG_ASESSVLD;
	OTG_CTRL_REG = l;

	/* Power up the transceiver in USB host mode */
	tahvo_write_reg(TAHVO_REG_USBR, USBR_REGOUT | USBR_NSUSPEND |
			USBR_MASTER_SW2 | USBR_MASTER_SW1);
	tu->otg.state = OTG_STATE_A_IDLE;

	check_vbus_state(tu);
}
Пример #5
0
void __init omap2_usbfs_init(struct omap_usb_config *pdata)
{
	struct clk *ick;

	if (!cpu_is_omap24xx())
		return;

	ick = clk_get(NULL, "usb_l4_ick");
	if (IS_ERR(ick))
		return;

	clk_enable(ick);
	pdata->usb0_init = omap2_usb0_init;
	pdata->usb1_init = omap2_usb1_init;
	pdata->usb2_init = omap2_usb2_init;
	udc_device_init(pdata);
	ohci_device_init(pdata);
	otg_device_init(pdata);
	omap_otg_init(pdata);
	clk_disable(ick);
	clk_put(ick);
}
Пример #6
0
static int __init
omap_usb_init(void)
{
	const struct omap_usb_config *config;

	config = omap_get_config(OMAP_TAG_USB, struct omap_usb_config);
	if (config == NULL) {
		printk(KERN_ERR "USB: No board-specific "
				"platform config found\n");
		return -ENODEV;
	}
	platform_data = *config;

	if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx())
		omap_otg_init(&platform_data);
	else if (cpu_is_omap15xx())
		omap_1510_usb_init(&platform_data);
	else {
		printk(KERN_ERR "USB: No init for your chip yet\n");
		return -ENODEV;
	}
	return 0;
}