Re: [PATCHv7 04/19] usb: otg: ab8500: Start using struct usb_otg

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

 



Hi Felipe,

On Tue, Nov 08, 2011 at 04:20:31PM +0200, Felipe Balbi wrote:
> > @@ -169,8 +169,8 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab)
> >  		/* TODO: Disable regulators. */
> >  		ab8500_usb_host_phy_dis(ab);
> >  		ab8500_usb_peri_phy_dis(ab);
> > -		ab->otg.state = USB_PHY_STATE_B_IDLE;
> > -		ab->otg.default_a = false;
> > +		ab->phy.state = USB_PHY_STATE_B_IDLE;
> > +		ab->phy.otg->default_a = false;
> 
> ideally users wouldn't access 'otg' directly. You should have a bunch of
> reader/setter helpers which are optimized out when OTG isn't enabled.
> Then we could:
> 
> usb_otg_default_a(&ab->phy, false);
> 
> or something similar. Ditto for all others. Can, of course, be done on a
> later patch.

Yes. I left it out from this set as I wasn't sure if we want later
to be able to live without PHY driver, for example if you support OTG
but you have UTMI+ transceiver. Or do we always want to have PHY
driver? The "OTG driver" usually only needs to program the controller.

> > @@ -488,19 +487,27 @@ static int __devinit ab8500_usb_probe(struct platform_device *pdev)
> >  	if (!ab)
> >  		return -ENOMEM;
> >  
> > +	ab->phy.otg = kzalloc(sizeof *ab->phy.otg, GFP_KERNEL);
> 
> I don't see the point of requiring users to allocate the otg structure.
> What's the rationale ?

Well, I guess I was thinking about the previous idea. Eventually the
PHY drivers should not be responsible of the struct otg unless they
really need to be, like with CEA-2011, though that spec was cancelled
if I recall. They can still hold the pointer, so they can "carry" it
if needed. I'll cleanup this so the users don't allocate the
structure.

Thanks,

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