ci->fsm.a_bus_req = 1;
}
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
mutex_unlock(&ci->fsm.lock);
return count;
ci->fsm.a_bus_req = 0;
}
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
mutex_unlock(&ci->fsm.lock);
return count;
else if (buf[0] == '1')
ci->fsm.b_bus_req = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
mutex_unlock(&ci->fsm.lock);
return count;
if (buf[0] == '1')
ci->fsm.a_clr_err = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
mutex_unlock(&ci->fsm.lock);
return count;
set_tmout(ci, indicator);
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
static void a_wait_vfall_tmout_func(void *ptr, unsigned long indicator)
hw_write_otgsc(ci, OTGSC_DPIS, OTGSC_DPIS);
/* Enable data pulse irq */
hw_write_otgsc(ci, OTGSC_DPIE, OTGSC_DPIE);
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
static void b_ase0_brst_tmout_func(void *ptr, unsigned long indicator)
if (!hw_read_otgsc(ci, OTGSC_BSV))
ci->fsm.b_sess_vld = 0;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
static void b_ssend_srp_tmout_func(void *ptr, unsigned long indicator)
set_tmout(ci, indicator);
/* only vbus fall below B_sess_vld in b_idle state */
- if (ci->transceiver->state == OTG_STATE_B_IDLE) {
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
- }
+ if (ci->transceiver->state == OTG_STATE_B_IDLE)
+ ci_otg_queue_work(ci);
}
static void b_sess_vld_tmout_func(void *ptr, unsigned long indicator)
if (!(hw_read_otgsc(ci, OTGSC_BSV))) {
ci->fsm.b_sess_vld = 0;
ci_otg_add_timer(ci, B_SSEND_SRP);
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
}
hw_write_otgsc(ci, OTGSC_HABA, 0);
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
/* Initialize timers */
* a_idle to a_wait_vrise when power up
*/
if ((ci->fsm.id) || (ci->id_event) ||
- (ci->fsm.power_up)) {
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
- }
+ (ci->fsm.power_up))
+ ci_otg_queue_work(ci);
if (ci->id_event)
ci->id_event = false;
} else if (ci->transceiver->state == OTG_STATE_B_IDLE) {
* Further transite to b_periphearl state
* when register gadget driver with vbus on
*/
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
}
}
if (port_conn) {
fsm->b_conn = 1;
fsm->a_bus_req = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
break;
case OTG_STATE_B_IDLE:
if (otg_bsess_vld && (intr_sts & USBi_PCI) && port_conn) {
fsm->b_sess_vld = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
break;
case OTG_STATE_B_PERIPHERAL:
if ((intr_sts & USBi_SLI) && port_conn && otg_bsess_vld) {
fsm->a_bus_suspend = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
} else if (intr_sts & USBi_PCI) {
if (fsm->a_bus_suspend == 1)
fsm->a_bus_suspend = 0;
if ((intr_sts & USBi_PCI) && !port_conn) {
fsm->a_conn = 0;
fsm->b_bus_req = 0;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
ci_otg_add_timer(ci, B_SESS_VLD);
}
break;
/* A device to be peripheral mode */
ci->gadget.is_a_peripheral = 1;
}
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
break;
case OTG_STATE_A_HOST:
if ((intr_sts & USBi_PCI) && !port_conn) {
fsm->b_conn = 0;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
break;
case OTG_STATE_B_WAIT_ACON:
if ((intr_sts & USBi_PCI) && port_conn) {
fsm->a_conn = 1;
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
break;
default:
fsm->b_conn = 0;
}
}
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
return IRQ_HANDLED;
}
void ci_hdrc_otg_fsm_start(struct ci_hdrc *ci)
{
- disable_irq_nosync(ci->irq);
- queue_work(ci->wq, &ci->work);
+ ci_otg_queue_work(ci);
}
int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)