difos/target/linux/bcm27xx/patches-6.12/950-0131-drm-v3d-Switch-clock-setting-to-new-api.patch
Shiji Yang 30cdc48360 kernel: bump 6.12 to 6.12.31
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.31

Remove upstreamed patches:
  backport-6.12/780-27-v6.15-r8169-don-t-scan-PHY-addresses-0.patch [1]
  backport-6.12/780-33-v6.15-r8169-disable-RTL8126-ZRX-DC-timeout.patch [2]
  bcm27xx/patches-6.12/950-0315-media-i2c-imx219-Correct-the-minimum-vblanking-value.patch [3]
  bcm27xx/patches-6.12/950-0857-drm-v3d-Add-clock-handling.patch [4]
  bcm27xx/patches-6.12/950-0874-PCI-brcmstb-Expand-inbound-window-size-up-to-64GB.patch [5]
  bcm27xx/patches-6.12/950-0877-PCI-brcmstb-Adding-a-softdep-to-MIP-MSI-X-driver.patch [6]
  bcm27xx/patches-6.12/950-0960-media-imx335-Set-vblank-immediately.patch [7]

Manually rebased patches:
  d1/patches-6.12/0009-ASoC-sunxi-sun4i-codec-add-basic-support-for-D1-audi.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=ba59747562c49974cbace989d76b94a8331da442
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=2780aa8394415df0a69e3b908d6dd8c79e1d1bcc
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=9a981079097bee6a0583877798de0b240717bdde
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=bbd6dc1fb6c56267ad1d58810d92287fcd5b0058
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=3ffaa2e999380477774e76680ff4cef247451168
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=12153e3948c596737853c3ec4ff7e4e3f4a9f9a6
[7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=8d7e13c31c52690655883dff604238b0760a3644

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18953
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-05-31 17:35:29 +02:00

74 lines
2.2 KiB
Diff

From 371cc25966194e8fd47d36e089b5390ccc9e4df7 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Wed, 20 Apr 2022 18:08:38 +0100
Subject: [PATCH] drm/v3d: Switch clock setting to new api
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drm/v3d: Convert to new clock range API
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/gpu/drm/v3d/v3d_drv.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -17,6 +17,7 @@
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/sched/clock.h>
@@ -24,6 +25,9 @@
#include <drm/drm_drv.h>
#include <drm/drm_managed.h>
+
+#include <soc/bcm2835/raspberrypi-firmware.h>
+
#include <uapi/drm/v3d_drm.h>
#include "v3d_drv.h"
@@ -263,6 +267,8 @@ map_regs(struct v3d_dev *v3d, void __iom
static int v3d_platform_drm_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ struct rpi_firmware *firmware;
+ struct device_node *node;
struct drm_device *drm;
struct v3d_dev *v3d;
int ret;
@@ -337,7 +343,20 @@ static int v3d_platform_drm_probe(struct
dev_err(dev, "Failed to get clock (%ld)\n", PTR_ERR(v3d->clk));
return PTR_ERR(v3d->clk);
}
- v3d->clk_up_rate = clk_get_rate(v3d->clk);
+
+ node = rpi_firmware_find_node();
+ if (!node)
+ return -EINVAL;
+
+ firmware = rpi_firmware_get(node);
+ of_node_put(node);
+ if (!firmware)
+ return -EPROBE_DEFER;
+
+ v3d->clk_up_rate = rpi_firmware_clk_get_max_rate(firmware,
+ RPI_FIRMWARE_V3D_CLK_ID);
+ rpi_firmware_put(firmware);
+
/* For downclocking, drop it to the minimum frequency we can get from
* the CPRMAN clock generator dividing off our parent. The divider is
* 4 bits, but ask for just higher than that so that rounding doesn't
@@ -375,7 +394,7 @@ static int v3d_platform_drm_probe(struct
ret = v3d_sysfs_init(dev);
if (ret)
goto drm_unregister;
- ret = clk_set_rate(v3d->clk, v3d->clk_down_rate);
+ ret = clk_set_min_rate(v3d->clk, v3d->clk_down_rate);
WARN_ON_ONCE(ret != 0);
return 0;