Lines Matching refs:otg_ctrl
90 otg_ctrl.timer[A_WAIT_BCON_TIMER]); in mv_otg_timer_await_bcon()
92 mvotg->otg_ctrl.a_wait_bcon_timeout = 1; in mv_otg_timer_await_bcon()
109 timer = &mvotg->otg_ctrl.timer[id]; in mv_otg_cancel_timer()
125 timer = &mvotg->otg_ctrl.timer[id]; in mv_otg_set_timer()
290 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; in mv_otg_update_inputs() local
297 otg_ctrl->b_sess_vld = 1; in mv_otg_update_inputs()
298 otg_ctrl->b_sess_end = 0; in mv_otg_update_inputs()
300 otg_ctrl->b_sess_vld = 0; in mv_otg_update_inputs()
301 otg_ctrl->b_sess_end = 1; in mv_otg_update_inputs()
304 otg_ctrl->b_sess_vld = !!(otgsc & OTGSC_STS_B_SESSION_VALID); in mv_otg_update_inputs()
305 otg_ctrl->b_sess_end = !!(otgsc & OTGSC_STS_B_SESSION_END); in mv_otg_update_inputs()
309 otg_ctrl->id = !!mvotg->pdata->id->poll(); in mv_otg_update_inputs()
311 otg_ctrl->id = !!(otgsc & OTGSC_STS_USB_ID); in mv_otg_update_inputs()
313 if (mvotg->pdata->otg_force_a_bus_req && !otg_ctrl->id) in mv_otg_update_inputs()
314 otg_ctrl->a_bus_req = 1; in mv_otg_update_inputs()
316 otg_ctrl->a_sess_vld = !!(otgsc & OTGSC_STS_A_SESSION_VALID); in mv_otg_update_inputs()
317 otg_ctrl->a_vbus_vld = !!(otgsc & OTGSC_STS_A_VBUS_VALID); in mv_otg_update_inputs()
320 dev_dbg(&mvotg->pdev->dev, "id %d\n", otg_ctrl->id); in mv_otg_update_inputs()
321 dev_dbg(&mvotg->pdev->dev, "b_sess_vld %d\n", otg_ctrl->b_sess_vld); in mv_otg_update_inputs()
322 dev_dbg(&mvotg->pdev->dev, "b_sess_end %d\n", otg_ctrl->b_sess_end); in mv_otg_update_inputs()
323 dev_dbg(&mvotg->pdev->dev, "a_vbus_vld %d\n", otg_ctrl->a_vbus_vld); in mv_otg_update_inputs()
324 dev_dbg(&mvotg->pdev->dev, "a_sess_vld %d\n", otg_ctrl->a_sess_vld); in mv_otg_update_inputs()
329 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; in mv_otg_update_state() local
337 if (otg_ctrl->id == 0) in mv_otg_update_state()
339 else if (otg_ctrl->b_sess_vld) in mv_otg_update_state()
343 if (!otg_ctrl->b_sess_vld || otg_ctrl->id == 0) in mv_otg_update_state()
347 if (otg_ctrl->id) in mv_otg_update_state()
349 else if (!(otg_ctrl->a_bus_drop) && in mv_otg_update_state()
350 (otg_ctrl->a_bus_req || otg_ctrl->a_srp_det)) in mv_otg_update_state()
354 if (otg_ctrl->a_vbus_vld) in mv_otg_update_state()
358 if (otg_ctrl->id || otg_ctrl->a_bus_drop in mv_otg_update_state()
359 || otg_ctrl->a_wait_bcon_timeout) { in mv_otg_update_state()
361 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
363 otg_ctrl->a_bus_req = 0; in mv_otg_update_state()
364 } else if (!otg_ctrl->a_vbus_vld) { in mv_otg_update_state()
366 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
368 } else if (otg_ctrl->b_conn) { in mv_otg_update_state()
370 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
375 if (otg_ctrl->id || !otg_ctrl->b_conn in mv_otg_update_state()
376 || otg_ctrl->a_bus_drop) in mv_otg_update_state()
378 else if (!otg_ctrl->a_vbus_vld) in mv_otg_update_state()
382 if (otg_ctrl->id in mv_otg_update_state()
383 || (!otg_ctrl->b_conn && otg_ctrl->a_sess_vld) in mv_otg_update_state()
384 || otg_ctrl->a_bus_req) in mv_otg_update_state()
388 if (otg_ctrl->id || otg_ctrl->a_clr_err in mv_otg_update_state()
389 || otg_ctrl->a_bus_drop) { in mv_otg_update_state()
390 otg_ctrl->a_clr_err = 0; in mv_otg_update_state()
456 mvotg->otg_ctrl.b_conn = 1; in mv_otg_work()
465 mvotg->otg_ctrl.b_conn = 0; in mv_otg_work()
522 mvotg->otg_ctrl.a_bus_req); in a_bus_req_show()
544 mvotg->otg_ctrl.a_bus_req = 1; in a_bus_req_store()
545 mvotg->otg_ctrl.a_bus_drop = 0; in a_bus_req_store()
572 mvotg->otg_ctrl.a_clr_err = 1; in a_clr_err_store()
593 mvotg->otg_ctrl.a_bus_drop); in a_bus_drop_show()
608 mvotg->otg_ctrl.a_bus_drop = 0; in a_bus_drop_store()
612 mvotg->otg_ctrl.a_bus_drop = 1; in a_bus_drop_store()
613 mvotg->otg_ctrl.a_bus_req = 0; in a_bus_drop_store()
714 timer_setup(&mvotg->otg_ctrl.timer[i], in mv_otg_probe()