From nobody Tue Feb 10 04:17:22 2026 Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) (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 0A3991F471A for ; Fri, 27 Dec 2024 11:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735297775; cv=none; b=q9z+aI0OwHH4ExAeFpyIR254F779gR0M/LyoMwqBMxfoHzcwtufVnPbKjG0FBvXHV/twwXKqDDDVKRWI4qWVi0VMjty96sfqXxHZZTmzeoeyp3sAMCY+VBqcSl4VGJOlzFEzVU1LKmi0yGF9rU7rz2YMr8mlM0kLgz4YjSJummE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735297775; c=relaxed/simple; bh=Z1yBsrhc1T8q3fTFow1RSmWl9UXwRZd8FWpkoLs2A1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sd/7SJZ1R8iEXuk2XbjlP/wrwC3aanOs2MhTVBSFRErj88WWDk/oGUM54Em29ysCCqWY5QFaPEhlOCWssKcUC7p1JwSXTl8la+nbsRcvdEER5UeKpmlcMAIYOaY1eojWldy/4FcyCHSY91RyS32bViCu6B0DbRExa70vR2lEedk= 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=K+mmc0qC; arc=none smtp.client-ip=35.89.44.39 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="K+mmc0qC" Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTPS id R46etExbovH7lR8DltJAc3; Fri, 27 Dec 2024 11:09:34 +0000 Received: from md-in-79.webhostbox.net ([43.225.55.182]) by cmsmtp with ESMTPS id R8Dit36VVT3CkR8Dktx0tZ; Fri, 27 Dec 2024 11:09:33 +0000 X-Authority-Analysis: v=2.4 cv=EYHOQumC c=1 sm=1 tr=0 ts=676e8aed 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=K+mmc0qCD1oeBnmS8Ikf5mGTPh h+jzblvCCQfECKO8ISpEnomfDHd58ScOdegbccHnKPkIEmuW2laOgCO7A7taC3teqkhEwCW4+/QnC /VeXjJAIawTJWThTieaJbsthYHZidV4d0/t8k4M2GRnJ30+RHoiOsYEm7XpeDzV08uBUfe6DaAiYr /2MN4xG2abto2E9p+9oqjiRTBLC+MsZZoUe8RlvJgX4SmvgNCStHvrAIVk0jeG1CQcdKLCy5er6e+ Tues0rIuKxbPtNAaYsY40NuFPFOH4lQeZSRszaHpYgho7gJAYs/nVMprhHdkBu9NWiMKdeasnqjF0 YYL53Gcg==; Received: from [122.165.245.213] (port=50828 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 1tR8DY-000bEK-13; Fri, 27 Dec 2024 16:39:20 +0530 From: Parthiban Nallathambi Date: Fri, 27 Dec 2024 16:38:00 +0530 Subject: [PATCH 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-13b52f71fb14@linumiz.com> References: <20241227-a133-display-support-v1-0-13b52f71fb14@linumiz.com> In-Reply-To: <20241227-a133-display-support-v1-0-13b52f71fb14@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=1735297689; l=2767; i=parthiban@linumiz.com; s=20241125; h=from:subject:message-id; bh=Z1yBsrhc1T8q3fTFow1RSmWl9UXwRZd8FWpkoLs2A1A=; b=1d7aNRq2I2NijFkHAwRD1Rbm4xuW2LihHWK58pL81Pzcc5ItjJp9TlIPwLnfLhhWbRoHaLsEN 5XTBxMkIJABBgwWXMm2Bak9KnYtqWPi9bX1/NDCI5LwA+QDtoEpt1t7 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: 1tR8DY-000bEK-13 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([127.0.1.1]) [122.165.245.213]:50828 X-Source-Auth: parthiban@linumiz.com X-Email-Count: 382 X-Org: HG=dishared_whb_net_legacy;ORG=directi; X-Source-Cap: bGludW1jbWM7aG9zdGdhdG9yO21kLWluLTc5LndlYmhvc3Rib3gubmV0 X-Local-Domain: yes X-CMAE-Envelope: MS4xfLkTAYs3xk1smnB2r2ib0i1GZ8gigcGD71L/TbQTvsI3edFXfuayENYeNHYtMzq4q4UpieTruyhFCe9d2s32jWh+jnTgGDwhTMR9vgYtks2P+jhmZF3P w89E7yYR5hCx8pr+mJ3laeUCWqr4TmhtxwG7DgDObEk7aH9zUec9FDfxTrGej8P8Ur/1mIlS03TkIrAlDBXvnZKABhiExtks+a8= 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