diff options
author | rajaram <rajaram.ragupathy@stericsson.com> | 2011-10-28 11:46:46 +0530 |
---|---|---|
committer | Rabin VINCENT <rabin.vincent@stericsson.com> | 2011-10-28 08:22:54 +0200 |
commit | 8f62dad11b54cbbaba8d9e88411713a5d3fdee58 (patch) | |
tree | 80f3402e36be20511d17398df359eb9610fc8f11 | |
parent | 44339f688810651ad64b30ac54d42aa34a0c495b (diff) |
u8500 : USB :New notification events for BatMan
Added notification events for ACA cases so that
battery manager can distinguish between Standard Host and
ACA charger.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 362951
ST-Ericsson FOSS-OUT ID: Trivial
Signed-off-by: rajaram <rajaram.ragupathy@stericsson.com>
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Change-Id: I02a19bced97b408990d8effb785418bf182ac27b
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34862
Tested-by: Rajaram REGUPATHY <ragupathy.rajaram@stericsson.com>
Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
-rw-r--r-- | drivers/usb/musb/ux500.c | 1 | ||||
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 23 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 3 |
3 files changed, 18 insertions, 9 deletions
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index d0bfd2ffdc9..bae06ec7d67 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -225,6 +225,7 @@ static int musb_otg_notifications(struct notifier_block *nb, switch (event) { case USB_EVENT_ID: + case USB_EVENT_RIDA: dev_dbg(musb->controller, "ID GND\n"); if (is_otg_enabled(musb)) { ux500_musb_set_vbus(musb, 1); diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index 34aef32e104..19446ba114d 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -317,10 +317,11 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) lsts = (reg >> 3) & 0x0F; switch (lsts) { + case USB_LINK_ACA_RID_B: + event = USB_EVENT_RIDB; 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) @@ -328,18 +329,19 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) ab->mode = USB_IDLE; ab->otg.default_a = false; ab->vbus_draw = 0; - event = USB_EVENT_NONE; + if (event != USB_EVENT_RIDB) + event = USB_EVENT_NONE; break; - + case USB_LINK_ACA_RID_C_NM: + case USB_LINK_ACA_RID_C_HS: + case USB_LINK_ACA_RID_C_HS_CHIRP: + event = USB_EVENT_RIDC; case USB_LINK_STD_HOST_NC: case USB_LINK_STD_HOST_C_NS: case USB_LINK_STD_HOST_C_S: case USB_LINK_HOST_CHG_NM: case USB_LINK_HOST_CHG_HS: case USB_LINK_HOST_CHG_HS_CHIRP: - 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); @@ -351,11 +353,13 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) ux500_restore_context(); ab8500_usb_peri_phy_en(ab); } - event = USB_EVENT_VBUS; + if (event != USB_EVENT_RIDC) + event = USB_EVENT_VBUS; break; - case USB_LINK_HM_IDGND: case USB_LINK_ACA_RID_A: + event = USB_EVENT_RIDA; + case USB_LINK_HM_IDGND: if (ab->mode == USB_PERIPHERAL) { ab->mode = USB_HOST; ab8500_usb_peri_phy_dis(ab); @@ -368,7 +372,8 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab) ab8500_usb_host_phy_en(ab); } ab->otg.default_a = true; - event = USB_EVENT_ID; + if (event != USB_EVENT_RIDA) + event = USB_EVENT_ID; break; case USB_LINK_DEDICATED_CHG: diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index d87f44f5b04..010b40d1b52 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -41,6 +41,9 @@ enum usb_xceiv_events { USB_EVENT_ID, /* id was grounded */ USB_EVENT_CHARGER, /* usb dedicated charger */ USB_EVENT_ENUMERATED, /* gadget driver enumerated */ + USB_EVENT_RIDA, + USB_EVENT_RIDB, + USB_EVENT_RIDC, }; struct otg_transceiver; |