summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/tegra_udc.c8
-rw-r--r--drivers/usb/gadget/tegra_udc.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index 6826e0b62ac6..aa910654cc3f 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -1416,7 +1416,8 @@ static int tegra_vbus_session(struct usb_gadget *gadget, int is_active)
}
/* start the controller */
dr_controller_run(udc);
- tegra_usb_set_charging_current(udc);
+ if (udc->connect_type != CONNECT_TYPE_SDP)
+ tegra_usb_set_charging_current(udc);
}
return 0;
@@ -1436,7 +1437,7 @@ static int tegra_vbus_draw(struct usb_gadget *gadget, unsigned mA)
udc = container_of(gadget, struct tegra_udc, gadget);
/* Do not set current limits for CDP ports */
- if (udc->connect_type != CONNECT_TYPE_CDP) {
+ if (udc->connect_type == CONNECT_TYPE_SDP) {
udc->current_limit = mA;
schedule_work(&udc->current_work);
}
@@ -1796,6 +1797,9 @@ static void setup_received_irq(struct tegra_udc *udc,
return;
case USB_REQ_SET_ADDRESS:
+ udc->connect_type = CONNECT_TYPE_SDP;
+ tegra_vbus_draw(&udc->gadget,
+ USB_CHARGING_SDP_CURRENT_LIMIT_UA/1000);
/* Status phase from udc */
if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD
| USB_RECIP_DEVICE))
diff --git a/drivers/usb/gadget/tegra_udc.h b/drivers/usb/gadget/tegra_udc.h
index d90d4624e941..a6ff9d4e9777 100644
--- a/drivers/usb/gadget/tegra_udc.h
+++ b/drivers/usb/gadget/tegra_udc.h
@@ -42,7 +42,7 @@
#define USB_CHARGING_CDP_CURRENT_LIMIT_UA 1500000
#define USB_CHARGING_SDP_CURRENT_LIMIT_UA 100000
#define USB_CHARGING_NV_CHARGER_CURRENT_LIMIT_UA 2000000
-#define USB_CHARGING_NON_STANDARD_CHARGER_CURRENT_LIMIT_UA 1800000
+#define USB_CHARGING_NON_STANDARD_CHARGER_CURRENT_LIMIT_UA 500000
/* 4 sec wait time for charger detection after vbus is detected */
#define USB_CHARGER_DETECTION_WAIT_TIME_MS 4000