All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/8] ehci-platform: add init() method to platform data
@ 2013-04-04 22:59 Sergei Shtylyov
  2013-04-05 14:43 ` Alan Stern
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2013-04-04 22:59 UTC (permalink / raw)
  To: linux-sh

Sometimes there is a need to initialize some non-standard registers mapped to
the EHCI region before accessing the standard EHCI registers.  Add the init()
method to the 'ehci-platform' platform data for this purpose.

Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/usb/host/ehci-platform.c |    7 +++++++
 include/linux/usb/ehci_pdriver.h |    1 +
 2 files changed, 8 insertions(+)

Index: renesas/drivers/usb/host/ehci-platform.c
=================================--- renesas.orig/drivers/usb/host/ehci-platform.c
+++ renesas/drivers/usb/host/ehci-platform.c
@@ -110,6 +110,13 @@ static int ehci_platform_probe(struct pl
 		err = PTR_ERR(hcd->regs);
 		goto err_put_hcd;
 	}
+
+	if (pdata->init) {
+		err = pdata->init(dev, hcd->regs);
+		if (err < 0)
+			goto err_put_hcd;
+	}
+
 	err = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (err)
 		goto err_put_hcd;
Index: renesas/include/linux/usb/ehci_pdriver.h
=================================--- renesas.orig/include/linux/usb/ehci_pdriver.h
+++ renesas/include/linux/usb/ehci_pdriver.h
@@ -50,6 +50,7 @@ struct usb_ehci_pdata {
 	/* Turn on only VBUS suspend power and hotplug detection,
 	 * turn off everything else */
 	void (*power_suspend)(struct platform_device *pdev);
+	int (*init)(struct platform_device *pdev, void __iomem *regs);
 };
 
 #endif /* __USB_CORE_EHCI_PDRIVER_H */

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-05 21:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 22:59 [PATCH 2/8] ehci-platform: add init() method to platform data Sergei Shtylyov
2013-04-05 14:43 ` Alan Stern
2013-04-05 20:40 ` Sergei Shtylyov
2013-04-05 20:48 ` Sergei Shtylyov
2013-04-05 20:55 ` Alan Stern
2013-04-05 20:56 ` Alan Stern
2013-04-05 20:59 ` Sergei Shtylyov
2013-04-05 21:15 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.