summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-msm.c
diff options
context:
space:
mode:
authorIvan T. Ivanov <iivanov@mm-sol.com>2013-10-11 14:46:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-11 16:31:15 -0700
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)
* powering up VBUS, mapping of registers address space and power
* management.
*/
- phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
+ if (pdev->dev.of_node)
+ phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
+ else
+ phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
+
if (IS_ERR(phy)) {
dev_err(&pdev->dev, "unable to find transceiver\n");
- ret = -ENODEV;
+ ret = -EPROBE_DEFER;
goto put_hcd;
}
@@ -187,12 +191,19 @@ static const struct dev_pm_ops ehci_msm_dev_pm_ops = {
.resume = ehci_msm_pm_resume,
};
+static struct of_device_id msm_ehci_dt_match[] = {
+ { .compatible = "qcom,ehci-host", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, msm_ehci_dt_match);
+
static struct platform_driver ehci_msm_driver = {
.probe = ehci_msm_probe,
.remove = ehci_msm_remove,
.driver = {
.name = "msm_hsusb_host",
.pm = &ehci_msm_dev_pm_ops,
+ .of_match_table = msm_ehci_dt_match,
},
};