]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
usb: gadget: tegra: Notify if HOST PC is connected
authorRohith Seelaboyina <rseelaboyina@nvidia.com>
Tue, 15 Oct 2013 09:40:39 +0000 (15:10 +0530)
committerRohith Seelaboyina <rseelaboyina@nvidia.com>
Thu, 17 Oct 2013 11:30:32 +0000 (04:30 -0700)
While going to LP0 with charger/PC connected, otg state
changes from peripheral to suspend. If the previous connect type
is charger then udc driver need not notify otg as this would
acquire a temporary wakelock and abort the suspend.
Notify only when HOST PC is connected.

Bug 1354941

Change-Id: Id90af5c4a224424d06322ccc6b3e8e0e13a084d6
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/299405
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
drivers/usb/gadget/tegra_udc.c

index 9710deb577354d33f514bb0cf8209e93b1dba161..649c58bf0f39ffee010dbe01ecf864e6b541b73d 100644 (file)
@@ -1385,7 +1385,10 @@ static int tegra_usb_set_charging_current(struct tegra_udc *udc)
        case CONNECT_TYPE_NONE:
                dev_info(dev, "USB cable/charger disconnected\n");
                max_ua = 0;
-               tegra_udc_notify_event(udc, USB_EVENT_NONE);
+               /* Notify if HOST(SDP/CDP) is connected */
+               if ((udc->prev_connect_type == CONNECT_TYPE_SDP) ||
+                       (udc->prev_connect_type == CONNECT_TYPE_CDP))
+                       tegra_udc_notify_event(udc, USB_EVENT_NONE);
                break;
        case CONNECT_TYPE_SDP:
                if (udc->current_limit > 2)