All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Heiko Stuebner <heiko@sntech.de>, Alex Bee <knaerzche@gmail.com>,
	maccraft123mc@gmail.com, Chris Healy <cphealy@gmail.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Jonas Karlman <jonas@kwiboo.se>,
	Thierry Reding <thierry.reding@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@linux.ie>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	kernel@collabora.com
Subject: [PATCH 04/12] hantro: Make struct hantro_variant.init() optional
Date: Thu, 24 Jun 2021 15:26:04 -0300	[thread overview]
Message-ID: <20210624182612.177969-5-ezequiel@collabora.com> (raw)
In-Reply-To: <20210624182612.177969-1-ezequiel@collabora.com>

The hantro_variant.init() function is there for platforms
to perform hardware-specific initialization, such as
clock rate bumping.

Not all platforms require it, so make it optional.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro.h          |  4 ++--
 drivers/staging/media/hantro/hantro_drv.c      | 10 ++++++----
 drivers/staging/media/hantro/sama5d4_vdec_hw.c |  6 ------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h
index a70c386de6f1..c2e2dca38628 100644
--- a/drivers/staging/media/hantro/hantro.h
+++ b/drivers/staging/media/hantro/hantro.h
@@ -61,8 +61,8 @@ struct hantro_irq {
  * @num_postproc_fmts:		Number of post-processor formats.
  * @codec:			Supported codecs
  * @codec_ops:			Codec ops.
- * @init:			Initialize hardware.
- * @runtime_resume:		reenable hardware after power gating
+ * @init:			Initialize hardware, optional.
+ * @runtime_resume:		reenable hardware after power gating, optional.
  * @irqs:			array of irq names and interrupt handlers
  * @num_irqs:			number of irqs in the array
  * @clk_names:			array of clock names
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 31d8449ca1d2..9b5415176bfe 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -942,10 +942,12 @@ static int hantro_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = vpu->variant->init(vpu);
-	if (ret) {
-		dev_err(&pdev->dev, "Failed to init VPU hardware\n");
-		return ret;
+	if (vpu->variant->init) {
+		ret = vpu->variant->init(vpu);
+		if (ret) {
+			dev_err(&pdev->dev, "Failed to init VPU hardware\n");
+			return ret;
+		}
 	}
 
 	pm_runtime_set_autosuspend_delay(vpu->dev, 100);
diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
index 58ae72c2b723..9c3b8cd0b239 100644
--- a/drivers/staging/media/hantro/sama5d4_vdec_hw.c
+++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
@@ -64,11 +64,6 @@ static const struct hantro_fmt sama5d4_vdec_fmts[] = {
 	},
 };
 
-static int sama5d4_hw_init(struct hantro_dev *vpu)
-{
-	return 0;
-}
-
 /*
  * Supported codec ops.
  */
@@ -109,7 +104,6 @@ const struct hantro_variant sama5d4_vdec_variant = {
 	.codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
 		 HANTRO_H264_DECODER,
 	.codec_ops = sama5d4_vdec_codec_ops,
-	.init = sama5d4_hw_init,
 	.irqs = sama5d4_irqs,
 	.num_irqs = ARRAY_SIZE(sama5d4_irqs),
 	.clk_names = sama5d4_clk_names,
-- 
2.30.0


WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Alex Bee <knaerzche@gmail.com>, Hans Verkuil <hverkuil@xs4all.nl>,
	Thierry Reding <thierry.reding@gmail.com>,
	kernel@collabora.com, Sam Ravnborg <sam@ravnborg.org>,
	Chris Healy <cphealy@gmail.com>,
	maccraft123mc@gmail.com
Subject: [PATCH 04/12] hantro: Make struct hantro_variant.init() optional
Date: Thu, 24 Jun 2021 15:26:04 -0300	[thread overview]
Message-ID: <20210624182612.177969-5-ezequiel@collabora.com> (raw)
In-Reply-To: <20210624182612.177969-1-ezequiel@collabora.com>

The hantro_variant.init() function is there for platforms
to perform hardware-specific initialization, such as
clock rate bumping.

Not all platforms require it, so make it optional.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro.h          |  4 ++--
 drivers/staging/media/hantro/hantro_drv.c      | 10 ++++++----
 drivers/staging/media/hantro/sama5d4_vdec_hw.c |  6 ------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h
index a70c386de6f1..c2e2dca38628 100644
--- a/drivers/staging/media/hantro/hantro.h
+++ b/drivers/staging/media/hantro/hantro.h
@@ -61,8 +61,8 @@ struct hantro_irq {
  * @num_postproc_fmts:		Number of post-processor formats.
  * @codec:			Supported codecs
  * @codec_ops:			Codec ops.
- * @init:			Initialize hardware.
- * @runtime_resume:		reenable hardware after power gating
+ * @init:			Initialize hardware, optional.
+ * @runtime_resume:		reenable hardware after power gating, optional.
  * @irqs:			array of irq names and interrupt handlers
  * @num_irqs:			number of irqs in the array
  * @clk_names:			array of clock names
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 31d8449ca1d2..9b5415176bfe 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -942,10 +942,12 @@ static int hantro_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = vpu->variant->init(vpu);
-	if (ret) {
-		dev_err(&pdev->dev, "Failed to init VPU hardware\n");
-		return ret;
+	if (vpu->variant->init) {
+		ret = vpu->variant->init(vpu);
+		if (ret) {
+			dev_err(&pdev->dev, "Failed to init VPU hardware\n");
+			return ret;
+		}
 	}
 
 	pm_runtime_set_autosuspend_delay(vpu->dev, 100);
diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
index 58ae72c2b723..9c3b8cd0b239 100644
--- a/drivers/staging/media/hantro/sama5d4_vdec_hw.c
+++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
@@ -64,11 +64,6 @@ static const struct hantro_fmt sama5d4_vdec_fmts[] = {
 	},
 };
 
-static int sama5d4_hw_init(struct hantro_dev *vpu)
-{
-	return 0;
-}
-
 /*
  * Supported codec ops.
  */
@@ -109,7 +104,6 @@ const struct hantro_variant sama5d4_vdec_variant = {
 	.codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
 		 HANTRO_H264_DECODER,
 	.codec_ops = sama5d4_vdec_codec_ops,
-	.init = sama5d4_hw_init,
 	.irqs = sama5d4_irqs,
 	.num_irqs = ARRAY_SIZE(sama5d4_irqs),
 	.clk_names = sama5d4_clk_names,
-- 
2.30.0


  parent reply	other threads:[~2021-06-24 18:26 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 18:26 [PATCH 00/12] hantro: Enable H.264 VDPU2 (Odroid Advance Go) Ezequiel Garcia
2021-06-24 18:26 ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 01/12] drm/panel: kd35t133: Add panel orientation support Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:36   ` Heiko Stübner
2021-06-24 18:36     ` Heiko Stübner
2021-06-24 18:26 ` [PATCH 02/12] arm64: dts: rockchip: Add panel orientation to Odroid Go Advance Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:37   ` Heiko Stübner
2021-06-24 18:37     ` Heiko Stübner
2021-06-24 18:44     ` Ezequiel Garcia
2021-06-24 18:44       ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 03/12] hantro: vp8: Move noisy WARN_ON to vpu_debug Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:26 ` Ezequiel Garcia [this message]
2021-06-24 18:26   ` [PATCH 04/12] hantro: Make struct hantro_variant.init() optional Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 05/12] media: hantro: Avoid redundant hantro_get_{dst,src}_buf() calls Ezequiel Garcia
2021-06-24 18:26   ` [PATCH 05/12] media: hantro: Avoid redundant hantro_get_{dst, src}_buf() calls Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 06/12] media: hantro: h264: Move DPB valid and long-term bitmaps Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 07/12] media: hantro: h264: Move reference picture number to a helper Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 08/12] media: hantro: Add H.264 support for Rockchip VDPU2 Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 09/12] media: hantro: Enable H.264 on " Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 23:13   ` Alex Bee
2021-06-24 23:13     ` Alex Bee
2021-06-26  0:46     ` Ezequiel Garcia
2021-06-26  0:46       ` Ezequiel Garcia
2021-06-26  8:33       ` Alex Bee
2021-06-26  8:33         ` Alex Bee
2021-06-29 12:28         ` Ezequiel Garcia
2021-06-29 12:28           ` Ezequiel Garcia
2021-06-30 11:36           ` Alex Bee
2021-06-30 11:36             ` Alex Bee
2021-06-24 18:26 ` [PATCH 10/12] dt-bindings: media: rockchip-vpu: Add PX30 compatible Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-25  9:21   ` Dafna Hirschfeld
2021-06-25  9:21     ` Dafna Hirschfeld
2021-06-26  0:47     ` Ezequiel Garcia
2021-06-26  0:47       ` Ezequiel Garcia
2021-06-26  8:49       ` Alex Bee
2021-06-26  8:49         ` Alex Bee
2021-06-24 18:26 ` [PATCH 11/12] arm64: dts: rockchip: Add VPU support for the PX30 Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 18:26 ` [PATCH 12/12] media: hantro: Add support for the Rockchip PX30 Ezequiel Garcia
2021-06-24 18:26   ` Ezequiel Garcia
2021-06-24 22:39   ` Alex Bee
2021-06-24 22:39     ` Alex Bee
2021-06-26  0:49     ` Ezequiel Garcia
2021-06-26  0:49       ` Ezequiel Garcia
2021-06-26  9:17 ` [PATCH 00/12] hantro: Enable H.264 VDPU2 (Odroid Advance Go) Alex Bee
2021-06-26  9:17   ` Alex Bee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210624182612.177969-5-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=airlied@linux.ie \
    --cc=cphealy@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=knaerzche@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=maccraft123mc@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.