summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorBrian Ruley <[email protected]>2026-06-16 15:51:39 +0300
committerFabio Estevam <[email protected]>2026-06-26 23:02:46 -0300
commitd8673fd3b5998ceb2ba3552a9d579c14566ffec7 (patch)
tree73d3b616de26d9f5b5e134982876f18403b9c1ce /drivers/video
parentdb4aa4571882a8d42c3b2b8da9cf6099a8db8852 (diff)
video: imx: ipuv3: enable ipu clk before writing registers in CCF
Obviously, the clock has to be enabled if writing to it's registers. This was missed because the board I tested on had enabled the clocks in early init. Also, remove the completely useless "ipu_clk_enabled" struct member and use the accurate usecount / enabled_count instead. Signed-off-by: Brian Ruley <[email protected]>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/imx/ipu.h1
-rw-r--r--drivers/video/imx/ipu_common.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/imx/ipu.h b/drivers/video/imx/ipu.h
index ae40e20bc28..aecb6adffce 100644
--- a/drivers/video/imx/ipu.h
+++ b/drivers/video/imx/ipu.h
@@ -136,7 +136,6 @@ struct ipu_ctx {
struct clk *ipu_clk;
struct clk *ldb_clk;
- unsigned char ipu_clk_enabled;
struct clk *di_clk[2];
struct clk *pixel_clk[2];
diff --git a/drivers/video/imx/ipu_common.c b/drivers/video/imx/ipu_common.c
index 8630374a055..d3b52605731 100644
--- a/drivers/video/imx/ipu_common.c
+++ b/drivers/video/imx/ipu_common.c
@@ -299,9 +299,9 @@ struct ipu_ctx *ipu_probe(struct udevice *dev)
#if CONFIG_IS_ENABLED(IPU_CLK_LEGACY)
clk_set_parent(ctx->pixel_clk[0], ctx->ipu_clk);
clk_set_parent(ctx->pixel_clk[1], ctx->ipu_clk);
+#endif
clk_enable(ctx->ipu_clk);
-#endif
for (int i = 0; i <= 1; i++) {
ret = ipu_di_clk_init(ctx, i);
@@ -384,10 +384,8 @@ int32_t ipu_init_channel(struct ipu_ctx *ctx, ipu_channel_t channel,
debug("init channel = %d\n", IPU_CHAN_ID(channel));
- if (ctx->ipu_clk_enabled == 0) {
- ctx->ipu_clk_enabled = 1;
+ if (!ipu_clk_enabled(ctx))
clk_enable(ipu_clk);
- }
if (*channel_init_mask & (1L << IPU_CHAN_ID(channel))) {
printf("Warning: channel already initialized %d\n",
@@ -543,7 +541,6 @@ void ipu_uninit_channel(struct ipu_ctx *ctx, ipu_channel_t channel)
if (ipu_conf == 0) {
clk_disable(ctx->ipu_clk);
- ctx->ipu_clk_enabled = 0;
}
}
@@ -1045,5 +1042,9 @@ ipu_color_space_t format_to_colorspace(u32 fmt)
bool ipu_clk_enabled(struct ipu_ctx *ctx)
{
- return ctx->ipu_clk_enabled;
+#if CONFIG_IS_ENABLED(IPU_CLK_LEGACY)
+ return clk_get_usecount(ctx->ipu_clk);
+#else
+ return ctx->ipu_clk->enable_count;
+#endif
}