diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-20 08:06:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-05 21:02:34 -0400 |
commit | 7aaad13124598580dbce98d33618e9356412274c (patch) | |
tree | b1da481319dec1620a6836c81749fdec08ac003f | |
parent | 33bf1786602d819dc0467e77816dfa3f2a7e459d (diff) |
[media] vpif_capture: move routing info from subdev to input
Routing information is a property of the input, not of the subdev.
One subdev may provide multiple inputs, each with its own routing
information.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sekhar Nori <nsekhar@ti.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>
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-dm646x-evm.c | 10 | ||||
-rw-r--r-- | drivers/media/platform/davinci/vpif_capture.c | 7 | ||||
-rw-r--r-- | include/media/davinci/vpif_types.h | 4 |
4 files changed, 19 insertions, 12 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index d92e0ab8c279..87bd249ffb9c 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -1182,8 +1182,11 @@ static const struct vpif_input da850_ch0_inputs[] = { | |||
1182 | .index = 0, | 1182 | .index = 0, |
1183 | .name = "Composite", | 1183 | .name = "Composite", |
1184 | .type = V4L2_INPUT_TYPE_CAMERA, | 1184 | .type = V4L2_INPUT_TYPE_CAMERA, |
1185 | .capabilities = V4L2_IN_CAP_STD, | ||
1185 | .std = TVP514X_STD_ALL, | 1186 | .std = TVP514X_STD_ALL, |
1186 | }, | 1187 | }, |
1188 | .input_route = INPUT_CVBS_VI2B, | ||
1189 | .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
1187 | .subdev_name = TVP5147_CH0, | 1190 | .subdev_name = TVP5147_CH0, |
1188 | }, | 1191 | }, |
1189 | }; | 1192 | }; |
@@ -1194,8 +1197,11 @@ static const struct vpif_input da850_ch1_inputs[] = { | |||
1194 | .index = 0, | 1197 | .index = 0, |
1195 | .name = "S-Video", | 1198 | .name = "S-Video", |
1196 | .type = V4L2_INPUT_TYPE_CAMERA, | 1199 | .type = V4L2_INPUT_TYPE_CAMERA, |
1200 | .capabilities = V4L2_IN_CAP_STD, | ||
1197 | .std = TVP514X_STD_ALL, | 1201 | .std = TVP514X_STD_ALL, |
1198 | }, | 1202 | }, |
1203 | .input_route = INPUT_SVIDEO_VI2C_VI1C, | ||
1204 | .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
1199 | .subdev_name = TVP5147_CH1, | 1205 | .subdev_name = TVP5147_CH1, |
1200 | }, | 1206 | }, |
1201 | }; | 1207 | }; |
@@ -1207,8 +1213,6 @@ static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = { | |||
1207 | I2C_BOARD_INFO("tvp5146", 0x5d), | 1213 | I2C_BOARD_INFO("tvp5146", 0x5d), |
1208 | .platform_data = &tvp5146_pdata, | 1214 | .platform_data = &tvp5146_pdata, |
1209 | }, | 1215 | }, |
1210 | .input = INPUT_CVBS_VI2B, | ||
1211 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
1212 | .vpif_if = { | 1216 | .vpif_if = { |
1213 | .if_type = VPIF_IF_BT656, | 1217 | .if_type = VPIF_IF_BT656, |
1214 | .hd_pol = 1, | 1218 | .hd_pol = 1, |
@@ -1222,8 +1226,6 @@ static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = { | |||
1222 | I2C_BOARD_INFO("tvp5146", 0x5c), | 1226 | I2C_BOARD_INFO("tvp5146", 0x5c), |
1223 | .platform_data = &tvp5146_pdata, | 1227 | .platform_data = &tvp5146_pdata, |
1224 | }, | 1228 | }, |
1225 | .input = INPUT_SVIDEO_VI2C_VI1C, | ||
1226 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
1227 | .vpif_if = { | 1229 | .vpif_if = { |
1228 | .if_type = VPIF_IF_BT656, | 1230 | .if_type = VPIF_IF_BT656, |
1229 | .hd_pol = 1, | 1231 | .hd_pol = 1, |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index a0be63b1dc0b..6f329caca6e8 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -601,8 +601,6 @@ static struct vpif_subdev_info vpif_capture_sdev_info[] = { | |||
601 | I2C_BOARD_INFO("tvp5146", 0x5d), | 601 | I2C_BOARD_INFO("tvp5146", 0x5d), |
602 | .platform_data = &tvp5146_pdata, | 602 | .platform_data = &tvp5146_pdata, |
603 | }, | 603 | }, |
604 | .input = INPUT_CVBS_VI2B, | ||
605 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
606 | .vpif_if = { | 604 | .vpif_if = { |
607 | .if_type = VPIF_IF_BT656, | 605 | .if_type = VPIF_IF_BT656, |
608 | .hd_pol = 1, | 606 | .hd_pol = 1, |
@@ -616,8 +614,6 @@ static struct vpif_subdev_info vpif_capture_sdev_info[] = { | |||
616 | I2C_BOARD_INFO("tvp5146", 0x5c), | 614 | I2C_BOARD_INFO("tvp5146", 0x5c), |
617 | .platform_data = &tvp5146_pdata, | 615 | .platform_data = &tvp5146_pdata, |
618 | }, | 616 | }, |
619 | .input = INPUT_SVIDEO_VI2C_VI1C, | ||
620 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
621 | .vpif_if = { | 617 | .vpif_if = { |
622 | .if_type = VPIF_IF_BT656, | 618 | .if_type = VPIF_IF_BT656, |
623 | .hd_pol = 1, | 619 | .hd_pol = 1, |
@@ -633,9 +629,12 @@ static const struct vpif_input dm6467_ch0_inputs[] = { | |||
633 | .index = 0, | 629 | .index = 0, |
634 | .name = "Composite", | 630 | .name = "Composite", |
635 | .type = V4L2_INPUT_TYPE_CAMERA, | 631 | .type = V4L2_INPUT_TYPE_CAMERA, |
632 | .capabilities = V4L2_IN_CAP_STD, | ||
636 | .std = TVP514X_STD_ALL, | 633 | .std = TVP514X_STD_ALL, |
637 | }, | 634 | }, |
638 | .subdev_name = TVP5147_CH0, | 635 | .subdev_name = TVP5147_CH0, |
636 | .input_route = INPUT_CVBS_VI2B, | ||
637 | .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
639 | }, | 638 | }, |
640 | }; | 639 | }; |
641 | 640 | ||
@@ -645,9 +644,12 @@ static const struct vpif_input dm6467_ch1_inputs[] = { | |||
645 | .index = 0, | 644 | .index = 0, |
646 | .name = "S-Video", | 645 | .name = "S-Video", |
647 | .type = V4L2_INPUT_TYPE_CAMERA, | 646 | .type = V4L2_INPUT_TYPE_CAMERA, |
647 | .capabilities = V4L2_IN_CAP_STD, | ||
648 | .std = TVP514X_STD_ALL, | 648 | .std = TVP514X_STD_ALL, |
649 | }, | 649 | }, |
650 | .subdev_name = TVP5147_CH1, | 650 | .subdev_name = TVP5147_CH1, |
651 | .input_route = INPUT_SVIDEO_VI2C_VI1C, | ||
652 | .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
651 | }, | 653 | }, |
652 | }; | 654 | }; |
653 | 655 | ||
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index d90e23596541..d668a3aa5fe0 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -1464,6 +1464,9 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index) | |||
1464 | 1464 | ||
1465 | chan_cfg = &config->chan_config[ch->channel_id]; | 1465 | chan_cfg = &config->chan_config[ch->channel_id]; |
1466 | 1466 | ||
1467 | if (index >= chan_cfg->input_count) | ||
1468 | return -EINVAL; | ||
1469 | |||
1467 | if (common->started) { | 1470 | if (common->started) { |
1468 | vpif_err("Streaming in progress\n"); | 1471 | vpif_err("Streaming in progress\n"); |
1469 | return -EBUSY; | 1472 | return -EBUSY; |
@@ -1502,8 +1505,8 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index) | |||
1502 | } | 1505 | } |
1503 | } | 1506 | } |
1504 | 1507 | ||
1505 | input = subdev_info->input; | 1508 | input = chan_cfg->inputs[index].input_route; |
1506 | output = subdev_info->output; | 1509 | output = chan_cfg->inputs[index].output_route; |
1507 | ret = v4l2_subdev_call(vpif_obj.sd[sd_index], video, s_routing, | 1510 | ret = v4l2_subdev_call(vpif_obj.sd[sd_index], video, s_routing, |
1508 | input, output, 0); | 1511 | input, output, 0); |
1509 | if (ret < 0 && ret != -ENOIOCTLCMD) { | 1512 | if (ret < 0 && ret != -ENOIOCTLCMD) { |
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h index 1fe46a51de7c..a422ed085cd2 100644 --- a/include/media/davinci/vpif_types.h +++ b/include/media/davinci/vpif_types.h | |||
@@ -37,8 +37,6 @@ struct vpif_interface { | |||
37 | struct vpif_subdev_info { | 37 | struct vpif_subdev_info { |
38 | const char *name; | 38 | const char *name; |
39 | struct i2c_board_info board_info; | 39 | struct i2c_board_info board_info; |
40 | u32 input; | ||
41 | u32 output; | ||
42 | struct vpif_interface vpif_if; | 40 | struct vpif_interface vpif_if; |
43 | }; | 41 | }; |
44 | 42 | ||
@@ -56,6 +54,8 @@ struct vpif_display_config { | |||
56 | struct vpif_input { | 54 | struct vpif_input { |
57 | struct v4l2_input input; | 55 | struct v4l2_input input; |
58 | const char *subdev_name; | 56 | const char *subdev_name; |
57 | u32 input_route; | ||
58 | u32 output_route; | ||
59 | }; | 59 | }; |
60 | 60 | ||
61 | struct vpif_capture_chan_config { | 61 | struct vpif_capture_chan_config { |