diff options
author | Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> | 2011-09-15 14:47:20 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:03:08 +0200 |
commit | c4947d9f3516df71e776ff25531472e737eba3c0 (patch) | |
tree | f20d573c2cb988fce525e1b8fcac8346d2bc74fa | |
parent | 212f06b70a02881a4f5f87f9905784806c80da06 (diff) |
ux500: musb: Add support for Accessory Charging Adaptor
ACA will allow simultanious connection to a host/device accessory along
with dedicated charger using a single USB port on the platform.
ST-Ericsson ID: WP 265141
ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10160
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: dushyanth.sr <dushyanth.sr@stericsson.com>
Change-Id: I934ff2a4775661e2a4894da6e49360060e0fa011
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31035
Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index 13fbabacbc8..a47bce1d776 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -294,6 +294,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) case USB_LINK_NOT_CONFIGURED: case USB_LINK_RESERVED: case USB_LINK_NOT_VALID_LINK: + case USB_LINK_ACA_RID_B: if (ab->mode == USB_HOST) ab8500_usb_host_phy_dis(ab); else if (ab->mode == USB_PERIPHERAL) @@ -310,29 +311,36 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) case USB_LINK_HOST_CHG_NM: case USB_LINK_HOST_CHG_HS: case USB_LINK_HOST_CHG_HS_CHIRP: - if (ab->phy.otg->gadget) { - /* TODO: Enable regulators. */ + case USB_LINK_ACA_RID_C_NM: + case USB_LINK_ACA_RID_C_HS: + case USB_LINK_ACA_RID_C_HS_CHIRP: + if (ab->mode == USB_HOST) { + ab->mode = USB_PERIPHERAL; + ab8500_usb_host_phy_dis(ab); ab8500_usb_peri_phy_en(ab); + } + if (ab->mode == USB_IDLE) { ab->mode = USB_PERIPHERAL; + ab8500_usb_peri_phy_en(ab); } event = USB_EVENT_VBUS; break; case USB_LINK_HM_IDGND: - if (ab->phy.otg->host) { + case USB_LINK_ACA_RID_A: + if (ab->mode == USB_PERIPHERAL) { + ab->mode = USB_HOST; + ab8500_usb_peri_phy_dis(ab); ab8500_usb_host_phy_en(ab); + } + if (ab->mode == USB_IDLE) { ab->mode = USB_HOST; + ab8500_usb_host_phy_en(ab); } ab->phy.otg->default_a = true; event = USB_EVENT_ID; break; - case USB_LINK_ACA_RID_A: - case USB_LINK_ACA_RID_B: - /* TODO */ - case USB_LINK_ACA_RID_C_NM: - case USB_LINK_ACA_RID_C_HS: - case USB_LINK_ACA_RID_C_HS_CHIRP: case USB_LINK_DEDICATED_CHG: /* TODO: vbus_draw */ ab->mode = USB_DEDICATED_CHG; |