media: rockchip: rga: use card type to specify rga type

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>
This commit is contained in:
Sven Püschel 2026-05-21 00:44:23 +02:00 committed by Hans Verkuil
parent 9481ec73f6
commit d8eb890079
3 changed files with 5 additions and 1 deletions

View 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,

View 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;

View 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;