mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 08:51:13 +00:00
66 lines
1.8 KiB
Diff
66 lines
1.8 KiB
Diff
|
From 775b90e37e5e418b19827eb696e5d034e7089f57 Mon Sep 17 00:00:00 2001
|
||
|
From: Maxime Ripard <maxime@cerno.tech>
|
||
|
Date: Wed, 16 Mar 2022 09:58:31 +0100
|
||
|
Subject: [PATCH] Revert "rpivid: Switch to new clock api"
|
||
|
|
||
|
This reverts commit ec7556e20c2c29c3df9493248a1a4d60ed20ae38.
|
||
|
---
|
||
|
drivers/staging/media/rpivid/rpivid.h | 1 -
|
||
|
drivers/staging/media/rpivid/rpivid_video.c | 18 +++++-------------
|
||
|
2 files changed, 5 insertions(+), 14 deletions(-)
|
||
|
|
||
|
--- a/drivers/staging/media/rpivid/rpivid.h
|
||
|
+++ b/drivers/staging/media/rpivid/rpivid.h
|
||
|
@@ -90,7 +90,6 @@ struct rpivid_ctx {
|
||
|
struct v4l2_pix_format_mplane dst_fmt;
|
||
|
int dst_fmt_set;
|
||
|
|
||
|
- struct clk_request *clk_req;
|
||
|
int src_stream_on;
|
||
|
int dst_stream_on;
|
||
|
|
||
|
--- a/drivers/staging/media/rpivid/rpivid_video.c
|
||
|
+++ b/drivers/staging/media/rpivid/rpivid_video.c
|
||
|
@@ -545,13 +545,10 @@ static int rpivid_buf_prepare(struct vb2
|
||
|
static void stop_clock(struct rpivid_dev *dev, struct rpivid_ctx *ctx)
|
||
|
{
|
||
|
if (ctx->src_stream_on ||
|
||
|
- ctx->dst_stream_on ||
|
||
|
- !ctx->clk_req)
|
||
|
+ ctx->dst_stream_on)
|
||
|
return;
|
||
|
|
||
|
- clk_request_done(ctx->clk_req);
|
||
|
- ctx->clk_req = NULL;
|
||
|
-
|
||
|
+ clk_set_min_rate(dev->clock, 0);
|
||
|
clk_disable_unprepare(dev->clock);
|
||
|
}
|
||
|
|
||
|
@@ -561,22 +558,17 @@ static int start_clock(struct rpivid_dev
|
||
|
long max_hevc_clock;
|
||
|
int rv;
|
||
|
|
||
|
- if (ctx->clk_req)
|
||
|
- return 0;
|
||
|
-
|
||
|
max_hevc_clock = clk_round_rate(dev->clock, ULONG_MAX);
|
||
|
|
||
|
- ctx->clk_req = clk_request_start(dev->clock, max_hevc_clock);
|
||
|
- if (!ctx->clk_req) {
|
||
|
+ rv = clk_set_min_rate(dev->clock, max_hevc_clock);
|
||
|
+ if (rv) {
|
||
|
dev_err(dev->dev, "Failed to set clock rate\n");
|
||
|
- return -EIO;
|
||
|
+ return rv;
|
||
|
}
|
||
|
|
||
|
rv = clk_prepare_enable(dev->clock);
|
||
|
if (rv) {
|
||
|
dev_err(dev->dev, "Failed to enable clock\n");
|
||
|
- clk_request_done(ctx->clk_req);
|
||
|
- ctx->clk_req = NULL;
|
||
|
return rv;
|
||
|
}
|
||
|
|