media: ti-vpe: cal: Operate on phy instances in cal_quickdump_regs()

The cal_quickdump_regs() dumps registers for the two CAMERARX instances.
Retrieve those instances from the cal_dev directly instead of going
through the contexts, and simplify the code by using a loop.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Laurent Pinchart 2020-07-06 20:36:25 +02:00 committed by Mauro Carvalho Chehab
parent 539e7c5d7c
commit 517cf52b77

View File

@ -450,26 +450,24 @@ static inline void set_field(u32 *valp, u32 field, u32 mask)
static void cal_quickdump_regs(struct cal_dev *cal) static void cal_quickdump_regs(struct cal_dev *cal)
{ {
unsigned int i;
cal_info(cal, "CAL Registers @ 0x%pa:\n", &cal->res->start); cal_info(cal, "CAL Registers @ 0x%pa:\n", &cal->res->start);
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4,
(__force const void *)cal->base, (__force const void *)cal->base,
resource_size(cal->res), false); resource_size(cal->res), false);
if (cal->ctx[0]) { for (i = 0; i < ARRAY_SIZE(cal->phy); ++i) {
cal_info(cal, "CSI2 Core 0 Registers @ %pa:\n", struct cal_camerarx *phy = cal->phy[i];
&cal->ctx[0]->phy->res->start);
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4,
(__force const void *)cal->ctx[0]->phy->base,
resource_size(cal->ctx[0]->phy->res),
false);
}
if (cal->ctx[1]) { if (!phy)
cal_info(cal, "CSI2 Core 1 Registers @ %pa:\n", continue;
&cal->ctx[1]->phy->res->start);
cal_info(cal, "CSI2 Core %u Registers @ %pa:\n", i,
&phy->res->start);
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4, print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 4,
(__force const void *)cal->ctx[1]->phy->base, (__force const void *)phy->base,
resource_size(cal->ctx[1]->phy->res), resource_size(phy->res),
false); false);
} }
} }