diff options
author | Li Jun <B47624@freescale.com> | 2014-04-08 10:04:35 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 12:02:37 -0400 |
commit | a34bc8dd0b5d740832e756b175d69473b97887e7 (patch) | |
tree | 523b3d03dd1bb8dca6fe126b321549e1cc13062d /drivers/usb/chipidea/otg_fsm.c | |
parent | 69dc55ea263ed13ef0c1a139cb250f0085f0aca0 (diff) |
ENGR00307558-12 usb: chipidea: udc: usb charger handling when otg fsm mode
This patch adds usb charger notify condition when usb otg fsm
is enabled, do not do charger notify when doing role switch.
Signed-off-by: Li Jun <b47624@freescale.com>
Diffstat (limited to 'drivers/usb/chipidea/otg_fsm.c')
-rw-r--r-- | drivers/usb/chipidea/otg_fsm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index fff809ca3a18..028f7687ad29 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c | |||
@@ -592,10 +592,18 @@ int ci_otg_fsm_work(struct ci_hdrc *ci) | |||
592 | /* | 592 | /* |
593 | * Don't do fsm transition for B device | 593 | * Don't do fsm transition for B device |
594 | * when there is no gadget class driver | 594 | * when there is no gadget class driver |
595 | * only handle charger notify | ||
595 | */ | 596 | */ |
596 | if (ci->fsm.id && !(ci->driver) && | 597 | if (ci->fsm.id && !(ci->driver) && |
597 | ci->transceiver->state < OTG_STATE_A_IDLE) | 598 | ci->transceiver->state < OTG_STATE_A_IDLE) { |
599 | if (ci->b_sess_valid_event) { | ||
600 | if (ci->fsm.b_sess_vld) | ||
601 | usb_gadget_vbus_connect(&ci->gadget); | ||
602 | else | ||
603 | usb_gadget_vbus_disconnect(&ci->gadget); | ||
604 | } | ||
598 | return 0; | 605 | return 0; |
606 | } | ||
599 | 607 | ||
600 | if (otg_statemachine(&ci->fsm)) { | 608 | if (otg_statemachine(&ci->fsm)) { |
601 | if (ci->transceiver->state == OTG_STATE_A_IDLE) { | 609 | if (ci->transceiver->state == OTG_STATE_A_IDLE) { |
@@ -764,6 +772,7 @@ irqreturn_t ci_otg_fsm_irq(struct ci_hdrc *ci) | |||
764 | } | 772 | } |
765 | } else if (otg_int_src & OTGSC_BSVIS) { | 773 | } else if (otg_int_src & OTGSC_BSVIS) { |
766 | hw_write_otgsc(ci, OTGSC_BSVIS, OTGSC_BSVIS); | 774 | hw_write_otgsc(ci, OTGSC_BSVIS, OTGSC_BSVIS); |
775 | ci->b_sess_valid_event = true; | ||
767 | if (otgsc & OTGSC_BSV) { | 776 | if (otgsc & OTGSC_BSV) { |
768 | fsm->b_sess_vld = 1; | 777 | fsm->b_sess_vld = 1; |
769 | ci_otg_del_timer(ci, B_SSEND_SRP); | 778 | ci_otg_del_timer(ci, B_SSEND_SRP); |