Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] adv7842: add support to for the content type control

This receiver now supports reading the IT content type of the incoming
video.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
e8979274 297a4144

+20
+20
drivers/media/i2c/adv7842.c
··· 1359 1359 return -EINVAL; 1360 1360 } 1361 1361 1362 + static int adv7842_g_volatile_ctrl(struct v4l2_ctrl *ctrl) 1363 + { 1364 + struct v4l2_subdev *sd = to_sd(ctrl); 1365 + 1366 + if (ctrl->id == V4L2_CID_DV_RX_IT_CONTENT_TYPE) { 1367 + ctrl->val = V4L2_DV_IT_CONTENT_TYPE_NO_ITC; 1368 + if ((io_read(sd, 0x60) & 1) && (infoframe_read(sd, 0x03) & 0x80)) 1369 + ctrl->val = (infoframe_read(sd, 0x05) >> 4) & 3; 1370 + return 0; 1371 + } 1372 + return -EINVAL; 1373 + } 1374 + 1362 1375 static inline bool no_power(struct v4l2_subdev *sd) 1363 1376 { 1364 1377 return io_read(sd, 0x0c) & 0x24; ··· 3035 3022 3036 3023 static const struct v4l2_ctrl_ops adv7842_ctrl_ops = { 3037 3024 .s_ctrl = adv7842_s_ctrl, 3025 + .g_volatile_ctrl = adv7842_g_volatile_ctrl, 3038 3026 }; 3039 3027 3040 3028 static const struct v4l2_subdev_core_ops adv7842_core_ops = { ··· 3210 3196 V4L2_DV_BT_CEA_640X480P59_94; 3211 3197 struct adv7842_platform_data *pdata = client->dev.platform_data; 3212 3198 struct v4l2_ctrl_handler *hdl; 3199 + struct v4l2_ctrl *ctrl; 3213 3200 struct v4l2_subdev *sd; 3214 3201 u16 rev; 3215 3202 int err; ··· 3276 3261 V4L2_CID_SATURATION, 0, 255, 1, 128); 3277 3262 v4l2_ctrl_new_std(hdl, &adv7842_ctrl_ops, 3278 3263 V4L2_CID_HUE, 0, 128, 1, 0); 3264 + ctrl = v4l2_ctrl_new_std_menu(hdl, &adv7842_ctrl_ops, 3265 + V4L2_CID_DV_RX_IT_CONTENT_TYPE, V4L2_DV_IT_CONTENT_TYPE_NO_ITC, 3266 + 0, V4L2_DV_IT_CONTENT_TYPE_NO_ITC); 3267 + if (ctrl) 3268 + ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; 3279 3269 3280 3270 /* custom controls */ 3281 3271 state->detect_tx_5v_ctrl = v4l2_ctrl_new_std(hdl, NULL,