Re: [PATCH v6.5 20/25] usb: chipidea: add host role

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

 



Hi,

On Wed, May 09, 2012 at 01:23:38PM +0200, Matthieu CASTET wrote:
> Alexander Shishkin a écrit :
> > This adds EHCI host support to the chipidea driver. We want it to be
> > part of the hdrc driver and not a standalone (sub-)driver module, as
> > the structure of ehci-hcd.c suggests, so for chipidea controller we
> > hack it to not provide platform-related code, but only the ehci hcd.
> > 
> > The ehci-platform driver won't work for us here too, because the
> > controller uses the same registers for both device and host mode and
> > also otg-related bits, so it's not really possible to put ehci registers
> > into a separate resource.
> > 
> > This is not a pretty solution, but the alternative is exporting symbols
> > from the chipidea driver to a ehci-chipidea driver and doing all the
> > module refcounting.
> > 
> > Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> > Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> > +
> > +static const struct hc_driver ci_ehci_hc_driver = {
> > +       .description    = "ehci_hcd",
> > +       .product_desc   = "ChipIdea HDRC EHCI",
> > +       .hcd_priv_size  = sizeof(struct ehci_hcd),
> > +
> > +       /*
> > +        * generic hardware linkage
> > +        */
> > +       .irq    = ehci_irq,
> > +       .flags  = HCD_MEMORY | HCD_USB2,
> > +
> > +       /*
> > +        * basic lifecycle operations
> > +        */
> > +       .reset          = ci_ehci_setup,
> > +       .start          = ehci_run,
> > +       .stop           = ehci_stop,
> > +       .shutdown       = ehci_shutdown,
> > +
> > +       /*
> > +        * managing i/o requests and associated device resources
> > +        */
> > +       .urb_enqueue            = ehci_urb_enqueue,
> > +       .urb_dequeue            = ehci_urb_dequeue,
> > +       .endpoint_disable       = ehci_endpoint_disable,
> > +       .endpoint_reset         = ehci_endpoint_reset,
> > +
> > +       /*
> > +        * scheduling support
> > +        */
> > +       .get_frame_number = ehci_get_frame,
> > +
> > +       /*
> > +        * root hub support
> > +        */
> > +       .hub_status_data        = ehci_hub_status_data,
> > +       .hub_control            = ehci_hub_control,
> > +       .bus_suspend            = ehci_bus_suspend,
> > +       .bus_resume             = ehci_bus_resume,
> > +       .relinquish_port        = ehci_relinquish_port,
> > +       .port_handed_over       = ehci_port_handed_over,
> > +
> > +       .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
> > +};
> > +
> Note that some chipidea version need special callback for phy init or errata
> workaround.
> 
> In the current version, this is done in platform driver (ehci-fsl.c,
> ehci-tegra.c, ...).
> 
> I don't know you do you plan to manage them ?

A quick come back from my time off:

Errata workarounds should be done by revision detection, see
drivers/usb/dwc3/ and grep for WORKAROUND.

PHY initialization should be done in a PHY driver and users of the phy
should just call usb_phy_*() at correct places.

(back to time off)

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux