aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorjean-michel.hautbois@vodalys.com <jean-michel.hautbois@vodalys.com>2015-02-06 09:37:58 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-02 12:54:22 -0500
commit5851462531b5c08811057b4530cdb3170e22ac2a (patch)
treeba0ec80191b24da6fb768a04d67c08eb1cb39ded /drivers/media
parent8aa9eb9059f6246b530d664f271e5c32858222ed (diff)
[media] media: i2c: ADV7604: In free run mode, signal is locked
The CP_NON_STD_VIDEO bit indicates an input not aligned with DV timings. If there is no input, and chip is in free run mode, consider we are locked. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> [hans.verkuil@cisco.com: put both conditions in one 'if'] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/adv7604.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index d228b7c82310..5f34e0ab06f3 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -1253,13 +1253,19 @@ static inline bool no_lock_cp(struct v4l2_subdev *sd)
1253 return io_read(sd, 0x12) & 0x01; 1253 return io_read(sd, 0x12) & 0x01;
1254} 1254}
1255 1255
1256static inline bool in_free_run(struct v4l2_subdev *sd)
1257{
1258 return cp_read(sd, 0xff) & 0x10;
1259}
1260
1256static int adv7604_g_input_status(struct v4l2_subdev *sd, u32 *status) 1261static int adv7604_g_input_status(struct v4l2_subdev *sd, u32 *status)
1257{ 1262{
1258 *status = 0; 1263 *status = 0;
1259 *status |= no_power(sd) ? V4L2_IN_ST_NO_POWER : 0; 1264 *status |= no_power(sd) ? V4L2_IN_ST_NO_POWER : 0;
1260 *status |= no_signal(sd) ? V4L2_IN_ST_NO_SIGNAL : 0; 1265 *status |= no_signal(sd) ? V4L2_IN_ST_NO_SIGNAL : 0;
1261 if (no_lock_cp(sd)) 1266 if (!in_free_run(sd) && no_lock_cp(sd))
1262 *status |= is_digital_input(sd) ? V4L2_IN_ST_NO_SYNC : V4L2_IN_ST_NO_H_LOCK; 1267 *status |= is_digital_input(sd) ?
1268 V4L2_IN_ST_NO_SYNC : V4L2_IN_ST_NO_H_LOCK;
1263 1269
1264 v4l2_dbg(1, debug, sd, "%s: status = 0x%x\n", __func__, *status); 1270 v4l2_dbg(1, debug, sd, "%s: status = 0x%x\n", __func__, *status);
1265 1271
@@ -2200,7 +2206,7 @@ static int adv7604_log_status(struct v4l2_subdev *sd)
2200 v4l2_info(sd, "STDI locked: %s\n", no_lock_stdi(sd) ? "false" : "true"); 2206 v4l2_info(sd, "STDI locked: %s\n", no_lock_stdi(sd) ? "false" : "true");
2201 v4l2_info(sd, "CP locked: %s\n", no_lock_cp(sd) ? "false" : "true"); 2207 v4l2_info(sd, "CP locked: %s\n", no_lock_cp(sd) ? "false" : "true");
2202 v4l2_info(sd, "CP free run: %s\n", 2208 v4l2_info(sd, "CP free run: %s\n",
2203 (!!(cp_read(sd, 0xff) & 0x10) ? "on" : "off")); 2209 (in_free_run(sd)) ? "on" : "off");
2204 v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n", 2210 v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n",
2205 io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f, 2211 io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f,
2206 (io_read(sd, 0x01) & 0x70) >> 4); 2212 (io_read(sd, 0x01) & 0x70) >> 4);