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: 5762261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB7509F3CA for ; Mon, 2 Feb 2015 13:23:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D60F4203C3 for ; Mon, 2 Feb 2015 13:23:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04609203C1 for ; Mon, 2 Feb 2015 13:23:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIGwU-0003Mu-KI; Mon, 02 Feb 2015 13:21:30 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIGw8-00037b-Uf for linux-arm-kernel@lists.infradead.org; Mon, 02 Feb 2015 13:21:09 +0000 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 linux-arm-kernel@lists.infradead.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150202_052109_136273_1158E524 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -5.0 (-----) Cc: jy0922.shim@samsung.com, Tobias Jakobi , Tomasz Figa , dri-devel@lists.freedesktop.org, Daniel Drake , Inki Dae , Andrzej Hajda , kyungmin.park@samsung.com, Kukjin Kim , Javier Martinez Canillas , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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);