USB: msm_otg: Notify the charger type early

The current code notify the charger type to power supply driver
only after the amount of avaialble current is determined.  If
we are attached to Host PC, this is delayed till host sends
set config request.  Instead notify the charger type once the
charger is determined.

CRs-Fixed: 441014
Change-Id: Ieb126ae8106ed1b0433c3d756d473e37cb55cdca
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
usb: otg: Add delay between ASSERT and DEASSERT in clock reset

If target dont have phy_reset_clk , there is no waiting between
link_clk_reset assert and deassert, which cause the reset to fail.
10 useconds waiting is added.

Change-Id: I34a94710767a3e7bf6b48d28c917129bc9d9767f
Signed-off-by: Bar Weiner <bweiner@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
usb: otg: Increase delay for asserting controller reset

This change increases delay from 10 usecs, which is
the min value recommended by HW designers, to 100 usecs.
This is required since in some cases, using the minimal
value proved not to reset the controller correctly to POR
registers values.

Change-Id: I192e12ac0c750b37d04ce494ba7a6a23eea7164d
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
usb: msm_otg: add charger detection for floated D+ and D-

Floated charger means "D+/D- floated charger". According batt
charging spec 1.2, during primary detection, the DP voltage
is VDP_SRC, DM voltage may not exceed VDAT_REF, it's same to
standard downstream port(SDP). Introducing data contact
detection(DCD) here to distinguish between SDP and floated
charger. If DCD detected, it's SDP, otherwise floated charger
is detected.

Change-Id: Id7655f7209408092da84a09e3ab6f5c5a764ef78
Signed-off-by: zhenhuah <zhenhuah@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>

Conflicts:
	drivers/usb/otg/msm_otg.c
USB: msm_otg: Fix a bug in charger detection procedure

USB PHY is put into non-driving mode and pull-down resistors on DP
and DM are disabled before starting the charger detection.  The
PHY is put into driving mode at the end of the charger detection
without enabling the pull-down resistors.  Due to this DP is
pulled high when a dedicated charger is connected.  USB controller
is not allowing PHY suspend if line state is non-zero when charger
is connected.  Enable pull-down resistors at the end of charger
detection to resolve this issue.

CRs-Fixed: 509608
Change-Id: Ic1fc663b397e29e62d526b4146e92c93c84240ac
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
msm: enable floating charger support by default

Change-Id: Ic04f3d56b3f15f55ec9a9ff7949381a69c5e830a
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>