diff options
author | Yunfei Dong <yunfei.dong@mediatek.com> | 2022-06-10 02:53:12 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-06-27 08:49:20 +0100 |
commit | cce4de66ccca78b45b78f9935c1bb14765ca8490 (patch) | |
tree | 5dedd90825614f0cc1fc6141eb1c0880756e4b12 /drivers/media/platform/mediatek | |
parent | fd83ef8f8e59053c0b5b2b847d0357589d4c35bd (diff) |
media: mediatek: vcodec: Fix decoder v4l2 bus_info not correctly
Fix v4l2 capability bus_info value with correct chip name according to
compatible.
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/mediatek')
-rw-r--r-- | drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 61412d0eeb33..957e0f09468f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -223,11 +223,32 @@ static int vidioc_vdec_dqbuf(struct file *file, void *priv, return v4l2_m2m_dqbuf(file, ctx->m2m_ctx, buf); } +static int mtk_vcodec_dec_get_chip_name(void *priv) +{ + struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); + struct device *dev = &ctx->dev->plat_dev->dev; + + if (of_device_is_compatible(dev->of_node, "mediatek,mt8173-vcodec-dec")) + return 8173; + else if (of_device_is_compatible(dev->of_node, "mediatek,mt8183-vcodec-dec")) + return 8183; + else if (of_device_is_compatible(dev->of_node, "mediatek,mt8192-vcodec-dec")) + return 8192; + else if (of_device_is_compatible(dev->of_node, "mediatek,mt8195-vcodec-dec")) + return 8195; + else if (of_device_is_compatible(dev->of_node, "mediatek,mt8186-vcodec-dec")) + return 8186; + else + return 8173; +} + static int vidioc_vdec_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { + int platform_name = mtk_vcodec_dec_get_chip_name(priv); + strscpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver)); - strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-dec", platform_name); strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card)); return 0; |