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 <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Philipp Zabel 2019-04-12 11:51:28 -04:00 committed by Mauro Carvalho Chehab
parent 74135fb184
commit 8a61895725

View File

@ -1857,11 +1857,16 @@ 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);
coda_dbg(2, ctx, "s_ctrl: id = 0x%x, name = \"%s\", val = %d\n", if (val_names)
ctrl->id, ctrl->name, ctrl->val); 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) { switch (ctrl->id) {
case V4L2_CID_HFLIP: case V4L2_CID_HFLIP: