EHCI: HSIC: Add support to vote for SVS digital voltage

HSIC HW can operate at SVS digital voltage when it is active.
Currently HSIC is voting for 120Mhz SFAB and 64Mhz DFAB clock
frequencies. Clock frequencies are directly proportional to SVS
voltage. If DFAB is running at 64Mhz or SFAB is running at 120Mhz
or higher SVS is not possible even though HSIC votes for it. Hence
do not vote for SFAB clock frequency and only vote for 32Mhz for
DFAB in order to allow SVS to happen. Voting for SVS voltage reduces
current consumption by 3mA in HSDPA network.

Change-Id: I8a6844efbbe90a8ea118be8450f8210717c2641b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>

mako: EHCI: HSIC: Add support to vote for SVS digital voltage

HSIC HW can operate at SVS digital voltage when it is active.
Currently HSIC is voting for 120Mhz SFAB and 64Mhz DFAB clock
frequencies. Clock frequencies are directly proportional to SVS
voltage. If DFAB is running at 64Mhz or SFAB is running at 120Mhz
or higher SVS is not possible even though HSIC votes for it. Hence
do not vote for SFAB clock frequency and only vote for 32Mhz for
DFAB in order to allow SVS to happen. Voting for SVS voltage reduces
current consumption by 3mA in HSDPA network.

Change-Id: I8a6844efbbe90a8ea118be8450f8210717c2641b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
usb: ehci-msm-hsic: Add support in device tree to MSM HSIC host

Add support in device tree to MSM HSIC host including support in
GDSC (Global Distributed Switch Controller) for new platforms.

Change-Id: I6b0df0eabb03278b97b2b69f9fcdc2ef3806ba0b
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
usb: ehci-msm-hsic: Change HSIC reset sequence

Due to USB HW changes, RST CMD resets CSC/CCS fields in PORTSC
and PCI bit in USBSTS. Therefore HSIC reset sequence should be
changed to avoid case that the device was powered up before the
host and due to a RST CMD the host will miss that the device is
connected.

CRs-Fixed: 417642
Change-Id: I2b1fb2a92658058d70ccc6cb5f73174ce4128b72
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
USB: HSIC: Add support for HSIC core and SMSC HUB using DT

Add device tree support in SMSC HUB driver which also registers
platform_device for HSIC as its child. This allows SMSC HUB driver
to turn OFF clocks for power savings after HSIC is suspended.
Also add support for SMSC HUB to use dedicated clock as ref_clk
instead of XO.

Change-Id: I3e8828ddc232936df3e21c8e1158af92b16996a2
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
usb: ehci-msm-hsic: Add asynchronous reset to HSIC

Add support for asynchronous block reset to the HSIC hardware.
In platforms that uses an asynchronous reset methodology,
the HSIC alt_core_clk is not presented.

Change-Id: I0dc0e1bf294260a5530e01660d970cc939a9dbec
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
usb: ks_bridge: Fix memory leaks in the driver

This change addresses two memory leaks:-
1) misc device is not getting deregistered during device
disconnect. Hence call misc_deregister() in disconnect.

2) Driver returns without freeing previous instances of
the driver data structure if memory allocation fails. Hence
free up memory allocated for ks_bridge structure.

Change-Id: I90133a002aa9d38597de8d1b21d3aad621552d46
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
usb: misc: Avoid excessive logging during disconnect

When the device is in the midst of being disconnected, calls to
usb_autopm_get_interface() may fail, and a ERR-level message is
printed. Callers of such I/O functions may repeatedly try calling
again, and could end up flooding the console leading to a watchdog
timeout. Replace these printks with DBG-level messages since the
device disconnection is normal and the errors they indicate are
usually benign.

CRs-fixed: 394256
Change-Id: Icf9000faa9001832734ff9c64cd903b375cc2017
Signed-off-by: Jack Pham <jackp@codeaurora.org>
USB: HSIC: Fix setting of strobe and data gpios for HSIC host

Since the following commit I3e8828ddc232936df3e21c8e1158af92b16996a2
the ehci msm hsic host driver read device tree settings as the strobe
and the data gpios. In case that these gpios not exists in the device
tree the return value is negative. The return value was assigned to
unsigned variables, therefore the driver assumes that there are
such gpios.
This fix handles correctly the return value of the of_get_named_gpio.

Change-Id: Ia5dde57cc36438b977791df658375e0946123096
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Revert "mako: disable support for loadable modules"

This reverts commit d2d721eb69ff1fe8ae7427fb6d5b342434614a25.
msm: mdm: Assert soft_reset_gpio in mdm_power_down_common

In cases where the external modem is powered up very early in the
boot up process, user space application is not loaded as a result
mdm2ap_status is never pulled high. In case where we need to shutdown
the phone for charging we leave the ap2mdm_soft_reset_gpio pulled
high which results in leakage. Assert the ap2mdm_soft-reset_gpio
irrespective of the state of mdm2ap_status gpio.

CRs-Fixed: 425684
Change-Id: Icd37ac8eec1a8b9259563f2627ee57340f4e9f59
Signed-off-by: Taniya Das <tdas@codeaurora.org>
usb: host: ehci: allow ehci_bus_resume symbol to be unused

All the platforms may not use ehci_bus_resume symbol in their
hc_driver structure. This may result in below warning:

drivers/usb/host/ehci-hub.c: warning: 'ehci_bus_resume' \
    defined but not used

In order to remove this warning add '__maybe_unused' annotation
to ehci_bus_resume function.

Change-Id: I3c97eed7555688d99d68618f3810197e574499cb
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
ehci-msm-hsic: reduce timeout by 20% from original

Faux123's solution to data drops related to CAF patches for msm_hsic_host wakelocks.

Thanks to Faux123 <reioux@gmail.com>