Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1441314 > unrolled thread
| Started by | Rafał Miłecki <zajec5@gmail.com> |
|---|---|
| First post | 2016-07-12 14:40 +0200 |
| Last post | 2016-07-12 14:40 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] ohci-platform: register HCD provider Rafał Miłecki <zajec5@gmail.com> - 2016-07-12 14:40 +0200
| From | Rafał Miłecki <zajec5@gmail.com> |
|---|---|
| Date | 2016-07-12 14:40 +0200 |
| Subject | [PATCH 2/2] ohci-platform: register HCD provider |
| Message-ID | <rU58K-4Sa-43@gated-at.bofh.it> |
This allows platforms using e.g. "generic-ohci" to reference HCD using
recently introduced providers mechanism
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/usb/host/ohci-platform.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 898b740..57be81c 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -28,6 +28,7 @@
#include <linux/usb/ohci_pdriver.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
+#include <linux/usb/provider.h>
#include "ohci.h"
@@ -40,6 +41,7 @@ struct ohci_platform_priv {
struct clk *clks[OHCI_MAX_CLKS];
struct reset_control *resets[OHCI_MAX_RESETS];
struct phy **phys;
+ struct hcd_provider *hcd_provider;
int num_phys;
};
@@ -258,6 +260,11 @@ static int ohci_platform_probe(struct platform_device *dev)
if (err)
goto err_power;
+ if (dev->dev.of_node)
+ priv->hcd_provider = of_hcd_provider_register(dev->dev.of_node,
+ of_hcd_xlate_simple,
+ hcd);
+
device_wakeup_enable(hcd->self.controller);
platform_set_drvdata(dev, hcd);
@@ -289,6 +296,8 @@ static int ohci_platform_remove(struct platform_device *dev)
struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
int clk, rst;
+ of_hcd_provider_unregister(priv->hcd_provider);
+
usb_remove_hcd(hcd);
if (pdata->power_off)
--
1.8.4.5
Back to top | Article view | linux.kernel
csiph-web