Changeset 34475


Ignore:
Timestamp:
2012-12-04T17:19:18+01:00 (5 years ago)
Author:
florian
Message:

cns3xxx: fix dwc_otg driver compat with udc-core

function. This removes those from the dwc_otg driver and removes the patch
that comments out the linkage of udc-core so that the dwc_otg driver can
co-exist happily with other USB Device Controllers.

Signed-off-by: Tim Harvey <tharvey@…>
Signed-off-by: Florian Fainelli <florian@…>

Location:
trunk/target/linux/cns3xxx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/cns3xxx/files/drivers/usb/dwc/otg_pcd.c

    r34162 r34475  
    24172417} 
    24182418 
    2419 /** 
    2420  * This function registers a gadget driver with the PCD. 
    2421  * 
    2422  * When a driver is successfully registered, it will receive control 
    2423  * requests including set_configuration(), which enables non-control 
    2424  * requests.  then usb traffic follows until a disconnect is reported. 
    2425  * then a host may connect again, or the driver might get unbound. 
    2426  * 
    2427  * @param driver The driver being registered 
    2428  */ 
    2429 int usb_gadget_probe_driver(struct usb_gadget_driver *driver, 
    2430         int (*bind)(struct usb_gadget *)) 
    2431 { 
    2432         int retval; 
    2433  
    2434         DWC_DEBUGPL(DBG_PCD, "registering gadget driver '%s'\n", driver->driver.name); 
    2435  
    2436         if (!driver || driver->max_speed == USB_SPEED_UNKNOWN || 
    2437                 !bind || 
    2438                 !driver->unbind || 
    2439                 !driver->disconnect || 
    2440                 !driver->setup) { 
    2441                 DWC_DEBUGPL(DBG_PCDV,"EINVAL\n"); 
    2442                 return -EINVAL; 
    2443         } 
    2444         if (s_pcd == 0) { 
    2445                 DWC_DEBUGPL(DBG_PCDV,"ENODEV\n"); 
    2446                 return -ENODEV; 
    2447         } 
    2448         if (s_pcd->driver != 0) { 
    2449                 DWC_DEBUGPL(DBG_PCDV,"EBUSY (%p)\n", s_pcd->driver); 
    2450                 return -EBUSY; 
    2451         } 
    2452  
    2453         /* hook up the driver */ 
    2454         s_pcd->driver = driver; 
    2455         s_pcd->gadget.dev.driver = &driver->driver; 
    2456  
    2457         DWC_DEBUGPL(DBG_PCD, "bind to driver %s\n", driver->driver.name); 
    2458         retval = bind(&s_pcd->gadget); 
    2459         if (retval) { 
    2460                 DWC_ERROR("bind to driver %s --> error %d\n", 
    2461                                         driver->driver.name, retval); 
    2462                 s_pcd->driver = 0; 
    2463                 s_pcd->gadget.dev.driver = 0; 
    2464                 return retval; 
    2465         } 
    2466         DWC_DEBUGPL(DBG_ANY, "registered gadget driver '%s'\n", 
    2467                                         driver->driver.name); 
    2468         return 0; 
    2469 } 
    2470  
    2471 EXPORT_SYMBOL(usb_gadget_probe_driver); 
    2472  
    2473 /** 
    2474  * This function unregisters a gadget driver 
    2475  * 
    2476  * @param driver The driver being unregistered 
    2477  */ 
    2478 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) 
    2479 { 
    2480         //DWC_DEBUGPL(DBG_PCDV,"%s(%p)\n", __func__, _driver); 
    2481  
    2482         if (s_pcd == 0) { 
    2483                 DWC_DEBUGPL(DBG_ANY, "%s Return(%d): s_pcd==0\n", __func__, 
    2484                                 -ENODEV); 
    2485                 return -ENODEV; 
    2486         } 
    2487         if (driver == 0 || driver != s_pcd->driver) { 
    2488                 DWC_DEBUGPL(DBG_ANY, "%s Return(%d): driver?\n", __func__, 
    2489                                 -EINVAL); 
    2490                 return -EINVAL; 
    2491         } 
    2492  
    2493         driver->unbind(&s_pcd->gadget); 
    2494         s_pcd->driver = 0; 
    2495  
    2496         DWC_DEBUGPL(DBG_ANY, "unregistered driver '%s'\n", 
    2497                         driver->driver.name); 
    2498         return 0; 
    2499 } 
    2500 EXPORT_SYMBOL(usb_gadget_unregister_driver); 
    2501  
    25022419#endif /* DWC_HOST_ONLY */ 
  • trunk/target/linux/cns3xxx/patches-3.3/200-dwc_otg_support.patch

    r34169 r34475  
    5757           A USB device uses a controller to talk to its host. 
    5858           Systems should have only one such upstream link. 
    59 --- a/drivers/usb/gadget/Makefile 
    60 +++ b/drivers/usb/gadget/Makefile 
    61 @@ -3,7 +3,7 @@ 
    62  # 
    63  ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG 
    64   
    65 -obj-$(CONFIG_USB_GADGET)       += udc-core.o 
    66 +#obj-$(CONFIG_USB_GADGET)      += udc-core.o 
    67  obj-$(CONFIG_USB_DUMMY_HCD)    += dummy_hcd.o 
    68  obj-$(CONFIG_USB_NET2272)      += net2272.o 
    69  obj-$(CONFIG_USB_NET2280)      += net2280.o 
Note: See TracChangeset for help on using the changeset viewer.