From 2a10ab01c0728fe7a610c9018e0976808ab683ae Mon Sep 17 00:00:00 2001 From: Sakethram Bommisetti Date: Thu, 15 Sep 2011 14:47:20 +0530 Subject: 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 Signed-off-by: dushyanth.sr Change-Id: I934ff2a4775661e2a4894da6e49360060e0fa011 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31035 Reviewed-by: Praveena NADAHALLY --- drivers/usb/otg/ab8500-usb.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index 995fcedb9e5..8b9986ffb61 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -299,6 +299,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) @@ -315,28 +316,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->otg.gadget) { + 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->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->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; -- cgit v1.2.3