Commit 8a618957 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 74135fb1
...@@ -1857,9 +1857,14 @@ static const struct vb2_ops coda_qops = { ...@@ -1857,9 +1857,14 @@ static const struct vb2_ops coda_qops = {
static int coda_s_ctrl(struct v4l2_ctrl *ctrl) static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
{ {
const char * const *val_names = v4l2_ctrl_get_menu(ctrl->id);
struct coda_ctx *ctx = struct coda_ctx *ctx =
container_of(ctrl->handler, struct coda_ctx, ctrls); container_of(ctrl->handler, struct coda_ctx, ctrls);
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", coda_dbg(2, ctx, "s_ctrl: id = 0x%x, name = \"%s\", val = %d\n",
ctrl->id, ctrl->name, ctrl->val); ctrl->id, ctrl->name, ctrl->val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment