Re: [PATCH 06/20] usb: hcd-pci: introduce pm-ops for platform-pci devs

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

 



On 09/05/2011 04:24 PM, Felipe Balbi wrote:
Hi,
Hi,

On Mon, Sep 05, 2011 at 04:05:01PM +0200, Sebastian Andrzej Siewior wrote:
I don't think how ehci_platform_ops would fit in here unless it is a
copy of of ehci_hc_driver. For the phy suspend it is a parent/child

you missed the point. As I already pointed out, we can have something
like below:

struct ehci_platform_ops {
	int	(*reset)(struct device *child);

reset is one one time thing. So I'm not sure if it fits in here.

	int	(*map)(struct device *child, struct urb *urb);
	int	(*unmap)(struct device *child, struct urb *urb);

	...
};

then, let's say ehci-tegra populates that... on ehci_probe()
(ehci-hcd.c::probe), we could have:

...

ehci->ops = pdev->dev.platform_data;

I know where you go with this but as of now we can't do this because
usb_add_hcd() allocates the ehci struct.

...


then on ehci_reset() (this is the one which actually goes to hc_driver)

...

/*
  * if this pointer is valid, it means arch code wants to handle it
  * differently
  */
if (ehci->ops->reset)
	return ehci->ops->reset(ehci->dev);

/* otherwise we can use the generic version */
return ehci_generic_reset(ehci);

...


similarly on map and unmap:

...

if (ehci->ops->map)
	return ehci->ops->map(ehci->dev, urb);

return ehci_generic_map(ehci, urb);

...

See that ehci-tegra, would only pass the fields which it needs and if
the pointer is NULL the default/generic implementations are used,
because it's assumed that this particular architecture doesn't need
anything different from what the standard says.

I see. So ehci_platform_ops would contain all elements from hc_driver
but it won't overwrite all of them. So it is close to what the ATA
subsystem is doing.

This would make code flow almost the same, the difference would be only
that we don't have "that much" callbacks set which don't different from
the regular implementation.

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