From patchwork Tue Oct 7 10:19:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 5044641 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0611A9F30B for ; Tue, 7 Oct 2014 10:19:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1782C201C8 for ; Tue, 7 Oct 2014 10:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 097D72010C for ; Tue, 7 Oct 2014 10:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbaJGKTu (ORCPT ); Tue, 7 Oct 2014 06:19:50 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:57152 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbaJGKTp (ORCPT ); Tue, 7 Oct 2014 06:19:45 -0400 Received: by mail-pd0-f176.google.com with SMTP id fp1so4865764pdb.21 for ; Tue, 07 Oct 2014 03:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FfgKFuzEwi4vgLwwIdrmAQlzIML6EaS10tW6VTO4LZs=; b=aAp+ECgkbBfScO0nh1hAdLenOqyVdEmBVDpElGEI///o7yP2FICNkxUVdGeWNSm3kX jwSAJXcPmxKjGioP5TqNrljyuaS9oyIzy2zD96zArRHcd0Uf+oAZdnyLmKFlkCYrrquL og0q2zcR7Nn9ilBCYgv8cg/xx2JmZj5TTB8Ut40k1lb4mVvoyo3mpy8KsXjQZBDjVoKT Cv8VrsxB8xf0W/E5HDe7Fmr2gLCbKRy3LYjKs0lxo/4AFN3Mu60ts5smJeBulOCqNlVa /z6Wq96wvKwKpRA1cSaOsVyIM1BLWxBw2HgNXOR8nmgJUo/njkN0vX61FpEB+mVLZnkl rQOQ== X-Received: by 10.70.119.8 with SMTP id kq8mr3030085pdb.1.1412677185242; Tue, 07 Oct 2014 03:19:45 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id ca3sm15514850pbb.80.2014.10.07.03.19.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 03:19:44 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, balbi@ti.com, kgene.kim@samsung.com, mark.rutland@arm.com, pawel.moll@arm.com, robh+dt@kernel.org, kishon@ti.com, Vivek Gautam Subject: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7 Date: Tue, 7 Oct 2014 15:49:33 +0530 Message-Id: <1412677176-3850-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1412677176-3850-1-git-send-email-gautam.vivek@samsung.com> References: <1412677176-3850-1-git-send-email-gautam.vivek@samsung.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Exynos7 also has a separate special gate clock going to the IP apart from the usual AHB clock. So add support for the same. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/dwc3-exynos.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 3951a65..7dc6a98 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -35,6 +35,7 @@ struct dwc3_exynos { struct device *dev; struct clk *clk; + struct clk *sclk; struct regulator *vdd33; struct regulator *vdd10; }; @@ -139,10 +140,21 @@ static int dwc3_exynos_probe(struct platform_device *pdev) return -EINVAL; } + /* + * Exynos7 has a special gate clock going to this IP, + * which in earlier SoCs was probably concealed. + */ + exynos->sclk = devm_clk_get(dev, "usbdrd30_sclk"); + if (IS_ERR(exynos->sclk)) { + dev_info(dev, "no sclk specified\n"); + exynos->sclk = NULL; + } + exynos->dev = dev; exynos->clk = clk; clk_prepare_enable(exynos->clk); + clk_prepare_enable(exynos->sclk); exynos->vdd33 = devm_regulator_get(dev, "vdd33"); if (IS_ERR(exynos->vdd33)) { @@ -185,6 +197,7 @@ err4: err3: regulator_disable(exynos->vdd33); err2: + clk_disable_unprepare(exynos->sclk); clk_disable_unprepare(clk); return ret; } @@ -197,6 +210,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev) platform_device_unregister(exynos->usb2_phy); platform_device_unregister(exynos->usb3_phy); + clk_disable_unprepare(exynos->sclk); clk_disable_unprepare(exynos->clk); regulator_disable(exynos->vdd33); @@ -218,6 +232,7 @@ static int dwc3_exynos_suspend(struct device *dev) { struct dwc3_exynos *exynos = dev_get_drvdata(dev); + clk_disable(exynos->sclk); clk_disable(exynos->clk); regulator_disable(exynos->vdd33); @@ -243,6 +258,7 @@ static int dwc3_exynos_resume(struct device *dev) } clk_enable(exynos->clk); + clk_enable(exynos->sclk); /* runtime set active to reflect active state. */ pm_runtime_disable(dev);