From 8a618957257aba5c42ea04c828d8bc6525ebd494 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Fri, 12 Apr 2019 11:51:28 -0400
Subject: media: coda: add menu strings to s_ctrl debug output
When a menu control is updated via s_ctrl, print the corresponding menu
entry string in addition to the numerical value it is set to.
Signed-off-by: Philipp Zabel
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
drivers/media/platform/coda/coda-common.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'drivers')
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 15d49de6becb..171a3db72b30 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1857,11 +1857,16 @@ static const struct vb2_ops coda_qops = {
static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
{
+ const char * const *val_names = v4l2_ctrl_get_menu(ctrl->id);
struct coda_ctx *ctx =
container_of(ctrl->handler, struct coda_ctx, ctrls);
- coda_dbg(2, ctx, "s_ctrl: id = 0x%x, name = \"%s\", val = %d\n",
- ctrl->id, ctrl->name, ctrl->val);
+ if (val_names)
+ coda_dbg(2, ctx, "s_ctrl: id = 0x%x, name = \"%s\", val = %d (\"%s\")\n",
+ ctrl->id, ctrl->name, ctrl->val, val_names[ctrl->val]);
+ else
+ coda_dbg(2, ctx, "s_ctrl: id = 0x%x, name = \"%s\", val = %d\n",
+ ctrl->id, ctrl->name, ctrl->val);
switch (ctrl->id) {
case V4L2_CID_HFLIP:
--
cgit v1.2.3