From: Al Cooper Date: Wed, 19 Jul 2017 19:11:42 +0000 (-0400) Subject: usb: bdc: Add clock enable for new chips with a separate BDC clock X-Git-Tag: v4.14-rc1~150^2~31^2~14 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=c87dca047849b0fd75c48a7e0375afb93047446c;p=linux.git usb: bdc: Add clock enable for new chips with a separate BDC clock Newer SoC's have added a BDC clock to the Device Tree, so get and enable it. Signed-off-by: Al Cooper Signed-off-by: Florian Fainelli Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index e9bd8d4abca0..dda7b438ada8 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "bdc.h" #include "bdc_dbg.h" @@ -452,8 +453,22 @@ static int bdc_probe(struct platform_device *pdev) int irq; u32 temp; struct device *dev = &pdev->dev; + struct clk *clk; dev_dbg(dev, "%s()\n", __func__); + + clk = devm_clk_get(dev, "sw_usbd"); + if (IS_ERR(clk)) { + dev_info(dev, "Clock not found in Device Tree\n"); + clk = NULL; + } + + ret = clk_prepare_enable(clk); + if (ret) { + dev_err(dev, "could not enable clock\n"); + return ret; + } + bdc = devm_kzalloc(dev, sizeof(*bdc), GFP_KERNEL); if (!bdc) return -ENOMEM;