1 Index: linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c
2 ===================================================================
3 --- linux-2.6.38-rc7.orig/drivers/cbus/tahvo-usb.c 2011-03-06 23:00:14.411191087 +0100
4 +++ linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c 2011-03-06 23:43:26.524751556 +0100
5 @@ -98,8 +98,9 @@ struct tahvo_usb {
11 -static struct platform_device tahvo_usb_device;
12 +static struct tahvo_usb *tahvo_usb_device;
15 * ---------------------------------------------------------------------------
16 @@ -114,8 +115,7 @@ static struct platform_device *tahvo_otg
18 static irqreturn_t omap_otg_irq(int irq, void *arg)
20 - struct platform_device *otg_dev = arg;
21 - struct tahvo_usb *tu = platform_get_drvdata(otg_dev);
22 + struct tahvo_usb *tu = arg;
25 otg_irq = omap_readw(OTG_IRQ_SRC);
26 @@ -201,12 +201,12 @@ static int __init omap_otg_probe(struct
28 return request_irq(tahvo_otg_dev->resource[1].start,
29 omap_otg_irq, IRQF_DISABLED, DRIVER_NAME,
34 static int __exit omap_otg_remove(struct platform_device *pdev)
36 - free_irq(tahvo_otg_dev->resource[1].start, &tahvo_usb_device);
37 + free_irq(tahvo_otg_dev->resource[1].start, tahvo_usb_device);
41 @@ -659,6 +659,7 @@ static int __init tahvo_usb_probe(struct
42 tu = kzalloc(sizeof(*tu), GFP_KERNEL);
45 + tahvo_usb_device = tu;
47 tu->pt_dev = container_of(dev, struct platform_device, dev);
49 @@ -673,6 +674,14 @@ static int __init tahvo_usb_probe(struct
50 INIT_WORK(&tu->irq_work, tahvo_usb_irq_work);
51 mutex_init(&tu->serialize);
53 + tu->ick = clk_get(NULL, "usb_l4_ick");
54 + if (IS_ERR(tu->ick)) {
55 + printk(KERN_ERR "Failed to get usb_l4_ick\n");
56 + ret = PTR_ERR(tu->ick);
59 + clk_enable(tu->ick);
61 /* Set initial state, so that we generate kevents only on
63 tu->vbus_state = tahvo_read_reg(TAHVO_REG_IDSR) & 0x01;
64 @@ -680,10 +689,9 @@ static int __init tahvo_usb_probe(struct
65 /* We cannot enable interrupt until omap_udc is initialized */
66 ret = tahvo_request_irq(TAHVO_INT_VBUSON, tahvo_usb_vbus_interrupt,
67 (unsigned long) tu, "vbus_interrupt");
71 printk(KERN_ERR "Could not register Tahvo interrupt for VBUS\n");
73 + goto err_release_clk;
77 @@ -708,9 +716,7 @@ static int __init tahvo_usb_probe(struct
78 ret = otg_set_transceiver(&tu->otg);
80 printk(KERN_ERR "Cannot register USB transceiver\n");
82 - tahvo_free_irq(TAHVO_INT_VBUSON);
87 dev_set_drvdata(dev, tu);
88 @@ -719,10 +725,23 @@ static int __init tahvo_usb_probe(struct
89 * may not be generated in addition to this. */
90 schedule_work(&tu->irq_work);
94 + tahvo_free_irq(TAHVO_INT_VBUSON);
96 + clk_disable(tu->ick);
100 + tahvo_usb_device = NULL;
105 static int __exit tahvo_usb_remove(struct platform_device *pdev)
107 + struct tahvo_usb *tu = platform_get_drvdata(pdev);
109 dev_dbg(&pdev->dev, "remove\n");
111 tahvo_free_irq(TAHVO_INT_VBUSON);
112 @@ -732,6 +751,12 @@ static int __exit tahvo_usb_remove(struc
113 #ifdef CONFIG_USB_OTG
114 device_remove_file(&pdev->dev, &dev_attr_otg_mode);
116 + clk_disable(tu->ick);
120 + tahvo_usb_device = NULL;
125 Index: linux-2.6.38-rc7/arch/arm/mach-omap2/board-n8x0.c
126 ===================================================================
127 --- linux-2.6.38-rc7.orig/arch/arm/mach-omap2/board-n8x0.c 2011-03-06 23:00:14.388188076 +0100
128 +++ linux-2.6.38-rc7/arch/arm/mach-omap2/board-n8x0.c 2011-03-06 23:06:50.508033149 +0100
130 #include <plat/serial.h>
131 #include <plat/cbus.h>
132 #include <plat/gpio-switch.h>
133 +#include <plat/usb.h>
137 @@ -395,6 +396,14 @@ static struct musb_hdrc_platform_data tu
138 .config = &musb_config,
141 +static struct omap_usb_config n8x0_omap_usb_config __initdata = {
143 + .register_host = 1,
149 static void __init n8x0_usb_init(void)
152 @@ -417,6 +426,8 @@ static void __init n8x0_usb_init(void)
156 + omap2_usbfs_init(&n8x0_omap_usb_config);