Commit 75c38caf authored by kyrie wu's avatar kyrie wu Committed by Mauro Carvalho Chehab

media: mtk-jpeg: Fixes jpeghw multi-core judgement

some chips have multi-hw, but others have only one,
modify the condition of multi-hw judgement

Fixes: 934e8bcc ("mtk-jpegenc: support jpegenc multi-hardware")
Signed-off-by: default avatarkyrie wu <kyrie.wu@mediatek.com>
Signed-off-by: default avatarirui wang <irui.wang@mediatek.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 71937240
...@@ -1692,7 +1692,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) ...@@ -1692,7 +1692,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
if (list_empty(&pdev->dev.devres_head)) { if (!jpeg->variant->multi_core) {
INIT_DELAYED_WORK(&jpeg->job_timeout_work, INIT_DELAYED_WORK(&jpeg->job_timeout_work,
mtk_jpeg_job_timeout_work); mtk_jpeg_job_timeout_work);
...@@ -1875,6 +1875,7 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = { ...@@ -1875,6 +1875,7 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = {
.ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.multi_core = false,
}; };
static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
...@@ -1886,6 +1887,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { ...@@ -1886,6 +1887,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
.ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.multi_core = true,
}; };
static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
...@@ -1897,6 +1899,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { ...@@ -1897,6 +1899,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
.ioctl_ops = &mtk_jpeg_dec_ioctl_ops, .ioctl_ops = &mtk_jpeg_dec_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_JPEG, .out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M, .cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
.multi_core = true,
}; };
static const struct of_device_id mtk_jpeg_match[] = { static const struct of_device_id mtk_jpeg_match[] = {
......
...@@ -60,6 +60,7 @@ enum mtk_jpeg_ctx_state { ...@@ -60,6 +60,7 @@ enum mtk_jpeg_ctx_state {
* @ioctl_ops: the callback of jpeg v4l2_ioctl_ops * @ioctl_ops: the callback of jpeg v4l2_ioctl_ops
* @out_q_default_fourcc: output queue default fourcc * @out_q_default_fourcc: output queue default fourcc
* @cap_q_default_fourcc: capture queue default fourcc * @cap_q_default_fourcc: capture queue default fourcc
* @multi_core: mark jpeg hw is multi_core or not
*/ */
struct mtk_jpeg_variant { struct mtk_jpeg_variant {
struct clk_bulk_data *clks; struct clk_bulk_data *clks;
...@@ -74,6 +75,7 @@ struct mtk_jpeg_variant { ...@@ -74,6 +75,7 @@ struct mtk_jpeg_variant {
const struct v4l2_ioctl_ops *ioctl_ops; const struct v4l2_ioctl_ops *ioctl_ops;
u32 out_q_default_fourcc; u32 out_q_default_fourcc;
u32 cap_q_default_fourcc; u32 cap_q_default_fourcc;
bool multi_core;
}; };
struct mtk_jpeg_src_buf { struct mtk_jpeg_src_buf {
......
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