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 <mwa...@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

Reply via email to