summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-06-14 13:23:20 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-07-12 12:45:39 +0200
commit0de6f41a06b8b69f2230a0488fde1703e55f0f39 (patch)
tree3a15b57478daf03b20dd41cb6971d445757e79c3 /drivers/media/platform
parentmedia: ti-vpe: cal: Add CSI2 context (diff)
downloadlinux-0de6f41a06b8b69f2230a0488fde1703e55f0f39.tar.xz
linux-0de6f41a06b8b69f2230a0488fde1703e55f0f39.zip
media: ti-vpe: cal: Add pixel processing context
CAL has 4 pixel processing contexts (PIX PROC) of which the driver currently uses pix proc 0 for PHY0, and pix proc 1 for PHY1 (as the driver supports only a single source per PHY). Add a pix_proc field to cal_ctx to allow us to use different pix proc contexts in the future Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c9
-rw-r--r--drivers/media/platform/ti-vpe/cal.h1
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index a96019cf8b28..1b38b8ad6cf9 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -355,16 +355,16 @@ static void cal_ctx_pix_proc_config(struct cal_ctx *ctx)
break;
}
- val = cal_read(ctx->cal, CAL_PIX_PROC(ctx->index));
+ val = cal_read(ctx->cal, CAL_PIX_PROC(ctx->pix_proc));
cal_set_field(&val, extract, CAL_PIX_PROC_EXTRACT_MASK);
cal_set_field(&val, CAL_PIX_PROC_DPCMD_BYPASS, CAL_PIX_PROC_DPCMD_MASK);
cal_set_field(&val, CAL_PIX_PROC_DPCME_BYPASS, CAL_PIX_PROC_DPCME_MASK);
cal_set_field(&val, pack, CAL_PIX_PROC_PACK_MASK);
cal_set_field(&val, ctx->cport, CAL_PIX_PROC_CPORT_MASK);
cal_set_field(&val, 1, CAL_PIX_PROC_EN_MASK);
- cal_write(ctx->cal, CAL_PIX_PROC(ctx->index), val);
- ctx_dbg(3, ctx, "CAL_PIX_PROC(%d) = 0x%08x\n", ctx->index,
- cal_read(ctx->cal, CAL_PIX_PROC(ctx->index)));
+ cal_write(ctx->cal, CAL_PIX_PROC(ctx->pix_proc), val);
+ ctx_dbg(3, ctx, "CAL_PIX_PROC(%u) = 0x%08x\n", ctx->pix_proc,
+ cal_read(ctx->cal, CAL_PIX_PROC(ctx->pix_proc)));
}
static void cal_ctx_wr_dma_config(struct cal_ctx *ctx)
@@ -856,6 +856,7 @@ static struct cal_ctx *cal_ctx_create(struct cal_dev *cal, int inst)
ctx->index = inst;
ctx->csi2_ctx = inst;
ctx->cport = inst;
+ ctx->pix_proc = inst;
ret = cal_ctx_v4l2_init(ctx);
if (ret)
diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
index bcc3378b6b41..9475dc80559b 100644
--- a/drivers/media/platform/ti-vpe/cal.h
+++ b/drivers/media/platform/ti-vpe/cal.h
@@ -220,6 +220,7 @@ struct cal_ctx {
u8 index;
u8 cport;
u8 csi2_ctx;
+ u8 pix_proc;
};
extern unsigned int cal_debug;