Re: [PATCH 5/7] usb: chipidea: otg_fsm: add HNP polling support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 09, 2015 at 03:52:35PM +0800, Peter Chen wrote:
> On Mon, Mar 09, 2015 at 10:09:21AM +0800, Li Jun wrote:
> > From: Li Jun <b47624@xxxxxxxxxxxxx>
> > 
> > Add a dedicataed normal timer for HNP polling since it's cyclical, while
> > in peripheral mode, change a/b_bus_req to be 1 will make it response
> > to host request flag with 1, then role switch will be started.
> 
> use a_bus_req/b_bus_req
> 

Okay.

> Why hnp polling timer can't use chipidea fsm hrtimer list?
> 

It can use hrtimer, I thought using hrtimer for HNP polling is some over-design,
I will change.

Li Jun
> > 
> > Signed-off-by: Li Jun <jun.li@xxxxxxxxxxxxx>
> > ---
> >  drivers/usb/chipidea/ci.h      |    4 ++++
> >  drivers/usb/chipidea/otg_fsm.c |   49 +++++++++++++++++++++++++++++++++++++---
> >  drivers/usb/chipidea/otg_fsm.h |    2 ++
> >  3 files changed, 52 insertions(+), 3 deletions(-)
> > 
> > +		if (otg_hnp_polling(&ci->fsm) != HOST_REQUEST_FLAG) {
> > +			pm_runtime_put_sync(ci->dev);
> > +			return 0;
> > +		}
> > +	}
> > +
> 
> When you do the polling device, it seems you disable the interrupt.
> 

I will move it out of otg fsm queue work.

Li Jun
> >  	if (otg_statemachine(&ci->fsm)) {
> >  		if (ci->fsm.otg->state == OTG_STATE_A_IDLE) {
> >  			/*
> > @@ -817,4 +859,5 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
> >  void ci_hdrc_otg_fsm_remove(struct ci_hdrc *ci)
> >  {
> >  	sysfs_remove_group(&ci->dev->kobj, &inputs_attr_group);
> > +	del_timer_sync(&ci->hnp_polling_timer);
> >  }
> > diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
> > index 2689375..fbd6dc7 100644
> > --- a/drivers/usb/chipidea/otg_fsm.h
> > +++ b/drivers/usb/chipidea/otg_fsm.h
> > @@ -62,6 +62,8 @@
> >  /* SSEND time before SRP */
> >  #define TB_SSEND_SRP         (1500)	/* minimum 1.5 sec, section:5.1.2 */
> >  
> > +#define T_HOST_REQ_POLL      (1500)	/* HNP polling interval 1s~2s */
> > +
> >  #ifdef CONFIG_USB_OTG_FSM
> >  
> >  int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
> > -- 
> 
> -- 
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux