Re: [PATCH v2 3/7] usb: chipidea: add otg id switch and vbus connect/disconnect detect

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

 



On Mon, Nov 19, 2012 at 10:38:00AM +0100, Marc Kleine-Budde wrote:
> On 11/19/2012 10:33 AM, Peter Chen wrote:
> > The main design flow is the same with msm otg driver, that is the id and
> > vbus interrupt are handled at core driver, others are handled by
> > individual drivers.
> > 
> > - At former design, when switch usb role from device->host, it will call
> > udc_stop, it will remove the gadget driver, so when switch role
> > from host->device, it can't add gadget driver any more.
> > At new design, when role switch occurs, the gadget just calls
> > usb_gadget_vbus_disconnect/usb_gadget_vbus_connect as well as
> > reset controller, it will not free any device/gadget structure
> > 
> > - Add vbus connect and disconnect to core interrupt handler, it can
> > notify udc driver by calling usb_gadget_vbus_disconnect
> > /usb_gadget_vbus_connect.
> > 
> > Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>
> > ---
> >  drivers/usb/chipidea/bits.h |   10 +++
> >  drivers/usb/chipidea/ci.h   |    6 ++
> >  drivers/usb/chipidea/core.c |  188 ++++++++++++++++++++++++++++++++++++++----
> >  drivers/usb/chipidea/otg.c  |    1 +
> >  drivers/usb/chipidea/udc.c  |    2 +
> >  5 files changed, 189 insertions(+), 18 deletions(-)
> > 
> > diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
> > index 050de85..ba9c6ef 100644
> > --- a/drivers/usb/chipidea/bits.h
> > +++ b/drivers/usb/chipidea/bits.h
> > @@ -65,11 +65,21 @@
> >  #define OTGSC_ASVIS	      BIT(18)
> >  #define OTGSC_BSVIS	      BIT(19)
> >  #define OTGSC_BSEIS	      BIT(20)
> > +#define OTGSC_1MSIS	      BIT(21)
> > +#define OTGSC_DPIS	      BIT(22)
> >  #define OTGSC_IDIE	      BIT(24)
> >  #define OTGSC_AVVIE	      BIT(25)
> >  #define OTGSC_ASVIE	      BIT(26)
> >  #define OTGSC_BSVIE	      BIT(27)
> >  #define OTGSC_BSEIE	      BIT(28)
> > +#define OTGSC_1MSIE	      BIT(29)
> > +#define OTGSC_DPIE	      BIT(30)
> > +#define OTGSC_INT_EN_BITS	(OTGSC_IDIE | OTGSC_AVVIE | OTGSC_ASVIE \
> > +				| OTGSC_BSVIE | OTGSC_BSEIE | OTGSC_1MSIE \
> > +				| OTGSC_DPIE)
> > +#define OTGSC_INT_STATUS_BITS	(OTGSC_IDIS | OTGSC_AVVIS | OTGSC_ASVIS	\
> > +				| OTGSC_BSVIS | OTGSC_BSEIS | OTGSC_1MSIS \
> > +				| OTGSC_DPIS)
> >  
> >  /* USBMODE */
> >  #define USBMODE_CM            (0x03UL <<  0)
> > diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
> > index d738603..d32f932 100644
> > --- a/drivers/usb/chipidea/ci.h
> > +++ b/drivers/usb/chipidea/ci.h
> > @@ -139,6 +139,7 @@ struct ci13xxx {
> >  	enum ci_role			role;
> >  	bool				is_otg;
> >  	struct work_struct		work;
> > +	struct delayed_work		dwork;
> >  	struct workqueue_struct		*wq;
> >  
> >  	struct dma_pool			*qh_pool;
> > @@ -164,6 +165,11 @@ struct ci13xxx {
> >  	bool				global_phy;
> >  	struct usb_phy			*transceiver;
> >  	struct usb_hcd			*hcd;
> > +	/* events handled at ci_role_work */
> > +#define ID		0
> > +#define B_SESS_VALID	1
> 
> Can you add a prefix (like CI_) to these constants?

Ok, will change at next version
> 
> > +	unsigned long events;
> > +	struct usb_otg			otg;
> >  };
> 
> Marc
> -- 
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 



-- 

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