From patchwork Tue May 15 13:47:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 10401137 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 8629B601F9 for ; Tue, 15 May 2018 13:54:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 740502880F for ; Tue, 15 May 2018 13:54:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 688932881C; Tue, 15 May 2018 13:54:23 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 097C42880F for ; Tue, 15 May 2018 13:54:22 +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=F8IPW//NY+QvuCOCOH31+QyvztV0/8bLDScZ8zDf9Ec=; b=ie8/VVlnZzUa9EAnwVlVLOY3gE 4CroI791fyp7GNFsx3SThvjolwK1Ienw8QDmSgYBd+qFq2U9kppMQVuJzvrX52Igq92T2mIpBS4rP DWtP7jaG1Eu1OUrrQjcnrnVmyfDJUQX4PdaAUaVigcY+jpDlcLpKMUqy8Mp06zBT1rlL24emsoRfZ 5UiLwVq85gHq4KrHXaY3G3qB1HQQiVCI4GPg6L936VtiIxR8biDqsiQey+bDpX7iTcZCLx6000Itp +zfWhqR8M3wi5Eq6WBavFBV63T/Yuou4zinK9uwissEQpzKvQVYnnPfwg/IjeDWVihgJ7t9gNNjIJ 4FsjFKvQ==; 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 1fIaP7-0006br-Ki; Tue, 15 May 2018 13:54:13 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIaJN-0002co-RN; Tue, 15 May 2018 13:48:22 +0000 Received: from wd0766.dip.tu-dresden.de ([141.76.110.254] helo=phil.dip.tu-dresden.de) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fIaJ0-0001QX-B5; Tue, 15 May 2018 15:47:54 +0200 From: Heiko Stuebner To: architt@codeaurora.org, a.hajda@samsung.com Subject: [PATCH v3 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching Date: Tue, 15 May 2018 15:47:32 +0200 Message-Id: <20180515134736.5824-3-heiko@sntech.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515134736.5824-1-heiko@sntech.de> References: <20180515134736.5824-1-heiko@sntech.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180515_064818_129879_1E4E5E1B X-CRM114-Status: GOOD ( 14.15 ) 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: mark.rutland@arm.com, Jose.Abreu@synopsys.com, algea.cao@rock-chips.com, Heiko Stuebner , devicetree@vger.kernel.org, hjc@rock-chips.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, zhengyang@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 So far we always encountered socs with 2 output crtcs needing the driver to tell the hdmi block which output to connect to. But there also exist socs with only one crtc like the rk3228, rk3328 and rk3368. So adapt the register field to simply carry a negative value to signal that no output-switching is necessary. Signed-off-by: Heiko Stuebner Tested-by: Robin Murphy --- changes in v3: - fixed wording issue found by Robin Murphy drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 11309a2a4e43..b09c3531305b 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -36,7 +36,7 @@ * @lcdsel_lit: reg value of selecting vop little for HDMI */ struct rockchip_hdmi_chip_data { - u32 lcdsel_grf_reg; + int lcdsel_grf_reg; u32 lcdsel_big; u32 lcdsel_lit; }; @@ -245,6 +245,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder) u32 val; int ret; + if (hdmi->chip_data->lcdsel_grf_reg < 0) + return; + ret = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder); if (ret) val = hdmi->chip_data->lcdsel_lit;