aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Jun <b47624@freescale.com>2014-05-16 15:15:34 -0400
committerLi Jun <B47624@freescale.com>2014-06-26 04:49:55 -0400
commite4f6fd0ec67b34ca9ed40dfd009e75c66fb71d94 (patch)
tree74205bae90f37ea0315c2b56cad66c8c52ae5790
parentc2df0104f56d83b9bdc06e350358dc4cdffa87df (diff)
ENGR00319720-2 usb: common: otg-fsm: start HNP polling timer in host state
This patch starts HNP polling timer when otg is set to be a_host or b_host. Signed-off-by: Li Jun <b47624@freescale.com>
-rw-r--r--drivers/usb/common/usb-otg-fsm.c2
-rw-r--r--include/linux/usb/otg-fsm.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index f51dc5e9a23b..adea774c8cac 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -169,6 +169,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
169 otg_set_protocol(fsm, PROTO_HOST); 169 otg_set_protocol(fsm, PROTO_HOST);
170 usb_bus_start_enum(fsm->otg->host, 170 usb_bus_start_enum(fsm->otg->host,
171 fsm->otg->host->otg_port); 171 fsm->otg->host->otg_port);
172 otg_add_timer(fsm, HNP_POLLING);
172 break; 173 break;
173 case OTG_STATE_A_IDLE: 174 case OTG_STATE_A_IDLE:
174 otg_drv_vbus(fsm, 0); 175 otg_drv_vbus(fsm, 0);
@@ -203,6 +204,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
203 */ 204 */
204 if (!fsm->a_bus_req || fsm->a_suspend_req_inf) 205 if (!fsm->a_bus_req || fsm->a_suspend_req_inf)
205 otg_add_timer(fsm, A_WAIT_ENUM); 206 otg_add_timer(fsm, A_WAIT_ENUM);
207 otg_add_timer(fsm, HNP_POLLING);
206 break; 208 break;
207 case OTG_STATE_A_SUSPEND: 209 case OTG_STATE_A_SUSPEND:
208 otg_drv_vbus(fsm, 1); 210 otg_drv_vbus(fsm, 1);
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
index b6ba1bfb86f2..1deea98838b2 100644
--- a/include/linux/usb/otg-fsm.h
+++ b/include/linux/usb/otg-fsm.h
@@ -1,4 +1,4 @@
1/* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. 1/* Copyright (C) 2007-2014 Freescale Semiconductor, Inc.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify it 3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the 4 * under the terms of the GNU General Public License as published by the
@@ -53,6 +53,7 @@ enum otg_fsm_timer {
53 B_SE0_SRP, 53 B_SE0_SRP,
54 B_SRP_FAIL, 54 B_SRP_FAIL,
55 A_WAIT_ENUM, 55 A_WAIT_ENUM,
56 HNP_POLLING,
56 57
57 NUM_OTG_FSM_TIMERS, 58 NUM_OTG_FSM_TIMERS,
58}; 59};