From nobody Tue Feb 10 19:09:50 2026 Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D9F714F9FB for ; Fri, 27 Dec 2024 13:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735304560; cv=none; b=jXx7aF9YWc+bQ+Fk8LbRQ1Z6OUdhmW0Ew/6Uk/E4owiIy7zWVR5vlW+vKm6HNljyClcR+KI0Vbl7pqOizQq0x+v1czR8zaNGF5XJ+fUNL4UfS4Fp7+ole7/AebEn4bqcgBEWgkJ96o/oePuX0m4h2fNbV8Cs+CWvIvKUnh8NRRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735304560; c=relaxed/simple; bh=Z1yBsrhc1T8q3fTFow1RSmWl9UXwRZd8FWpkoLs2A1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EB4BANTe1lfJbfgukgX/yvkqNO+5ivHk4l7K6dUhA5uz0mYUpXpDZ0b41bLpvT3/PbzGF3HIkaEoE7yMfWPePV5k7FEZBBIL+HutTHVzTBZSnKlhijx/21R87+MEXPxe6r5i7TWgFZcXaVnqr2Ci/uaKy2V+TPsl0RXo8ziDqFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linumiz.com; spf=pass smtp.mailfrom=linumiz.com; dkim=pass (2048-bit key) header.d=linumiz.com header.i=@linumiz.com header.b=Por5VnV3; arc=none smtp.client-ip=35.89.44.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linumiz.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linumiz.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linumiz.com header.i=@linumiz.com header.b="Por5VnV3" Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id R1oJtcqcKqvuoR9zDtyI9S; Fri, 27 Dec 2024 13:02:39 +0000 Received: from md-in-79.webhostbox.net ([43.225.55.182]) by cmsmtp with ESMTPS id R9zAtfE1dWdNZR9zCthSaX; Fri, 27 Dec 2024 13:02:39 +0000 X-Authority-Analysis: v=2.4 cv=FtTO/Hrq c=1 sm=1 tr=0 ts=676ea56f a=LfuyaZh/8e9VOkaVZk0aRw==:117 a=kofhyyBXuK/oEhdxNjf66Q==:17 a=IkcTkHD0fZMA:10 a=RZcAm9yDv7YA:10 a=-pn6D5nKLtMA:10 a=vU9dKmh3AAAA:8 a=U3DMF0o1PY4y7HjVE7sA:9 a=QEXdDO2ut3YA:10 a=lcdGsAA1t286La22BbtU:22 a=rsP06fVo5MYu2ilr0aT5:22 a=ZCPYImcxYIQFgLOT52_G:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linumiz.com ; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=dbYyqDxlPnUOcenlEsyd1+KMbnZL6BSy8ly64QBKbVQ=; b=Por5VnV35tosi3+JJ7NTnryKFJ UZ3i/aCSsN8ASDSsooEu1dnjn6lqUjDe42kZCTnJmK9Iday3mVbCRQ00+zD6WtmdW1rUy2G8tydQ2 tduvd+W7th/UfYa3I5TJGh8z/879dsE6lMQ3siODjZpE73PPlyLPx1qd2rfRN2/djaz/Y26+Ka4X/ kzDiJeSLlRd4JzbQvAMbGC3Dw+ijajl8gXgSz8wLUyKtzmIgJmB9fQy6ySu6fL09qQ4mh2r4UrpIl 9rnVZzDxOiC4V0g1uSZy6KFE368UBTyys54uzzz6IihbYUxS5xjXFoJzF0u3JrCFw13axwFBks9YX 5TC9frQQ==; Received: from [122.165.245.213] (port=58270 helo=[127.0.1.1]) by md-in-79.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tR9z3-002EaQ-2x; Fri, 27 Dec 2024 18:32:29 +0530 From: Parthiban Nallathambi Date: Fri, 27 Dec 2024 18:31:02 +0530 Subject: [PATCH RESEND 13/22] drm/sun4i: make tcon top tv0 optional Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241227-a133-display-support-v1-13-abad35b3579c@linumiz.com> References: <20241227-a133-display-support-v1-0-abad35b3579c@linumiz.com> In-Reply-To: <20241227-a133-display-support-v1-0-abad35b3579c@linumiz.com> To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Michael Turquette , Stephen Boyd , Philipp Zabel , Linus Walleij , Vinod Koul , Kishon Vijay Abraham I Cc: iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-phy@lists.infradead.org, Parthiban Nallathambi X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735304469; l=2767; i=parthiban@linumiz.com; s=20241125; h=from:subject:message-id; bh=Z1yBsrhc1T8q3fTFow1RSmWl9UXwRZd8FWpkoLs2A1A=; b=d9QdVen3zcO2vxcUSjbW8STNjFQd/Fya6B9N47bAWh3SbRj3wHmlor7MKAsKcq+kliww2MjaD 8hgcJHZVT3SCJjubJ72pmYS56EWz8ZMwjPeWk9Ap8R4VpZW+hN7PVi3 X-Developer-Key: i=parthiban@linumiz.com; a=ed25519; pk=PrcMZ/nwnHbeXNFUFUS833wF3DAX4hziDHEbBp1eNb8= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - md-in-79.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - linumiz.com X-BWhitelist: no X-Source-IP: 122.165.245.213 X-Source-L: No X-Exim-ID: 1tR9z3-002EaQ-2x X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([127.0.1.1]) [122.165.245.213]:58270 X-Source-Auth: parthiban@linumiz.com X-Email-Count: 406 X-Org: HG=dishared_whb_net_legacy;ORG=directi; X-Source-Cap: bGludW1jbWM7aG9zdGdhdG9yO21kLWluLTc5LndlYmhvc3Rib3gubmV0 X-Local-Domain: yes X-CMAE-Envelope: MS4xfG2aYNJ3VuPcFuEvqCPydHKtkNO5sJS0d9hGTYVpvPgWzlyB1r5MsrIzHZi5c6MukvbEBuO3CJpEWvee6I2ljk4j9JsGQsSNT+DHyaZe85765nXyt2oT rZdZF+pT18C+fvlD5dGiuE7JhVvvFYQtRed6qx3ARSXSXTc+0wDrx4giQqLOMWgGpkuWp+ZvHfvH/a4ov6JzihNYACiDRkWObuc= current implementation of tcon top assumes tv0 is always present, which isn't case in A100/A133 SoC's. Make tv0 optional by introducing another control similar to tv1 and make existing users with true/present. Signed-off-by: Parthiban Nallathambi --- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 34 ++++++++++++++++++++----------= ---- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i= /sun8i_tcon_top.c index 8adda578c51b..bd9d0840ead7 100644 --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c @@ -16,6 +16,7 @@ #include "sun8i_tcon_top.h" =20 struct sun8i_tcon_top_quirks { + bool has_tcon_tv0; bool has_tcon_tv1; bool has_dsi; }; @@ -191,10 +192,11 @@ static int sun8i_tcon_top_bind(struct device *dev, st= ruct device *master, * to TVE clock parent. */ i =3D 0; - clk_data->hws[CLK_TCON_TOP_TV0] =3D - sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs, - &tcon_top->reg_lock, - TCON_TOP_TCON_TV0_GATE, i++); + if (quirks->has_tcon_tv0) + clk_data->hws[CLK_TCON_TOP_TV0] =3D + sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs, + &tcon_top->reg_lock, + TCON_TOP_TCON_TV0_GATE, i++); =20 if (quirks->has_tcon_tv1) clk_data->hws[CLK_TCON_TOP_TV1] =3D @@ -208,16 +210,18 @@ static int sun8i_tcon_top_bind(struct device *dev, st= ruct device *master, &tcon_top->reg_lock, TCON_TOP_TCON_DSI_GATE, i++); =20 - for (i =3D 0; i < CLK_NUM; i++) - if (IS_ERR(clk_data->hws[i])) { - ret =3D PTR_ERR(clk_data->hws[i]); - goto err_unregister_gates; - } + if (i) { + for (i =3D 0; i < CLK_NUM; i++) + if (IS_ERR(clk_data->hws[i])) { + ret =3D PTR_ERR(clk_data->hws[i]); + goto err_unregister_gates; + } =20 - ret =3D of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, - clk_data); - if (ret) - goto err_unregister_gates; + ret =3D of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, + clk_data); + if (ret) + goto err_unregister_gates; + } =20 dev_set_drvdata(dev, tcon_top); =20 @@ -266,16 +270,18 @@ static void sun8i_tcon_top_remove(struct platform_dev= ice *pdev) } =20 static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks =3D { + .has_tcon_tv0 =3D true, .has_tcon_tv1 =3D true, .has_dsi =3D true, }; =20 static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks =3D { + .has_tcon_tv0 =3D true, .has_dsi =3D true, }; =20 static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks =3D { - /* Nothing special */ + .has_tcon_tv0 =3D true, }; =20 /* sun4i_drv uses this list to check if a device node is a TCON TOP */ --=20 2.39.5