Merge remote-tracking branch 'stable/linux-3.0.y' into develop-3.0
[firefly-linux-kernel-4.4.55.git] / drivers / usb / core / hub.c
old mode 100644 (file)
new mode 100755 (executable)
index be9cac6..e37fdcf
@@ -1286,7 +1286,7 @@ static void hub_disconnect(struct usb_interface *intf)
 
        kref_put(&hub->kref, hub_release);
 }
-
+struct usb_hub *g_root_hub20 = NULL;
 static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
        struct usb_host_interface *desc;
@@ -1346,7 +1346,10 @@ descriptor_error:
                dev_dbg (&intf->dev, "couldn't kmalloc hub struct\n");
                return -ENOMEM;
        }
-
+       if(!g_root_hub20)
+       {
+               g_root_hub20 = hub;
+       }
        kref_init(&hub->kref);
        INIT_LIST_HEAD(&hub->event_list);
        hub->intfdev = &intf->dev;
@@ -1914,7 +1917,11 @@ int usb_new_device(struct usb_device *udev)
                add_device_randomness(udev->manufacturer,
                                      strlen(udev->manufacturer));
 
-       device_enable_async_suspend(&udev->dev);
+       /* kever@rk 20111205
+        * We don't use async suspend in rk29 usb
+        * to make sure usb1.1 host is suspend before usb 2.0 host.
+        */
+       //device_enable_async_suspend(&udev->dev);
        /* Register the device.  The device driver is responsible
         * for configuring the device and invoking the add-device
         * notifier chain (used by usbfs and possibly others).
@@ -2910,11 +2917,17 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
                udev->ttport = hdev->ttport;
        } else if (udev->speed != USB_SPEED_HIGH
                        && hdev->speed == USB_SPEED_HIGH) {
+                       
+       /* yk@rk 20110617
+        * parent hub has no TT would not be error in rk29
+        */
+               #if 0
                if (!hub->tt.hub) {
                        dev_err(&udev->dev, "parent hub has no TT\n");
                        retval = -EINVAL;
                        goto fail;
                }
+               #endif
                udev->tt = &hub->tt;
                udev->ttport = port1;
        }
@@ -3648,6 +3661,14 @@ static void hub_events(void)
         } /* end while (1) */
 }
 
+/* yk@rk 20100730 
+ * disconnect all devices on root hub
+ */
+void hub_disconnect_device(struct usb_hub *hub)
+{
+       hub_port_connect_change(hub, 1, 0, 0x2);
+}
+
 static int hub_thread(void *__unused)
 {
        /* khubd needs to be freezable to avoid intefering with USB-PERSIST