From patchwork Tue Jan 22 07:32:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10775005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FB9913B5 for ; Tue, 22 Jan 2019 07:32:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA932A937 for ; Tue, 22 Jan 2019 07:32:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 228A62A93A; Tue, 22 Jan 2019 07:32:43 +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.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AE062A937 for ; Tue, 22 Jan 2019 07:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=IsXxt4Bzj3krWA+nU7rg+7rjifGM+897fSrQwyT2r3c=; b=I22 IfDUAXGXZnQ2XLcJq2iICMqppgaVCLSOFA6Pz5xXkCBtRJCbOoMc55uW7Kx/lzrZITzdiYLioRqKE P0z1sdsqn3LC8S1QRaqp7TfFkZFzAB5rtXhjwx5xh4UWVuQ9yCFx8Rg/HP4wfw6cmf/grDqoudoOV 6u+24tI2uzMg6AurLZVQUwhUmKThkhoOX40pPZ+FnKJUOoCNZxdtSX3e3pKt4u3/xdf6ZpkeWKq5T v5icllr08Jnlc99/5FADdFgQ/JflmqSi2y15sXrwScydbekV7f9FfFBuRZzjdVlilZ/s/3etEuqPf cpa2WAr3nZXPJb9k6MlZ4JiUiXciO1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1glqY3-0004UI-Cn; Tue, 22 Jan 2019 07:32:39 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glqY0-0004Is-Gg for linux-arm-kernel@lists.infradead.org; Tue, 22 Jan 2019 07:32:38 +0000 Received: from localhost (unknown [IPv6:2001:bb8:4008:ff:21a:64ff:fe97:f62]) by plaes.org (Postfix) with ESMTPSA id 4366E40377; Tue, 22 Jan 2019 07:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1548142354; bh=B1Qep9dESQIpSgo3ifGmlcmiBpGPcpysADD3kbecHoI=; h=From:To:Cc:Subject:Date:From; b=jI91dIFhE51RhvSc3Ns5QVancwYQOppbWroe3RREntyxrC4DxKFTEr8gG6nnCEmUj 1hc0Rzd5hD8t/5jP5h5vqJOSF/bb7zwp795niUohEZU+rsQOX0UZ7FLSbh3455mdzn iyY+64aNn8zKfZXqTKux4ezUbGhkWt0ciw1Pc/Tdkc0a3ZIiqHKp9tJM/j3HtEijiL TphNjOzZAy2XoUta3m4/j+7O7NP62NxBWSQBIPgtnVm1xgI9Wskzo5UnaqysdTOb4q yrpOv/yRbTee1HQbK3M90L/StNDW2vfwbUlM3c6E1Cds+9VhpL5VZhiffIjuHPz8E5 L+uY1yvHoEoMw== From: Priit Laes To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/sun4i: hdmi: Fix usage of TMDS clock Date: Tue, 22 Jan 2019 09:32:32 +0200 Message-Id: <20190122073232.7240-1-plaes@plaes.org> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190121_233236_768809_FDE6AB16 X-CRM114-Status: UNSURE ( 7.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Priit Laes MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Priit Laes Although TMDS clock is required for HDMI to properly function, nobody called clk_prepare_enable(). This fixes reference counting issues and makes sure clock is running when it needs to be running. Due to TDMS clock being parent clock for DDC clock, TDMS clock was turned on/off for each EDID probe, causing spurious failures for certain HDMI/DVI screens. Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support") Signed-off-by: Priit Laes --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 061d2e0d9011..25f4d676fd82 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG); val &= ~SUN4I_HDMI_VID_CTRL_ENABLE; writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG); + + clk_disable_unprepare(hdmi->tmds_clk); } static void sun4i_hdmi_enable(struct drm_encoder *encoder) @@ -112,6 +114,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE; writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG); + + clk_prepare_enable(hdmi->tmds_clk); } static void sun4i_hdmi_mode_set(struct drm_encoder *encoder,