aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-msm.c
diff options
context:
space:
mode:
authorIvan T. Ivanov <iivanov@mm-sol.com>2013-10-11 07:46:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-11 19:31:15 -0400
commit0fc924bd4eecc45f05cc8437c28a8f33f9c45d3b (patch)
treecf123e89c06ad0b0ea534538153c50f6792a0222 /drivers/usb/host/ehci-msm.c
parente4f0da055e4ff3e6ed2e2ad1f9c2334aeb845755 (diff)
USB: ehci-msm: Add device tree support and binding information
Allows MSM EHCI controller to be specified via device tree. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Acked-by: David Brown <davidb@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-msm.c')
-rw-r--r--drivers/usb/host/ehci-msm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 1bc93552151c..f341651d6f6c 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -108,10 +108,14 @@ static int ehci_msm_probe(struct platform_device *pdev)
108 * powering up VBUS, mapping of registers address space and power 108 * powering up VBUS, mapping of registers address space and power
109 * management. 109 * management.
110 */ 110 */
111 phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); 111 if (pdev->dev.of_node)
112 phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
113 else
114 phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
115
112 if (IS_ERR(phy)) { 116 if (IS_ERR(phy)) {
113 dev_err(&pdev->dev, "unable to find transceiver\n"); 117 dev_err(&pdev->dev, "unable to find transceiver\n");
114 ret = -ENODEV; 118 ret = -EPROBE_DEFER;
115 goto put_hcd; 119 goto put_hcd;
116 } 120 }
117 121
@@ -187,12 +191,19 @@ static const struct dev_pm_ops ehci_msm_dev_pm_ops = {
187 .resume = ehci_msm_pm_resume, 191 .resume = ehci_msm_pm_resume,
188}; 192};
189 193
194static struct of_device_id msm_ehci_dt_match[] = {
195 { .compatible = "qcom,ehci-host", },
196 {}
197};
198MODULE_DEVICE_TABLE(of, msm_ehci_dt_match);
199
190static struct platform_driver ehci_msm_driver = { 200static struct platform_driver ehci_msm_driver = {
191 .probe = ehci_msm_probe, 201 .probe = ehci_msm_probe,
192 .remove = ehci_msm_remove, 202 .remove = ehci_msm_remove,
193 .driver = { 203 .driver = {
194 .name = "msm_hsusb_host", 204 .name = "msm_hsusb_host",
195 .pm = &ehci_msm_dev_pm_ops, 205 .pm = &ehci_msm_dev_pm_ops,
206 .of_match_table = msm_ehci_dt_match,
196 }, 207 },
197}; 208};
198 209