aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-20 08:06:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-05 21:00:44 -0400
commit6f47c6c69cd45d9e57458e31528628af2d346f73 (patch)
tree9536e765d297e2f6d603052cd3a5c92dfa14ae6d /drivers
parent3cfee2daf9fe9dc514c29f7e7fb35c17136771d2 (diff)
[media] vpif_capture: move input_idx to channel_obj
input_idx does not belong to video_obj. Move it where it belongs. Also remove the bogus code in the open() function that suddenly changes the input to 0 for no reason. 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')
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c9
-rw-r--r--drivers/media/platform/davinci/vpif_capture.h4
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 8dbbd4bffb84..834510679c6d 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -888,8 +888,6 @@ static int vpif_open(struct file *filep)
888 if (vpif_obj.sd[i]) { 888 if (vpif_obj.sd[i]) {
889 /* the sub device is registered */ 889 /* the sub device is registered */
890 ch->curr_subdev_info = &config->subdev_info[i]; 890 ch->curr_subdev_info = &config->subdev_info[i];
891 /* make first input as the current input */
892 vid_ch->input_idx = 0;
893 break; 891 break;
894 } 892 }
895 } 893 }
@@ -1442,10 +1440,8 @@ static int vpif_g_input(struct file *file, void *priv, unsigned int *index)
1442{ 1440{
1443 struct vpif_fh *fh = priv; 1441 struct vpif_fh *fh = priv;
1444 struct channel_obj *ch = fh->channel; 1442 struct channel_obj *ch = fh->channel;
1445 struct video_obj *vid_ch = &ch->video;
1446
1447 *index = vid_ch->input_idx;
1448 1443
1444 *index = ch->input_idx;
1449 return 0; 1445 return 0;
1450} 1446}
1451 1447
@@ -1462,7 +1458,6 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
1462 struct vpif_fh *fh = priv; 1458 struct vpif_fh *fh = priv;
1463 struct channel_obj *ch = fh->channel; 1459 struct channel_obj *ch = fh->channel;
1464 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1460 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
1465 struct video_obj *vid_ch = &ch->video;
1466 struct vpif_subdev_info *subdev_info; 1461 struct vpif_subdev_info *subdev_info;
1467 int ret = 0, sd_index = 0; 1462 int ret = 0, sd_index = 0;
1468 u32 input = 0, output = 0; 1463 u32 input = 0, output = 0;
@@ -1517,7 +1512,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
1517 return ret; 1512 return ret;
1518 } 1513 }
1519 } 1514 }
1520 vid_ch->input_idx = index; 1515 ch->input_idx = index;
1521 ch->curr_subdev_info = subdev_info; 1516 ch->curr_subdev_info = subdev_info;
1522 ch->curr_sd_index = sd_index; 1517 ch->curr_sd_index = sd_index;
1523 /* copy interface parameters to vpif */ 1518 /* copy interface parameters to vpif */
diff --git a/drivers/media/platform/davinci/vpif_capture.h b/drivers/media/platform/davinci/vpif_capture.h
index 1bc9d8bdd756..760964c56879 100644
--- a/drivers/media/platform/davinci/vpif_capture.h
+++ b/drivers/media/platform/davinci/vpif_capture.h
@@ -54,8 +54,6 @@ struct video_obj {
54 /* Currently selected or default standard */ 54 /* Currently selected or default standard */
55 v4l2_std_id stdid; 55 v4l2_std_id stdid;
56 struct v4l2_dv_timings dv_timings; 56 struct v4l2_dv_timings dv_timings;
57 /* This is to track the last input that is passed to application */
58 u32 input_idx;
59}; 57};
60 58
61struct vpif_cap_buffer { 59struct vpif_cap_buffer {
@@ -121,6 +119,8 @@ struct channel_obj {
121 enum vpif_channel_id channel_id; 119 enum vpif_channel_id channel_id;
122 /* index into sd table */ 120 /* index into sd table */
123 int curr_sd_index; 121 int curr_sd_index;
122 /* Current input */
123 u32 input_idx;
124 /* ptr to current sub device information */ 124 /* ptr to current sub device information */
125 struct vpif_subdev_info *curr_subdev_info; 125 struct vpif_subdev_info *curr_subdev_info;
126 /* vpif configuration params */ 126 /* vpif configuration params */