Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbdF0SYd (ORCPT ); Tue, 27 Jun 2017 14:24:33 -0400 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170]:43388 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbdF0SYY (ORCPT ); Tue, 27 Jun 2017 14:24:24 -0400 From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Al Cooper , Florian Fainelli , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi , yuan linyu , linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), bcm-kernel-feedback-list@broadcom.com Subject: [PATCH 3/8] usb: bdc: Add clock enable for new chips with a separate BDC clock Date: Tue, 27 Jun 2017 14:23:21 -0400 Message-Id: <1498587806-24781-4-git-send-email-alcooperx@gmail.com> X-Mailer: git-send-email 1.9.0.138.g2de3478 In-Reply-To: <1498587806-24781-1-git-send-email-alcooperx@gmail.com> References: <1498587806-24781-1-git-send-email-alcooperx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 46 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 --- drivers/usb/gadget/udc/bdc/bdc_core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index ccb9c21..3bd82d2 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; -- 1.9.0.138.g2de3478