Lines Matching +full:local +full:- +full:timers

1 // SPDX-License-Identifier: GPL-2.0+
18 * Table:6-4
23 * Table:6-5
29 /* Standard OTG timers */
38 /* Auxiliary timers */
49 * struct otg_fsm - OTG state machine according to the OTG spec
54 * @id: TRUE for B-device, FALSE for A-device.
56 * ADP measurement taken at n-2, differs by more than CADP_THR
60 * A-Device state inputs
61 * @a_srp_det: TRUE if the A-device detects SRP
63 * @b_conn: TRUE if the A-device detects connection from the B-device
64 * @a_bus_resume: TRUE when the B-device detects that the A-device is signaling
66 * B-Device state inputs
67 * @a_bus_suspend: TRUE when the B-device detects that the A-device has put the
69 * @a_conn: TRUE if the B-device detects a connection from the A-device
74 * @b_sess_vld: TRUE when the B-device detects that the voltage on VBUS is
76 * @test_device: TRUE when the B-device switches to B-Host and detects an OTG
79 * Application inputs (A-Device)
80 * @a_bus_drop: TRUE when A-device application needs to power down the bus
81 * @a_bus_req: TRUE when A-device application wants to use the bus.
84 * Application inputs (B-Device)
86 * B-device wants to use the bus
89 * @a_sess_vld: TRUE if the A-device detects that VBUS is above VA_SESS_VLD
90 * @b_bus_suspend: TRUE when the A-device detects that the B-device has put
92 * @b_bus_resume: TRUE when the A-device detects that the B-device is signaling
99 * @drv_vbus: TRUE when A-device is driving VBUS
100 * @loc_conn: TRUE when the local device has signaled that it is connected
102 * @loc_sof: TRUE when the local device is generating activity on the bus
103 * @adp_prb: TRUE when the local device is in the process of doing
106 * Outputs for B-device state
107 * @adp_sns: TRUE when the B-device is in the process of carrying out
109 * @data_pulse: TRUE when the B-device is performing data line pulsing
113 * a_set_b_hnp_en: TRUE when the A-device has successfully set the
114 * b_hnp_enable bit in the B-device.
115 * Unused as OTG fsm uses otg->host->b_hnp_enable instead
116 * b_srp_done: TRUE when the B-device has completed initiating SRP
117 * b_hnp_enable: TRUE when the B-device has accepted the
118 * SetFeature(b_hnp_enable) B-device.
119 * Unused as OTG fsm uses otg->gadget->b_hnp_enable instead
121 * overcurrent condition and causes the A-device to transition
170 /* Timeout indicator for timers */
207 if (!fsm->ops->chrg_vbus) in otg_chrg_vbus()
208 return -EOPNOTSUPP; in otg_chrg_vbus()
209 fsm->ops->chrg_vbus(fsm, on); in otg_chrg_vbus()
215 if (!fsm->ops->drv_vbus) in otg_drv_vbus()
216 return -EOPNOTSUPP; in otg_drv_vbus()
217 if (fsm->drv_vbus != on) { in otg_drv_vbus()
218 fsm->drv_vbus = on; in otg_drv_vbus()
219 fsm->ops->drv_vbus(fsm, on); in otg_drv_vbus()
226 if (!fsm->ops->loc_conn) in otg_loc_conn()
227 return -EOPNOTSUPP; in otg_loc_conn()
228 if (fsm->loc_conn != on) { in otg_loc_conn()
229 fsm->loc_conn = on; in otg_loc_conn()
230 fsm->ops->loc_conn(fsm, on); in otg_loc_conn()
237 if (!fsm->ops->loc_sof) in otg_loc_sof()
238 return -EOPNOTSUPP; in otg_loc_sof()
239 if (fsm->loc_sof != on) { in otg_loc_sof()
240 fsm->loc_sof = on; in otg_loc_sof()
241 fsm->ops->loc_sof(fsm, on); in otg_loc_sof()
248 if (!fsm->ops->start_pulse) in otg_start_pulse()
249 return -EOPNOTSUPP; in otg_start_pulse()
250 if (!fsm->data_pulse) { in otg_start_pulse()
251 fsm->data_pulse = 1; in otg_start_pulse()
252 fsm->ops->start_pulse(fsm); in otg_start_pulse()
259 if (!fsm->ops->start_adp_prb) in otg_start_adp_prb()
260 return -EOPNOTSUPP; in otg_start_adp_prb()
261 if (!fsm->adp_prb) { in otg_start_adp_prb()
262 fsm->adp_sns = 0; in otg_start_adp_prb()
263 fsm->adp_prb = 1; in otg_start_adp_prb()
264 fsm->ops->start_adp_prb(fsm); in otg_start_adp_prb()
271 if (!fsm->ops->start_adp_sns) in otg_start_adp_sns()
272 return -EOPNOTSUPP; in otg_start_adp_sns()
273 if (!fsm->adp_sns) { in otg_start_adp_sns()
274 fsm->adp_sns = 1; in otg_start_adp_sns()
275 fsm->ops->start_adp_sns(fsm); in otg_start_adp_sns()
282 if (!fsm->ops->add_timer) in otg_add_timer()
283 return -EOPNOTSUPP; in otg_add_timer()
284 fsm->ops->add_timer(fsm, timer); in otg_add_timer()
290 if (!fsm->ops->del_timer) in otg_del_timer()
291 return -EOPNOTSUPP; in otg_del_timer()
292 fsm->ops->del_timer(fsm, timer); in otg_del_timer()
298 if (!fsm->ops->start_host) in otg_start_host()
299 return -EOPNOTSUPP; in otg_start_host()
300 return fsm->ops->start_host(fsm, on); in otg_start_host()
305 if (!fsm->ops->start_gadget) in otg_start_gadget()
306 return -EOPNOTSUPP; in otg_start_gadget()
307 return fsm->ops->start_gadget(fsm, on); in otg_start_gadget()