From patchwork Fri Oct 13 22:53:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Hugues Husson X-Patchwork-Id: 10006085 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 0864660230 for ; Fri, 13 Oct 2017 22:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAB57290C9 for ; Fri, 13 Oct 2017 22:55:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF95429183; Fri, 13 Oct 2017 22:55:21 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 5E869290C9 for ; Fri, 13 Oct 2017 22:55:21 +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=uwF3P+TqK5K+hA3TXrTBcl9mVX7uUx8RqgtMKIdRo3A=; b=MV3PX+vxyywvJltFbtygLj+FUe GdvtEntX/I5hiCNrGlGIrtAeIUYJF7EBh8EgpMqpmyg+J2ubhOAEfHtDx6T08zUFNpLCoFESZ2dK1 9IszSzLyVPuCMO8g1PEe92mATKogITanutIJccNpvNqj2+LSVf81H1rgcmRFMHJdCGwhNJLRGsAWf hjV2pG9dIp1f6itEC8YC4ZZAqENMGO1S2kE8+oWFR3ZwGXZdgxyUQp0oi2KtxAOCQAHlz7GFuSop1 xzm2dTeTWQ5AUFyeaX5zlmTuSPtdVfZhlgEiOJViu+f+1sbGU/PX98C+WzGbtVkf4ZFvU7M74B8PZ AU438hZQ==; 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 1e38r4-00067L-Cb; Fri, 13 Oct 2017 22:54:58 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e38qI-0005NY-3R; Fri, 13 Oct 2017 22:54:13 +0000 Received: by mail-wm0-x242.google.com with SMTP id k4so24302129wmc.1; Fri, 13 Oct 2017 15:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+IKRbe1f3YE5K9IF4xVXPAFXL/Qfo4rLhWNJiCa9qSc=; b=CEPJhlb1x9U5Fw5+jG7l7Qg8tpRFsUN780FKOaBTXWs4io6Bk2PGSLT4a33UQoetvH 1FKelNE/wXZ+oDg6mayPceWEVSlzAEdAmt33+GCgaNerTkeH+JeViDFgf+7exjZwSdIe QP+Xdiqqr6eqFqe2bdFiIUiMcld3eJognBgZ7oBQFcMHk+VxgNpGwNjfDK11Axe+Tjlw wmcLreH5mgDBaFMF2apyqCrJDh59sdUhf7gYy+1EEYlhx5UJP2TyBpg5nnmBEQaa2t0P CSU0sLMumpBESACHSqThxcWnYizOO6hvoGahDMqnG+BtGFilPsTgAs5/xY1kqmMgbOu4 YojA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+IKRbe1f3YE5K9IF4xVXPAFXL/Qfo4rLhWNJiCa9qSc=; b=HZGbc7jETjjCdRvw0eOXOz+N6kBw5ldtk5Fd+W4wCIyq49pQFi96UlWEcHmyPVm8WW vQZTvd+fUy4nHP/jT7xR1F1zxEuxOAf9VaL9YzjF2ukxp+/6DkA7rd7G0j/P7nk/Iezv b5h2M6dXYRsb7btwdJQH8Fj8oNjXTqsWJx3BQtOPEEFFYlLjDbKtLRCrZSz0WmYDculD X2O+uq3+Wi1VI9S/kxwd6/b72ZOPmVe6ZZrsU0m3BbvPuIpIyG/cua07d0sM9dEbVBCA 6JsQmpFJP22MPeMCZda7eoitBNS7Gn69p4TXN+rUoqVaHQsXwAq5ZBlmUje5eLlaoW7W 31Tw== X-Gm-Message-State: AMCzsaWCzkPo71OI1J2owmxRPGj8GoucdDAve4wryEiTkOHwmnk2xP6a FcDG/JvLE/IRqYx6C5Aac+UZULD1 X-Google-Smtp-Source: ABhQp+QSvEn+XaRYKACOP9mRhd9yYT7ne8g/C6rNq2WJdqQQ84o3tzXhx9Kw2EtGN0kdCesJxq493Q== X-Received: by 10.28.154.137 with SMTP id c131mr2846219wme.142.1507935228175; Fri, 13 Oct 2017 15:53:48 -0700 (PDT) Received: from phh-desktop.rezel.net (2a01cb000a08d500a1dfa11427700a23.ipv6.abo.wanadoo.fr. [2a01:cb00:a08:d500:a1df:a114:2770:a23]) by smtp.gmail.com with ESMTPSA id w4sm2304777wrc.17.2017.10.13.15.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 15:53:46 -0700 (PDT) From: Pierre-Hugues Husson To: linux-rockchip@lists.infradead.org Subject: [PATCH 1/3] drm: bridge: synopsys/dw-hdmi: Enable cec clock Date: Sat, 14 Oct 2017 00:53:35 +0200 Message-Id: <20171013225337.5196-2-phh@phh.me> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013225337.5196-1-phh@phh.me> References: <20171013225337.5196-1-phh@phh.me> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171013_155410_307605_58000AEE X-CRM114-Status: UNSURE ( 8.88 ) 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: Pierre-Hugues Husson , linux-media@vger.kernel.org, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 The documentation already mentions "cec" optional clock, but currently the driver doesn't enable it. Signed-off-by: Pierre-Hugues Husson Acked-by: Hans Verkuil Tested-by: Hans Verkuil --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index bf14214fa464..5007cdf43131 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -138,6 +138,7 @@ struct dw_hdmi { struct device *dev; struct clk *isfr_clk; struct clk *iahb_clk; + struct clk *cec_clk; struct dw_hdmi_i2c *i2c; struct hdmi_data_info hdmi_data; @@ -2382,6 +2383,18 @@ __dw_hdmi_probe(struct platform_device *pdev, goto err_isfr; } + hdmi->cec_clk = devm_clk_get(hdmi->dev, "cec"); + if (IS_ERR(hdmi->cec_clk)) { + hdmi->cec_clk = NULL; + } else { + ret = clk_prepare_enable(hdmi->cec_clk); + if (ret) { + dev_err(hdmi->dev, "Cannot enable HDMI cec clock: %d\n", + ret); + goto err_res; + } + } + /* Product and revision IDs */ hdmi->version = (hdmi_readb(hdmi, HDMI_DESIGN_ID) << 8) | (hdmi_readb(hdmi, HDMI_REVISION_ID) << 0); @@ -2518,6 +2531,8 @@ __dw_hdmi_probe(struct platform_device *pdev, cec_notifier_put(hdmi->cec_notifier); clk_disable_unprepare(hdmi->iahb_clk); + if (hdmi->cec_clk) + clk_disable_unprepare(hdmi->cec_clk); err_isfr: clk_disable_unprepare(hdmi->isfr_clk); err_res: @@ -2541,6 +2556,8 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi) clk_disable_unprepare(hdmi->iahb_clk); clk_disable_unprepare(hdmi->isfr_clk); + if (hdmi->cec_clk) + clk_disable_unprepare(hdmi->cec_clk); if (hdmi->i2c) i2c_del_adapter(&hdmi->i2c->adap);