Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5772902imm; Tue, 12 Jun 2018 13:06:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJXq2fbpRF3wrtwrUcRFEdgML+Oeop6pRYKeBfGgsTa8Pm1sbQZmnFkf765eTbBmPD6urWR X-Received: by 2002:a63:730d:: with SMTP id o13-v6mr1531388pgc.1.1528833969997; Tue, 12 Jun 2018 13:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528833969; cv=none; d=google.com; s=arc-20160816; b=RrquiSd83UPcL5Mb5YwthclVzufTMfeeWsu40Y+ps/Pk5XVnOmFMMn3870DRIixuqY 3GHZUdRP5X8uJcXACRinOwew3x7HgRESYywF90Ar9wSFDL0NtqG0MqBQNpB8XKTmu6CU R/N7LO/f4+ewicnqvwO+zQO+RRvJQwg+qzK2ulyNom+jLNrvagtkGx8KMgBm8fWto4/v 8Xmt8N/IbGMabyiKgFoTf2yb7vVoXmXqUCXsxuQAxos8bKm8Z7XzEIod2gmlOVvt/EwP n1dH4jRBxNWdJqncPYUY8psMMzlHVreH7TLbTvm/keTKioDfbqF4NWNxC4a+P56d7bgd X1qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qqb9/SK9JBHiOsxsdaAlhGT15PQaiYD+4Z5JA0euiMM=; b=tiw4oNXvquyarmvkvRrGKZ/1dcMip8/kRVyqdPtdCcn1mvJqPrcgOxL8KYSGty4a5n l2FCMH/Uda90RU+BM3S5hI/mPM2A+rwvd0NZXOuujetlVNPFvFjYzHLlW7bopzMnR6/q VhE/qY4mddTuHcseY5QCaRgccA45LtJFUDfcMomrr6q2o38SeFuY8/05TZKygnLnS7bY VxkAGMXIJ+9xOZLMBizKqOuDzL34zlzTSUjTSjmUbEENFK8f3AtmoRBClpsenlVDdvH7 9BdvQ7pUVkn4ZHBkhT9nCLGxx3E2bMDxQt9P7MVk3VQ1OVVsv+lHRWJBUx+FrPUAQ/6z AsZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2-v6si923464plr.223.2018.06.12.13.05.55; Tue, 12 Jun 2018 13:06:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934683AbeFLUEt (ORCPT + 99 others); Tue, 12 Jun 2018 16:04:49 -0400 Received: from mailoutvs9.siol.net ([185.57.226.200]:38695 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934464AbeFLUCj (ORCPT ); Tue, 12 Jun 2018 16:02:39 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 19D9F522431; Tue, 12 Jun 2018 22:02:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id moqK1QQACl-n; Tue, 12 Jun 2018 22:02:36 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id 8E7AC522020; Tue, 12 Jun 2018 22:02:36 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id 0E8F1522431; Tue, 12 Jun 2018 22:02:34 +0200 (CEST) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org, robh+dt@kernel.org Cc: airlied@linux.ie, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, mark.rutland@arm.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v2 19/27] drm/sun4i: Enable DW HDMI PHY clock Date: Tue, 12 Jun 2018 22:00:28 +0200 Message-Id: <20180612200036.21483-20-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612200036.21483-1-jernej.skrabec@siol.net> References: <20180612200036.21483-1-jernej.skrabec@siol.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current DW HDMI PHY code never prepares and enables PHY clock after it is created. It's just used as it is. This may work in some cases, but it's clearly wrong. Fix it by adding proper calls to enable/disable PHY clock. Fixes: 4f86e81748fe ("drm/sun4i: Add support for H3 HDMI PHY variant") Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c index 5a52fc489a9d..966688f04741 100644 --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c @@ -477,13 +477,15 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node) dev_err(dev, "Couldn't create the PHY clock\n"); goto err_put_clk_pll0; } + + clk_prepare_enable(phy->clk_phy); } phy->rst_phy = of_reset_control_get_shared(node, "phy"); if (IS_ERR(phy->rst_phy)) { dev_err(dev, "Could not get phy reset control\n"); ret = PTR_ERR(phy->rst_phy); - goto err_put_clk_pll0; + goto err_disable_clk_phy; } ret = reset_control_deassert(phy->rst_phy); @@ -514,6 +516,8 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node) reset_control_assert(phy->rst_phy); err_put_rst_phy: reset_control_put(phy->rst_phy); +err_disable_clk_phy: + clk_disable_unprepare(phy->clk_phy); err_put_clk_pll0: if (phy->variant->has_phy_clk) clk_put(phy->clk_pll0); @@ -531,6 +535,7 @@ void sun8i_hdmi_phy_remove(struct sun8i_dw_hdmi *hdmi) clk_disable_unprepare(phy->clk_mod); clk_disable_unprepare(phy->clk_bus); + clk_disable_unprepare(phy->clk_phy); reset_control_assert(phy->rst_phy); -- 2.17.1