diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-05-25 17:06:33 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-18 07:17:42 -0400 |
commit | 70c276a6abdb1a466a9026da631c396fee2984bd (patch) | |
tree | e13eb90357bc6da51857738f646638ec6d1e5b5c /drivers/media | |
parent | de87897af08081aecb0c0bbc5fa01a8640e2d74c (diff) |
[media] Revert "[media] media: mx2_camera: Fix mbus format handling"
This reverts commit d509835e32bd761a2b7b446034a273da568e5573. That commit
breaks support for the generic pass-through mode in the driver for formats,
not natively supported by it. Besides due to a merge conflict it also breaks
driver compilation:
drivers/media/video/mx2_camera.c: In function 'mx2_camera_set_bus_param':
drivers/media/video/mx2_camera.c:937: error: 'pixfmt' undeclared (first use in this function)
drivers/media/video/mx2_camera.c:937: error: (Each undeclared identifier is reported only once
drivers/media/video/mx2_camera.c:937: error: for each function it appears in.)
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/mx2_camera.c | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index ded26b7286fa..41f9a254b245 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -345,19 +345,6 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
345 | PRP_INTR_CH2OVF, | 345 | PRP_INTR_CH2OVF, |
346 | } | 346 | } |
347 | }, | 347 | }, |
348 | { | ||
349 | .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, | ||
350 | .out_fmt = V4L2_PIX_FMT_YUV420, | ||
351 | .cfg = { | ||
352 | .channel = 2, | ||
353 | .in_fmt = PRP_CNTL_DATA_IN_YUV422, | ||
354 | .out_fmt = PRP_CNTL_CH2_OUT_YUV420, | ||
355 | .src_pixel = 0x22000888, /* YUV422 (YUYV) */ | ||
356 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | ||
357 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | ||
358 | PRP_INTR_CH2OVF, | ||
359 | } | ||
360 | }, | ||
361 | }; | 348 | }; |
362 | 349 | ||
363 | static struct mx2_fmt_cfg *mx27_emma_prp_get_format( | 350 | static struct mx2_fmt_cfg *mx27_emma_prp_get_format( |
@@ -984,7 +971,6 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
984 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 971 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
985 | struct mx2_camera_dev *pcdev = ici->priv; | 972 | struct mx2_camera_dev *pcdev = ici->priv; |
986 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; | 973 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; |
987 | const struct soc_camera_format_xlate *xlate; | ||
988 | unsigned long common_flags; | 974 | unsigned long common_flags; |
989 | int ret; | 975 | int ret; |
990 | int bytesperline; | 976 | int bytesperline; |
@@ -1029,31 +1015,14 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1029 | return ret; | 1015 | return ret; |
1030 | } | 1016 | } |
1031 | 1017 | ||
1032 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | ||
1033 | if (!xlate) { | ||
1034 | dev_warn(icd->parent, "Format %x not found\n", pixfmt); | ||
1035 | return -EINVAL; | ||
1036 | } | ||
1037 | |||
1038 | if (xlate->code == V4L2_MBUS_FMT_YUYV8_2X8) { | ||
1039 | csicr1 |= CSICR1_PACK_DIR; | ||
1040 | csicr1 &= ~CSICR1_SWAP16_EN; | ||
1041 | dev_dbg(icd->parent, "already yuyv format, don't convert\n"); | ||
1042 | } else if (xlate->code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1043 | csicr1 &= ~CSICR1_PACK_DIR; | ||
1044 | csicr1 |= CSICR1_SWAP16_EN; | ||
1045 | dev_dbg(icd->parent, "convert uyvy mbus format into yuyv\n"); | ||
1046 | } else { | ||
1047 | dev_warn(icd->parent, "mbus format not supported\n"); | ||
1048 | return -EINVAL; | ||
1049 | } | ||
1050 | |||
1051 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) | 1018 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) |
1052 | csicr1 |= CSICR1_REDGE; | 1019 | csicr1 |= CSICR1_REDGE; |
1053 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) | 1020 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) |
1054 | csicr1 |= CSICR1_SOF_POL; | 1021 | csicr1 |= CSICR1_SOF_POL; |
1055 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) | 1022 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) |
1056 | csicr1 |= CSICR1_HSYNC_POL; | 1023 | csicr1 |= CSICR1_HSYNC_POL; |
1024 | if (pcdev->platform_flags & MX2_CAMERA_SWAP16) | ||
1025 | csicr1 |= CSICR1_SWAP16_EN; | ||
1057 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) | 1026 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) |
1058 | csicr1 |= CSICR1_EXT_VSYNC; | 1027 | csicr1 |= CSICR1_EXT_VSYNC; |
1059 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) | 1028 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) |
@@ -1064,6 +1033,8 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1064 | csicr1 |= CSICR1_GCLK_MODE; | 1033 | csicr1 |= CSICR1_GCLK_MODE; |
1065 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) | 1034 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) |
1066 | csicr1 |= CSICR1_INV_DATA; | 1035 | csicr1 |= CSICR1_INV_DATA; |
1036 | if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB) | ||
1037 | csicr1 |= CSICR1_PACK_DIR; | ||
1067 | 1038 | ||
1068 | pcdev->csicr1 = csicr1; | 1039 | pcdev->csicr1 = csicr1; |
1069 | 1040 | ||
@@ -1138,8 +1109,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1138 | return 0; | 1109 | return 0; |
1139 | } | 1110 | } |
1140 | 1111 | ||
1141 | if (code == V4L2_MBUS_FMT_YUYV8_2X8 || | 1112 | if (code == V4L2_MBUS_FMT_YUYV8_2X8) { |
1142 | code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1143 | formats++; | 1113 | formats++; |
1144 | if (xlate) { | 1114 | if (xlate) { |
1145 | /* | 1115 | /* |
@@ -1155,18 +1125,6 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1155 | } | 1125 | } |
1156 | } | 1126 | } |
1157 | 1127 | ||
1158 | if (code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1159 | formats++; | ||
1160 | if (xlate) { | ||
1161 | xlate->host_fmt = | ||
1162 | soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_2X8); | ||
1163 | xlate->code = code; | ||
1164 | dev_dbg(dev, "Providing host format %s for sensor code %d\n", | ||
1165 | xlate->host_fmt->name, code); | ||
1166 | xlate++; | ||
1167 | } | ||
1168 | } | ||
1169 | |||
1170 | /* Generic pass-trough */ | 1128 | /* Generic pass-trough */ |
1171 | formats++; | 1129 | formats++; |
1172 | if (xlate) { | 1130 | if (xlate) { |