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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
+6 −4
Original line number Diff line number Diff line
@@ -942,11 +942,13 @@ static int hantro_probe(struct platform_device *pdev)
		}
	}

	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);
	pm_runtime_use_autosuspend(vpu->dev);
+0 −6
Original line number Diff line number Diff line
@@ -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,