summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-06 20:36:32 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 10:33:26 +0200
commitdfbb172e512eaba56039e0b4c485256295442147 (patch)
tree88d57f3703c10c44bcde8899e426b1a5d06377b0 /drivers/media
parent05930cf1e5c5d7d526e492cfe0f0bb3116bc29de (diff)
downloadlwn-dfbb172e512eaba56039e0b4c485256295442147.tar.gz
lwn-dfbb172e512eaba56039e0b4c485256295442147.zip
media: ti-vpe: cal: Print revision and hwinfo in a more readable format
Print the hardware revision in the X.Y.R format, which is more readable that the 32-bit hex value. For the hardware info register, only print its value if it doesn't contain what we expect. 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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index fca591a94aca..ec52cb7f3039 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -2342,21 +2342,36 @@ static const struct of_device_id cal_of_match[] = {
};
MODULE_DEVICE_TABLE(of, cal_of_match);
-/*
- * Get Revision and HW info
- */
+/* Get hardware revision and info. */
+
+#define CAL_HL_HWINFO_VALUE 0xa3c90469
+
static void cal_get_hwinfo(struct cal_dev *cal)
{
u32 revision;
u32 hwinfo;
revision = reg_read(cal, CAL_HL_REVISION);
- cal_dbg(3, cal, "CAL_HL_REVISION = 0x%08x (expecting 0x40000200)\n",
- revision);
+ switch (FIELD_GET(CAL_HL_REVISION_SCHEME_MASK, revision)) {
+ case CAL_HL_REVISION_SCHEME_H08:
+ cal_dbg(3, cal, "CAL HW revision %lu.%lu.%lu (0x%08x)\n",
+ FIELD_GET(CAL_HL_REVISION_MAJOR_MASK, revision),
+ FIELD_GET(CAL_HL_REVISION_MINOR_MASK, revision),
+ FIELD_GET(CAL_HL_REVISION_RTL_MASK, revision),
+ revision);
+ break;
+
+ case CAL_HL_REVISION_SCHEME_LEGACY:
+ default:
+ cal_info(cal, "Unexpected CAL HW revision 0x%08x\n",
+ revision);
+ break;
+ }
hwinfo = reg_read(cal, CAL_HL_HWINFO);
- cal_dbg(3, cal, "CAL_HL_HWINFO = 0x%08x (expecting 0xA3C90469)\n",
- hwinfo);
+ if (hwinfo != CAL_HL_HWINFO_VALUE)
+ cal_info(cal, "CAL_HL_HWINFO = 0x%08x, expected 0x%08x\n",
+ hwinfo, CAL_HL_HWINFO_VALUE);
}
static int cal_probe(struct platform_device *pdev)