From 2489007e7d740ccbc3e0a202914e243ad5178787 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 22 Sep 2012 09:48:20 +0200 Subject: merge opensource jb u5 Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2 --- drivers/usb/core/hub.c | 54 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'drivers/usb/core/hub.c') diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 069739b..93aa0e7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -29,6 +29,9 @@ #include #include "usb.h" +#ifdef CONFIG_SAMSUNG_SMARTDOCK +#include "sec-dock.h" +#endif /* if we are in debug mode, always announce new devices */ #ifdef DEBUG @@ -766,7 +769,16 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) "under this hub\n."); } } + #ifdef CONFIG_MDM_HSIC_PM + /* MDM9x15, HSIC device do not need power on delay */ + if (dev_name(hub->intfdev) && + !strcmp(dev_name(hub->intfdev), "1-0:1.0")) + hub_power_on(hub, false); + else + hub_power_on(hub, true); + #else hub_power_on(hub, true); + #endif } else { hub_power_on(hub, true); } @@ -879,7 +891,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) * If any port-status changes do occur during this delay, khubd * will see them later and handle them normally. */ -#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) +#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) \ + || defined(CONFIG_MDM_HSIC_PM) if (need_debounce_delay && type != HUB_RESET_RESUME) { #else if (need_debounce_delay) { @@ -1662,6 +1675,10 @@ void usb_disconnect(struct usb_device **pdev) dev_info(&udev->dev, "USB disconnect, device number %d by %pF\n", udev->devnum, __builtin_return_address(0)); +#ifdef CONFIG_SAMSUNG_SMARTDOCK + call_battery_notify(udev, 0); +#endif + usb_lock_device(udev); /* Free up all the children before we remove this device */ @@ -1905,7 +1922,12 @@ int usb_new_device(struct usb_device *udev) /* Tell the world! */ announce_device(udev); - +#ifdef CONFIG_SAMSUNG_SMARTDOCK +#if defined(CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK) + call_audiodock_notify(udev); +#endif + call_battery_notify(udev, 1); +#endif device_enable_async_suspend(&udev->dev); /* Register the device. The device driver is responsible * for configuring the device and invoking the add-device @@ -2130,7 +2152,13 @@ static int hub_port_reset(struct usb_hub *hub, int port1, switch (status) { case 0: /* TRSTRCY = 10 ms; plus some extra */ + #ifdef CONFIG_MDM_HSIC_PM + /* MDM9x15, HSIC deivce do not need this delay */ + if (!(udev->quirks & USB_QUIRK_HSIC_TUNE)) + msleep(10 + 40); + #else msleep(10 + 40); + #endif update_devnum(udev, 0); if (hcd->driver->reset_device) { status = hcd->driver->reset_device(hcd, udev); @@ -2276,6 +2304,11 @@ static int check_port_resume_type(struct usb_device *udev, if (portchange & USB_PORT_STAT_C_ENABLE) clear_port_feature(hub->hdev, port1, USB_PORT_FEAT_C_ENABLE); + #ifdef CONFIG_MDM_HSIC_PM + /* MDM9x15, HSIC deivce do need this delay at LPA wake */ + if (udev->quirks & USB_QUIRK_HSIC_TUNE) + msleep(30); + #endif } return status; @@ -2566,8 +2599,9 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) } SuspendCleared: -#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) - pr_debug("mif: %s: %d, %d\n", __func__, portstatus, portchange); +#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) \ + || defined(CONFIG_MDM_HSIC_PM) + pr_info("mif: %s: %d, %d\n", __func__, portstatus, portchange); #endif if (status == 0) { if (hub_is_superspeed(hub->hdev)) { @@ -2591,6 +2625,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) dev_dbg(&udev->dev, "can't resume, status %d\n", status); hub_port_logical_disconnect(hub, port1); } + return status; } @@ -3517,7 +3552,7 @@ static void hub_events(void) * EM interference sometimes causes badly * shielded USB devices to be shutdown by * the hub, this hack enables them again. - * Works at least with mouse driver. + * Works at least with mouse driver. */ if (!(portstatus & USB_PORT_STAT_ENABLE) && !connect_change @@ -3539,7 +3574,14 @@ static void hub_events(void) udev = hdev->children[i-1]; if (udev) { /* TRSMRCY = 10 msec */ + #ifdef CONFIG_MDM_HSIC_PM + /* MDM9x15, HSIC deivce */ + if (udev->quirks & USB_QUIRK_HSIC_TUNE) + msleep(10 + 10); + else + #else msleep(10); + #endif usb_lock_device(udev); ret = usb_remote_wakeup(hdev-> @@ -3555,7 +3597,7 @@ static void hub_events(void) "resume on port %d, status %d\n", i, ret); } - + if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0; u16 unused; -- cgit v1.1