From: Michael Walle <mwalle@kernel.org>
To: Frank Binns <frank.binns@imgtec.com>,
Matt Coster <matt.coster@imgtec.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Nishanth Menon <nm@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tero Kristo <kristo@kernel.org>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Michael Walle <mwalle@kernel.org>
Subject: [RFC PATCH 2/3] drm/imagination: fix clock control on the J722S
Date: Wed, 16 Jul 2025 15:47:16 +0200 [thread overview]
Message-ID: <20250716134717.4085567-3-mwalle@kernel.org> (raw)
In-Reply-To: <20250716134717.4085567-1-mwalle@kernel.org>
The J722S won't let you set the clock frequency if there is no device
using it. Thus, the assigned-clocks property won't work per se.
As a workaround, set the clock again during the probing of the driver.
Signed-off-by: Michael Walle <mwalle@kernel.org>
---
drivers/gpu/drm/imagination/pvr_device.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c
index 8b9ba4983c4c..e7a7cc1bdf93 100644
--- a/drivers/gpu/drm/imagination/pvr_device.c
+++ b/drivers/gpu/drm/imagination/pvr_device.c
@@ -16,6 +16,7 @@
#include <linux/bitfield.h>
#include <linux/clk.h>
+#include <linux/clk/clk-conf.h>
#include <linux/compiler_attributes.h>
#include <linux/compiler_types.h>
#include <linux/dma-mapping.h>
@@ -641,6 +642,14 @@ pvr_device_init(struct pvr_device *pvr_dev)
if (err)
return err;
+ /* Set any 'assigned-clocks' properties again. This is a workaround for
+ * the clock handling on k3 platforms. There, one cannot set the clock
+ * frequency until there is at least one (enabled) user if it.
+ */
+ err = of_clk_set_defaults(drm_dev->dev->of_node, true);
+ if (err)
+ return err;
+
/* Map the control registers into memory. */
err = pvr_device_reg_init(pvr_dev);
if (err)
--
2.39.5
next prev parent reply other threads:[~2025-07-16 13:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 13:47 [RFC PATCH 0/3] drm/imagination: add AM62P/AM67A/J722S support Michael Walle
2025-07-16 13:47 ` [RFC PATCH 1/3] dt-bindings: gpu: img: Add AM62P SoC specific compatible Michael Walle
2025-07-16 16:17 ` Andrew Davis
2025-07-17 6:56 ` Michael Walle
2025-07-16 13:47 ` Michael Walle [this message]
2025-08-13 18:19 ` [RFC PATCH 2/3] drm/imagination: fix clock control on the J722S Krzysztof Kozlowski
2025-07-16 13:47 ` [RFC PATCH 3/3] arm64: dts: ti: add GPU node Michael Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250716134717.4085567-3-mwalle@kernel.org \
--to=mwalle@kernel.org \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=frank.binns@imgtec.com \
--cc=kristo@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matt.coster@imgtec.com \
--cc=mripard@kernel.org \
--cc=nm@ti.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®