From patchwork Mon Feb 2 13:20:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5765851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 13AE7BF440 for ; Tue, 3 Feb 2015 01:07:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34FF420A27 for ; Tue, 3 Feb 2015 01:07:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6D4BE20A16 for ; Tue, 3 Feb 2015 01:07:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B965D6E59F; Mon, 2 Feb 2015 17:06:43 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by gabe.freedesktop.org (Postfix) with ESMTP id 754DC6E4A3 for ; Mon, 2 Feb 2015 05:20:48 -0800 (PST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJ5006EQBXFXZ30@mailout3.w1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 02 Feb 2015 13:24:51 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-31-54cf791e2302 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 30.E2.07834.E197FC45; Mon, 02 Feb 2015 13:18:22 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NJ5004YCBQ4PP60@eusync4.samsung.com>; Mon, 02 Feb 2015 13:20:47 +0000 (GMT) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v5 9/9] drm/exynos: add support for 'hdmi' clock Date: Mon, 02 Feb 2015 14:20:28 +0100 Message-id: <1422883228-10690-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1422883228-10690-1-git-send-email-m.szyprowski@samsung.com> References: <1422883228-10690-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xa7pyledDDLZ8E7S4te4cq8Wj+Y+Z La58fc9mMen+BBaLo78LLF7cu8hi0f/4NbPF2aY37BabHl9jtZhxfh+TRdfPn2wWa4/cZbdY tesPowOvx9/n11k8Fn3P8tg56y67x+JN+9k8Nq3qZPO4332cyWPzknqPvi2rGD0+b5IL4Izi sklJzcksSy3St0vgyljxbSljQYtoxZObixgbGC8LdjFyckgImEjcWdTOAmGLSVy4t56ti5GL Q0hgKaPE+uZ7zBBOH5PEigvfwKrYBAwlut52AVVxcIgIeEssv6YIUsMsMI9ZovXFOTaQGmEB B4m7+96xg9gsAqoSazd/YQaxeQU8JR7tXs4MsU1O4v/LFUwgNidQ/OPqp2D1QgIeEue2HGWd wMi7gJFhFaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZI0H7Zwbj4mNUhRgEORiUe3gfc50KE WBPLiitzDzFKcDArifBqWJwPEeJNSaysSi3Kjy8qzUktPsTIxMEp1cC4tOKyzCWxuev2S+c5 xSf2bDW7orG5vyU/eU7H+3CPOf91F22/9P6WhVrJxv2FU5/U9rMdCbki7HH7zD7+qgsWS+/e X/788mT1w4/yDwVLWxWnyf/+4r79FreoWWP6/k2/gjceMzytUeua/+stW3XcM5PgNp3SQ9WN p4qjfFYeXcTzsWF+b/I/JZbijERDLeai4kQAT5/CRDgCAAA= X-Mailman-Approved-At: Mon, 02 Feb 2015 17:06:40 -0800 Cc: Tobias Jakobi , dri-devel@lists.freedesktop.org, Daniel Drake , Andrzej Hajda , kyungmin.park@samsung.com, Kukjin Kim , Javier Martinez Canillas , Marek Szyprowski 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY 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 Mixed need to have hdmi clock enabled to properly perform power on/off sequences, so add handling of this clock directly to the mixer driver. Dependency between hdmi clock and mixer module has been observed on Exynos4 based boards. Suggested-by: Andrzej Hajda Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/video/exynos_mixer.txt | 1 + drivers/gpu/drm/exynos/exynos_mixer.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/video/exynos_mixer.txt b/Documentation/devicetree/bindings/video/exynos_mixer.txt index 08b394b1edbf..3e38128f866b 100644 --- a/Documentation/devicetree/bindings/video/exynos_mixer.txt +++ b/Documentation/devicetree/bindings/video/exynos_mixer.txt @@ -15,6 +15,7 @@ Required properties: a) mixer: Gate of Mixer IP bus clock. b) sclk_hdmi: HDMI Special clock, one of the two possible inputs of mixer mux. + c) hdmi: Gate of HDMI IP bus clock, needed together with sclk_hdmi. Example: diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 820b76234ef4..8212c8299625 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -72,6 +72,7 @@ struct mixer_resources { spinlock_t reg_slock; struct clk *mixer; struct clk *vp; + struct clk *hdmi; struct clk *sclk_mixer; struct clk *sclk_hdmi; struct clk *mout_mixer; @@ -774,6 +775,12 @@ static int mixer_resources_init(struct mixer_context *mixer_ctx) return -ENODEV; } + mixer_res->hdmi = devm_clk_get(dev, "hdmi"); + if (IS_ERR(mixer_res->hdmi)) { + dev_err(dev, "failed to get clock 'hdmi'\n"); + return PTR_ERR(mixer_res->hdmi); + } + mixer_res->sclk_hdmi = devm_clk_get(dev, "sclk_hdmi"); if (IS_ERR(mixer_res->sclk_hdmi)) { dev_err(dev, "failed to get clock 'sclk_hdmi'\n"); @@ -1095,6 +1102,7 @@ static void mixer_poweron(struct exynos_drm_manager *mgr) pm_runtime_get_sync(ctx->dev); clk_prepare_enable(res->mixer); + clk_prepare_enable(res->hdmi); if (ctx->vp_enabled) { clk_prepare_enable(res->vp); if (ctx->has_sclk) @@ -1134,6 +1142,7 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr) ctx->powered = false; mutex_unlock(&ctx->mixer_mutex); + clk_disable_unprepare(res->hdmi); clk_disable_unprepare(res->mixer); if (ctx->vp_enabled) { clk_disable_unprepare(res->vp);