mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-15 04:42:02 +00:00
61 lines
2 KiB
Diff
61 lines
2 KiB
Diff
From 5bb7b5dd7ecd857b77574f5692c1faa692e2e936 Mon Sep 17 00:00:00 2001
|
|
From: Dom Cobley <popcornmix@gmail.com>
|
|
Date: Mon, 19 Apr 2021 19:30:26 +0100
|
|
Subject: [PATCH 382/552] rpivid: Switch to new clock api
|
|
|
|
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
|
---
|
|
drivers/staging/media/rpivid/rpivid.h | 1 +
|
|
drivers/staging/media/rpivid/rpivid_video.c | 11 +++--------
|
|
2 files changed, 4 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/drivers/staging/media/rpivid/rpivid.h b/drivers/staging/media/rpivid/rpivid.h
|
|
index 0e8280b803a3..f85cf9d08926 100644
|
|
--- a/drivers/staging/media/rpivid/rpivid.h
|
|
+++ b/drivers/staging/media/rpivid/rpivid.h
|
|
@@ -172,6 +172,7 @@ struct rpivid_dev {
|
|
void __iomem *base_h265;
|
|
|
|
struct clk *clock;
|
|
+ struct clk_request *hevc_req;
|
|
|
|
struct rpivid_hw_irq_ctrl ic_active1;
|
|
struct rpivid_hw_irq_ctrl ic_active2;
|
|
diff --git a/drivers/staging/media/rpivid/rpivid_video.c b/drivers/staging/media/rpivid/rpivid_video.c
|
|
index b377c17dfb21..def891a86e55 100644
|
|
--- a/drivers/staging/media/rpivid/rpivid_video.c
|
|
+++ b/drivers/staging/media/rpivid/rpivid_video.c
|
|
@@ -499,8 +499,8 @@ static int rpivid_start_streaming(struct vb2_queue *vq, unsigned int count)
|
|
if (V4L2_TYPE_IS_OUTPUT(vq->type) && dev->dec_ops->start)
|
|
ret = dev->dec_ops->start(ctx);
|
|
|
|
- ret = clk_set_rate(dev->clock, max_hevc_clock);
|
|
- if (ret) {
|
|
+ dev->hevc_req = clk_request_start(dev->clock, max_hevc_clock);
|
|
+ if (!dev->hevc_req) {
|
|
dev_err(dev->dev, "Failed to set clock rate\n");
|
|
goto out;
|
|
}
|
|
@@ -520,18 +520,13 @@ static void rpivid_stop_streaming(struct vb2_queue *vq)
|
|
{
|
|
struct rpivid_ctx *ctx = vb2_get_drv_priv(vq);
|
|
struct rpivid_dev *dev = ctx->dev;
|
|
- long min_hevc_clock = clk_round_rate(dev->clock, 0);
|
|
- int ret;
|
|
|
|
if (V4L2_TYPE_IS_OUTPUT(vq->type) && dev->dec_ops->stop)
|
|
dev->dec_ops->stop(ctx);
|
|
|
|
rpivid_queue_cleanup(vq, VB2_BUF_STATE_ERROR);
|
|
|
|
- ret = clk_set_rate(dev->clock, min_hevc_clock);
|
|
- if (ret)
|
|
- dev_err(dev->dev, "Failed to set minimum clock rate\n");
|
|
-
|
|
+ clk_request_done(dev->hevc_req);
|
|
clk_disable_unprepare(dev->clock);
|
|
}
|
|
|
|
--
|
|
2.33.0
|
|
|