aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-03-04 04:47:57 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-23 14:46:38 -0400
commit3f1ccf16f3ea015e57c326c2b14010bf119b6184 (patch)
treeb5f46a2102c5e37f23ff78175fae393105e1eef3
parent20058f90916b7ed5e986c399240f58d9af8892e0 (diff)
[media] v4l2-subdev: support new 'which' field in enum_mbus_code
Support the new 'which' field in the enum_mbus_code ops. Most drivers do not need to be changed since they always return the same enumeration regardless of the 'which' field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.c1
-rw-r--r--drivers/media/platform/omap3isp/ispccdc.c4
-rw-r--r--drivers/media/platform/omap3isp/ispccp2.c2
-rw-r--r--drivers/media/platform/omap3isp/ispcsi2.c2
-rw-r--r--drivers/media/platform/omap3isp/ispresizer.c2
-rw-r--r--drivers/media/platform/vsp1/vsp1_bru.c4
-rw-r--r--drivers/media/platform/vsp1/vsp1_lif.c4
-rw-r--r--drivers/media/platform/vsp1/vsp1_lut.c4
-rw-r--r--drivers/media/platform/vsp1/vsp1_sru.c4
-rw-r--r--drivers/media/platform/vsp1/vsp1_uds.c4
-rw-r--r--drivers/staging/media/omap4iss/iss_csi2.c2
-rw-r--r--drivers/staging/media/omap4iss/iss_ipipeif.c2
-rw-r--r--drivers/staging/media/omap4iss/iss_resizer.c2
13 files changed, 24 insertions, 13 deletions
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
index 56a5cb0d2152..8b413be8d598 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -2327,6 +2327,7 @@ vpfe_async_bound(struct v4l2_async_notifier *notifier,
2327 2327
2328 memset(&mbus_code, 0, sizeof(mbus_code)); 2328 memset(&mbus_code, 0, sizeof(mbus_code));
2329 mbus_code.index = j; 2329 mbus_code.index = j;
2330 mbus_code.which = V4L2_SUBDEV_FORMAT_ACTIVE;
2330 ret = v4l2_subdev_call(subdev, pad, enum_mbus_code, 2331 ret = v4l2_subdev_call(subdev, pad, enum_mbus_code,
2331 NULL, &mbus_code); 2332 NULL, &mbus_code);
2332 if (ret) 2333 if (ret)
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index b0431a988d47..818aa524edbc 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -2133,7 +2133,7 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2133 2133
2134 case CCDC_PAD_SOURCE_OF: 2134 case CCDC_PAD_SOURCE_OF:
2135 format = __ccdc_get_format(ccdc, cfg, code->pad, 2135 format = __ccdc_get_format(ccdc, cfg, code->pad,
2136 V4L2_SUBDEV_FORMAT_TRY); 2136 code->which);
2137 2137
2138 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 || 2138 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
2139 format->code == MEDIA_BUS_FMT_UYVY8_2X8) { 2139 format->code == MEDIA_BUS_FMT_UYVY8_2X8) {
@@ -2164,7 +2164,7 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2164 return -EINVAL; 2164 return -EINVAL;
2165 2165
2166 format = __ccdc_get_format(ccdc, cfg, code->pad, 2166 format = __ccdc_get_format(ccdc, cfg, code->pad,
2167 V4L2_SUBDEV_FORMAT_TRY); 2167 code->which);
2168 2168
2169 /* A pixel code equal to 0 means that the video port doesn't 2169 /* A pixel code equal to 0 means that the video port doesn't
2170 * support the input format. Don't enumerate any pixel code. 2170 * support the input format. Don't enumerate any pixel code.
diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c
index 3f10c3af3a0a..1d79368c1ba6 100644
--- a/drivers/media/platform/omap3isp/ispccp2.c
+++ b/drivers/media/platform/omap3isp/ispccp2.c
@@ -703,7 +703,7 @@ static int ccp2_enum_mbus_code(struct v4l2_subdev *sd,
703 return -EINVAL; 703 return -EINVAL;
704 704
705 format = __ccp2_get_format(ccp2, cfg, CCP2_PAD_SINK, 705 format = __ccp2_get_format(ccp2, cfg, CCP2_PAD_SINK,
706 V4L2_SUBDEV_FORMAT_TRY); 706 code->which);
707 code->code = format->code; 707 code->code = format->code;
708 } 708 }
709 709
diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c
index 12ca63f2bf53..bde734cba86e 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -909,7 +909,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
909 code->code = csi2_input_fmts[code->index]; 909 code->code = csi2_input_fmts[code->index];
910 } else { 910 } else {
911 format = __csi2_get_format(csi2, cfg, CSI2_PAD_SINK, 911 format = __csi2_get_format(csi2, cfg, CSI2_PAD_SINK,
912 V4L2_SUBDEV_FORMAT_TRY); 912 code->which);
913 switch (code->index) { 913 switch (code->index) {
914 case 0: 914 case 0:
915 /* Passthrough sink pad code */ 915 /* Passthrough sink pad code */
diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c
index 3ede27bc0a45..02549fa8a94d 100644
--- a/drivers/media/platform/omap3isp/ispresizer.c
+++ b/drivers/media/platform/omap3isp/ispresizer.c
@@ -1431,7 +1431,7 @@ static int resizer_enum_mbus_code(struct v4l2_subdev *sd,
1431 return -EINVAL; 1431 return -EINVAL;
1432 1432
1433 format = __resizer_get_format(res, cfg, RESZ_PAD_SINK, 1433 format = __resizer_get_format(res, cfg, RESZ_PAD_SINK,
1434 V4L2_SUBDEV_FORMAT_TRY); 1434 code->which);
1435 code->code = format->code; 1435 code->code = format->code;
1436 } 1436 }
1437 1437
diff --git a/drivers/media/platform/vsp1/vsp1_bru.c b/drivers/media/platform/vsp1/vsp1_bru.c
index 31ad0b634e0c..7dd763311c0f 100644
--- a/drivers/media/platform/vsp1/vsp1_bru.c
+++ b/drivers/media/platform/vsp1/vsp1_bru.c
@@ -190,6 +190,7 @@ static int bru_enum_mbus_code(struct v4l2_subdev *subdev,
190 MEDIA_BUS_FMT_ARGB8888_1X32, 190 MEDIA_BUS_FMT_ARGB8888_1X32,
191 MEDIA_BUS_FMT_AYUV8_1X32, 191 MEDIA_BUS_FMT_AYUV8_1X32,
192 }; 192 };
193 struct vsp1_bru *bru = to_bru(subdev);
193 struct v4l2_mbus_framefmt *format; 194 struct v4l2_mbus_framefmt *format;
194 195
195 if (code->pad == BRU_PAD_SINK(0)) { 196 if (code->pad == BRU_PAD_SINK(0)) {
@@ -201,7 +202,8 @@ static int bru_enum_mbus_code(struct v4l2_subdev *subdev,
201 if (code->index) 202 if (code->index)
202 return -EINVAL; 203 return -EINVAL;
203 204
204 format = v4l2_subdev_get_try_format(subdev, cfg, BRU_PAD_SINK(0)); 205 format = vsp1_entity_get_pad_format(&bru->entity, cfg,
206 BRU_PAD_SINK(0), code->which);
205 code->code = format->code; 207 code->code = format->code;
206 } 208 }
207 209
diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c
index b91c925a9887..60f1bd85d48a 100644
--- a/drivers/media/platform/vsp1/vsp1_lif.c
+++ b/drivers/media/platform/vsp1/vsp1_lif.c
@@ -81,6 +81,7 @@ static int lif_enum_mbus_code(struct v4l2_subdev *subdev,
81 MEDIA_BUS_FMT_ARGB8888_1X32, 81 MEDIA_BUS_FMT_ARGB8888_1X32,
82 MEDIA_BUS_FMT_AYUV8_1X32, 82 MEDIA_BUS_FMT_AYUV8_1X32,
83 }; 83 };
84 struct vsp1_lif *lif = to_lif(subdev);
84 85
85 if (code->pad == LIF_PAD_SINK) { 86 if (code->pad == LIF_PAD_SINK) {
86 if (code->index >= ARRAY_SIZE(codes)) 87 if (code->index >= ARRAY_SIZE(codes))
@@ -96,7 +97,8 @@ static int lif_enum_mbus_code(struct v4l2_subdev *subdev,
96 if (code->index) 97 if (code->index)
97 return -EINVAL; 98 return -EINVAL;
98 99
99 format = v4l2_subdev_get_try_format(subdev, cfg, LIF_PAD_SINK); 100 format = vsp1_entity_get_pad_format(&lif->entity, cfg,
101 LIF_PAD_SINK, code->which);
100 code->code = format->code; 102 code->code = format->code;
101 } 103 }
102 104
diff --git a/drivers/media/platform/vsp1/vsp1_lut.c b/drivers/media/platform/vsp1/vsp1_lut.c
index 003363d9a5d8..8aa8c111301c 100644
--- a/drivers/media/platform/vsp1/vsp1_lut.c
+++ b/drivers/media/platform/vsp1/vsp1_lut.c
@@ -90,6 +90,7 @@ static int lut_enum_mbus_code(struct v4l2_subdev *subdev,
90 MEDIA_BUS_FMT_AHSV8888_1X32, 90 MEDIA_BUS_FMT_AHSV8888_1X32,
91 MEDIA_BUS_FMT_AYUV8_1X32, 91 MEDIA_BUS_FMT_AYUV8_1X32,
92 }; 92 };
93 struct vsp1_lut *lut = to_lut(subdev);
93 struct v4l2_mbus_framefmt *format; 94 struct v4l2_mbus_framefmt *format;
94 95
95 if (code->pad == LUT_PAD_SINK) { 96 if (code->pad == LUT_PAD_SINK) {
@@ -104,7 +105,8 @@ static int lut_enum_mbus_code(struct v4l2_subdev *subdev,
104 if (code->index) 105 if (code->index)
105 return -EINVAL; 106 return -EINVAL;
106 107
107 format = v4l2_subdev_get_try_format(subdev, cfg, LUT_PAD_SINK); 108 format = vsp1_entity_get_pad_format(&lut->entity, cfg,
109 LUT_PAD_SINK, code->which);
108 code->code = format->code; 110 code->code = format->code;
109 } 111 }
110 112
diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c
index c51dcee228bc..554340d4e2b3 100644
--- a/drivers/media/platform/vsp1/vsp1_sru.c
+++ b/drivers/media/platform/vsp1/vsp1_sru.c
@@ -173,6 +173,7 @@ static int sru_enum_mbus_code(struct v4l2_subdev *subdev,
173 MEDIA_BUS_FMT_ARGB8888_1X32, 173 MEDIA_BUS_FMT_ARGB8888_1X32,
174 MEDIA_BUS_FMT_AYUV8_1X32, 174 MEDIA_BUS_FMT_AYUV8_1X32,
175 }; 175 };
176 struct vsp1_sru *sru = to_sru(subdev);
176 struct v4l2_mbus_framefmt *format; 177 struct v4l2_mbus_framefmt *format;
177 178
178 if (code->pad == SRU_PAD_SINK) { 179 if (code->pad == SRU_PAD_SINK) {
@@ -187,7 +188,8 @@ static int sru_enum_mbus_code(struct v4l2_subdev *subdev,
187 if (code->index) 188 if (code->index)
188 return -EINVAL; 189 return -EINVAL;
189 190
190 format = v4l2_subdev_get_try_format(subdev, cfg, SRU_PAD_SINK); 191 format = vsp1_entity_get_pad_format(&sru->entity, cfg,
192 SRU_PAD_SINK, code->which);
191 code->code = format->code; 193 code->code = format->code;
192 } 194 }
193 195
diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
index 08d916d5d1ac..ef4d307f80d1 100644
--- a/drivers/media/platform/vsp1/vsp1_uds.c
+++ b/drivers/media/platform/vsp1/vsp1_uds.c
@@ -176,6 +176,7 @@ static int uds_enum_mbus_code(struct v4l2_subdev *subdev,
176 MEDIA_BUS_FMT_ARGB8888_1X32, 176 MEDIA_BUS_FMT_ARGB8888_1X32,
177 MEDIA_BUS_FMT_AYUV8_1X32, 177 MEDIA_BUS_FMT_AYUV8_1X32,
178 }; 178 };
179 struct vsp1_uds *uds = to_uds(subdev);
179 180
180 if (code->pad == UDS_PAD_SINK) { 181 if (code->pad == UDS_PAD_SINK) {
181 if (code->index >= ARRAY_SIZE(codes)) 182 if (code->index >= ARRAY_SIZE(codes))
@@ -191,7 +192,8 @@ static int uds_enum_mbus_code(struct v4l2_subdev *subdev,
191 if (code->index) 192 if (code->index)
192 return -EINVAL; 193 return -EINVAL;
193 194
194 format = v4l2_subdev_get_try_format(subdev, cfg, UDS_PAD_SINK); 195 format = vsp1_entity_get_pad_format(&uds->entity, cfg,
196 UDS_PAD_SINK, code->which);
195 code->code = format->code; 197 code->code = format->code;
196 } 198 }
197 199
diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c
index e404ad4fd987..2d5079deb631 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -908,7 +908,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
908 code->code = csi2_input_fmts[code->index]; 908 code->code = csi2_input_fmts[code->index];
909 } else { 909 } else {
910 format = __csi2_get_format(csi2, cfg, CSI2_PAD_SINK, 910 format = __csi2_get_format(csi2, cfg, CSI2_PAD_SINK,
911 V4L2_SUBDEV_FORMAT_TRY); 911 code->which);
912 switch (code->index) { 912 switch (code->index) {
913 case 0: 913 case 0:
914 /* Passthrough sink pad code */ 914 /* Passthrough sink pad code */
diff --git a/drivers/staging/media/omap4iss/iss_ipipeif.c b/drivers/staging/media/omap4iss/iss_ipipeif.c
index 948edcca8704..b8e7277499d2 100644
--- a/drivers/staging/media/omap4iss/iss_ipipeif.c
+++ b/drivers/staging/media/omap4iss/iss_ipipeif.c
@@ -467,7 +467,7 @@ static int ipipeif_enum_mbus_code(struct v4l2_subdev *sd,
467 return -EINVAL; 467 return -EINVAL;
468 468
469 format = __ipipeif_get_format(ipipeif, cfg, IPIPEIF_PAD_SINK, 469 format = __ipipeif_get_format(ipipeif, cfg, IPIPEIF_PAD_SINK,
470 V4L2_SUBDEV_FORMAT_TRY); 470 code->which);
471 471
472 code->code = format->code; 472 code->code = format->code;
473 break; 473 break;
diff --git a/drivers/staging/media/omap4iss/iss_resizer.c b/drivers/staging/media/omap4iss/iss_resizer.c
index f9b0aac91e9d..075b876e8e68 100644
--- a/drivers/staging/media/omap4iss/iss_resizer.c
+++ b/drivers/staging/media/omap4iss/iss_resizer.c
@@ -513,7 +513,7 @@ static int resizer_enum_mbus_code(struct v4l2_subdev *sd,
513 513
514 case RESIZER_PAD_SOURCE_MEM: 514 case RESIZER_PAD_SOURCE_MEM:
515 format = __resizer_get_format(resizer, cfg, RESIZER_PAD_SINK, 515 format = __resizer_get_format(resizer, cfg, RESIZER_PAD_SINK,
516 V4L2_SUBDEV_FORMAT_TRY); 516 code->which);
517 517
518 if (code->index == 0) { 518 if (code->index == 0) {
519 code->code = format->code; 519 code->code = format->code;