summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-09-15 14:47:20 +0530
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 16:12:38 +0200
commit2a10ab01c0728fe7a610c9018e0976808ab683ae (patch)
tree5ac4fe957b13c4720e2fd31f497ed05b854e827f
parent3b4e628413cd4464eb491357d2305ac36cc3941d (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.c25
1 files 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;