aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/platform/davinci/vpif_display.c17
-rw-r--r--drivers/media/platform/davinci/vpif_display.h1
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 4e2800043c9..6229e4844be 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1246,6 +1246,8 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
1246 vpif_err("Failed to set output standard\n"); 1246 vpif_err("Failed to set output standard\n");
1247 1247
1248 ch->output_idx = i; 1248 ch->output_idx = i;
1249 if (vpif_obj.sd[i])
1250 ch->sd = vpif_obj.sd[i];
1249 return ret; 1251 return ret;
1250} 1252}
1251 1253
@@ -1317,14 +1319,13 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
1317 } 1319 }
1318 1320
1319 /* Configure subdevice timings, if any */ 1321 /* Configure subdevice timings, if any */
1320 ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx], 1322 ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
1321 video, s_dv_timings, timings);
1322 if (ret == -ENOIOCTLCMD) { 1323 if (ret == -ENOIOCTLCMD) {
1323 vpif_dbg(2, debug, "Custom DV timings not supported by " 1324 vpif_dbg(2, debug, "Custom DV timings not supported by "
1324 "subdevice\n"); 1325 "subdevice\n");
1325 return -EINVAL; 1326 return -ENODATA;
1326 } 1327 }
1327 if (ret < 0) { 1328 if (ret < 0 && ret != -ENODEV) {
1328 vpif_dbg(2, debug, "Error setting custom DV timings\n"); 1329 vpif_dbg(2, debug, "Error setting custom DV timings\n");
1329 return ret; 1330 return ret;
1330 } 1331 }
@@ -1449,8 +1450,7 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
1449 struct vpif_fh *fh = priv; 1450 struct vpif_fh *fh = priv;
1450 struct channel_obj *ch = fh->channel; 1451 struct channel_obj *ch = fh->channel;
1451 1452
1452 return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, 1453 return v4l2_subdev_call(ch->sd, core, g_register, reg);
1453 g_register, reg);
1454} 1454}
1455 1455
1456/* 1456/*
@@ -1467,8 +1467,7 @@ static int vpif_dbg_s_register(struct file *file, void *priv,
1467 struct vpif_fh *fh = priv; 1467 struct vpif_fh *fh = priv;
1468 struct channel_obj *ch = fh->channel; 1468 struct channel_obj *ch = fh->channel;
1469 1469
1470 return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, 1470 return v4l2_subdev_call(ch->sd, core, s_register, reg);
1471 s_register, reg);
1472} 1471}
1473#endif 1472#endif
1474 1473
@@ -1739,6 +1738,8 @@ static __init int vpif_probe(struct platform_device *pdev)
1739 1738
1740 } 1739 }
1741 ch->initialized = 0; 1740 ch->initialized = 0;
1741 if (subdev_count)
1742 ch->sd = vpif_obj.sd[0];
1742 ch->channel_id = j; 1743 ch->channel_id = j;
1743 if (j < 2) 1744 if (j < 2)
1744 ch->common[VPIF_VIDEO_INDEX].numbuffers = 1745 ch->common[VPIF_VIDEO_INDEX].numbuffers =
diff --git a/drivers/media/platform/davinci/vpif_display.h b/drivers/media/platform/davinci/vpif_display.h
index 532ee9e8ce3..a5a18f74395 100644
--- a/drivers/media/platform/davinci/vpif_display.h
+++ b/drivers/media/platform/davinci/vpif_display.h
@@ -125,6 +125,7 @@ struct channel_obj {
125 u8 initialized; /* flag to indicate whether 125 u8 initialized; /* flag to indicate whether
126 * encoder is initialized */ 126 * encoder is initialized */
127 u32 output_idx; /* Current output index */ 127 u32 output_idx; /* Current output index */
128 struct v4l2_subdev *sd; /* Current output subdev(may be NULL) */
128 129
129 enum vpif_channel_id channel_id;/* Identifies channel */ 130 enum vpif_channel_id channel_id;/* Identifies channel */
130 struct vpif_params vpifparams; 131 struct vpif_params vpifparams;