aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea
diff options
context:
space:
mode:
authorIvan T. Ivanov <iivanov@mm-sol.com>2014-05-03 21:24:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-22 22:36:44 -0400
commit2629b10167d5f641126487fef84cd036ab9cd72f (patch)
tree1415d110bd9d9d6e358c9b1d65fb3bf780ee2eea /drivers/usb/chipidea
parenta33d8ce729f670e1618eb3faa76246b61128008e (diff)
usb: chipidea: msm: Add device tree support
Allows controller to be specified via device tree. Pass PHY phandle specified in DT to core driver. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea')
-rw-r--r--drivers/usb/chipidea/ci_hdrc_msm.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 2d51d852b474..736aeb2a53d6 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -57,9 +57,21 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
57static int ci_hdrc_msm_probe(struct platform_device *pdev) 57static int ci_hdrc_msm_probe(struct platform_device *pdev)
58{ 58{
59 struct platform_device *plat_ci; 59 struct platform_device *plat_ci;
60 struct usb_phy *phy;
60 61
61 dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n"); 62 dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
62 63
64 /*
65 * OTG(PHY) driver takes care of PHY initialization, clock management,
66 * powering up VBUS, mapping of registers address space and power
67 * management.
68 */
69 phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
70 if (IS_ERR(phy))
71 return PTR_ERR(phy);
72
73 ci_hdrc_msm_platdata.phy = phy;
74
63 plat_ci = ci_hdrc_add_device(&pdev->dev, 75 plat_ci = ci_hdrc_add_device(&pdev->dev,
64 pdev->resource, pdev->num_resources, 76 pdev->resource, pdev->num_resources,
65 &ci_hdrc_msm_platdata); 77 &ci_hdrc_msm_platdata);
@@ -86,10 +98,19 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev)
86 return 0; 98 return 0;
87} 99}
88 100
101static const struct of_device_id msm_ci_dt_match[] = {
102 { .compatible = "qcom,ci-hdrc", },
103 { }
104};
105MODULE_DEVICE_TABLE(of, msm_ci_dt_match);
106
89static struct platform_driver ci_hdrc_msm_driver = { 107static struct platform_driver ci_hdrc_msm_driver = {
90 .probe = ci_hdrc_msm_probe, 108 .probe = ci_hdrc_msm_probe,
91 .remove = ci_hdrc_msm_remove, 109 .remove = ci_hdrc_msm_remove,
92 .driver = { .name = "msm_hsusb", }, 110 .driver = {
111 .name = "msm_hsusb",
112 .of_match_table = msm_ci_dt_match,
113 },
93}; 114};
94 115
95module_platform_driver(ci_hdrc_msm_driver); 116module_platform_driver(ci_hdrc_msm_driver);