From patchwork Sat Sep 30 01:45:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: crj X-Patchwork-Id: 9978997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C8556034B for ; Sat, 30 Sep 2017 01:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DF93297A4 for ; Sat, 30 Sep 2017 01:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42DC5298A4; Sat, 30 Sep 2017 01:45:44 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 CE461297A4 for ; Sat, 30 Sep 2017 01:45:43 +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:References: In-Reply-To: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:List-Owner; bh=JJa2xAkKvJsbRlJ60hdpsQIhbOPu0ULIk6nstYapF3o=; b=ZmoVizfcg5qtvq955EMl5HfesL rsAYThQJ5hxkBJFiT8JrfVZBmvb5VGdU8iUS5VvKPxSA0WW2bGvCMjzu0Bg+YUf4b0EQvatUHK76h ZrpPdwhlu9sQ3c3nzDOr7LcYCtsYXlx5Z8A2A8O1PPIx740/KaW8M3I8jTvDPPHAjApDUrpSHlQg0 Bn2ZnaHZLcZvgM2LI7KX6FnEZAdClhBevR2efdLdkjHDp9yRSIuR39zb9Kc1QUxMQv0dp6qjhXIuI VEx9VVKtkOjYVrwmFcCCNLvDfPuY41w7dQQElNv5/NYxh1P3ts9Of3lXexLtQ90BN+Wz6DzTb5oC4 hH7zM0fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dy6qd-0008JT-Hn; Sat, 30 Sep 2017 01:45:43 +0000 Received: from regular1.263xmail.com ([211.150.99.140]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dy6qa-0007xi-JX for linux-rockchip@lists.infradead.org; Sat, 30 Sep 2017 01:45:42 +0000 Received: from algea.cao?rock-chips.com (unknown [192.168.167.204]) by regular1.263xmail.com (Postfix) with ESMTP id CBB234A2B; Sat, 30 Sep 2017 09:45:16 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 1174C3B5; Sat, 30 Sep 2017 09:45:13 +0800 (CST) X-RL-SENDER: algea.cao@rock-chips.com X-FST-TO: daniel.vetter@intel.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: algea.cao@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: algea.cao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 223970C6AI9; Sat, 30 Sep 2017 09:45:16 +0800 (CST) From: Algea Cao To: daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 5/7] drm/rockchip: dw_hdmi: add hclk_vio Date: Sat, 30 Sep 2017 09:45:12 +0800 Message-Id: <1506735912-152263-1-git-send-email-algea.cao@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506735713-147081-0> References: <1506735713-147081-0> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_184541_033536_C07A627B X-CRM114-Status: UNSURE ( 7.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , yang.zheng@rock-chips.com, kever.yang@rock-chips.com, mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add clk hclk_vio and enable it when hdmi bind. Signed-off-by: Algea Cao --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 7658b2f..e1a9941 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -61,6 +61,7 @@ struct rockchip_hdmi { enum dw_hdmi_devtype dev_type; struct clk *vpll_clk; struct clk *grf_clk; + struct clk *hclk_vio; struct phy *phy; }; @@ -277,12 +278,27 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) return PTR_ERR(hdmi->grf_clk); } + hdmi->hclk_vio = devm_clk_get(hdmi->dev, "hclk_vio"); + if (PTR_ERR(hdmi->hclk_vio) == -ENOENT) { + hdmi->hclk_vio = NULL; + } else if (PTR_ERR(hdmi->hclk_vio) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (IS_ERR(hdmi->hclk_vio)) { + dev_dbg(hdmi->dev, "failed to get hclk_vio clock\n"); + return PTR_ERR(hdmi->hclk_vio); + } ret = clk_prepare_enable(hdmi->vpll_clk); if (ret) { dev_err(hdmi->dev, "Failed to enable HDMI vpll: %d\n", ret); return ret; } + ret = clk_prepare_enable(hdmi->hclk_vio); + if (ret) { + dev_dbg(hdmi->dev, "Failed to eanble HDMI hclk_vio: %d\n", + ret); + return ret; + } return 0; } @@ -506,6 +522,11 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, void *data) { + struct rockchip_hdmi *hdmi = container_of(&dev, struct rockchip_hdmi, + dev); + + clk_disable_unprepare(hdmi->hclk_vio); + return dw_hdmi_unbind(dev); }