1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/bcm27xx/patches-5.14/0381-bcm2835-unicam-Switch-to-new-clock-api.patch
Ycarus (Yannick Chabanois) 5c593832cc Add 5.14 patches for RPI
2021-10-01 16:58:58 +02:00

58 lines
2.1 KiB
Diff

From fe43caac8138987cdadfb86512fd4e3d029ff913 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Tue, 13 Apr 2021 16:48:35 +0100
Subject: [PATCH 381/552] bcm2835-unicam: Switch to new clock api
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
---
drivers/media/platform/bcm2835/bcm2835-unicam.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c
index db99d1562904..a603891986b9 100644
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
@@ -429,6 +429,8 @@ struct unicam_device {
struct clk *clock;
/* vpu clock handle */
struct clk *vpu_clock;
+ /* vpu clock request */
+ struct clk_request *vpu_req;
/* clock status for error handling */
bool clocks_enabled;
/* V4l2 device */
@@ -1694,8 +1696,8 @@ static int unicam_start_streaming(struct vb2_queue *vq, unsigned int count)
unicam_dbg(1, dev, "Running with %u data lanes\n",
dev->active_data_lanes);
- ret = clk_set_min_rate(dev->vpu_clock, MIN_VPU_CLOCK_RATE);
- if (ret) {
+ dev->vpu_req = clk_request_start(dev->vpu_clock, MIN_VPU_CLOCK_RATE);
+ if (!dev->vpu_req) {
unicam_err(dev, "failed to set up VPU clock\n");
goto err_pm_put;
}
@@ -1751,8 +1753,7 @@ static int unicam_start_streaming(struct vb2_queue *vq, unsigned int count)
unicam_disable(dev);
clk_disable_unprepare(dev->clock);
err_vpu_clock:
- if (clk_set_min_rate(dev->vpu_clock, 0))
- unicam_err(dev, "failed to reset the VPU clock\n");
+ clk_request_done(dev->vpu_req);
clk_disable_unprepare(dev->vpu_clock);
err_pm_put:
unicam_runtime_put(dev);
@@ -1782,9 +1783,7 @@ static void unicam_stop_streaming(struct vb2_queue *vq)
unicam_disable(dev);
if (dev->clocks_enabled) {
- if (clk_set_min_rate(dev->vpu_clock, 0))
- unicam_err(dev, "failed to reset the min VPU clock\n");
-
+ clk_request_done(dev->vpu_req);
clk_disable_unprepare(dev->vpu_clock);
clk_disable_unprepare(dev->clock);
dev->clocks_enabled = false;
--
2.33.0