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 <alcooperx@gmail.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
7890b16a99
commit
c87dca0478
1 changed files with 15 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
#include <linux/usb/ch9.h>
|
#include <linux/usb/ch9.h>
|
||||||
#include <linux/usb/gadget.h>
|
#include <linux/usb/gadget.h>
|
||||||
|
#include <linux/clk.h>
|
||||||
|
|
||||||
#include "bdc.h"
|
#include "bdc.h"
|
||||||
#include "bdc_dbg.h"
|
#include "bdc_dbg.h"
|
||||||
|
@ -452,8 +453,22 @@ static int bdc_probe(struct platform_device *pdev)
|
||||||
int irq;
|
int irq;
|
||||||
u32 temp;
|
u32 temp;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
|
struct clk *clk;
|
||||||
|
|
||||||
dev_dbg(dev, "%s()\n", __func__);
|
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);
|
bdc = devm_kzalloc(dev, sizeof(*bdc), GFP_KERNEL);
|
||||||
if (!bdc)
|
if (!bdc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Reference in a new issue