mvotg              53 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = container_of(otg->usb_phy, struct mv_otg, phy);
mvotg              54 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->set_vbus == NULL)
mvotg              57 drivers/usb/phy/phy-mv-usb.c 	return mvotg->pdata->set_vbus(on);
mvotg              76 drivers/usb/phy/phy-mv-usb.c static void mv_otg_run_state_machine(struct mv_otg *mvotg,
mvotg              79 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "transceiver is updated\n");
mvotg              80 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->qwork)
mvotg              83 drivers/usb/phy/phy-mv-usb.c 	queue_delayed_work(mvotg->qwork, &mvotg->work, delay);
mvotg              88 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = from_timer(mvotg, t,
mvotg              91 drivers/usb/phy/phy-mv-usb.c 	mvotg->otg_ctrl.a_wait_bcon_timeout = 1;
mvotg              93 drivers/usb/phy/phy-mv-usb.c 	dev_info(&mvotg->pdev->dev, "B Device No Response!\n");
mvotg              95 drivers/usb/phy/phy-mv-usb.c 	if (spin_trylock(&mvotg->wq_lock)) {
mvotg              96 drivers/usb/phy/phy-mv-usb.c 		mv_otg_run_state_machine(mvotg, 0);
mvotg              97 drivers/usb/phy/phy-mv-usb.c 		spin_unlock(&mvotg->wq_lock);
mvotg             101 drivers/usb/phy/phy-mv-usb.c static int mv_otg_cancel_timer(struct mv_otg *mvotg, unsigned int id)
mvotg             108 drivers/usb/phy/phy-mv-usb.c 	timer = &mvotg->otg_ctrl.timer[id];
mvotg             116 drivers/usb/phy/phy-mv-usb.c static int mv_otg_set_timer(struct mv_otg *mvotg, unsigned int id,
mvotg             124 drivers/usb/phy/phy-mv-usb.c 	timer = &mvotg->otg_ctrl.timer[id];
mvotg             126 drivers/usb/phy/phy-mv-usb.c 		dev_err(&mvotg->pdev->dev, "Timer%d is already running\n", id);
mvotg             136 drivers/usb/phy/phy-mv-usb.c static int mv_otg_reset(struct mv_otg *mvotg)
mvotg             142 drivers/usb/phy/phy-mv-usb.c 	tmp = readl(&mvotg->op_regs->usbcmd);
mvotg             144 drivers/usb/phy/phy-mv-usb.c 	writel(tmp, &mvotg->op_regs->usbcmd);
mvotg             147 drivers/usb/phy/phy-mv-usb.c 	writel(USBCMD_CTRL_RESET, &mvotg->op_regs->usbcmd);
mvotg             150 drivers/usb/phy/phy-mv-usb.c 	while (readl(&mvotg->op_regs->usbcmd) & USBCMD_CTRL_RESET) {
mvotg             152 drivers/usb/phy/phy-mv-usb.c 			dev_err(&mvotg->pdev->dev,
mvotg             160 drivers/usb/phy/phy-mv-usb.c 	writel(0x0, &mvotg->op_regs->usbintr);
mvotg             161 drivers/usb/phy/phy-mv-usb.c 	tmp = readl(&mvotg->op_regs->usbsts);
mvotg             162 drivers/usb/phy/phy-mv-usb.c 	writel(tmp, &mvotg->op_regs->usbsts);
mvotg             167 drivers/usb/phy/phy-mv-usb.c static void mv_otg_init_irq(struct mv_otg *mvotg)
mvotg             171 drivers/usb/phy/phy-mv-usb.c 	mvotg->irq_en = OTGSC_INTR_A_SESSION_VALID
mvotg             173 drivers/usb/phy/phy-mv-usb.c 	mvotg->irq_status = OTGSC_INTSTS_A_SESSION_VALID
mvotg             176 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->vbus == NULL) {
mvotg             177 drivers/usb/phy/phy-mv-usb.c 		mvotg->irq_en |= OTGSC_INTR_B_SESSION_VALID
mvotg             179 drivers/usb/phy/phy-mv-usb.c 		mvotg->irq_status |= OTGSC_INTSTS_B_SESSION_VALID
mvotg             183 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->id == NULL) {
mvotg             184 drivers/usb/phy/phy-mv-usb.c 		mvotg->irq_en |= OTGSC_INTR_USB_ID;
mvotg             185 drivers/usb/phy/phy-mv-usb.c 		mvotg->irq_status |= OTGSC_INTSTS_USB_ID;
mvotg             188 drivers/usb/phy/phy-mv-usb.c 	otgsc = readl(&mvotg->op_regs->otgsc);
mvotg             189 drivers/usb/phy/phy-mv-usb.c 	otgsc |= mvotg->irq_en;
mvotg             190 drivers/usb/phy/phy-mv-usb.c 	writel(otgsc, &mvotg->op_regs->otgsc);
mvotg             193 drivers/usb/phy/phy-mv-usb.c static void mv_otg_start_host(struct mv_otg *mvotg, int on)
mvotg             196 drivers/usb/phy/phy-mv-usb.c 	struct usb_otg *otg = mvotg->phy.otg;
mvotg             202 drivers/usb/phy/phy-mv-usb.c 	dev_info(&mvotg->pdev->dev, "%s host\n", on ? "start" : "stop");
mvotg             215 drivers/usb/phy/phy-mv-usb.c static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)
mvotg             217 drivers/usb/phy/phy-mv-usb.c 	struct usb_otg *otg = mvotg->phy.otg;
mvotg             222 drivers/usb/phy/phy-mv-usb.c 	dev_info(mvotg->phy.dev, "gadget %s\n", on ? "on" : "off");
mvotg             230 drivers/usb/phy/phy-mv-usb.c static void otg_clock_enable(struct mv_otg *mvotg)
mvotg             232 drivers/usb/phy/phy-mv-usb.c 	clk_prepare_enable(mvotg->clk);
mvotg             235 drivers/usb/phy/phy-mv-usb.c static void otg_clock_disable(struct mv_otg *mvotg)
mvotg             237 drivers/usb/phy/phy-mv-usb.c 	clk_disable_unprepare(mvotg->clk);
mvotg             240 drivers/usb/phy/phy-mv-usb.c static int mv_otg_enable_internal(struct mv_otg *mvotg)
mvotg             244 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->active)
mvotg             247 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "otg enabled\n");
mvotg             249 drivers/usb/phy/phy-mv-usb.c 	otg_clock_enable(mvotg);
mvotg             250 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->phy_init) {
mvotg             251 drivers/usb/phy/phy-mv-usb.c 		retval = mvotg->pdata->phy_init(mvotg->phy_regs);
mvotg             253 drivers/usb/phy/phy-mv-usb.c 			dev_err(&mvotg->pdev->dev,
mvotg             255 drivers/usb/phy/phy-mv-usb.c 			otg_clock_disable(mvotg);
mvotg             259 drivers/usb/phy/phy-mv-usb.c 	mvotg->active = 1;
mvotg             265 drivers/usb/phy/phy-mv-usb.c static int mv_otg_enable(struct mv_otg *mvotg)
mvotg             267 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->clock_gating)
mvotg             268 drivers/usb/phy/phy-mv-usb.c 		return mv_otg_enable_internal(mvotg);
mvotg             273 drivers/usb/phy/phy-mv-usb.c static void mv_otg_disable_internal(struct mv_otg *mvotg)
mvotg             275 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->active) {
mvotg             276 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev, "otg disabled\n");
mvotg             277 drivers/usb/phy/phy-mv-usb.c 		if (mvotg->pdata->phy_deinit)
mvotg             278 drivers/usb/phy/phy-mv-usb.c 			mvotg->pdata->phy_deinit(mvotg->phy_regs);
mvotg             279 drivers/usb/phy/phy-mv-usb.c 		otg_clock_disable(mvotg);
mvotg             280 drivers/usb/phy/phy-mv-usb.c 		mvotg->active = 0;
mvotg             284 drivers/usb/phy/phy-mv-usb.c static void mv_otg_disable(struct mv_otg *mvotg)
mvotg             286 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->clock_gating)
mvotg             287 drivers/usb/phy/phy-mv-usb.c 		mv_otg_disable_internal(mvotg);
mvotg             290 drivers/usb/phy/phy-mv-usb.c static void mv_otg_update_inputs(struct mv_otg *mvotg)
mvotg             292 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
mvotg             295 drivers/usb/phy/phy-mv-usb.c 	otgsc = readl(&mvotg->op_regs->otgsc);
mvotg             297 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->vbus) {
mvotg             298 drivers/usb/phy/phy-mv-usb.c 		if (mvotg->pdata->vbus->poll() == VBUS_HIGH) {
mvotg             310 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->id)
mvotg             311 drivers/usb/phy/phy-mv-usb.c 		otg_ctrl->id = !!mvotg->pdata->id->poll();
mvotg             315 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->otg_force_a_bus_req && !otg_ctrl->id)
mvotg             321 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "%s: ", __func__);
mvotg             322 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "id %d\n", otg_ctrl->id);
mvotg             323 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "b_sess_vld %d\n", otg_ctrl->b_sess_vld);
mvotg             324 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "b_sess_end %d\n", otg_ctrl->b_sess_end);
mvotg             325 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "a_vbus_vld %d\n", otg_ctrl->a_vbus_vld);
mvotg             326 drivers/usb/phy/phy-mv-usb.c 	dev_dbg(&mvotg->pdev->dev, "a_sess_vld %d\n", otg_ctrl->a_sess_vld);
mvotg             329 drivers/usb/phy/phy-mv-usb.c static void mv_otg_update_state(struct mv_otg *mvotg)
mvotg             331 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
mvotg             332 drivers/usb/phy/phy-mv-usb.c 	int old_state = mvotg->phy.otg->state;
mvotg             336 drivers/usb/phy/phy-mv-usb.c 		mvotg->phy.otg->state = OTG_STATE_B_IDLE;
mvotg             340 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_IDLE;
mvotg             342 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_B_PERIPHERAL;
mvotg             346 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_B_IDLE;
mvotg             350 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_B_IDLE;
mvotg             353 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_WAIT_VRISE;
mvotg             357 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON;
mvotg             362 drivers/usb/phy/phy-mv-usb.c 			mv_otg_cancel_timer(mvotg, A_WAIT_BCON_TIMER);
mvotg             363 drivers/usb/phy/phy-mv-usb.c 			mvotg->otg_ctrl.a_wait_bcon_timeout = 0;
mvotg             364 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL;
mvotg             367 drivers/usb/phy/phy-mv-usb.c 			mv_otg_cancel_timer(mvotg, A_WAIT_BCON_TIMER);
mvotg             368 drivers/usb/phy/phy-mv-usb.c 			mvotg->otg_ctrl.a_wait_bcon_timeout = 0;
mvotg             369 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR;
mvotg             371 drivers/usb/phy/phy-mv-usb.c 			mv_otg_cancel_timer(mvotg, A_WAIT_BCON_TIMER);
mvotg             372 drivers/usb/phy/phy-mv-usb.c 			mvotg->otg_ctrl.a_wait_bcon_timeout = 0;
mvotg             373 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_HOST;
mvotg             379 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON;
mvotg             381 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR;
mvotg             387 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_IDLE;
mvotg             393 drivers/usb/phy/phy-mv-usb.c 			mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL;
mvotg             403 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg;
mvotg             407 drivers/usb/phy/phy-mv-usb.c 	mvotg = container_of(to_delayed_work(work), struct mv_otg, work);
mvotg             411 drivers/usb/phy/phy-mv-usb.c 	otg = mvotg->phy.otg;
mvotg             414 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->active)
mvotg             417 drivers/usb/phy/phy-mv-usb.c 	mv_otg_update_inputs(mvotg);
mvotg             418 drivers/usb/phy/phy-mv-usb.c 	mv_otg_update_state(mvotg);
mvotg             420 drivers/usb/phy/phy-mv-usb.c 	if (old_state != mvotg->phy.otg->state) {
mvotg             421 drivers/usb/phy/phy-mv-usb.c 		dev_info(&mvotg->pdev->dev, "change from state %s to %s\n",
mvotg             423 drivers/usb/phy/phy-mv-usb.c 			 state_string[mvotg->phy.otg->state]);
mvotg             425 drivers/usb/phy/phy-mv-usb.c 		switch (mvotg->phy.otg->state) {
mvotg             429 drivers/usb/phy/phy-mv-usb.c 				mv_otg_start_periphrals(mvotg, 0);
mvotg             430 drivers/usb/phy/phy-mv-usb.c 			mv_otg_reset(mvotg);
mvotg             431 drivers/usb/phy/phy-mv-usb.c 			mv_otg_disable(mvotg);
mvotg             432 drivers/usb/phy/phy-mv-usb.c 			usb_phy_set_event(&mvotg->phy, USB_EVENT_NONE);
mvotg             435 drivers/usb/phy/phy-mv-usb.c 			mv_otg_enable(mvotg);
mvotg             436 drivers/usb/phy/phy-mv-usb.c 			mv_otg_start_periphrals(mvotg, 1);
mvotg             437 drivers/usb/phy/phy-mv-usb.c 			usb_phy_set_event(&mvotg->phy, USB_EVENT_ENUMERATED);
mvotg             441 drivers/usb/phy/phy-mv-usb.c 			mv_otg_enable(mvotg);
mvotg             443 drivers/usb/phy/phy-mv-usb.c 				mv_otg_start_host(mvotg, 0);
mvotg             444 drivers/usb/phy/phy-mv-usb.c 			mv_otg_reset(mvotg);
mvotg             451 drivers/usb/phy/phy-mv-usb.c 				mv_otg_start_host(mvotg, 1);
mvotg             452 drivers/usb/phy/phy-mv-usb.c 			mv_otg_set_timer(mvotg, A_WAIT_BCON_TIMER,
mvotg             458 drivers/usb/phy/phy-mv-usb.c 			mvotg->otg_ctrl.b_conn = 1;
mvotg             467 drivers/usb/phy/phy-mv-usb.c 			mvotg->otg_ctrl.b_conn = 0;
mvotg             481 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev;
mvotg             484 drivers/usb/phy/phy-mv-usb.c 	otgsc = readl(&mvotg->op_regs->otgsc);
mvotg             485 drivers/usb/phy/phy-mv-usb.c 	writel(otgsc, &mvotg->op_regs->otgsc);
mvotg             491 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->pdata->vbus)
mvotg             496 drivers/usb/phy/phy-mv-usb.c 	if ((otgsc & mvotg->irq_status) == 0)
mvotg             499 drivers/usb/phy/phy-mv-usb.c 	mv_otg_run_state_machine(mvotg, 0);
mvotg             506 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev;
mvotg             509 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->active) {
mvotg             510 drivers/usb/phy/phy-mv-usb.c 		mv_otg_enable(mvotg);
mvotg             511 drivers/usb/phy/phy-mv-usb.c 		mv_otg_init_irq(mvotg);
mvotg             514 drivers/usb/phy/phy-mv-usb.c 	mv_otg_run_state_machine(mvotg, 0);
mvotg             522 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev_get_drvdata(dev);
mvotg             524 drivers/usb/phy/phy-mv-usb.c 			 mvotg->otg_ctrl.a_bus_req);
mvotg             531 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev_get_drvdata(dev);
mvotg             537 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->phy.otg->state != OTG_STATE_B_IDLE
mvotg             538 drivers/usb/phy/phy-mv-usb.c 	    && mvotg->phy.otg->state != OTG_STATE_A_IDLE)
mvotg             542 drivers/usb/phy/phy-mv-usb.c 	mv_otg_enable(mvotg);
mvotg             543 drivers/usb/phy/phy-mv-usb.c 	mv_otg_init_irq(mvotg);
mvotg             546 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_bus_req = 1;
mvotg             547 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_bus_drop = 0;
mvotg             548 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev,
mvotg             551 drivers/usb/phy/phy-mv-usb.c 		if (spin_trylock(&mvotg->wq_lock)) {
mvotg             552 drivers/usb/phy/phy-mv-usb.c 			mv_otg_run_state_machine(mvotg, 0);
mvotg             553 drivers/usb/phy/phy-mv-usb.c 			spin_unlock(&mvotg->wq_lock);
mvotg             566 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev_get_drvdata(dev);
mvotg             567 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->phy.otg->default_a)
mvotg             574 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_clr_err = 1;
mvotg             575 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev,
mvotg             579 drivers/usb/phy/phy-mv-usb.c 	if (spin_trylock(&mvotg->wq_lock)) {
mvotg             580 drivers/usb/phy/phy-mv-usb.c 		mv_otg_run_state_machine(mvotg, 0);
mvotg             581 drivers/usb/phy/phy-mv-usb.c 		spin_unlock(&mvotg->wq_lock);
mvotg             593 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev_get_drvdata(dev);
mvotg             595 drivers/usb/phy/phy-mv-usb.c 			 mvotg->otg_ctrl.a_bus_drop);
mvotg             602 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = dev_get_drvdata(dev);
mvotg             603 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->phy.otg->default_a)
mvotg             610 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_bus_drop = 0;
mvotg             611 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev,
mvotg             614 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_bus_drop = 1;
mvotg             615 drivers/usb/phy/phy-mv-usb.c 		mvotg->otg_ctrl.a_bus_req = 0;
mvotg             616 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev,
mvotg             618 drivers/usb/phy/phy-mv-usb.c 		dev_dbg(&mvotg->pdev->dev,
mvotg             622 drivers/usb/phy/phy-mv-usb.c 	if (spin_trylock(&mvotg->wq_lock)) {
mvotg             623 drivers/usb/phy/phy-mv-usb.c 		mv_otg_run_state_machine(mvotg, 0);
mvotg             624 drivers/usb/phy/phy-mv-usb.c 		spin_unlock(&mvotg->wq_lock);
mvotg             651 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = platform_get_drvdata(pdev);
mvotg             653 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->qwork) {
mvotg             654 drivers/usb/phy/phy-mv-usb.c 		flush_workqueue(mvotg->qwork);
mvotg             655 drivers/usb/phy/phy-mv-usb.c 		destroy_workqueue(mvotg->qwork);
mvotg             658 drivers/usb/phy/phy-mv-usb.c 	mv_otg_disable(mvotg);
mvotg             660 drivers/usb/phy/phy-mv-usb.c 	usb_remove_phy(&mvotg->phy);
mvotg             668 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg;
mvotg             678 drivers/usb/phy/phy-mv-usb.c 	mvotg = devm_kzalloc(&pdev->dev, sizeof(*mvotg), GFP_KERNEL);
mvotg             679 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg)
mvotg             686 drivers/usb/phy/phy-mv-usb.c 	platform_set_drvdata(pdev, mvotg);
mvotg             688 drivers/usb/phy/phy-mv-usb.c 	mvotg->pdev = pdev;
mvotg             689 drivers/usb/phy/phy-mv-usb.c 	mvotg->pdata = pdata;
mvotg             691 drivers/usb/phy/phy-mv-usb.c 	mvotg->clk = devm_clk_get(&pdev->dev, NULL);
mvotg             692 drivers/usb/phy/phy-mv-usb.c 	if (IS_ERR(mvotg->clk))
mvotg             693 drivers/usb/phy/phy-mv-usb.c 		return PTR_ERR(mvotg->clk);
mvotg             695 drivers/usb/phy/phy-mv-usb.c 	mvotg->qwork = create_singlethread_workqueue("mv_otg_queue");
mvotg             696 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->qwork) {
mvotg             701 drivers/usb/phy/phy-mv-usb.c 	INIT_DELAYED_WORK(&mvotg->work, mv_otg_work);
mvotg             704 drivers/usb/phy/phy-mv-usb.c 	mvotg->pdev = pdev;
mvotg             705 drivers/usb/phy/phy-mv-usb.c 	mvotg->phy.dev = &pdev->dev;
mvotg             706 drivers/usb/phy/phy-mv-usb.c 	mvotg->phy.otg = otg;
mvotg             707 drivers/usb/phy/phy-mv-usb.c 	mvotg->phy.label = driver_name;
mvotg             710 drivers/usb/phy/phy-mv-usb.c 	otg->usb_phy = &mvotg->phy;
mvotg             716 drivers/usb/phy/phy-mv-usb.c 		timer_setup(&mvotg->otg_ctrl.timer[i],
mvotg             719 drivers/usb/phy/phy-mv-usb.c 	r = platform_get_resource_byname(mvotg->pdev,
mvotg             727 drivers/usb/phy/phy-mv-usb.c 	mvotg->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
mvotg             728 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->phy_regs == NULL) {
mvotg             734 drivers/usb/phy/phy-mv-usb.c 	r = platform_get_resource_byname(mvotg->pdev,
mvotg             742 drivers/usb/phy/phy-mv-usb.c 	mvotg->cap_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
mvotg             743 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->cap_regs == NULL) {
mvotg             750 drivers/usb/phy/phy-mv-usb.c 	retval = mv_otg_enable_internal(mvotg);
mvotg             756 drivers/usb/phy/phy-mv-usb.c 	mvotg->op_regs =
mvotg             757 drivers/usb/phy/phy-mv-usb.c 		(struct mv_otg_regs __iomem *) ((unsigned long) mvotg->cap_regs
mvotg             758 drivers/usb/phy/phy-mv-usb.c 			+ (readl(mvotg->cap_regs) & CAPLENGTH_MASK));
mvotg             763 drivers/usb/phy/phy-mv-usb.c 						IRQF_ONESHOT, "id", mvotg);
mvotg             772 drivers/usb/phy/phy-mv-usb.c 		mvotg->clock_gating = 1;
mvotg             775 drivers/usb/phy/phy-mv-usb.c 						IRQF_ONESHOT, "vbus", mvotg);
mvotg             780 drivers/usb/phy/phy-mv-usb.c 			mvotg->clock_gating = 0;
mvotg             786 drivers/usb/phy/phy-mv-usb.c 		mvotg->clock_gating = 0;
mvotg             788 drivers/usb/phy/phy-mv-usb.c 	mv_otg_reset(mvotg);
mvotg             789 drivers/usb/phy/phy-mv-usb.c 	mv_otg_init_irq(mvotg);
mvotg             791 drivers/usb/phy/phy-mv-usb.c 	r = platform_get_resource(mvotg->pdev, IORESOURCE_IRQ, 0);
mvotg             798 drivers/usb/phy/phy-mv-usb.c 	mvotg->irq = r->start;
mvotg             799 drivers/usb/phy/phy-mv-usb.c 	if (devm_request_irq(&pdev->dev, mvotg->irq, mv_otg_irq, IRQF_SHARED,
mvotg             800 drivers/usb/phy/phy-mv-usb.c 			driver_name, mvotg)) {
mvotg             802 drivers/usb/phy/phy-mv-usb.c 			mvotg->irq);
mvotg             803 drivers/usb/phy/phy-mv-usb.c 		mvotg->irq = 0;
mvotg             808 drivers/usb/phy/phy-mv-usb.c 	retval = usb_add_phy(&mvotg->phy, USB_PHY_TYPE_USB2);
mvotg             815 drivers/usb/phy/phy-mv-usb.c 	spin_lock_init(&mvotg->wq_lock);
mvotg             816 drivers/usb/phy/phy-mv-usb.c 	if (spin_trylock(&mvotg->wq_lock)) {
mvotg             817 drivers/usb/phy/phy-mv-usb.c 		mv_otg_run_state_machine(mvotg, 2 * HZ);
mvotg             818 drivers/usb/phy/phy-mv-usb.c 		spin_unlock(&mvotg->wq_lock);
mvotg             823 drivers/usb/phy/phy-mv-usb.c 		 mvotg->clock_gating ? "with" : "without");
mvotg             828 drivers/usb/phy/phy-mv-usb.c 	mv_otg_disable_internal(mvotg);
mvotg             830 drivers/usb/phy/phy-mv-usb.c 	flush_workqueue(mvotg->qwork);
mvotg             831 drivers/usb/phy/phy-mv-usb.c 	destroy_workqueue(mvotg->qwork);
mvotg             839 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = platform_get_drvdata(pdev);
mvotg             841 drivers/usb/phy/phy-mv-usb.c 	if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) {
mvotg             844 drivers/usb/phy/phy-mv-usb.c 			 mvotg->phy.otg->state);
mvotg             848 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->clock_gating)
mvotg             849 drivers/usb/phy/phy-mv-usb.c 		mv_otg_disable_internal(mvotg);
mvotg             856 drivers/usb/phy/phy-mv-usb.c 	struct mv_otg *mvotg = platform_get_drvdata(pdev);
mvotg             859 drivers/usb/phy/phy-mv-usb.c 	if (!mvotg->clock_gating) {
mvotg             860 drivers/usb/phy/phy-mv-usb.c 		mv_otg_enable_internal(mvotg);
mvotg             862 drivers/usb/phy/phy-mv-usb.c 		otgsc = readl(&mvotg->op_regs->otgsc);
mvotg             863 drivers/usb/phy/phy-mv-usb.c 		otgsc |= mvotg->irq_en;
mvotg             864 drivers/usb/phy/phy-mv-usb.c 		writel(otgsc, &mvotg->op_regs->otgsc);
mvotg             866 drivers/usb/phy/phy-mv-usb.c 		if (spin_trylock(&mvotg->wq_lock)) {
mvotg             867 drivers/usb/phy/phy-mv-usb.c 			mv_otg_run_state_machine(mvotg, 0);
mvotg             868 drivers/usb/phy/phy-mv-usb.c 			spin_unlock(&mvotg->wq_lock);