diff options
Diffstat (limited to 'drivers/usb/host/ohci-platform.c')
-rw-r--r-- | drivers/usb/host/ohci-platform.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index c3e7287f7921..7c2738bf540a 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -16,6 +16,7 @@ #include <linux/err.h> #include <linux/platform_device.h> #include <linux/usb/ohci_pdriver.h> +#include <linux/clk.h> static int ohci_platform_reset(struct usb_hcd *hcd) { @@ -125,6 +126,19 @@ static int ohci_platform_probe(struct platform_device *dev) goto err_power; } + hcd->clk = devm_clk_get(&dev->dev, NULL); + if (IS_ERR(hcd->clk)) { + dev_err(&dev->dev, "failed to get clk\n"); + err = -ENODEV; + goto err_put_hcd; + } + + err = clk_prepare_enable(hcd->clk); + if (err < 0) { + dev_err(&dev->dev, "failed to enable clk %d\n", err); + goto err_put_hcd; + } + hcd->rsrc_start = res_mem->start; hcd->rsrc_len = resource_size(res_mem); @@ -155,6 +169,7 @@ static int ohci_platform_remove(struct platform_device *dev) struct usb_hcd *hcd = platform_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->dev.platform_data; + clk_disable_unprepare(hcd->clk); usb_remove_hcd(hcd); usb_put_hcd(hcd); platform_set_drvdata(dev, NULL); @@ -212,6 +227,12 @@ static const struct dev_pm_ops ohci_platform_pm_ops = { .resume = ohci_platform_resume, }; +static const struct of_device_id ohci_platform_ids[] = { + { .compatible = "generic-ohci", }, + { } +}; +MODULE_DEVICE_TABLE(of, ohci_platform_ids); + static struct platform_driver ohci_platform_driver = { .id_table = ohci_platform_table, .probe = ohci_platform_probe, |