]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: rockchip: rga: use card type to specify rga type
authorSven Püschel <s.pueschel@pengutronix.de>
Wed, 20 May 2026 22:44:23 +0000 (00:44 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 21 May 2026 10:32:20 +0000 (12:32 +0200)
In preparation of the RGA3 support add a filed to the rga_hw struct
to specify the desired card type value. This allows the user to
differentiate the RGA2 and RGA3 video device nodes.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/rockchip/rga/rga-hw.c
drivers/media/platform/rockchip/rga/rga.c
drivers/media/platform/rockchip/rga/rga.h

index f2900812ba76fee2f2f9715b1f8dc642a8f698e5..43fd023b7571c68ca22c31a7d250593bbcc654c5 100644 (file)
@@ -577,6 +577,7 @@ static struct rga_fmt formats[] = {
 };
 
 const struct rga_hw rga2_hw = {
+       .card_type = "rga2",
        .formats = formats,
        .num_formats = ARRAY_SIZE(formats),
        .cmdbuf_size = RGA_CMDBUF_SIZE,
index 22954bbae55fcdb858350c3392fb642375965d64..91775b43ff617aa11d2d7f196dd45074df2a491e 100644 (file)
@@ -354,8 +354,10 @@ static const struct v4l2_file_operations rga_fops = {
 static int
 vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
 {
+       struct rockchip_rga *rga = video_drvdata(file);
+
        strscpy(cap->driver, RGA_NAME, sizeof(cap->driver));
-       strscpy(cap->card, "rockchip-rga", sizeof(cap->card));
+       strscpy(cap->card, rga->hw->card_type, sizeof(cap->card));
        strscpy(cap->bus_info, "platform:rga", sizeof(cap->bus_info));
 
        return 0;
index df525c6aea8b63e16e42a42e7c32abbaeb75f34e..cee2e75ea89f1b3fbe35a2ab076da42a9b33b4e7 100644 (file)
@@ -149,6 +149,7 @@ static inline void rga_mod(struct rockchip_rga *rga, u32 reg, u32 val, u32 mask)
 };
 
 struct rga_hw {
+       const char *card_type;
        struct rga_fmt *formats;
        u32 num_formats;
        size_t cmdbuf_size;