RE: [PATCH 07/10] MXS: Add USB PHY driver

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

 



 
> > On Wed, Apr 18, 2012 at 10:02:02PM +0200, Marek Vasut wrote:
> > > Dear Sascha Hauer,
> > >
> > > > > +static void mxs_usb_work(struct work_struct *w)
> > > > > +{
> > > > > +	struct mxs_usb_phy *phy = container_of(w, struct mxs_usb_phy,
> > > > > work); +	struct usb_otg *otg = phy->phy.otg;
> > > > > +	struct usb_hcd *hcd;
> > > > > +
> > > > > +	switch (otg->phy->state) {
> > > > > +	case OTG_STATE_A_HOST:
> > > > > +		if (otg->host) {
> > > > > +			hcd = bus_to_hcd(otg->host);
> > > > > +			usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
> > > > > +		}
> > > > > +		break;
> > > > > +	default:
> > > > > +		break;
> > > > > +	}
> > > > > +}
> > > >
> > > > This function should be in imx-otg.
> > >
> > > You mean imx-usb? What'd it do in there?
> >
> > otg/imx-usb.c, yes (though I would prefer imx-otg.c)
> >
> > It should be there because it's the imx-otg.c driver which manages the
> > state. The phy driver is only a helper.
> 
> I believe the imx-otg should only call otg_set_host()/otg_set_peripheral()
> on
> the particular PHY, in this case mxs-usb-phy, correct? The mxs_usb_work()
> should
> stay in the PHY's driver, because it'll likely frob with the PHY's own
> registers
> once peripheral support is added.
> 
mxs_usb_work() manages host/device state switch due to id/vbus (at register otgsc) changing.
It is better to put it at otg driver.

> >
> > Sascha
> 
> Best regards,
> Marek Vasut


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