EHCI: HSIC: Fix GPT timer count values used for resume sequence

The counter value to be loaded into GPT timer represents the time
in micro seconds minus 1 for the timer duration.  The current code
incorrectly programs the timer.  Fix it.

Change-Id: Ief8039b4e75910001d31a7c05b3b274e6e66c2da
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
EHCI: HSIC: Handle asynchronous interrupt properly

Runtime PM resume and asynchronous interrupt can run in parallel. When
this happens, there is a possibility of PM usage counter mismatch.
Fix this by checking the return value of pm_runtime_get() and by
disabling the USB interrupt while resuming the HSIC.

Consider asynchronous interrupt case when resuming HSIC during system
resume.

CRs-Fixed: 444883
Change-Id: I315fb6cecffcea83c03037be899e3ff840791c21
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
EHCI: HSIC: Disable asynchronous interrupt when wakeup gpio is present

Controller can generate interrupt asynchronously in low power mode (LPM).
Enable this interrupt in USBCMD register only when wakeup gpio IRQ is
not available.

CRs-Fixed: 444883
Change-Id: I8f68fa63c1c086990ff429cd1224e14a1d34654b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
usb: host: read bus scaling parameters for HSIC host

Use a bus scaling device tree parameters for the HSIC host node.

Change-Id: I93f57400c6a2a4da2634b50fd67f2d6015eab9c2
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
usb: ehci-msm-hsic: Restore CMD_RUN bit in ehci->command after resume

EHCI driver maintains a copy of USB_CMD contents in ehci->command
variable.  CMD_RUN bit is cleared from this variable to delay SOF
till port is resumed. Restore this bit back in ehci->command after
resume is completed otherwise ehci driver may later use stale
ehci->command value to update USB_CMD register clearing CMD_RUN bit.

Change-Id: I672aa14140f44a8de8757d84fe2305693da18130
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
EHCI: HSIC: fix driver removal function for msm_hsic_host

Upon driver removal function we need to disable the device pm runtime
in order to, first, undo all the logic done in probe and second, to keep
balanced disable depth counter in case of platform driver unbind.

However the removal function can be called also in consequences of
platform_device_del(), in this case the platform device was already
disabled and removed so if we call pm_runtime_disable() again we
decrease the disable_depth for the second time causing for unbalanced
counter.

Therefore we use an if statement to check if the device was already
removed or not.

CRs-Fixed: 445674
Change-Id: I5ff6b20d0f8e811a5c673903ca340f7bcc2e2d78
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
msm: msm_bus: Add device tree support for bus scaling clients

This patch enables clients to specify vectors in device tree
format. Clients will no longer need to specify vectors in
the boards file. Instead, they can add the bus-scaling
related data to their own device-nodes.
The clients can then call an API exposed by the bus driver
which will build the pdata out of those strings.
The registration process using pdata remains unchanged.

Change-Id: I1bba645d031e2cd822f16d8edcdf926a0418618c
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Merge remote-tracking branch 'hsic/jb-hsic' into 4.2.2-touch-hsic