[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241227-a133-display-support-v1-13-13b52f71fb14@linumiz.com>
Date: Fri, 27 Dec 2024 16:38:00 +0530
From: Parthiban Nallathambi <parthiban@...umiz.com>
To: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, Maxime Ripard <mripard@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>,
Linus Walleij <linus.walleij@...aro.org>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>
Cc: iommu@...ts.linux.dev, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-clk@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-phy@...ts.infradead.org,
Parthiban Nallathambi <parthiban@...umiz.com>
Subject: [PATCH 13/22] drm/sun4i: make tcon top tv0 optional
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 <parthiban@...umiz.com>
---
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"
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, struct device *master,
* to TVE clock parent.
*/
i = 0;
- clk_data->hws[CLK_TCON_TOP_TV0] =
- 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] =
+ sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs,
+ &tcon_top->reg_lock,
+ TCON_TOP_TCON_TV0_GATE, i++);
if (quirks->has_tcon_tv1)
clk_data->hws[CLK_TCON_TOP_TV1] =
@@ -208,16 +210,18 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
&tcon_top->reg_lock,
TCON_TOP_TCON_DSI_GATE, i++);
- for (i = 0; i < CLK_NUM; i++)
- if (IS_ERR(clk_data->hws[i])) {
- ret = PTR_ERR(clk_data->hws[i]);
- goto err_unregister_gates;
- }
+ if (i) {
+ for (i = 0; i < CLK_NUM; i++)
+ if (IS_ERR(clk_data->hws[i])) {
+ ret = PTR_ERR(clk_data->hws[i]);
+ goto err_unregister_gates;
+ }
- ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
- clk_data);
- if (ret)
- goto err_unregister_gates;
+ ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
+ clk_data);
+ if (ret)
+ goto err_unregister_gates;
+ }
dev_set_drvdata(dev, tcon_top);
@@ -266,16 +270,18 @@ static void sun8i_tcon_top_remove(struct platform_device *pdev)
}
static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = {
+ .has_tcon_tv0 = true,
.has_tcon_tv1 = true,
.has_dsi = true,
};
static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks = {
+ .has_tcon_tv0 = true,
.has_dsi = true,
};
static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks = {
- /* Nothing special */
+ .has_tcon_tv0 = true,
};
/* sun4i_drv uses this list to check if a device node is a TCON TOP */
--
2.39.5
Powered by blists - more mailing lists