[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231221124339.420119-5-raphael.gallais-pou@foss.st.com>
Date: Thu, 21 Dec 2023 13:43:35 +0100
From: Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Neil Armstrong
<neil.armstrong@...aro.org>,
Jessica Zhang <quic_jesszhan@...cinc.com>,
Sam
Ravnborg <sam@...nborg.org>,
Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof
Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley
<conor+dt@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre
Torgue <alexandre.torgue@...s.st.com>,
Yannick Fertre
<yannick.fertre@...s.st.com>,
Raphael Gallais-Pou
<raphael.gallais-pou@...s.st.com>,
Philippe Cornu
<philippe.cornu@...s.st.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Lad
Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Thierry Reding
<thierry.reding@...il.com>
CC: <dri-devel@...ts.freedesktop.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: [PATCH RESEND v1 4/8] drm/stm: ltdc: implement bus clock
From: Yannick Fertre <yannick.fertre@...s.st.com>
The latest hardware version of the LTDC presents the addition of a bus
clock, which contains the global configuration registers and the interrupt
register.
Signed-off-by: Yannick Fertre <yannick.fertre@...s.st.com>
---
drivers/gpu/drm/stm/ltdc.c | 8 ++++++++
drivers/gpu/drm/stm/ltdc.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 5576fdae4962..67064f47a4cb 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1896,6 +1896,8 @@ void ltdc_suspend(struct drm_device *ddev)
DRM_DEBUG_DRIVER("\n");
clk_disable_unprepare(ldev->pixel_clk);
+ if (ldev->bus_clk)
+ clk_disable_unprepare(ldev->bus_clk);
}
int ltdc_resume(struct drm_device *ddev)
@@ -1910,6 +1912,12 @@ int ltdc_resume(struct drm_device *ddev)
DRM_ERROR("failed to enable pixel clock (%d)\n", ret);
return ret;
}
+ if (ldev->bus_clk) {
+ if (clk_prepare_enable(ldev->bus_clk)) {
+ DRM_ERROR("Unable to prepare bus clock\n");
+ return -ENODEV;
+ }
+ }
return 0;
}
diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h
index 9d488043ffdb..155d8e4a7c6b 100644
--- a/drivers/gpu/drm/stm/ltdc.h
+++ b/drivers/gpu/drm/stm/ltdc.h
@@ -44,6 +44,7 @@ struct ltdc_device {
void __iomem *regs;
struct regmap *regmap;
struct clk *pixel_clk; /* lcd pixel clock */
+ struct clk *bus_clk; /* bus clock */
struct mutex err_lock; /* protecting error_status */
struct ltdc_caps caps;
u32 irq_status;
--
2.25.1
Powered by blists - more mailing lists