Commit 96f33a5b authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: hantro: Make struct hantro_variant.init() optional

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: default avatarEzequiel Garcia <ezequiel@collabora.com>
Tested-by: default avatarAlex Bee <knaerzche@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 6ad61a78
...@@ -61,8 +61,8 @@ struct hantro_irq { ...@@ -61,8 +61,8 @@ struct hantro_irq {
* @num_postproc_fmts: Number of post-processor formats. * @num_postproc_fmts: Number of post-processor formats.
* @codec: Supported codecs * @codec: Supported codecs
* @codec_ops: Codec ops. * @codec_ops: Codec ops.
* @init: Initialize hardware. * @init: Initialize hardware, optional.
* @runtime_resume: reenable hardware after power gating * @runtime_resume: reenable hardware after power gating, optional.
* @irqs: array of irq names and interrupt handlers * @irqs: array of irq names and interrupt handlers
* @num_irqs: number of irqs in the array * @num_irqs: number of irqs in the array
* @clk_names: array of clock names * @clk_names: array of clock names
......
...@@ -942,11 +942,13 @@ static int hantro_probe(struct platform_device *pdev) ...@@ -942,11 +942,13 @@ static int hantro_probe(struct platform_device *pdev)
} }
} }
if (vpu->variant->init) {
ret = vpu->variant->init(vpu); ret = vpu->variant->init(vpu);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to init VPU hardware\n"); dev_err(&pdev->dev, "Failed to init VPU hardware\n");
return ret; return ret;
} }
}
pm_runtime_set_autosuspend_delay(vpu->dev, 100); pm_runtime_set_autosuspend_delay(vpu->dev, 100);
pm_runtime_use_autosuspend(vpu->dev); pm_runtime_use_autosuspend(vpu->dev);
......
...@@ -64,11 +64,6 @@ static const struct hantro_fmt sama5d4_vdec_fmts[] = { ...@@ -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. * Supported codec ops.
*/ */
...@@ -109,7 +104,6 @@ const struct hantro_variant sama5d4_vdec_variant = { ...@@ -109,7 +104,6 @@ const struct hantro_variant sama5d4_vdec_variant = {
.codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER | .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
HANTRO_H264_DECODER, HANTRO_H264_DECODER,
.codec_ops = sama5d4_vdec_codec_ops, .codec_ops = sama5d4_vdec_codec_ops,
.init = sama5d4_hw_init,
.irqs = sama5d4_irqs, .irqs = sama5d4_irqs,
.num_irqs = ARRAY_SIZE(sama5d4_irqs), .num_irqs = ARRAY_SIZE(sama5d4_irqs),
.clk_names = sama5d4_clk_names, .clk_names = sama5d4_clk_names,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment