From 2518079baa078336146768ba15351c04a4b36803 Mon Sep 17 00:00:00 2001 From: Mika Laitio Date: Tue, 20 Jan 2009 01:08:25 +0200 Subject: [PATCH] h63xx: usb gadget driver support for allowing network over usb. --- arch/arm/mach-omap1/board-h6300.c | 8 ++++++++ drivers/usb/gadget/omap_udc.c | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap1/board-h6300.c b/arch/arm/mach-omap1/board-h6300.c index 90b000bd694..14173037593 100644 --- a/arch/arm/mach-omap1/board-h6300.c +++ b/arch/arm/mach-omap1/board-h6300.c @@ -46,9 +46,17 @@ static struct omap_uart_config h6300_uart_config __initdata = { .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), }; +/* assume no Mini-AB port */ +static struct omap_usb_config h6300_usb_config __initdata = { + .hmc_mode = 0, + .register_dev = 1, + .pins[0] = 0, +}; + static struct omap_board_config_kernel h6300_config[] = { { OMAP_TAG_LCD, &h6300_lcd_config }, { OMAP_TAG_UART, &h6300_uart_config }, + { OMAP_TAG_USB, &h6300_usb_config }, }; static void __init h6300_init_irq(void) diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index f2b065fd28b..975a54fb0dc 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -60,7 +60,11 @@ #undef USB_TRACE /* bulk DMA seems to be behaving for both IN and OUT */ +#ifdef CONFIG_MACH_OMAP_H6300 +#undef USE_DMA +#else #define USE_DMA +#endif /* ISO too */ #define USE_ISO @@ -2147,7 +2151,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) /* boards that don't have VBUS sensing can't autogate 48MHz; * can't enter deep sleep while a gadget driver is active. */ - if (machine_is_omap_innovator() || machine_is_omap_osk()) + if (machine_is_omap_innovator() || machine_is_omap_osk() || machine_is_omap_h6300()) omap_vbus_session(&udc->gadget, 1); done: @@ -2170,7 +2174,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) if (udc->dc_clk != NULL) omap_udc_enable_clock(1); - if (machine_is_omap_innovator() || machine_is_omap_osk()) + if (machine_is_omap_innovator() || machine_is_omap_osk() || machine_is_omap_h6300()) omap_vbus_session(&udc->gadget, 0); if (udc->transceiver) @@ -2791,7 +2795,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) hmc = HMC_1510; type = "(unknown)"; - if (machine_is_omap_innovator()) { + if (machine_is_omap_innovator() || machine_is_omap_h6300()) { /* just set up software VBUS detect, and then * later rig it so we always report VBUS. * FIXME without really sensing VBUS, we can't -- 2.41.0