diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-20 08:06:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-05 21:01:11 -0400 |
commit | 311673ee9b6746aa366cc19049899308ce8bd01f (patch) | |
tree | 6950ce681dc31f64be813eb77c43bab4d3742132 /drivers/media | |
parent | 6f47c6c69cd45d9e57458e31528628af2d346f73 (diff) |
[media] vpif_display: move output_id to channel_obj
The output index does not belong to video_obj, it belongs to
channel_obj. Also rename to output_idx to be consistent with
the input_idx name used in vpif_capture.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Tested-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/davinci/vpif_display.c | 17 | ||||
-rw-r--r-- | drivers/media/platform/davinci/vpif_display.h | 2 |
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 749368321c54..2d90328baa60 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
@@ -1231,7 +1231,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) | |||
1231 | { | 1231 | { |
1232 | struct vpif_fh *fh = priv; | 1232 | struct vpif_fh *fh = priv; |
1233 | struct channel_obj *ch = fh->channel; | 1233 | struct channel_obj *ch = fh->channel; |
1234 | struct video_obj *vid_ch = &ch->video; | ||
1235 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 1234 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
1236 | int ret = 0; | 1235 | int ret = 0; |
1237 | 1236 | ||
@@ -1246,7 +1245,7 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) | |||
1246 | if (ret < 0) | 1245 | if (ret < 0) |
1247 | vpif_err("Failed to set output standard\n"); | 1246 | vpif_err("Failed to set output standard\n"); |
1248 | 1247 | ||
1249 | vid_ch->output_id = i; | 1248 | ch->output_idx = i; |
1250 | return ret; | 1249 | return ret; |
1251 | } | 1250 | } |
1252 | 1251 | ||
@@ -1254,9 +1253,8 @@ static int vpif_g_output(struct file *file, void *priv, unsigned int *i) | |||
1254 | { | 1253 | { |
1255 | struct vpif_fh *fh = priv; | 1254 | struct vpif_fh *fh = priv; |
1256 | struct channel_obj *ch = fh->channel; | 1255 | struct channel_obj *ch = fh->channel; |
1257 | struct video_obj *vid_ch = &ch->video; | ||
1258 | 1256 | ||
1259 | *i = vid_ch->output_id; | 1257 | *i = ch->output_idx; |
1260 | 1258 | ||
1261 | return 0; | 1259 | return 0; |
1262 | } | 1260 | } |
@@ -1291,9 +1289,8 @@ vpif_enum_dv_timings(struct file *file, void *priv, | |||
1291 | { | 1289 | { |
1292 | struct vpif_fh *fh = priv; | 1290 | struct vpif_fh *fh = priv; |
1293 | struct channel_obj *ch = fh->channel; | 1291 | struct channel_obj *ch = fh->channel; |
1294 | struct video_obj *vid_ch = &ch->video; | ||
1295 | 1292 | ||
1296 | return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], | 1293 | return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], |
1297 | video, enum_dv_timings, timings); | 1294 | video, enum_dv_timings, timings); |
1298 | } | 1295 | } |
1299 | 1296 | ||
@@ -1320,7 +1317,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, | |||
1320 | } | 1317 | } |
1321 | 1318 | ||
1322 | /* Configure subdevice timings, if any */ | 1319 | /* Configure subdevice timings, if any */ |
1323 | ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], | 1320 | ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx], |
1324 | video, s_dv_timings, timings); | 1321 | video, s_dv_timings, timings); |
1325 | if (ret == -ENOIOCTLCMD) { | 1322 | if (ret == -ENOIOCTLCMD) { |
1326 | vpif_dbg(2, debug, "Custom DV timings not supported by " | 1323 | vpif_dbg(2, debug, "Custom DV timings not supported by " |
@@ -1451,9 +1448,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv, | |||
1451 | struct v4l2_dbg_register *reg){ | 1448 | struct v4l2_dbg_register *reg){ |
1452 | struct vpif_fh *fh = priv; | 1449 | struct vpif_fh *fh = priv; |
1453 | struct channel_obj *ch = fh->channel; | 1450 | struct channel_obj *ch = fh->channel; |
1454 | struct video_obj *vid_ch = &ch->video; | ||
1455 | 1451 | ||
1456 | return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, | 1452 | return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, |
1457 | g_register, reg); | 1453 | g_register, reg); |
1458 | } | 1454 | } |
1459 | 1455 | ||
@@ -1470,9 +1466,8 @@ static int vpif_dbg_s_register(struct file *file, void *priv, | |||
1470 | struct v4l2_dbg_register *reg){ | 1466 | struct v4l2_dbg_register *reg){ |
1471 | struct vpif_fh *fh = priv; | 1467 | struct vpif_fh *fh = priv; |
1472 | struct channel_obj *ch = fh->channel; | 1468 | struct channel_obj *ch = fh->channel; |
1473 | struct video_obj *vid_ch = &ch->video; | ||
1474 | 1469 | ||
1475 | return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, | 1470 | return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, |
1476 | s_register, reg); | 1471 | s_register, reg); |
1477 | } | 1472 | } |
1478 | #endif | 1473 | #endif |
diff --git a/drivers/media/platform/davinci/vpif_display.h b/drivers/media/platform/davinci/vpif_display.h index b90a1640ce8c..532ee9e8ce38 100644 --- a/drivers/media/platform/davinci/vpif_display.h +++ b/drivers/media/platform/davinci/vpif_display.h | |||
@@ -62,7 +62,6 @@ struct video_obj { | |||
62 | v4l2_std_id stdid; /* Currently selected or default | 62 | v4l2_std_id stdid; /* Currently selected or default |
63 | * standard */ | 63 | * standard */ |
64 | struct v4l2_dv_timings dv_timings; | 64 | struct v4l2_dv_timings dv_timings; |
65 | u32 output_id; /* Current output id */ | ||
66 | }; | 65 | }; |
67 | 66 | ||
68 | struct vpif_disp_buffer { | 67 | struct vpif_disp_buffer { |
@@ -125,6 +124,7 @@ struct channel_obj { | |||
125 | * which is being displayed */ | 124 | * which is being displayed */ |
126 | u8 initialized; /* flag to indicate whether | 125 | u8 initialized; /* flag to indicate whether |
127 | * encoder is initialized */ | 126 | * encoder is initialized */ |
127 | u32 output_idx; /* Current output index */ | ||
128 | 128 | ||
129 | enum vpif_channel_id channel_id;/* Identifies channel */ | 129 | enum vpif_channel_id channel_id;/* Identifies channel */ |
130 | struct vpif_params vpifparams; | 130 | struct vpif_params vpifparams; |