diff options
author | Li Jun <b47624@freescale.com> | 2014-06-23 07:51:42 -0400 |
---|---|---|
committer | Li Jun <B47624@freescale.com> | 2014-06-26 04:50:52 -0400 |
commit | 5ea815dad0466b672908b5798b586508a66c6a64 (patch) | |
tree | 1fdf89c83d42960b154420842254f41e51a29c8e /drivers/usb/chipidea/otg_fsm.c | |
parent | f3dd2721c55fe5777ee2ba1e8c8317058a24173f (diff) |
ENGR00319720-7 usb: chipidea: otg_fsm: set host request flag via sys input
This patch sets host request flag with sys input when a A device
sets a_bus_req or a B device sets b_bus_req as peripheral role.
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 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 59454bfadf06..a30e2bf25ef9 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c | |||
@@ -82,6 +82,11 @@ set_a_bus_req(struct device *dev, struct device_attribute *attr, | |||
82 | return count; | 82 | return count; |
83 | } | 83 | } |
84 | ci->fsm.a_bus_req = 1; | 84 | ci->fsm.a_bus_req = 1; |
85 | if (ci->transceiver->state == OTG_STATE_A_PERIPHERAL) { | ||
86 | ci->gadget.host_request_flag = 1; | ||
87 | mutex_unlock(&ci->fsm.lock); | ||
88 | return count; | ||
89 | } | ||
85 | } | 90 | } |
86 | 91 | ||
87 | ci_otg_queue_work(ci); | 92 | ci_otg_queue_work(ci); |
@@ -160,8 +165,14 @@ set_b_bus_req(struct device *dev, struct device_attribute *attr, | |||
160 | mutex_lock(&ci->fsm.lock); | 165 | mutex_lock(&ci->fsm.lock); |
161 | if (buf[0] == '0') | 166 | if (buf[0] == '0') |
162 | ci->fsm.b_bus_req = 0; | 167 | ci->fsm.b_bus_req = 0; |
163 | else if (buf[0] == '1') | 168 | else if (buf[0] == '1') { |
164 | ci->fsm.b_bus_req = 1; | 169 | ci->fsm.b_bus_req = 1; |
170 | if (ci->transceiver->state == OTG_STATE_B_PERIPHERAL) { | ||
171 | ci->gadget.host_request_flag = 1; | ||
172 | mutex_unlock(&ci->fsm.lock); | ||
173 | return count; | ||
174 | } | ||
175 | } | ||
165 | 176 | ||
166 | ci_otg_queue_work(ci); | 177 | ci_otg_queue_work(ci); |
167 | mutex_unlock(&ci->fsm.lock); | 178 | mutex_unlock(&ci->fsm.lock); |