From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A784DC433DF for ; Sat, 10 Oct 2020 23:16:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7205C20760 for ; Sat, 10 Oct 2020 23:16:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="PC35notr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730804AbgJJWvk (ORCPT ); Sat, 10 Oct 2020 18:51:40 -0400 Received: from o1.b.az.sendgrid.net ([208.117.55.133]:14372 "EHLO o1.b.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731242AbgJJTFJ (ORCPT ); Sat, 10 Oct 2020 15:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:to:cc:content-type: content-transfer-encoding; s=001; bh=nAJZakghzr7JwdXt31dydBHC6AGXJnAIYTAyCKaQf5U=; b=PC35notrsluMKEtXrx+00hA/7mdLEP0dYlDe5YZ4F97AxB2FbB1c+8wCFl2DT/ypo8SJ lktfdkzCJKjCzl6ik8zAmz7ahPHYTYZbHZAUJ/VCbQDdzWzpDWDvovYpuhFxqqZFIH7ARr liinpjGwGy/EmEckcg2tKrDKhnMhEQcwo= Received: by filterdrecv-p3mdw1-6685f47d68-ckbbx with SMTP id filterdrecv-p3mdw1-6685f47d68-ckbbx-20-5F81D403-62 2020-10-10 15:32:19.989765983 +0000 UTC m=+233779.068193756 Received: from bionic.localdomain (unknown) by ismtpd0005p1lon1.sendgrid.net (SG) with ESMTP id svU4HSZBQumIlycPppIvOg Sat, 10 Oct 2020 15:32:19.702 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v3 5/6] phy/rockchip: inno-hdmi: force set_rate on power_on Date: Sat, 10 Oct 2020 15:32:20 +0000 (UTC) Message-Id: <20201010153214.19722-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201010153214.19722-1-jonas@kwiboo.se> References: <20200108210740.28769-1-jonas@kwiboo.se> <20201010153214.19722-1-jonas@kwiboo.se> X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hyyYIFNv1tq5H+1qU?= =?us-ascii?Q?NYBOeobs=2FkbfAS1O=2Fyl8F4W63ETW0ZJQ8LdMpvZ?= =?us-ascii?Q?Xyiq4Ios7vQDZpdGL3Mwe6lFjuXN1joLZH8IGtl?= =?us-ascii?Q?mCzWhgIW9FS5VY78glB=2FH4sy=2FqfUu8YCOdDElAo?= =?us-ascii?Q?zoEZ7hwOMT7MB1ajMJUA7zqvt9i5Rq9fxR5fjUF?= =?us-ascii?Q?hRcD=2FqWbBOfWiOucUlMyg=3D=3D?= To: Kishon Vijay Abraham I , Heiko Stuebner Cc: Jonas Karlman , Vinod Koul , Zheng Yang , Algea Cao , Huicong Xu , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-Entity-ID: wSPGWgGSXUap++qShBI+ag== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huicong Xu Regular 8-bit and Deep Color video formats mainly differ in TMDS rate and not in pixel clock rate. When the hdmiphy clock is configured with the same pixel clock rate using clk_set_rate() the clock framework do not signal the hdmi phy driver to set_rate when switching between 8-bit and Deep Color. This result in pre/post pll not being re-configured when switching between regular 8-bit and Deep Color video formats. Fix this by calling set_rate in power_on to force pre pll re-configuration. Signed-off-by: Huicong Xu Signed-off-by: Jonas Karlman --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c index 3a59a6da0440..3719309ad0d0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -245,6 +245,7 @@ struct inno_hdmi_phy { struct clk_hw hw; struct clk *phyclk; unsigned long pixclock; + unsigned long tmdsclock; }; struct pre_pll_config { @@ -485,6 +486,8 @@ static int inno_hdmi_phy_power_on(struct phy *phy) dev_dbg(inno->dev, "Inno HDMI PHY Power On\n"); + inno->plat_data->clk_ops->set_rate(&inno->hw, inno->pixclock, 24000000); + ret = clk_prepare_enable(inno->phyclk); if (ret) return ret; @@ -509,6 +512,8 @@ static int inno_hdmi_phy_power_off(struct phy *phy) clk_disable_unprepare(inno->phyclk); + inno->tmdsclock = 0; + dev_dbg(inno->dev, "Inno HDMI PHY Power Off\n"); return 0; @@ -628,6 +633,9 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -670,6 +678,7 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } @@ -781,6 +790,9 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -820,6 +832,7 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4109DC43457 for ; Sat, 10 Oct 2020 15:32:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E37C622260 for ; Sat, 10 Oct 2020 15:32:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vfLm+0eH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="PC35notr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E37C622260 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kwiboo.se Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:References:In-Reply-To:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i9yHqgwkZLwFc0kzQ9VjZJShlBGqygJ3WjAh5AseEkM=; b=vfLm+0eHXa+o7jqTvsCfHhC5yC npE2ZIqlo7HkUEYmwq+pZmLjSmNPQM6+E7WyqcAdnSb+GtGYbNI61GbImRhCu7DFzzCphvgwhgihm 4rWu3+ynRJHdeTvE5+N2s2yyb8nmE4TA3FyO66lSJ5zM9Uscz3f/xbyRezQB3R8OovFb743sDw3wa EFpacuaJxSsFpUmJO1n5Qmq7O1alZHQiiRoiRdrOnhqqAlZq0BUHRyOser9N+cYvdQLGIO+CsEC/H Xdm/YzRLsVHZIdbZyMVV1sGpYLKg9tvwnw4iaVSv6PoNcXA1/8capho6dK/z2aquS56Lhb38haBhs z7eZdBiQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRGrM-0005US-DQ; Sat, 10 Oct 2020 15:32:36 +0000 Received: from o1.b.az.sendgrid.net ([208.117.55.133]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRGr6-0005Ph-8V for linux-rockchip@lists.infradead.org; Sat, 10 Oct 2020 15:32:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:to:cc:content-type: content-transfer-encoding; s=001; bh=nAJZakghzr7JwdXt31dydBHC6AGXJnAIYTAyCKaQf5U=; b=PC35notrsluMKEtXrx+00hA/7mdLEP0dYlDe5YZ4F97AxB2FbB1c+8wCFl2DT/ypo8SJ lktfdkzCJKjCzl6ik8zAmz7ahPHYTYZbHZAUJ/VCbQDdzWzpDWDvovYpuhFxqqZFIH7ARr liinpjGwGy/EmEckcg2tKrDKhnMhEQcwo= Received: by filterdrecv-p3mdw1-6685f47d68-ckbbx with SMTP id filterdrecv-p3mdw1-6685f47d68-ckbbx-20-5F81D403-62 2020-10-10 15:32:19.989765983 +0000 UTC m=+233779.068193756 Received: from bionic.localdomain (unknown) by ismtpd0005p1lon1.sendgrid.net (SG) with ESMTP id svU4HSZBQumIlycPppIvOg Sat, 10 Oct 2020 15:32:19.702 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v3 5/6] phy/rockchip: inno-hdmi: force set_rate on power_on Date: Sat, 10 Oct 2020 15:32:20 +0000 (UTC) Message-Id: <20201010153214.19722-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201010153214.19722-1-jonas@kwiboo.se> References: <20200108210740.28769-1-jonas@kwiboo.se> <20201010153214.19722-1-jonas@kwiboo.se> X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hyyYIFNv1tq5H+1qU?= =?us-ascii?Q?NYBOeobs=2FkbfAS1O=2Fyl8F4W63ETW0ZJQ8LdMpvZ?= =?us-ascii?Q?Xyiq4Ios7vQDZpdGL3Mwe6lFjuXN1jozWnTAwa4?= =?us-ascii?Q?i6uR8hNyQPJm4PDnCFedxACFRSyb7fRfuYRApqL?= =?us-ascii?Q?aRyA16Mpopbrp5JehyGNqrUs8WqYupjbP1EuYO5?= =?us-ascii?Q?+cgo=2FPW7E2AV8sJwtDl3w=3D=3D?= To: Kishon Vijay Abraham I , Heiko Stuebner X-Entity-ID: wSPGWgGSXUap++qShBI+ag== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201010_113220_383992_EF8B0CA3 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , Jonas Karlman , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Vinod Koul , Huicong Xu , linux-arm-kernel@lists.infradead.org, Zheng Yang MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Huicong Xu Regular 8-bit and Deep Color video formats mainly differ in TMDS rate and not in pixel clock rate. When the hdmiphy clock is configured with the same pixel clock rate using clk_set_rate() the clock framework do not signal the hdmi phy driver to set_rate when switching between 8-bit and Deep Color. This result in pre/post pll not being re-configured when switching between regular 8-bit and Deep Color video formats. Fix this by calling set_rate in power_on to force pre pll re-configuration. Signed-off-by: Huicong Xu Signed-off-by: Jonas Karlman --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c index 3a59a6da0440..3719309ad0d0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -245,6 +245,7 @@ struct inno_hdmi_phy { struct clk_hw hw; struct clk *phyclk; unsigned long pixclock; + unsigned long tmdsclock; }; struct pre_pll_config { @@ -485,6 +486,8 @@ static int inno_hdmi_phy_power_on(struct phy *phy) dev_dbg(inno->dev, "Inno HDMI PHY Power On\n"); + inno->plat_data->clk_ops->set_rate(&inno->hw, inno->pixclock, 24000000); + ret = clk_prepare_enable(inno->phyclk); if (ret) return ret; @@ -509,6 +512,8 @@ static int inno_hdmi_phy_power_off(struct phy *phy) clk_disable_unprepare(inno->phyclk); + inno->tmdsclock = 0; + dev_dbg(inno->dev, "Inno HDMI PHY Power Off\n"); return 0; @@ -628,6 +633,9 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -670,6 +678,7 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } @@ -781,6 +790,9 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -820,6 +832,7 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } -- 2.17.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87898C433DF for ; Sat, 10 Oct 2020 15:34:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3792822260 for ; Sat, 10 Oct 2020 15:34:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0Gx0IPAE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="PC35notr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3792822260 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kwiboo.se Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:References:In-Reply-To:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DHSTxk+1dPjslZVJsfFn0+dAKOyZ+OXJ4Bmiabm/DaU=; b=0Gx0IPAEod7u3UDWbrw/dLBzan chew1nI0aJM4OVt30jRfg33+hDQz2xvraPjxJBYV2xdiNOYQke1qLBCFioSL0+7FLmO3R4hCPDNwV xgZVDXI2nwCb837n9N5NwZEd3aZa/3CXknIIlPWeLfBzKIuxQIeA2H9h9N7uL6vlX+X3B8gd0C16V imqmIklMgjCeFbdwx1TlXY+w2bWLEcrLO7IXCrcp1lqvvMYCtX7U6KESUm1aVvwdfJH0lrpO+xDZt v/el1P+HMli+ijfp6YHeZgnPFn4LQ3iq9FlVPu5S7Z1HjFe25shwruEhN6hA252zdaw0d9x4HioES ZL8Iq2oA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRGrO-0005Um-3P; Sat, 10 Oct 2020 15:32:38 +0000 Received: from o1.b.az.sendgrid.net ([208.117.55.133]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRGr6-0005Pf-8K for linux-arm-kernel@lists.infradead.org; Sat, 10 Oct 2020 15:32:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:to:cc:content-type: content-transfer-encoding; s=001; bh=nAJZakghzr7JwdXt31dydBHC6AGXJnAIYTAyCKaQf5U=; b=PC35notrsluMKEtXrx+00hA/7mdLEP0dYlDe5YZ4F97AxB2FbB1c+8wCFl2DT/ypo8SJ lktfdkzCJKjCzl6ik8zAmz7ahPHYTYZbHZAUJ/VCbQDdzWzpDWDvovYpuhFxqqZFIH7ARr liinpjGwGy/EmEckcg2tKrDKhnMhEQcwo= Received: by filterdrecv-p3mdw1-6685f47d68-ckbbx with SMTP id filterdrecv-p3mdw1-6685f47d68-ckbbx-20-5F81D403-62 2020-10-10 15:32:19.989765983 +0000 UTC m=+233779.068193756 Received: from bionic.localdomain (unknown) by ismtpd0005p1lon1.sendgrid.net (SG) with ESMTP id svU4HSZBQumIlycPppIvOg Sat, 10 Oct 2020 15:32:19.702 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v3 5/6] phy/rockchip: inno-hdmi: force set_rate on power_on Date: Sat, 10 Oct 2020 15:32:20 +0000 (UTC) Message-Id: <20201010153214.19722-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201010153214.19722-1-jonas@kwiboo.se> References: <20200108210740.28769-1-jonas@kwiboo.se> <20201010153214.19722-1-jonas@kwiboo.se> X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hyyYIFNv1tq5H+1qU?= =?us-ascii?Q?NYBOeobs=2FkbfAS1O=2Fyl8F4W63ETW0ZJQ8LdMpvZ?= =?us-ascii?Q?Xyiq4Ios7vQDZpdGL3Mwe6lFjuXN1jpUjyJ23XE?= =?us-ascii?Q?36iemJDYWvFwuG48f3zchrzY6FEAPEmcFpbmiBN?= =?us-ascii?Q?+ALFiHjyO3swFoURJRwKh58QiWxd3QkpVOZk=2Fsz?= =?us-ascii?Q?t6XV24plpsg+U=2F5CH6N=2FA=3D=3D?= To: Kishon Vijay Abraham I , Heiko Stuebner X-Entity-ID: wSPGWgGSXUap++qShBI+ag== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201010_113220_374685_455A923D X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , Jonas Karlman , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Vinod Koul , Huicong Xu , linux-arm-kernel@lists.infradead.org, Zheng Yang MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Huicong Xu Regular 8-bit and Deep Color video formats mainly differ in TMDS rate and not in pixel clock rate. When the hdmiphy clock is configured with the same pixel clock rate using clk_set_rate() the clock framework do not signal the hdmi phy driver to set_rate when switching between 8-bit and Deep Color. This result in pre/post pll not being re-configured when switching between regular 8-bit and Deep Color video formats. Fix this by calling set_rate in power_on to force pre pll re-configuration. Signed-off-by: Huicong Xu Signed-off-by: Jonas Karlman --- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c index 3a59a6da0440..3719309ad0d0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c @@ -245,6 +245,7 @@ struct inno_hdmi_phy { struct clk_hw hw; struct clk *phyclk; unsigned long pixclock; + unsigned long tmdsclock; }; struct pre_pll_config { @@ -485,6 +486,8 @@ static int inno_hdmi_phy_power_on(struct phy *phy) dev_dbg(inno->dev, "Inno HDMI PHY Power On\n"); + inno->plat_data->clk_ops->set_rate(&inno->hw, inno->pixclock, 24000000); + ret = clk_prepare_enable(inno->phyclk); if (ret) return ret; @@ -509,6 +512,8 @@ static int inno_hdmi_phy_power_off(struct phy *phy) clk_disable_unprepare(inno->phyclk); + inno->tmdsclock = 0; + dev_dbg(inno->dev, "Inno HDMI PHY Power Off\n"); return 0; @@ -628,6 +633,9 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -670,6 +678,7 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } @@ -781,6 +790,9 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n", __func__, rate, tmdsclock); + if (inno->pixclock == rate && inno->tmdsclock == tmdsclock) + return 0; + cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -820,6 +832,7 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw, } inno->pixclock = rate; + inno->tmdsclock = tmdsclock; return 0; } -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel