From patchwork Fri Jun 17 12:03:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 9183695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAB0260573 for ; Fri, 17 Jun 2016 12:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99BF126C2F for ; Fri, 17 Jun 2016 12:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EA692835E; Fri, 17 Jun 2016 12:04:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D92C26C2F for ; Fri, 17 Jun 2016 12:04:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E3566EBDC; Fri, 17 Jun 2016 12:04:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D4F06EBDB for ; Fri, 17 Jun 2016 12:04:25 +0000 (UTC) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Fri, 17 Jun 2016 05:04:05 -0700 Received: from HQMAIL101.nvidia.com ([172.20.187.10]) by hqnvupgp08.nvidia.com (PGP Universal service); Fri, 17 Jun 2016 05:01:36 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 17 Jun 2016 05:01:36 -0700 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 17 Jun 2016 12:04:24 +0000 Received: from HQMAIL108.nvidia.com (172.18.146.13) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 17 Jun 2016 12:04:23 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Fri, 17 Jun 2016 12:04:23 +0000 Received: from jonathanh-lm.nvidia.com (Not Verified[10.21.132.108]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7, 5, 5, 8150) id ; Fri, 17 Jun 2016 05:04:23 -0700 From: Jon Hunter To: Thierry Reding , David Airlie , Stephen Warren , Alexandre Courbot , Wolfram Sang , Linus Walleij , Rob Herring , Mark Rutland Subject: [RFC PATCH 04/13] drm/tegra: Add sor-safe clock for DPAUX on Tegra210 Date: Fri, 17 Jun 2016 13:03:38 +0100 Message-ID: <1466165027-17917-5-git-send-email-jonathanh@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466165027-17917-1-git-send-email-jonathanh@nvidia.com> References: <1466165027-17917-1-git-send-email-jonathanh@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For Tegra210 the 'sor-safe' clock needs to be enabled when using DPAUX. Add support to the DPAUX driver for enabling this clock on Tegra210. Signed-off-by: Jon Hunter --- drivers/gpu/drm/tegra/dpaux.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index aa3a037fcd3b..d696a7e45935 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -37,6 +37,7 @@ struct tegra_dpaux { struct reset_control *rst; struct clk *clk_parent; + struct clk *clk_sor; struct clk *clk; struct regulator *vdd; @@ -340,18 +341,37 @@ static int tegra_dpaux_probe(struct platform_device *pdev) return PTR_ERR(dpaux->rst); } + if (of_device_is_compatible(pdev->dev.of_node, + "nvidia,tegra210-dpaux")) { + dpaux->clk_sor = devm_clk_get(&pdev->dev, "sor-safe"); + if (IS_ERR(dpaux->clk_sor)) { + dev_err(&pdev->dev, + "failed to get sor-safe clock: %ld\n", + PTR_ERR(dpaux->clk_sor)); + return PTR_ERR(dpaux->clk_sor); + } + + err = clk_prepare_enable(dpaux->clk_sor); + if (err < 0) { + dev_err(&pdev->dev, + "failed to enable sor-safe clock: %d\n", err); + return err; + } + } + dpaux->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(dpaux->clk)) { dev_err(&pdev->dev, "failed to get module clock: %ld\n", PTR_ERR(dpaux->clk)); - return PTR_ERR(dpaux->clk); + err = PTR_ERR(dpaux->clk); + goto disable_sor_clk; } err = clk_prepare_enable(dpaux->clk); if (err < 0) { dev_err(&pdev->dev, "failed to enable module clock: %d\n", err); - return err; + goto disable_sor_clk; } reset_control_deassert(dpaux->rst); @@ -434,6 +454,9 @@ disable_parent_clk: assert_reset: reset_control_assert(dpaux->rst); clk_disable_unprepare(dpaux->clk); +disable_sor_clk: + if (dpaux->clk_sor) + clk_disable_unprepare(dpaux->clk_sor); return err; } @@ -456,6 +479,8 @@ static int tegra_dpaux_remove(struct platform_device *pdev) clk_disable_unprepare(dpaux->clk_parent); reset_control_assert(dpaux->rst); clk_disable_unprepare(dpaux->clk); + if (dpaux->clk_sor) + clk_disable_unprepare(dpaux->clk_sor); return 0; }