From patchwork Tue Jul 10 20:35:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10518069 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 40E9E600CA for ; Tue, 10 Jul 2018 20:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3219829156 for ; Tue, 10 Jul 2018 20:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25FE629158; Tue, 10 Jul 2018 20:52:28 +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=unavailable 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 5E82229156 for ; Tue, 10 Jul 2018 20:52:27 +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=znRte03WLYy2wYahFyOqmYBC7WMp06PRIdU5/JaLkgo=; b=DXrtbIDc6Y0WV66fpF2ylXU+Z7 wC7dD6FKyc9XLHmYIvODRRkYwZFkkXFzF/KC8Am2No58MFD4DLivEG1Vt0Y7djW/Nph5kcP3alE5d zZ7N3kubsC9mkg69RuRlFFWXns2ieVCwAMMprxSC0/dbmBPWIx3PlCHscPLB/fsQIkGZ0l9UCIhbM XFdaTPFMCxuJ1nBTqs2e/zvzThXIn8zTM6atM1GnqOWWfTT2kB+wt1xFab4HjYC02gPoEnEW9QUCv 85keBUi7R34shRJsG7I2ABm+rcHbJW9Oja4oTRfXJzhfheUfplbBmZdn2vHz4z+KPcxPFIIXiPGSv eWgSlkBw==; 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 1fczcW-0002St-Fa; Tue, 10 Jul 2018 20:52:24 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fczcU-0002Hh-GE for linux-arm-kernel@bombadil.infradead.org; Tue, 10 Jul 2018 20:52:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jA3kC/nhAHXqTzMt8piQb6Kp+ATEUkB7rHE1FIhIgHk=; b=W/TkPKRleqM+EDpST7Zrhi3U5 Aixfy5D7XzGlCHMbKVF3MyMmqVmWNILzF1uMZM83KvSxROhU+vw3JiLTG9LvsSqh7GZl9eb+0PkeJ Mv0p5019WtQduPbFqKtM+rEccBrxUAXESj+GtfWPnbpRobQO/uZVZFDwY+wa8vRACLRWsud9HS0Wk X8Qt8L12lhfbHArL/mlNLol4cwFqcAdeUC1gP3PpNd8HqHlYiU2hU4mGy7om3X+diODjkUBvl2gna Y03k1o+Dh9RFw9nDizkBLH8OF7ZI3h4l5xaX4s8o7mg3wu4P2oxTRCSNjKOiBMv6I5gwWCKi6Wacm xAgkjt1MA==; Received: from mailoutvs24.siol.net ([185.57.226.215] helo=mail.siol.net) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fczMy-00034g-4A for linux-arm-kernel@lists.infradead.org; Tue, 10 Jul 2018 20:36:22 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id AC23E5224AB; Tue, 10 Jul 2018 22:36:08 +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 4xQJd80uSqUQ; Tue, 10 Jul 2018 22:36:08 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id 20800522548; Tue, 10 Jul 2018 22:36:08 +0200 (CEST) Received: from localhost.localdomain (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id AC34D5226EE; Tue, 10 Jul 2018 22:36:00 +0200 (CEST) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org, robh+dt@kernel.org Subject: [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time Date: Tue, 10 Jul 2018 22:35:10 +0200 Message-Id: <20180710203511.18454-18-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710203511.18454-1-jernej.skrabec@siol.net> References: <20180710203511.18454-1-jernej.skrabec@siol.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180710_213620_205242_FC5BA868 X-CRM114-Status: GOOD ( 13.99 ) 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: mark.rutland@arm.com, devicetree@vger.kernel.org, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.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 Now that R40 TCON migrated to runtime mux configuration, old code can be removed. Signed-off-by: Jernej Skrabec Reviewed-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 76 +------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c index c09b15b64192..b7cf0f0f6583 100644 --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c @@ -87,34 +87,6 @@ int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon) } EXPORT_SYMBOL(sun8i_tcon_top_de_config); -static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node, - int port_id) -{ - struct device_node *ep, *remote, *port; - struct of_endpoint endpoint; - - port = of_graph_get_port_by_id(node, port_id); - if (!port) - return -ENOENT; - - for_each_available_child_of_node(port, ep) { - remote = of_graph_get_remote_port_parent(ep); - if (!remote) - continue; - - if (of_device_is_available(remote)) { - of_graph_parse_endpoint(ep, &endpoint); - - of_node_put(remote); - - return endpoint.id; - } - - of_node_put(remote); - } - - return -ENOENT; -} static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev, const char *parent, @@ -149,11 +121,9 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master, struct platform_device *pdev = to_platform_device(dev); struct clk_hw_onecell_data *clk_data; struct sun8i_tcon_top *tcon_top; - bool mixer0_unused = false; struct resource *res; void __iomem *regs; - int ret, i, id; - u32 val; + int ret, i; tcon_top = devm_kzalloc(dev, sizeof(*tcon_top), GFP_KERNEL); if (!tcon_top) @@ -198,50 +168,6 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master, goto err_assert_reset; } - val = 0; - - /* check if HDMI mux output is connected */ - if (sun8i_tcon_top_get_connected_ep_id(dev->of_node, 5) >= 0) { - /* find HDMI input endpoint id, if it is connected at all*/ - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 4); - if (id >= 0) - val = FIELD_PREP(TCON_TOP_HDMI_SRC_MSK, id + 1); - else - DRM_DEBUG_DRIVER("TCON TOP HDMI input is not connected\n"); - } else { - DRM_DEBUG_DRIVER("TCON TOP HDMI output is not connected\n"); - } - - writel(val, regs + TCON_TOP_GATE_SRC_REG); - - val = 0; - - /* process mixer0 mux output */ - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 1); - if (id >= 0) { - val = FIELD_PREP(TCON_TOP_PORT_DE0_MSK, id); - } else { - DRM_DEBUG_DRIVER("TCON TOP mixer0 output is not connected\n"); - mixer0_unused = true; - } - - /* process mixer1 mux output */ - id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 3); - if (id >= 0) { - val |= FIELD_PREP(TCON_TOP_PORT_DE1_MSK, id); - - /* - * mixer0 mux has priority over mixer1 mux. We have to - * make sure mixer0 doesn't overtake TCON from mixer1. - */ - if (mixer0_unused && id == 0) - val |= FIELD_PREP(TCON_TOP_PORT_DE0_MSK, 1); - } else { - DRM_DEBUG_DRIVER("TCON TOP mixer1 output is not connected\n"); - } - - writel(val, regs + TCON_TOP_PORT_SEL_REG); - /* * TCON TOP has two muxes, which select parent clock for each TCON TV * channel clock. Parent could be either TCON TV or TVE clock. For now