RE: [PATCH 5/7] ehci mxc: make it more flexible to be used for mx28

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

 



> On Wed, 20 Jul 2011, Tony Lin wrote:
> 
> > old driver uses some hard coding for clks' name which could not be
> > used for mx28. So workaround these hard codings by judging the cpu is
> > mx28 or not.
> > add platform callback funtions in usb irq handler in the case usb phy
> > need to change its disconnect detector mode after usb device is
> > connected and disconnected. These callbacks also could be used for
> > other machines whose usb phy need such kind of operations
> >
> > Signed-off-by: Tony Lin <tony.lin@xxxxxxxxxxxxx>
> 
> ...
> 
> > --- a/drivers/usb/host/ehci-mxc.c
> > +++ b/drivers/usb/host/ehci-mxc.c
> 
> ...
> 
> > +static irqreturn_t fsl_ehci_irq(struct usb_hcd *hcd) {
> > +	struct mxc_usbh_platform_data *pdata;
> > +	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
> > +	u32			status;
> > +
> > +	pdata = hcd->self.controller->platform_data;
> > +	if (pdata->plt_get_usb_connect_status == NULL || \
> > +		pdata->plt_usb_disconnect_detect == NULL)
> > +		goto out;
> > +
> > +	spin_lock(&ehci->lock);
> 
> Do you really need to use this spinlock?  I don't see any reason for it.
> 
I'll remove it. Thanks for pointing out.

> > +	status = ehci_readl(ehci, &ehci->regs->status);
> > +	if (status & STS_PCD) {
> > +		if (pdata->plt_get_usb_connect_status())
> > +			pdata->plt_usb_disconnect_detect(true);
> > +		else
> > +			pdata->plt_usb_disconnect_detect(false);
> 
> How about just this:
> 
> 		pdata->plt_usb_disconnect_detect(
> 				pdata->plt_get_usb_connect_status());
> 
That's better.

> > +	}
> > +	spin_unlock(&ehci->lock);
> > +out:
> > +	return ehci_irq(hcd);
> > +}
> 
> Alan Stern
> 

--
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