aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/video4linux/soc-camera.txt2
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c4
-rw-r--r--arch/arm/mach-davinci/dm355.c7
-rw-r--r--arch/arm/mach-davinci/dm365.c7
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c2
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c2
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c14
-rw-r--r--drivers/media/platform/davinci/vpbe.c2
-rw-r--r--drivers/media/platform/davinci/vpfe_capture.c4
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-core.c8
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-core.h2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-core.c14
-rw-r--r--drivers/media/platform/exynos4-is/fimc-core.h4
-rw-r--r--drivers/media/platform/exynos4-is/fimc-isp.c16
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite-reg.c26
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite.c14
-rw-r--r--drivers/media/platform/exynos4-is/fimc-reg.c14
-rw-r--r--drivers/media/platform/exynos4-is/mipi-csis.c14
-rw-r--r--drivers/media/platform/marvell-ccic/mcam-core.c21
-rw-r--r--drivers/media/platform/marvell-ccic/mcam-core.h2
-rw-r--r--drivers/media/platform/omap3isp/ispccdc.c112
-rw-r--r--drivers/media/platform/omap3isp/ispccp2.c18
-rw-r--r--drivers/media/platform/omap3isp/ispcsi2.c42
-rw-r--r--drivers/media/platform/omap3isp/isppreview.c60
-rw-r--r--drivers/media/platform/omap3isp/ispresizer.c19
-rw-r--r--drivers/media/platform/omap3isp/ispvideo.c95
-rw-r--r--drivers/media/platform/omap3isp/ispvideo.h10
-rw-r--r--drivers/media/platform/s3c-camif/camif-capture.c10
-rw-r--r--drivers/media/platform/s3c-camif/camif-regs.c8
-rw-r--r--drivers/media/platform/s5p-tv/hdmi_drv.c2
-rw-r--r--drivers/media/platform/s5p-tv/sdo_drv.c2
-rw-r--r--drivers/media/platform/sh_vou.c8
-rw-r--r--drivers/media/platform/soc_camera/atmel-isi.c22
-rw-r--r--drivers/media/platform/soc_camera/mx2_camera.c26
-rw-r--r--drivers/media/platform/soc_camera/mx3_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/omap1_camera.c36
-rw-r--r--drivers/media/platform/soc_camera/pxa_camera.c16
-rw-r--r--drivers/media/platform/soc_camera/rcar_vin.c14
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c20
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_csi2.c38
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c2
-rw-r--r--drivers/media/platform/soc_camera/soc_camera_platform.c2
-rw-r--r--drivers/media/platform/soc_camera/soc_mediabus.c78
-rw-r--r--drivers/media/platform/via-camera.c8
-rw-r--r--drivers/media/platform/vsp1/vsp1_bru.c14
-rw-r--r--drivers/media/platform/vsp1/vsp1_hsit.c12
-rw-r--r--drivers/media/platform/vsp1/vsp1_lif.c10
-rw-r--r--drivers/media/platform/vsp1/vsp1_lut.c14
-rw-r--r--drivers/media/platform/vsp1/vsp1_rwpf.c10
-rw-r--r--drivers/media/platform/vsp1/vsp1_sru.c12
-rw-r--r--drivers/media/platform/vsp1/vsp1_uds.c10
-rw-r--r--drivers/media/platform/vsp1/vsp1_video.c42
-rw-r--r--include/media/davinci/vpbe.h2
-rw-r--r--include/media/davinci/vpbe_venc.h5
-rw-r--r--include/media/exynos-fimc.h2
-rw-r--r--include/media/soc_camera.h2
-rw-r--r--include/media/soc_mediabus.h6
59 files changed, 483 insertions, 495 deletions
diff --git a/Documentation/video4linux/soc-camera.txt b/Documentation/video4linux/soc-camera.txt
index daa9e2ac162c..84f41cf1f3e8 100644
--- a/Documentation/video4linux/soc-camera.txt
+++ b/Documentation/video4linux/soc-camera.txt
@@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to
151conveniently manage these formats. A table of standard transformations is 151conveniently manage these formats. A table of standard transformations is
152maintained by soc-camera core, which describes, what FOURCC pixel format will 152maintained by soc-camera core, which describes, what FOURCC pixel format will
153be obtained, if a media-bus pixel format is stored in memory according to 153be obtained, if a media-bus pixel format is stored in memory according to
154certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per 154certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
155sample and stored in memory in the little-endian order with no gaps between 155sample and stored in memory in the little-endian order with no gaps between
156bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These 156bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These
157standard transformations will be used by soc-camera or by camera host drivers to 157standard transformations will be used by soc-camera or by camera host drivers to
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 06d63d5651f3..b46b4d25f93e 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -294,7 +294,7 @@ static struct vpbe_output dm355evm_vpbe_outputs[] = {
294 .default_mode = "ntsc", 294 .default_mode = "ntsc",
295 .num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing), 295 .num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing),
296 .modes = dm355evm_enc_preset_timing, 296 .modes = dm355evm_enc_preset_timing,
297 .if_params = V4L2_MBUS_FMT_FIXED, 297 .if_params = MEDIA_BUS_FMT_FIXED,
298 }, 298 },
299}; 299};
300 300
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index e08a8684ead2..a756003595e9 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -485,7 +485,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
485 .default_mode = "ntsc", 485 .default_mode = "ntsc",
486 .num_modes = ARRAY_SIZE(dm365evm_enc_std_timing), 486 .num_modes = ARRAY_SIZE(dm365evm_enc_std_timing),
487 .modes = dm365evm_enc_std_timing, 487 .modes = dm365evm_enc_std_timing,
488 .if_params = V4L2_MBUS_FMT_FIXED, 488 .if_params = MEDIA_BUS_FMT_FIXED,
489 }, 489 },
490 { 490 {
491 .output = { 491 .output = {
@@ -498,7 +498,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
498 .default_mode = "480p59_94", 498 .default_mode = "480p59_94",
499 .num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing), 499 .num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing),
500 .modes = dm365evm_enc_preset_timing, 500 .modes = dm365evm_enc_preset_timing,
501 .if_params = V4L2_MBUS_FMT_FIXED, 501 .if_params = MEDIA_BUS_FMT_FIXED,
502 }, 502 },
503}; 503};
504 504
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 2f3ed3a58d57..9cbeda798584 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -785,14 +785,13 @@ static struct resource dm355_v4l2_disp_resources[] = {
785 }, 785 },
786}; 786};
787 787
788static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type, 788static int dm355_vpbe_setup_pinmux(u32 if_type, int field)
789 int field)
790{ 789{
791 switch (if_type) { 790 switch (if_type) {
792 case V4L2_MBUS_FMT_SGRBG8_1X8: 791 case MEDIA_BUS_FMT_SGRBG8_1X8:
793 davinci_cfg_reg(DM355_VOUT_FIELD_G70); 792 davinci_cfg_reg(DM355_VOUT_FIELD_G70);
794 break; 793 break;
795 case V4L2_MBUS_FMT_YUYV10_1X20: 794 case MEDIA_BUS_FMT_YUYV10_1X20:
796 if (field) 795 if (field)
797 davinci_cfg_reg(DM355_VOUT_FIELD); 796 davinci_cfg_reg(DM355_VOUT_FIELD);
798 else 797 else
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 0ae8114f5cc9..e3a3c54b6832 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1306,16 +1306,15 @@ static struct resource dm365_v4l2_disp_resources[] = {
1306 }, 1306 },
1307}; 1307};
1308 1308
1309static int dm365_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type, 1309static int dm365_vpbe_setup_pinmux(u32 if_type, int field)
1310 int field)
1311{ 1310{
1312 switch (if_type) { 1311 switch (if_type) {
1313 case V4L2_MBUS_FMT_SGRBG8_1X8: 1312 case MEDIA_BUS_FMT_SGRBG8_1X8:
1314 davinci_cfg_reg(DM365_VOUT_FIELD_G81); 1313 davinci_cfg_reg(DM365_VOUT_FIELD_G81);
1315 davinci_cfg_reg(DM365_VOUT_COUTL_EN); 1314 davinci_cfg_reg(DM365_VOUT_COUTL_EN);
1316 davinci_cfg_reg(DM365_VOUT_COUTH_EN); 1315 davinci_cfg_reg(DM365_VOUT_COUTH_EN);
1317 break; 1316 break;
1318 case V4L2_MBUS_FMT_YUYV10_1X20: 1317 case MEDIA_BUS_FMT_YUYV10_1X20:
1319 if (field) 1318 if (field)
1320 davinci_cfg_reg(DM365_VOUT_FIELD); 1319 davinci_cfg_reg(DM365_VOUT_FIELD);
1321 else 1320 else
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index ca5d34b92aa7..a673624878d1 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1153,7 +1153,7 @@ static struct soc_camera_platform_info camera_info = {
1153 .format_name = "UYVY", 1153 .format_name = "UYVY",
1154 .format_depth = 16, 1154 .format_depth = 16,
1155 .format = { 1155 .format = {
1156 .code = V4L2_MBUS_FMT_UYVY8_2X8, 1156 .code = MEDIA_BUS_FMT_UYVY8_2X8,
1157 .colorspace = V4L2_COLORSPACE_SMPTE170M, 1157 .colorspace = V4L2_COLORSPACE_SMPTE170M,
1158 .field = V4L2_FIELD_NONE, 1158 .field = V4L2_FIELD_NONE,
1159 .width = 640, 1159 .width = 640,
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 5620e33c18a0..d4b01d4cc102 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -338,7 +338,7 @@ static struct soc_camera_platform_info camera_info = {
338 .format_name = "UYVY", 338 .format_name = "UYVY",
339 .format_depth = 16, 339 .format_depth = 16,
340 .format = { 340 .format = {
341 .code = V4L2_MBUS_FMT_UYVY8_2X8, 341 .code = MEDIA_BUS_FMT_UYVY8_2X8,
342 .colorspace = V4L2_COLORSPACE_SMPTE170M, 342 .colorspace = V4L2_COLORSPACE_SMPTE170M,
343 .field = V4L2_FIELD_NONE, 343 .field = V4L2_FIELD_NONE,
344 .width = 640, 344 .width = 640,
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index 9b5daa65841c..b3345b37bb10 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -49,7 +49,7 @@
49struct bcap_format { 49struct bcap_format {
50 char *desc; 50 char *desc;
51 u32 pixelformat; 51 u32 pixelformat;
52 enum v4l2_mbus_pixelcode mbus_code; 52 u32 mbus_code;
53 int bpp; /* bits per pixel */ 53 int bpp; /* bits per pixel */
54 int dlen; /* data length for ppi in bits */ 54 int dlen; /* data length for ppi in bits */
55}; 55};
@@ -116,35 +116,35 @@ static const struct bcap_format bcap_formats[] = {
116 { 116 {
117 .desc = "YCbCr 4:2:2 Interleaved UYVY", 117 .desc = "YCbCr 4:2:2 Interleaved UYVY",
118 .pixelformat = V4L2_PIX_FMT_UYVY, 118 .pixelformat = V4L2_PIX_FMT_UYVY,
119 .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, 119 .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
120 .bpp = 16, 120 .bpp = 16,
121 .dlen = 8, 121 .dlen = 8,
122 }, 122 },
123 { 123 {
124 .desc = "YCbCr 4:2:2 Interleaved YUYV", 124 .desc = "YCbCr 4:2:2 Interleaved YUYV",
125 .pixelformat = V4L2_PIX_FMT_YUYV, 125 .pixelformat = V4L2_PIX_FMT_YUYV,
126 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 126 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
127 .bpp = 16, 127 .bpp = 16,
128 .dlen = 8, 128 .dlen = 8,
129 }, 129 },
130 { 130 {
131 .desc = "YCbCr 4:2:2 Interleaved UYVY", 131 .desc = "YCbCr 4:2:2 Interleaved UYVY",
132 .pixelformat = V4L2_PIX_FMT_UYVY, 132 .pixelformat = V4L2_PIX_FMT_UYVY,
133 .mbus_code = V4L2_MBUS_FMT_UYVY8_1X16, 133 .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
134 .bpp = 16, 134 .bpp = 16,
135 .dlen = 16, 135 .dlen = 16,
136 }, 136 },
137 { 137 {
138 .desc = "RGB 565", 138 .desc = "RGB 565",
139 .pixelformat = V4L2_PIX_FMT_RGB565, 139 .pixelformat = V4L2_PIX_FMT_RGB565,
140 .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE, 140 .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE,
141 .bpp = 16, 141 .bpp = 16,
142 .dlen = 8, 142 .dlen = 8,
143 }, 143 },
144 { 144 {
145 .desc = "RGB 444", 145 .desc = "RGB 444",
146 .pixelformat = V4L2_PIX_FMT_RGB444, 146 .pixelformat = V4L2_PIX_FMT_RGB444,
147 .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, 147 .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
148 .bpp = 16, 148 .bpp = 16,
149 .dlen = 8, 149 .dlen = 8,
150 }, 150 },
@@ -161,7 +161,7 @@ static struct bcap_buffer *to_bcap_vb(struct vb2_buffer *vb)
161 161
162static int bcap_init_sensor_formats(struct bcap_device *bcap_dev) 162static int bcap_init_sensor_formats(struct bcap_device *bcap_dev)
163{ 163{
164 enum v4l2_mbus_pixelcode code; 164 u32 code;
165 struct bcap_format *sf; 165 struct bcap_format *sf;
166 unsigned int num_formats = 0; 166 unsigned int num_formats = 0;
167 int i, j; 167 int i, j;
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index e5df9916b2a1..244d3d6c244c 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -227,7 +227,7 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index)
227 vpbe_current_encoder_info(vpbe_dev); 227 vpbe_current_encoder_info(vpbe_dev);
228 struct vpbe_config *cfg = vpbe_dev->cfg; 228 struct vpbe_config *cfg = vpbe_dev->cfg;
229 struct venc_platform_data *venc_device = vpbe_dev->venc_device; 229 struct venc_platform_data *venc_device = vpbe_dev->venc_device;
230 enum v4l2_mbus_pixelcode if_params; 230 u32 if_params;
231 int enc_out_index; 231 int enc_out_index;
232 int sd_index; 232 int sd_index;
233 int ret = 0; 233 int ret = 0;
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index de55f47a77db..3d0e3ae1795c 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -414,13 +414,13 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
414 /* assume V4L2_PIX_FMT_UYVY as default */ 414 /* assume V4L2_PIX_FMT_UYVY as default */
415 pix->pixelformat = V4L2_PIX_FMT_UYVY; 415 pix->pixelformat = V4L2_PIX_FMT_UYVY;
416 v4l2_fill_mbus_format(&mbus_fmt, pix, 416 v4l2_fill_mbus_format(&mbus_fmt, pix,
417 V4L2_MBUS_FMT_YUYV10_2X10); 417 MEDIA_BUS_FMT_YUYV10_2X10);
418 } else { 418 } else {
419 pix->field = V4L2_FIELD_NONE; 419 pix->field = V4L2_FIELD_NONE;
420 /* assume V4L2_PIX_FMT_SBGGR8 */ 420 /* assume V4L2_PIX_FMT_SBGGR8 */
421 pix->pixelformat = V4L2_PIX_FMT_SBGGR8; 421 pix->pixelformat = V4L2_PIX_FMT_SBGGR8;
422 v4l2_fill_mbus_format(&mbus_fmt, pix, 422 v4l2_fill_mbus_format(&mbus_fmt, pix,
423 V4L2_MBUS_FMT_SBGGR8_1X8); 423 MEDIA_BUS_FMT_SBGGR8_1X8);
424 } 424 }
425 425
426 /* if sub device supports g_mbus_fmt, override the defaults */ 426 /* if sub device supports g_mbus_fmt, override the defaults */
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index b4c9f1d08968..91d226b8fe5c 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -54,7 +54,7 @@ static const struct gsc_fmt gsc_formats[] = {
54 .corder = GSC_CBCR, 54 .corder = GSC_CBCR,
55 .num_planes = 1, 55 .num_planes = 1,
56 .num_comp = 1, 56 .num_comp = 1,
57 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 57 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
58 }, { 58 }, {
59 .name = "YUV 4:2:2 packed, CbYCrY", 59 .name = "YUV 4:2:2 packed, CbYCrY",
60 .pixelformat = V4L2_PIX_FMT_UYVY, 60 .pixelformat = V4L2_PIX_FMT_UYVY,
@@ -64,7 +64,7 @@ static const struct gsc_fmt gsc_formats[] = {
64 .corder = GSC_CBCR, 64 .corder = GSC_CBCR,
65 .num_planes = 1, 65 .num_planes = 1,
66 .num_comp = 1, 66 .num_comp = 1,
67 .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, 67 .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
68 }, { 68 }, {
69 .name = "YUV 4:2:2 packed, CrYCbY", 69 .name = "YUV 4:2:2 packed, CrYCbY",
70 .pixelformat = V4L2_PIX_FMT_VYUY, 70 .pixelformat = V4L2_PIX_FMT_VYUY,
@@ -74,7 +74,7 @@ static const struct gsc_fmt gsc_formats[] = {
74 .corder = GSC_CRCB, 74 .corder = GSC_CRCB,
75 .num_planes = 1, 75 .num_planes = 1,
76 .num_comp = 1, 76 .num_comp = 1,
77 .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, 77 .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
78 }, { 78 }, {
79 .name = "YUV 4:2:2 packed, YCrYCb", 79 .name = "YUV 4:2:2 packed, YCrYCb",
80 .pixelformat = V4L2_PIX_FMT_YVYU, 80 .pixelformat = V4L2_PIX_FMT_YVYU,
@@ -84,7 +84,7 @@ static const struct gsc_fmt gsc_formats[] = {
84 .corder = GSC_CRCB, 84 .corder = GSC_CRCB,
85 .num_planes = 1, 85 .num_planes = 1,
86 .num_comp = 1, 86 .num_comp = 1,
87 .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, 87 .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
88 }, { 88 }, {
89 .name = "YUV 4:4:4 planar, YCbYCr", 89 .name = "YUV 4:4:4 planar, YCbYCr",
90 .pixelformat = V4L2_PIX_FMT_YUV32, 90 .pixelformat = V4L2_PIX_FMT_YUV32,
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h
index ef0a6564cef9..0abdb17fb19c 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.h
+++ b/drivers/media/platform/exynos-gsc/gsc-core.h
@@ -117,7 +117,7 @@ enum gsc_yuv_fmt {
117 * @flags: flags indicating which operation mode format applies to 117 * @flags: flags indicating which operation mode format applies to
118 */ 118 */
119struct gsc_fmt { 119struct gsc_fmt {
120 enum v4l2_mbus_pixelcode mbus_code; 120 u32 mbus_code;
121 char *name; 121 char *name;
122 u32 pixelformat; 122 u32 pixelformat;
123 u32 color; 123 u32 color;
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index 3d2babd5067a..8a2fd8c33d42 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -749,7 +749,7 @@ static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv,
749 return -EINVAL; 749 return -EINVAL;
750 strncpy(f->description, fmt->name, sizeof(f->description) - 1); 750 strncpy(f->description, fmt->name, sizeof(f->description) - 1);
751 f->pixelformat = fmt->fourcc; 751 f->pixelformat = fmt->fourcc;
752 if (fmt->fourcc == V4L2_MBUS_FMT_JPEG_1X8) 752 if (fmt->fourcc == MEDIA_BUS_FMT_JPEG_1X8)
753 f->flags |= V4L2_FMT_FLAG_COMPRESSED; 753 f->flags |= V4L2_FMT_FLAG_COMPRESSED;
754 return 0; 754 return 0;
755} 755}
diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c
index aee92d908e49..dbd74d8dc2a8 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -81,7 +81,7 @@ static struct fimc_fmt fimc_formats[] = {
81 .flags = FMT_FLAGS_M2M_OUT | FMT_HAS_ALPHA, 81 .flags = FMT_FLAGS_M2M_OUT | FMT_HAS_ALPHA,
82 }, { 82 }, {
83 .name = "YUV 4:4:4", 83 .name = "YUV 4:4:4",
84 .mbus_code = V4L2_MBUS_FMT_YUV10_1X30, 84 .mbus_code = MEDIA_BUS_FMT_YUV10_1X30,
85 .flags = FMT_FLAGS_WRITEBACK, 85 .flags = FMT_FLAGS_WRITEBACK,
86 }, { 86 }, {
87 .name = "YUV 4:2:2 packed, YCbYCr", 87 .name = "YUV 4:2:2 packed, YCbYCr",
@@ -90,7 +90,7 @@ static struct fimc_fmt fimc_formats[] = {
90 .color = FIMC_FMT_YCBYCR422, 90 .color = FIMC_FMT_YCBYCR422,
91 .memplanes = 1, 91 .memplanes = 1,
92 .colplanes = 1, 92 .colplanes = 1,
93 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 93 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
94 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, 94 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
95 }, { 95 }, {
96 .name = "YUV 4:2:2 packed, CbYCrY", 96 .name = "YUV 4:2:2 packed, CbYCrY",
@@ -99,7 +99,7 @@ static struct fimc_fmt fimc_formats[] = {
99 .color = FIMC_FMT_CBYCRY422, 99 .color = FIMC_FMT_CBYCRY422,
100 .memplanes = 1, 100 .memplanes = 1,
101 .colplanes = 1, 101 .colplanes = 1,
102 .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, 102 .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
103 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, 103 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
104 }, { 104 }, {
105 .name = "YUV 4:2:2 packed, CrYCbY", 105 .name = "YUV 4:2:2 packed, CrYCbY",
@@ -108,7 +108,7 @@ static struct fimc_fmt fimc_formats[] = {
108 .color = FIMC_FMT_CRYCBY422, 108 .color = FIMC_FMT_CRYCBY422,
109 .memplanes = 1, 109 .memplanes = 1,
110 .colplanes = 1, 110 .colplanes = 1,
111 .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, 111 .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
112 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, 112 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
113 }, { 113 }, {
114 .name = "YUV 4:2:2 packed, YCrYCb", 114 .name = "YUV 4:2:2 packed, YCrYCb",
@@ -117,7 +117,7 @@ static struct fimc_fmt fimc_formats[] = {
117 .color = FIMC_FMT_YCRYCB422, 117 .color = FIMC_FMT_YCRYCB422,
118 .memplanes = 1, 118 .memplanes = 1,
119 .colplanes = 1, 119 .colplanes = 1,
120 .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, 120 .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
121 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, 121 .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
122 }, { 122 }, {
123 .name = "YUV 4:2:2 planar, Y/Cb/Cr", 123 .name = "YUV 4:2:2 planar, Y/Cb/Cr",
@@ -190,7 +190,7 @@ static struct fimc_fmt fimc_formats[] = {
190 .depth = { 8 }, 190 .depth = { 8 },
191 .memplanes = 1, 191 .memplanes = 1,
192 .colplanes = 1, 192 .colplanes = 1,
193 .mbus_code = V4L2_MBUS_FMT_JPEG_1X8, 193 .mbus_code = MEDIA_BUS_FMT_JPEG_1X8,
194 .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED, 194 .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED,
195 }, { 195 }, {
196 .name = "S5C73MX interleaved UYVY/JPEG", 196 .name = "S5C73MX interleaved UYVY/JPEG",
@@ -200,7 +200,7 @@ static struct fimc_fmt fimc_formats[] = {
200 .memplanes = 2, 200 .memplanes = 2,
201 .colplanes = 1, 201 .colplanes = 1,
202 .mdataplanes = 0x2, /* plane 1 holds frame meta data */ 202 .mdataplanes = 0x2, /* plane 1 holds frame meta data */
203 .mbus_code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8, 203 .mbus_code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8,
204 .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED, 204 .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED,
205 }, 205 },
206}; 206};
diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h
index 6c75c6ced1f7..7328f0845065 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.h
+++ b/drivers/media/platform/exynos4-is/fimc-core.h
@@ -579,8 +579,8 @@ static inline bool fimc_jpeg_fourcc(u32 pixelformat)
579 579
580static inline bool fimc_user_defined_mbus_fmt(u32 code) 580static inline bool fimc_user_defined_mbus_fmt(u32 code)
581{ 581{
582 return (code == V4L2_MBUS_FMT_JPEG_1X8 || 582 return (code == MEDIA_BUS_FMT_JPEG_1X8 ||
583 code == V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8); 583 code == MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8);
584} 584}
585 585
586/* Return the alpha component bit mask */ 586/* Return the alpha component bit mask */
diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c
index be62d6b9ac48..60c744915549 100644
--- a/drivers/media/platform/exynos4-is/fimc-isp.c
+++ b/drivers/media/platform/exynos4-is/fimc-isp.c
@@ -41,21 +41,21 @@ static const struct fimc_fmt fimc_isp_formats[FIMC_ISP_NUM_FORMATS] = {
41 .depth = { 8 }, 41 .depth = { 8 },
42 .color = FIMC_FMT_RAW8, 42 .color = FIMC_FMT_RAW8,
43 .memplanes = 1, 43 .memplanes = 1,
44 .mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8, 44 .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
45 }, { 45 }, {
46 .name = "RAW10 (GRBG)", 46 .name = "RAW10 (GRBG)",
47 .fourcc = V4L2_PIX_FMT_SGRBG10, 47 .fourcc = V4L2_PIX_FMT_SGRBG10,
48 .depth = { 10 }, 48 .depth = { 10 },
49 .color = FIMC_FMT_RAW10, 49 .color = FIMC_FMT_RAW10,
50 .memplanes = 1, 50 .memplanes = 1,
51 .mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10, 51 .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
52 }, { 52 }, {
53 .name = "RAW12 (GRBG)", 53 .name = "RAW12 (GRBG)",
54 .fourcc = V4L2_PIX_FMT_SGRBG12, 54 .fourcc = V4L2_PIX_FMT_SGRBG12,
55 .depth = { 12 }, 55 .depth = { 12 },
56 .color = FIMC_FMT_RAW12, 56 .color = FIMC_FMT_RAW12,
57 .memplanes = 1, 57 .memplanes = 1,
58 .mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12, 58 .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
59 }, 59 },
60}; 60};
61 61
@@ -149,7 +149,7 @@ static int fimc_isp_subdev_get_fmt(struct v4l2_subdev *sd,
149 149
150 if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) { 150 if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) {
151 mf->colorspace = V4L2_COLORSPACE_JPEG; 151 mf->colorspace = V4L2_COLORSPACE_JPEG;
152 mf->code = V4L2_MBUS_FMT_YUV10_1X30; 152 mf->code = MEDIA_BUS_FMT_YUV10_1X30;
153 } 153 }
154 } 154 }
155 155
@@ -175,7 +175,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp,
175 FIMC_ISP_SINK_WIDTH_MAX, 0, 175 FIMC_ISP_SINK_WIDTH_MAX, 0,
176 &mf->height, FIMC_ISP_SINK_HEIGHT_MIN, 176 &mf->height, FIMC_ISP_SINK_HEIGHT_MIN,
177 FIMC_ISP_SINK_HEIGHT_MAX, 0, 0); 177 FIMC_ISP_SINK_HEIGHT_MAX, 0, 0);
178 mf->code = V4L2_MBUS_FMT_SGRBG10_1X10; 178 mf->code = MEDIA_BUS_FMT_SGRBG10_1X10;
179 } else { 179 } else {
180 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) 180 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
181 format = v4l2_subdev_get_try_format(fh, 181 format = v4l2_subdev_get_try_format(fh,
@@ -188,7 +188,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp,
188 mf->height = format->height - FIMC_ISP_CAC_MARGIN_HEIGHT; 188 mf->height = format->height - FIMC_ISP_CAC_MARGIN_HEIGHT;
189 189
190 if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) { 190 if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) {
191 mf->code = V4L2_MBUS_FMT_YUV10_1X30; 191 mf->code = MEDIA_BUS_FMT_YUV10_1X30;
192 mf->colorspace = V4L2_COLORSPACE_JPEG; 192 mf->colorspace = V4L2_COLORSPACE_JPEG;
193 } else { 193 } else {
194 mf->code = format->code; 194 mf->code = format->code;
@@ -680,11 +680,11 @@ static void __isp_subdev_set_default_format(struct fimc_isp *isp)
680 FIMC_ISP_CAC_MARGIN_WIDTH; 680 FIMC_ISP_CAC_MARGIN_WIDTH;
681 isp->sink_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT + 681 isp->sink_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT +
682 FIMC_ISP_CAC_MARGIN_HEIGHT; 682 FIMC_ISP_CAC_MARGIN_HEIGHT;
683 isp->sink_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10; 683 isp->sink_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10;
684 684
685 isp->src_fmt.width = DEFAULT_PREVIEW_STILL_WIDTH; 685 isp->src_fmt.width = DEFAULT_PREVIEW_STILL_WIDTH;
686 isp->src_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT; 686 isp->src_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT;
687 isp->src_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10; 687 isp->src_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10;
688 __is_set_frame_size(is, &isp->src_fmt); 688 __is_set_frame_size(is, &isp->src_fmt);
689} 689}
690 690
diff --git a/drivers/media/platform/exynos4-is/fimc-lite-reg.c b/drivers/media/platform/exynos4-is/fimc-lite-reg.c
index bc3ec7d25a32..0477716a20db 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite-reg.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite-reg.c
@@ -112,24 +112,24 @@ void flite_hw_set_test_pattern(struct fimc_lite *dev, bool on)
112} 112}
113 113
114static const u32 src_pixfmt_map[8][3] = { 114static const u32 src_pixfmt_map[8][3] = {
115 { V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR, 115 { MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR,
116 FLITE_REG_CIGCTRL_YUV422_1P }, 116 FLITE_REG_CIGCTRL_YUV422_1P },
117 { V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB, 117 { MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB,
118 FLITE_REG_CIGCTRL_YUV422_1P }, 118 FLITE_REG_CIGCTRL_YUV422_1P },
119 { V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY, 119 { MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY,
120 FLITE_REG_CIGCTRL_YUV422_1P }, 120 FLITE_REG_CIGCTRL_YUV422_1P },
121 { V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY, 121 { MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY,
122 FLITE_REG_CIGCTRL_YUV422_1P }, 122 FLITE_REG_CIGCTRL_YUV422_1P },
123 { V4L2_MBUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 }, 123 { MEDIA_BUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 },
124 { V4L2_MBUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 }, 124 { MEDIA_BUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 },
125 { V4L2_MBUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 }, 125 { MEDIA_BUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 },
126 { V4L2_MBUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) }, 126 { MEDIA_BUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) },
127}; 127};
128 128
129/* Set camera input pixel format and resolution */ 129/* Set camera input pixel format and resolution */
130void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f) 130void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
131{ 131{
132 enum v4l2_mbus_pixelcode pixelcode = f->fmt->mbus_code; 132 u32 pixelcode = f->fmt->mbus_code;
133 int i = ARRAY_SIZE(src_pixfmt_map); 133 int i = ARRAY_SIZE(src_pixfmt_map);
134 u32 cfg; 134 u32 cfg;
135 135
@@ -232,10 +232,10 @@ static void flite_hw_set_pack12(struct fimc_lite *dev, int on)
232static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f) 232static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
233{ 233{
234 static const u32 pixcode[4][2] = { 234 static const u32 pixcode[4][2] = {
235 { V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR }, 235 { MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR },
236 { V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB }, 236 { MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB },
237 { V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY }, 237 { MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY },
238 { V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY }, 238 { MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
239 }; 239 };
240 u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT); 240 u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
241 int i = ARRAY_SIZE(pixcode); 241 int i = ARRAY_SIZE(pixcode);
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index a97d2352f1d7..b7dca8b2d455 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -48,7 +48,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
48 .depth = { 16 }, 48 .depth = { 16 },
49 .color = FIMC_FMT_YCBYCR422, 49 .color = FIMC_FMT_YCBYCR422,
50 .memplanes = 1, 50 .memplanes = 1,
51 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 51 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
52 .flags = FMT_FLAGS_YUV, 52 .flags = FMT_FLAGS_YUV,
53 }, { 53 }, {
54 .name = "YUV 4:2:2 packed, CbYCrY", 54 .name = "YUV 4:2:2 packed, CbYCrY",
@@ -57,7 +57,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
57 .depth = { 16 }, 57 .depth = { 16 },
58 .color = FIMC_FMT_CBYCRY422, 58 .color = FIMC_FMT_CBYCRY422,
59 .memplanes = 1, 59 .memplanes = 1,
60 .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, 60 .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
61 .flags = FMT_FLAGS_YUV, 61 .flags = FMT_FLAGS_YUV,
62 }, { 62 }, {
63 .name = "YUV 4:2:2 packed, CrYCbY", 63 .name = "YUV 4:2:2 packed, CrYCbY",
@@ -66,7 +66,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
66 .depth = { 16 }, 66 .depth = { 16 },
67 .color = FIMC_FMT_CRYCBY422, 67 .color = FIMC_FMT_CRYCBY422,
68 .memplanes = 1, 68 .memplanes = 1,
69 .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, 69 .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
70 .flags = FMT_FLAGS_YUV, 70 .flags = FMT_FLAGS_YUV,
71 }, { 71 }, {
72 .name = "YUV 4:2:2 packed, YCrYCb", 72 .name = "YUV 4:2:2 packed, YCrYCb",
@@ -75,7 +75,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
75 .depth = { 16 }, 75 .depth = { 16 },
76 .color = FIMC_FMT_YCRYCB422, 76 .color = FIMC_FMT_YCRYCB422,
77 .memplanes = 1, 77 .memplanes = 1,
78 .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, 78 .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
79 .flags = FMT_FLAGS_YUV, 79 .flags = FMT_FLAGS_YUV,
80 }, { 80 }, {
81 .name = "RAW8 (GRBG)", 81 .name = "RAW8 (GRBG)",
@@ -84,7 +84,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
84 .depth = { 8 }, 84 .depth = { 8 },
85 .color = FIMC_FMT_RAW8, 85 .color = FIMC_FMT_RAW8,
86 .memplanes = 1, 86 .memplanes = 1,
87 .mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8, 87 .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
88 .flags = FMT_FLAGS_RAW_BAYER, 88 .flags = FMT_FLAGS_RAW_BAYER,
89 }, { 89 }, {
90 .name = "RAW10 (GRBG)", 90 .name = "RAW10 (GRBG)",
@@ -93,7 +93,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
93 .depth = { 16 }, 93 .depth = { 16 },
94 .color = FIMC_FMT_RAW10, 94 .color = FIMC_FMT_RAW10,
95 .memplanes = 1, 95 .memplanes = 1,
96 .mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10, 96 .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
97 .flags = FMT_FLAGS_RAW_BAYER, 97 .flags = FMT_FLAGS_RAW_BAYER,
98 }, { 98 }, {
99 .name = "RAW12 (GRBG)", 99 .name = "RAW12 (GRBG)",
@@ -102,7 +102,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
102 .depth = { 16 }, 102 .depth = { 16 },
103 .color = FIMC_FMT_RAW12, 103 .color = FIMC_FMT_RAW12,
104 .memplanes = 1, 104 .memplanes = 1,
105 .mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12, 105 .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
106 .flags = FMT_FLAGS_RAW_BAYER, 106 .flags = FMT_FLAGS_RAW_BAYER,
107 }, 107 },
108}; 108};
diff --git a/drivers/media/platform/exynos4-is/fimc-reg.c b/drivers/media/platform/exynos4-is/fimc-reg.c
index 2d77fd8f440a..df0cbcb69b6b 100644
--- a/drivers/media/platform/exynos4-is/fimc-reg.c
+++ b/drivers/media/platform/exynos4-is/fimc-reg.c
@@ -592,10 +592,10 @@ struct mbus_pixfmt_desc {
592}; 592};
593 593
594static const struct mbus_pixfmt_desc pix_desc[] = { 594static const struct mbus_pixfmt_desc pix_desc[] = {
595 { V4L2_MBUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 }, 595 { MEDIA_BUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 },
596 { V4L2_MBUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 }, 596 { MEDIA_BUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 },
597 { V4L2_MBUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 }, 597 { MEDIA_BUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 },
598 { V4L2_MBUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 }, 598 { MEDIA_BUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 },
599}; 599};
600 600
601int fimc_hw_set_camera_source(struct fimc_dev *fimc, 601int fimc_hw_set_camera_source(struct fimc_dev *fimc,
@@ -689,11 +689,11 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
689 689
690 /* TODO: add remaining supported formats. */ 690 /* TODO: add remaining supported formats. */
691 switch (vid_cap->ci_fmt.code) { 691 switch (vid_cap->ci_fmt.code) {
692 case V4L2_MBUS_FMT_VYUY8_2X8: 692 case MEDIA_BUS_FMT_VYUY8_2X8:
693 tmp = FIMC_REG_CSIIMGFMT_YCBCR422_8BIT; 693 tmp = FIMC_REG_CSIIMGFMT_YCBCR422_8BIT;
694 break; 694 break;
695 case V4L2_MBUS_FMT_JPEG_1X8: 695 case MEDIA_BUS_FMT_JPEG_1X8:
696 case V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8: 696 case MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8:
697 tmp = FIMC_REG_CSIIMGFMT_USER(1); 697 tmp = FIMC_REG_CSIIMGFMT_USER(1);
698 cfg |= FIMC_REG_CIGCTRL_CAM_JPEG; 698 cfg |= FIMC_REG_CIGCTRL_CAM_JPEG;
699 break; 699 break;
diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c
index db6fd14d1936..2f3fdfba1a45 100644
--- a/drivers/media/platform/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/exynos4-is/mipi-csis.c
@@ -238,34 +238,34 @@ struct csis_state {
238 */ 238 */
239struct csis_pix_format { 239struct csis_pix_format {
240 unsigned int pix_width_alignment; 240 unsigned int pix_width_alignment;
241 enum v4l2_mbus_pixelcode code; 241 u32 code;
242 u32 fmt_reg; 242 u32 fmt_reg;
243 u8 data_alignment; 243 u8 data_alignment;
244}; 244};
245 245
246static const struct csis_pix_format s5pcsis_formats[] = { 246static const struct csis_pix_format s5pcsis_formats[] = {
247 { 247 {
248 .code = V4L2_MBUS_FMT_VYUY8_2X8, 248 .code = MEDIA_BUS_FMT_VYUY8_2X8,
249 .fmt_reg = S5PCSIS_CFG_FMT_YCBCR422_8BIT, 249 .fmt_reg = S5PCSIS_CFG_FMT_YCBCR422_8BIT,
250 .data_alignment = 32, 250 .data_alignment = 32,
251 }, { 251 }, {
252 .code = V4L2_MBUS_FMT_JPEG_1X8, 252 .code = MEDIA_BUS_FMT_JPEG_1X8,
253 .fmt_reg = S5PCSIS_CFG_FMT_USER(1), 253 .fmt_reg = S5PCSIS_CFG_FMT_USER(1),
254 .data_alignment = 32, 254 .data_alignment = 32,
255 }, { 255 }, {
256 .code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8, 256 .code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8,
257 .fmt_reg = S5PCSIS_CFG_FMT_USER(1), 257 .fmt_reg = S5PCSIS_CFG_FMT_USER(1),
258 .data_alignment = 32, 258 .data_alignment = 32,
259 }, { 259 }, {
260 .code = V4L2_MBUS_FMT_SGRBG8_1X8, 260 .code = MEDIA_BUS_FMT_SGRBG8_1X8,
261 .fmt_reg = S5PCSIS_CFG_FMT_RAW8, 261 .fmt_reg = S5PCSIS_CFG_FMT_RAW8,
262 .data_alignment = 24, 262 .data_alignment = 24,
263 }, { 263 }, {
264 .code = V4L2_MBUS_FMT_SGRBG10_1X10, 264 .code = MEDIA_BUS_FMT_SGRBG10_1X10,
265 .fmt_reg = S5PCSIS_CFG_FMT_RAW10, 265 .fmt_reg = S5PCSIS_CFG_FMT_RAW10,
266 .data_alignment = 24, 266 .data_alignment = 24,
267 }, { 267 }, {
268 .code = V4L2_MBUS_FMT_SGRBG12_1X12, 268 .code = MEDIA_BUS_FMT_SGRBG12_1X12,
269 .fmt_reg = S5PCSIS_CFG_FMT_RAW12, 269 .fmt_reg = S5PCSIS_CFG_FMT_RAW12,
270 .data_alignment = 24, 270 .data_alignment = 24,
271 } 271 }
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 7a86c77bffa0..f0eeb6cd262c 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -106,61 +106,61 @@ static struct mcam_format_struct {
106 __u32 pixelformat; 106 __u32 pixelformat;
107 int bpp; /* Bytes per pixel */ 107 int bpp; /* Bytes per pixel */
108 bool planar; 108 bool planar;
109 enum v4l2_mbus_pixelcode mbus_code; 109 u32 mbus_code;
110} mcam_formats[] = { 110} mcam_formats[] = {
111 { 111 {
112 .desc = "YUYV 4:2:2", 112 .desc = "YUYV 4:2:2",
113 .pixelformat = V4L2_PIX_FMT_YUYV, 113 .pixelformat = V4L2_PIX_FMT_YUYV,
114 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 114 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
115 .bpp = 2, 115 .bpp = 2,
116 .planar = false, 116 .planar = false,
117 }, 117 },
118 { 118 {
119 .desc = "UYVY 4:2:2", 119 .desc = "UYVY 4:2:2",
120 .pixelformat = V4L2_PIX_FMT_UYVY, 120 .pixelformat = V4L2_PIX_FMT_UYVY,
121 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 121 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
122 .bpp = 2, 122 .bpp = 2,
123 .planar = false, 123 .planar = false,
124 }, 124 },
125 { 125 {
126 .desc = "YUV 4:2:2 PLANAR", 126 .desc = "YUV 4:2:2 PLANAR",
127 .pixelformat = V4L2_PIX_FMT_YUV422P, 127 .pixelformat = V4L2_PIX_FMT_YUV422P,
128 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 128 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
129 .bpp = 2, 129 .bpp = 2,
130 .planar = true, 130 .planar = true,
131 }, 131 },
132 { 132 {
133 .desc = "YUV 4:2:0 PLANAR", 133 .desc = "YUV 4:2:0 PLANAR",
134 .pixelformat = V4L2_PIX_FMT_YUV420, 134 .pixelformat = V4L2_PIX_FMT_YUV420,
135 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 135 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
136 .bpp = 2, 136 .bpp = 2,
137 .planar = true, 137 .planar = true,
138 }, 138 },
139 { 139 {
140 .desc = "YVU 4:2:0 PLANAR", 140 .desc = "YVU 4:2:0 PLANAR",
141 .pixelformat = V4L2_PIX_FMT_YVU420, 141 .pixelformat = V4L2_PIX_FMT_YVU420,
142 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 142 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
143 .bpp = 2, 143 .bpp = 2,
144 .planar = true, 144 .planar = true,
145 }, 145 },
146 { 146 {
147 .desc = "RGB 444", 147 .desc = "RGB 444",
148 .pixelformat = V4L2_PIX_FMT_RGB444, 148 .pixelformat = V4L2_PIX_FMT_RGB444,
149 .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, 149 .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
150 .bpp = 2, 150 .bpp = 2,
151 .planar = false, 151 .planar = false,
152 }, 152 },
153 { 153 {
154 .desc = "RGB 565", 154 .desc = "RGB 565",
155 .pixelformat = V4L2_PIX_FMT_RGB565, 155 .pixelformat = V4L2_PIX_FMT_RGB565,
156 .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE, 156 .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE,
157 .bpp = 2, 157 .bpp = 2,
158 .planar = false, 158 .planar = false,
159 }, 159 },
160 { 160 {
161 .desc = "Raw RGB Bayer", 161 .desc = "Raw RGB Bayer",
162 .pixelformat = V4L2_PIX_FMT_SBGGR8, 162 .pixelformat = V4L2_PIX_FMT_SBGGR8,
163 .mbus_code = V4L2_MBUS_FMT_SBGGR8_1X8, 163 .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
164 .bpp = 1, 164 .bpp = 1,
165 .planar = false, 165 .planar = false,
166 }, 166 },
@@ -190,8 +190,7 @@ static const struct v4l2_pix_format mcam_def_pix_format = {
190 .sizeimage = VGA_WIDTH*VGA_HEIGHT*2, 190 .sizeimage = VGA_WIDTH*VGA_HEIGHT*2,
191}; 191};
192 192
193static const enum v4l2_mbus_pixelcode mcam_def_mbus_code = 193static const u32 mcam_def_mbus_code = MEDIA_BUS_FMT_YUYV8_2X8;
194 V4L2_MBUS_FMT_YUYV8_2X8;
195 194
196 195
197/* 196/*
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.h b/drivers/media/platform/marvell-ccic/mcam-core.h
index e0e628cb98f9..60a8e1cfeff7 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.h
+++ b/drivers/media/platform/marvell-ccic/mcam-core.h
@@ -183,7 +183,7 @@ struct mcam_camera {
183 183
184 /* Current operating parameters */ 184 /* Current operating parameters */
185 struct v4l2_pix_format pix_format; 185 struct v4l2_pix_format pix_format;
186 enum v4l2_mbus_pixelcode mbus_code; 186 u32 mbus_code;
187 187
188 /* Locks */ 188 /* Locks */
189 struct mutex s_mutex; /* Access to this structure */ 189 struct mutex s_mutex; /* Access to this structure */
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index 81a9dc053d58..587489a072d5 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -36,23 +36,23 @@ __ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
36 unsigned int pad, enum v4l2_subdev_format_whence which); 36 unsigned int pad, enum v4l2_subdev_format_whence which);
37 37
38static const unsigned int ccdc_fmts[] = { 38static const unsigned int ccdc_fmts[] = {
39 V4L2_MBUS_FMT_Y8_1X8, 39 MEDIA_BUS_FMT_Y8_1X8,
40 V4L2_MBUS_FMT_Y10_1X10, 40 MEDIA_BUS_FMT_Y10_1X10,
41 V4L2_MBUS_FMT_Y12_1X12, 41 MEDIA_BUS_FMT_Y12_1X12,
42 V4L2_MBUS_FMT_SGRBG8_1X8, 42 MEDIA_BUS_FMT_SGRBG8_1X8,
43 V4L2_MBUS_FMT_SRGGB8_1X8, 43 MEDIA_BUS_FMT_SRGGB8_1X8,
44 V4L2_MBUS_FMT_SBGGR8_1X8, 44 MEDIA_BUS_FMT_SBGGR8_1X8,
45 V4L2_MBUS_FMT_SGBRG8_1X8, 45 MEDIA_BUS_FMT_SGBRG8_1X8,
46 V4L2_MBUS_FMT_SGRBG10_1X10, 46 MEDIA_BUS_FMT_SGRBG10_1X10,
47 V4L2_MBUS_FMT_SRGGB10_1X10, 47 MEDIA_BUS_FMT_SRGGB10_1X10,
48 V4L2_MBUS_FMT_SBGGR10_1X10, 48 MEDIA_BUS_FMT_SBGGR10_1X10,
49 V4L2_MBUS_FMT_SGBRG10_1X10, 49 MEDIA_BUS_FMT_SGBRG10_1X10,
50 V4L2_MBUS_FMT_SGRBG12_1X12, 50 MEDIA_BUS_FMT_SGRBG12_1X12,
51 V4L2_MBUS_FMT_SRGGB12_1X12, 51 MEDIA_BUS_FMT_SRGGB12_1X12,
52 V4L2_MBUS_FMT_SBGGR12_1X12, 52 MEDIA_BUS_FMT_SBGGR12_1X12,
53 V4L2_MBUS_FMT_SGBRG12_1X12, 53 MEDIA_BUS_FMT_SGBRG12_1X12,
54 V4L2_MBUS_FMT_YUYV8_2X8, 54 MEDIA_BUS_FMT_YUYV8_2X8,
55 V4L2_MBUS_FMT_UYVY8_2X8, 55 MEDIA_BUS_FMT_UYVY8_2X8,
56}; 56};
57 57
58/* 58/*
@@ -266,10 +266,10 @@ static int __ccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable)
266 __ccdc_get_format(ccdc, NULL, CCDC_PAD_SINK, 266 __ccdc_get_format(ccdc, NULL, CCDC_PAD_SINK,
267 V4L2_SUBDEV_FORMAT_ACTIVE); 267 V4L2_SUBDEV_FORMAT_ACTIVE);
268 268
269 if ((format->code != V4L2_MBUS_FMT_SGRBG10_1X10) && 269 if ((format->code != MEDIA_BUS_FMT_SGRBG10_1X10) &&
270 (format->code != V4L2_MBUS_FMT_SRGGB10_1X10) && 270 (format->code != MEDIA_BUS_FMT_SRGGB10_1X10) &&
271 (format->code != V4L2_MBUS_FMT_SBGGR10_1X10) && 271 (format->code != MEDIA_BUS_FMT_SBGGR10_1X10) &&
272 (format->code != V4L2_MBUS_FMT_SGBRG10_1X10)) 272 (format->code != MEDIA_BUS_FMT_SGBRG10_1X10))
273 return -EINVAL; 273 return -EINVAL;
274 274
275 if (enable) 275 if (enable)
@@ -971,8 +971,8 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
971 971
972 format = &ccdc->formats[CCDC_PAD_SINK]; 972 format = &ccdc->formats[CCDC_PAD_SINK];
973 973
974 if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || 974 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
975 format->code == V4L2_MBUS_FMT_UYVY8_2X8) { 975 format->code == MEDIA_BUS_FMT_UYVY8_2X8) {
976 /* According to the OMAP3 TRM the input mode only affects SYNC 976 /* According to the OMAP3 TRM the input mode only affects SYNC
977 * mode, enabling BT.656 mode should take precedence. However, 977 * mode, enabling BT.656 mode should take precedence. However,
978 * in practice setting the input mode to YCbCr data on 8 bits 978 * in practice setting the input mode to YCbCr data on 8 bits
@@ -1020,7 +1020,7 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
1020 /* The CCDC_CFG.Y8POS bit is used in YCbCr8 input mode only. The 1020 /* The CCDC_CFG.Y8POS bit is used in YCbCr8 input mode only. The
1021 * hardware seems to ignore it in all other input modes. 1021 * hardware seems to ignore it in all other input modes.
1022 */ 1022 */
1023 if (format->code == V4L2_MBUS_FMT_UYVY8_2X8) 1023 if (format->code == MEDIA_BUS_FMT_UYVY8_2X8)
1024 isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, 1024 isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG,
1025 ISPCCDC_CFG_Y8POS); 1025 ISPCCDC_CFG_Y8POS);
1026 else 1026 else
@@ -1168,9 +1168,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1168 1168
1169 if (ccdc->bt656) 1169 if (ccdc->bt656)
1170 bridge = ISPCTRL_PAR_BRIDGE_DISABLE; 1170 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
1171 else if (fmt_info->code == V4L2_MBUS_FMT_YUYV8_2X8) 1171 else if (fmt_info->code == MEDIA_BUS_FMT_YUYV8_2X8)
1172 bridge = ISPCTRL_PAR_BRIDGE_LENDIAN; 1172 bridge = ISPCTRL_PAR_BRIDGE_LENDIAN;
1173 else if (fmt_info->code == V4L2_MBUS_FMT_UYVY8_2X8) 1173 else if (fmt_info->code == MEDIA_BUS_FMT_UYVY8_2X8)
1174 bridge = ISPCTRL_PAR_BRIDGE_BENDIAN; 1174 bridge = ISPCTRL_PAR_BRIDGE_BENDIAN;
1175 else 1175 else
1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE; 1176 bridge = ISPCTRL_PAR_BRIDGE_DISABLE;
@@ -1199,16 +1199,16 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1199 1199
1200 /* Mosaic filter */ 1200 /* Mosaic filter */
1201 switch (format->code) { 1201 switch (format->code) {
1202 case V4L2_MBUS_FMT_SRGGB10_1X10: 1202 case MEDIA_BUS_FMT_SRGGB10_1X10:
1203 case V4L2_MBUS_FMT_SRGGB12_1X12: 1203 case MEDIA_BUS_FMT_SRGGB12_1X12:
1204 ccdc_pattern = ccdc_srggb_pattern; 1204 ccdc_pattern = ccdc_srggb_pattern;
1205 break; 1205 break;
1206 case V4L2_MBUS_FMT_SBGGR10_1X10: 1206 case MEDIA_BUS_FMT_SBGGR10_1X10:
1207 case V4L2_MBUS_FMT_SBGGR12_1X12: 1207 case MEDIA_BUS_FMT_SBGGR12_1X12:
1208 ccdc_pattern = ccdc_sbggr_pattern; 1208 ccdc_pattern = ccdc_sbggr_pattern;
1209 break; 1209 break;
1210 case V4L2_MBUS_FMT_SGBRG10_1X10: 1210 case MEDIA_BUS_FMT_SGBRG10_1X10:
1211 case V4L2_MBUS_FMT_SGBRG12_1X12: 1211 case MEDIA_BUS_FMT_SGBRG12_1X12:
1212 ccdc_pattern = ccdc_sgbrg_pattern; 1212 ccdc_pattern = ccdc_sgbrg_pattern;
1213 break; 1213 break;
1214 default: 1214 default:
@@ -1267,7 +1267,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
1267 /* The CCDC outputs data in UYVY order by default. Swap bytes to get 1267 /* The CCDC outputs data in UYVY order by default. Swap bytes to get
1268 * YUYV. 1268 * YUYV.
1269 */ 1269 */
1270 if (format->code == V4L2_MBUS_FMT_YUYV8_1X16) 1270 if (format->code == MEDIA_BUS_FMT_YUYV8_1X16)
1271 isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, 1271 isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG,
1272 ISPCCDC_CFG_BSWD); 1272 ISPCCDC_CFG_BSWD);
1273 else 1273 else
@@ -1967,7 +1967,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
1967 enum v4l2_subdev_format_whence which) 1967 enum v4l2_subdev_format_whence which)
1968{ 1968{
1969 const struct isp_format_info *info; 1969 const struct isp_format_info *info;
1970 enum v4l2_mbus_pixelcode pixelcode; 1970 u32 pixelcode;
1971 unsigned int width = fmt->width; 1971 unsigned int width = fmt->width;
1972 unsigned int height = fmt->height; 1972 unsigned int height = fmt->height;
1973 struct v4l2_rect *crop; 1973 struct v4l2_rect *crop;
@@ -1983,7 +1983,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
1983 1983
1984 /* If not found, use SGRBG10 as default */ 1984 /* If not found, use SGRBG10 as default */
1985 if (i >= ARRAY_SIZE(ccdc_fmts)) 1985 if (i >= ARRAY_SIZE(ccdc_fmts))
1986 fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; 1986 fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
1987 1987
1988 /* Clamp the input size. */ 1988 /* Clamp the input size. */
1989 fmt->width = clamp_t(u32, width, 32, 4096); 1989 fmt->width = clamp_t(u32, width, 32, 4096);
@@ -2007,19 +2007,19 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
2007 * configured to pack bytes in BT.656, hiding the inaccuracy. 2007 * configured to pack bytes in BT.656, hiding the inaccuracy.
2008 * In all cases bytes can be swapped. 2008 * In all cases bytes can be swapped.
2009 */ 2009 */
2010 if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || 2010 if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
2011 fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) { 2011 fmt->code == MEDIA_BUS_FMT_UYVY8_2X8) {
2012 /* Use the user requested format if YUV. */ 2012 /* Use the user requested format if YUV. */
2013 if (pixelcode == V4L2_MBUS_FMT_YUYV8_2X8 || 2013 if (pixelcode == MEDIA_BUS_FMT_YUYV8_2X8 ||
2014 pixelcode == V4L2_MBUS_FMT_UYVY8_2X8 || 2014 pixelcode == MEDIA_BUS_FMT_UYVY8_2X8 ||
2015 pixelcode == V4L2_MBUS_FMT_YUYV8_1X16 || 2015 pixelcode == MEDIA_BUS_FMT_YUYV8_1X16 ||
2016 pixelcode == V4L2_MBUS_FMT_UYVY8_1X16) 2016 pixelcode == MEDIA_BUS_FMT_UYVY8_1X16)
2017 fmt->code = pixelcode; 2017 fmt->code = pixelcode;
2018 2018
2019 if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8) 2019 if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8)
2020 fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; 2020 fmt->code = MEDIA_BUS_FMT_YUYV8_1X16;
2021 else if (fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) 2021 else if (fmt->code == MEDIA_BUS_FMT_UYVY8_2X8)
2022 fmt->code = V4L2_MBUS_FMT_UYVY8_1X16; 2022 fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
2023 } 2023 }
2024 2024
2025 /* Hardcode the output size to the crop rectangle size. */ 2025 /* Hardcode the output size to the crop rectangle size. */
@@ -2047,8 +2047,8 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh,
2047 fmt->code = info->truncated; 2047 fmt->code = info->truncated;
2048 2048
2049 /* YUV formats are not supported by the video port. */ 2049 /* YUV formats are not supported by the video port. */
2050 if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || 2050 if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
2051 fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) 2051 fmt->code == MEDIA_BUS_FMT_UYVY8_2X8)
2052 fmt->code = 0; 2052 fmt->code = 0;
2053 2053
2054 /* The number of lines that can be clocked out from the video 2054 /* The number of lines that can be clocked out from the video
@@ -2083,7 +2083,7 @@ static void ccdc_try_crop(struct isp_ccdc_device *ccdc,
2083 * to keep the Bayer pattern. 2083 * to keep the Bayer pattern.
2084 */ 2084 */
2085 info = omap3isp_video_format_info(sink->code); 2085 info = omap3isp_video_format_info(sink->code);
2086 if (info->flavor != V4L2_MBUS_FMT_Y8_1X8) { 2086 if (info->flavor != MEDIA_BUS_FMT_Y8_1X8) {
2087 crop->left &= ~1; 2087 crop->left &= ~1;
2088 crop->top &= ~1; 2088 crop->top &= ~1;
2089 } 2089 }
@@ -2103,7 +2103,7 @@ static void ccdc_try_crop(struct isp_ccdc_device *ccdc,
2103 sink->height - crop->top); 2103 sink->height - crop->top);
2104 2104
2105 /* Odd width/height values don't make sense for Bayer formats. */ 2105 /* Odd width/height values don't make sense for Bayer formats. */
2106 if (info->flavor != V4L2_MBUS_FMT_Y8_1X8) { 2106 if (info->flavor != MEDIA_BUS_FMT_Y8_1X8) {
2107 crop->width &= ~1; 2107 crop->width &= ~1;
2108 crop->height &= ~1; 2108 crop->height &= ~1;
2109 } 2109 }
@@ -2135,13 +2135,13 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
2135 format = __ccdc_get_format(ccdc, fh, code->pad, 2135 format = __ccdc_get_format(ccdc, fh, code->pad,
2136 V4L2_SUBDEV_FORMAT_TRY); 2136 V4L2_SUBDEV_FORMAT_TRY);
2137 2137
2138 if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || 2138 if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
2139 format->code == V4L2_MBUS_FMT_UYVY8_2X8) { 2139 format->code == MEDIA_BUS_FMT_UYVY8_2X8) {
2140 /* In YUV mode the CCDC can swap bytes. */ 2140 /* In YUV mode the CCDC can swap bytes. */
2141 if (code->index == 0) 2141 if (code->index == 0)
2142 code->code = V4L2_MBUS_FMT_YUYV8_1X16; 2142 code->code = MEDIA_BUS_FMT_YUYV8_1X16;
2143 else if (code->index == 1) 2143 else if (code->index == 1)
2144 code->code = V4L2_MBUS_FMT_UYVY8_1X16; 2144 code->code = MEDIA_BUS_FMT_UYVY8_1X16;
2145 else 2145 else
2146 return -EINVAL; 2146 return -EINVAL;
2147 } else { 2147 } else {
@@ -2383,9 +2383,7 @@ static int ccdc_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2383 * return true if the combination is possible 2383 * return true if the combination is possible
2384 * return false otherwise 2384 * return false otherwise
2385 */ 2385 */
2386static bool ccdc_is_shiftable(enum v4l2_mbus_pixelcode in, 2386static bool ccdc_is_shiftable(u32 in, u32 out, unsigned int additional_shift)
2387 enum v4l2_mbus_pixelcode out,
2388 unsigned int additional_shift)
2389{ 2387{
2390 const struct isp_format_info *in_info, *out_info; 2388 const struct isp_format_info *in_info, *out_info;
2391 2389
@@ -2452,7 +2450,7 @@ static int ccdc_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
2452 memset(&format, 0, sizeof(format)); 2450 memset(&format, 0, sizeof(format));
2453 format.pad = CCDC_PAD_SINK; 2451 format.pad = CCDC_PAD_SINK;
2454 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; 2452 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
2455 format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; 2453 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
2456 format.format.width = 4096; 2454 format.format.width = 4096;
2457 format.format.height = 4096; 2455 format.format.height = 4096;
2458 ccdc_set_format(sd, fh, &format); 2456 ccdc_set_format(sd, fh, &format);
diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c
index 9cb49b3c04bd..f4aedb37e41e 100644
--- a/drivers/media/platform/omap3isp/ispccp2.c
+++ b/drivers/media/platform/omap3isp/ispccp2.c
@@ -289,10 +289,10 @@ static void ccp2_lcx_config(struct isp_ccp2_device *ccp2,
289 u32 val, format; 289 u32 val, format;
290 290
291 switch (config->format) { 291 switch (config->format) {
292 case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: 292 case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8:
293 format = ISPCCP2_LCx_CTRL_FORMAT_RAW8_DPCM10_VP; 293 format = ISPCCP2_LCx_CTRL_FORMAT_RAW8_DPCM10_VP;
294 break; 294 break;
295 case V4L2_MBUS_FMT_SGRBG10_1X10: 295 case MEDIA_BUS_FMT_SGRBG10_1X10:
296 default: 296 default:
297 format = ISPCCP2_LCx_CTRL_FORMAT_RAW10_VP; /* RAW10+VP */ 297 format = ISPCCP2_LCx_CTRL_FORMAT_RAW10_VP; /* RAW10+VP */
298 break; 298 break;
@@ -438,7 +438,7 @@ static void ccp2_mem_configure(struct isp_ccp2_device *ccp2,
438 u32 val, hwords; 438 u32 val, hwords;
439 439
440 if (sink_pixcode != source_pixcode && 440 if (sink_pixcode != source_pixcode &&
441 sink_pixcode == V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8) 441 sink_pixcode == MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8)
442 dpcm_decompress = 1; 442 dpcm_decompress = 1;
443 443
444 ccp2_pwr_cfg(ccp2); 444 ccp2_pwr_cfg(ccp2);
@@ -604,8 +604,8 @@ void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2)
604 */ 604 */
605 605
606static const unsigned int ccp2_fmts[] = { 606static const unsigned int ccp2_fmts[] = {
607 V4L2_MBUS_FMT_SGRBG10_1X10, 607 MEDIA_BUS_FMT_SGRBG10_1X10,
608 V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, 608 MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
609}; 609};
610 610
611/* 611/*
@@ -643,8 +643,8 @@ static void ccp2_try_format(struct isp_ccp2_device *ccp2,
643 643
644 switch (pad) { 644 switch (pad) {
645 case CCP2_PAD_SINK: 645 case CCP2_PAD_SINK:
646 if (fmt->code != V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8) 646 if (fmt->code != MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8)
647 fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; 647 fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
648 648
649 if (ccp2->input == CCP2_INPUT_SENSOR) { 649 if (ccp2->input == CCP2_INPUT_SENSOR) {
650 fmt->width = clamp_t(u32, fmt->width, 650 fmt->width = clamp_t(u32, fmt->width,
@@ -671,7 +671,7 @@ static void ccp2_try_format(struct isp_ccp2_device *ccp2,
671 */ 671 */
672 format = __ccp2_get_format(ccp2, fh, CCP2_PAD_SINK, which); 672 format = __ccp2_get_format(ccp2, fh, CCP2_PAD_SINK, which);
673 memcpy(fmt, format, sizeof(*fmt)); 673 memcpy(fmt, format, sizeof(*fmt));
674 fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; 674 fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
675 break; 675 break;
676 } 676 }
677 677
@@ -808,7 +808,7 @@ static int ccp2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
808 memset(&format, 0, sizeof(format)); 808 memset(&format, 0, sizeof(format));
809 format.pad = CCP2_PAD_SINK; 809 format.pad = CCP2_PAD_SINK;
810 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; 810 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
811 format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; 811 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
812 format.format.width = 4096; 812 format.format.width = 4096;
813 format.format.height = 4096; 813 format.format.height = 4096;
814 ccp2_set_format(sd, fh, &format); 814 ccp2_set_format(sd, fh, &format);
diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c
index 6530b255f103..09c686d96ae8 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -78,15 +78,15 @@ static void csi2_recv_config(struct isp_device *isp,
78} 78}
79 79
80static const unsigned int csi2_input_fmts[] = { 80static const unsigned int csi2_input_fmts[] = {
81 V4L2_MBUS_FMT_SGRBG10_1X10, 81 MEDIA_BUS_FMT_SGRBG10_1X10,
82 V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, 82 MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
83 V4L2_MBUS_FMT_SRGGB10_1X10, 83 MEDIA_BUS_FMT_SRGGB10_1X10,
84 V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, 84 MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,
85 V4L2_MBUS_FMT_SBGGR10_1X10, 85 MEDIA_BUS_FMT_SBGGR10_1X10,
86 V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, 86 MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,
87 V4L2_MBUS_FMT_SGBRG10_1X10, 87 MEDIA_BUS_FMT_SGBRG10_1X10,
88 V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, 88 MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,
89 V4L2_MBUS_FMT_YUYV8_2X8, 89 MEDIA_BUS_FMT_YUYV8_2X8,
90}; 90};
91 91
92/* To set the format on the CSI2 requires a mapping function that takes 92/* To set the format on the CSI2 requires a mapping function that takes
@@ -171,19 +171,19 @@ static u16 csi2_ctx_map_format(struct isp_csi2_device *csi2)
171 int fmtidx, destidx, is_3630; 171 int fmtidx, destidx, is_3630;
172 172
173 switch (fmt->code) { 173 switch (fmt->code) {
174 case V4L2_MBUS_FMT_SGRBG10_1X10: 174 case MEDIA_BUS_FMT_SGRBG10_1X10:
175 case V4L2_MBUS_FMT_SRGGB10_1X10: 175 case MEDIA_BUS_FMT_SRGGB10_1X10:
176 case V4L2_MBUS_FMT_SBGGR10_1X10: 176 case MEDIA_BUS_FMT_SBGGR10_1X10:
177 case V4L2_MBUS_FMT_SGBRG10_1X10: 177 case MEDIA_BUS_FMT_SGBRG10_1X10:
178 fmtidx = 0; 178 fmtidx = 0;
179 break; 179 break;
180 case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: 180 case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8:
181 case V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8: 181 case MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8:
182 case V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8: 182 case MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8:
183 case V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8: 183 case MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8:
184 fmtidx = 1; 184 fmtidx = 1;
185 break; 185 break;
186 case V4L2_MBUS_FMT_YUYV8_2X8: 186 case MEDIA_BUS_FMT_YUYV8_2X8:
187 fmtidx = 2; 187 fmtidx = 2;
188 break; 188 break;
189 default: 189 default:
@@ -843,7 +843,7 @@ csi2_try_format(struct isp_csi2_device *csi2, struct v4l2_subdev_fh *fh,
843 unsigned int pad, struct v4l2_mbus_framefmt *fmt, 843 unsigned int pad, struct v4l2_mbus_framefmt *fmt,
844 enum v4l2_subdev_format_whence which) 844 enum v4l2_subdev_format_whence which)
845{ 845{
846 enum v4l2_mbus_pixelcode pixelcode; 846 u32 pixelcode;
847 struct v4l2_mbus_framefmt *format; 847 struct v4l2_mbus_framefmt *format;
848 const struct isp_format_info *info; 848 const struct isp_format_info *info;
849 unsigned int i; 849 unsigned int i;
@@ -858,7 +858,7 @@ csi2_try_format(struct isp_csi2_device *csi2, struct v4l2_subdev_fh *fh,
858 858
859 /* If not found, use SGRBG10 as default */ 859 /* If not found, use SGRBG10 as default */
860 if (i >= ARRAY_SIZE(csi2_input_fmts)) 860 if (i >= ARRAY_SIZE(csi2_input_fmts))
861 fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; 861 fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
862 862
863 fmt->width = clamp_t(u32, fmt->width, 1, 8191); 863 fmt->width = clamp_t(u32, fmt->width, 1, 8191);
864 fmt->height = clamp_t(u32, fmt->height, 1, 8191); 864 fmt->height = clamp_t(u32, fmt->height, 1, 8191);
@@ -1029,7 +1029,7 @@ static int csi2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
1029 memset(&format, 0, sizeof(format)); 1029 memset(&format, 0, sizeof(format));
1030 format.pad = CSI2_PAD_SINK; 1030 format.pad = CSI2_PAD_SINK;
1031 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; 1031 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
1032 format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; 1032 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
1033 format.format.width = 4096; 1033 format.format.width = 4096;
1034 format.format.height = 4096; 1034 format.format.height = 4096;
1035 csi2_set_format(sd, fh, &format); 1035 csi2_set_format(sd, fh, &format);
diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
index 605f57ef0a49..dd9eed45d853 100644
--- a/drivers/media/platform/omap3isp/isppreview.c
+++ b/drivers/media/platform/omap3isp/isppreview.c
@@ -964,18 +964,16 @@ static void preview_setup_hw(struct isp_prev_device *prev, u32 update,
964 * @prev: pointer to previewer private structure 964 * @prev: pointer to previewer private structure
965 * @pixelcode: pixel code 965 * @pixelcode: pixel code
966 */ 966 */
967static void 967static void preview_config_ycpos(struct isp_prev_device *prev, u32 pixelcode)
968preview_config_ycpos(struct isp_prev_device *prev,
969 enum v4l2_mbus_pixelcode pixelcode)
970{ 968{
971 struct isp_device *isp = to_isp_device(prev); 969 struct isp_device *isp = to_isp_device(prev);
972 enum preview_ycpos_mode mode; 970 enum preview_ycpos_mode mode;
973 971
974 switch (pixelcode) { 972 switch (pixelcode) {
975 case V4L2_MBUS_FMT_YUYV8_1X16: 973 case MEDIA_BUS_FMT_YUYV8_1X16:
976 mode = YCPOS_CrYCbY; 974 mode = YCPOS_CrYCbY;
977 break; 975 break;
978 case V4L2_MBUS_FMT_UYVY8_1X16: 976 case MEDIA_BUS_FMT_UYVY8_1X16:
979 mode = YCPOS_YCrYCb; 977 mode = YCPOS_YCrYCb;
980 break; 978 break;
981 default: 979 default:
@@ -1028,16 +1026,16 @@ static void preview_config_input_format(struct isp_prev_device *prev,
1028 ISPPRV_PCR_WIDTH); 1026 ISPPRV_PCR_WIDTH);
1029 1027
1030 switch (info->flavor) { 1028 switch (info->flavor) {
1031 case V4L2_MBUS_FMT_SGRBG8_1X8: 1029 case MEDIA_BUS_FMT_SGRBG8_1X8:
1032 prev->params.cfa_order = 0; 1030 prev->params.cfa_order = 0;
1033 break; 1031 break;
1034 case V4L2_MBUS_FMT_SRGGB8_1X8: 1032 case MEDIA_BUS_FMT_SRGGB8_1X8:
1035 prev->params.cfa_order = 1; 1033 prev->params.cfa_order = 1;
1036 break; 1034 break;
1037 case V4L2_MBUS_FMT_SBGGR8_1X8: 1035 case MEDIA_BUS_FMT_SBGGR8_1X8:
1038 prev->params.cfa_order = 2; 1036 prev->params.cfa_order = 2;
1039 break; 1037 break;
1040 case V4L2_MBUS_FMT_SGBRG8_1X8: 1038 case MEDIA_BUS_FMT_SGBRG8_1X8:
1041 prev->params.cfa_order = 3; 1039 prev->params.cfa_order = 3;
1042 break; 1040 break;
1043 default: 1041 default:
@@ -1078,8 +1076,8 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active)
1078 unsigned int elv = prev->crop.top + prev->crop.height - 1; 1076 unsigned int elv = prev->crop.top + prev->crop.height - 1;
1079 u32 features; 1077 u32 features;
1080 1078
1081 if (format->code != V4L2_MBUS_FMT_Y8_1X8 && 1079 if (format->code != MEDIA_BUS_FMT_Y8_1X8 &&
1082 format->code != V4L2_MBUS_FMT_Y10_1X10) { 1080 format->code != MEDIA_BUS_FMT_Y10_1X10) {
1083 sph -= 2; 1081 sph -= 2;
1084 eph += 2; 1082 eph += 2;
1085 slv -= 2; 1083 slv -= 2;
@@ -1709,21 +1707,21 @@ __preview_get_crop(struct isp_prev_device *prev, struct v4l2_subdev_fh *fh,
1709 1707
1710/* previewer format descriptions */ 1708/* previewer format descriptions */
1711static const unsigned int preview_input_fmts[] = { 1709static const unsigned int preview_input_fmts[] = {
1712 V4L2_MBUS_FMT_Y8_1X8, 1710 MEDIA_BUS_FMT_Y8_1X8,
1713 V4L2_MBUS_FMT_SGRBG8_1X8, 1711 MEDIA_BUS_FMT_SGRBG8_1X8,
1714 V4L2_MBUS_FMT_SRGGB8_1X8, 1712 MEDIA_BUS_FMT_SRGGB8_1X8,
1715 V4L2_MBUS_FMT_SBGGR8_1X8, 1713 MEDIA_BUS_FMT_SBGGR8_1X8,
1716 V4L2_MBUS_FMT_SGBRG8_1X8, 1714 MEDIA_BUS_FMT_SGBRG8_1X8,
1717 V4L2_MBUS_FMT_Y10_1X10, 1715 MEDIA_BUS_FMT_Y10_1X10,
1718 V4L2_MBUS_FMT_SGRBG10_1X10, 1716 MEDIA_BUS_FMT_SGRBG10_1X10,
1719 V4L2_MBUS_FMT_SRGGB10_1X10, 1717 MEDIA_BUS_FMT_SRGGB10_1X10,
1720 V4L2_MBUS_FMT_SBGGR10_1X10, 1718 MEDIA_BUS_FMT_SBGGR10_1X10,
1721 V4L2_MBUS_FMT_SGBRG10_1X10, 1719 MEDIA_BUS_FMT_SGBRG10_1X10,
1722}; 1720};
1723 1721
1724static const unsigned int preview_output_fmts[] = { 1722static const unsigned int preview_output_fmts[] = {
1725 V4L2_MBUS_FMT_UYVY8_1X16, 1723 MEDIA_BUS_FMT_UYVY8_1X16,
1726 V4L2_MBUS_FMT_YUYV8_1X16, 1724 MEDIA_BUS_FMT_YUYV8_1X16,
1727}; 1725};
1728 1726
1729/* 1727/*
@@ -1742,7 +1740,7 @@ static void preview_try_format(struct isp_prev_device *prev,
1742 struct v4l2_mbus_framefmt *fmt, 1740 struct v4l2_mbus_framefmt *fmt,
1743 enum v4l2_subdev_format_whence which) 1741 enum v4l2_subdev_format_whence which)
1744{ 1742{
1745 enum v4l2_mbus_pixelcode pixelcode; 1743 u32 pixelcode;
1746 struct v4l2_rect *crop; 1744 struct v4l2_rect *crop;
1747 unsigned int i; 1745 unsigned int i;
1748 1746
@@ -1774,7 +1772,7 @@ static void preview_try_format(struct isp_prev_device *prev,
1774 1772
1775 /* If not found, use SGRBG10 as default */ 1773 /* If not found, use SGRBG10 as default */
1776 if (i >= ARRAY_SIZE(preview_input_fmts)) 1774 if (i >= ARRAY_SIZE(preview_input_fmts))
1777 fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; 1775 fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
1778 break; 1776 break;
1779 1777
1780 case PREV_PAD_SOURCE: 1778 case PREV_PAD_SOURCE:
@@ -1782,13 +1780,13 @@ static void preview_try_format(struct isp_prev_device *prev,
1782 *fmt = *__preview_get_format(prev, fh, PREV_PAD_SINK, which); 1780 *fmt = *__preview_get_format(prev, fh, PREV_PAD_SINK, which);
1783 1781
1784 switch (pixelcode) { 1782 switch (pixelcode) {
1785 case V4L2_MBUS_FMT_YUYV8_1X16: 1783 case MEDIA_BUS_FMT_YUYV8_1X16:
1786 case V4L2_MBUS_FMT_UYVY8_1X16: 1784 case MEDIA_BUS_FMT_UYVY8_1X16:
1787 fmt->code = pixelcode; 1785 fmt->code = pixelcode;
1788 break; 1786 break;
1789 1787
1790 default: 1788 default:
1791 fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; 1789 fmt->code = MEDIA_BUS_FMT_YUYV8_1X16;
1792 break; 1790 break;
1793 } 1791 }
1794 1792
@@ -1843,8 +1841,8 @@ static void preview_try_crop(struct isp_prev_device *prev,
1843 * and no columns in other modes. Increase the margins based on the sink 1841 * and no columns in other modes. Increase the margins based on the sink
1844 * format. 1842 * format.
1845 */ 1843 */
1846 if (sink->code != V4L2_MBUS_FMT_Y8_1X8 && 1844 if (sink->code != MEDIA_BUS_FMT_Y8_1X8 &&
1847 sink->code != V4L2_MBUS_FMT_Y10_1X10) { 1845 sink->code != MEDIA_BUS_FMT_Y10_1X10) {
1848 left += 2; 1846 left += 2;
1849 right -= 2; 1847 right -= 2;
1850 top += 2; 1848 top += 2;
@@ -2092,7 +2090,7 @@ static int preview_init_formats(struct v4l2_subdev *sd,
2092 memset(&format, 0, sizeof(format)); 2090 memset(&format, 0, sizeof(format));
2093 format.pad = PREV_PAD_SINK; 2091 format.pad = PREV_PAD_SINK;
2094 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; 2092 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
2095 format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; 2093 format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
2096 format.format.width = 4096; 2094 format.format.width = 4096;
2097 format.format.height = 4096; 2095 format.format.height = 4096;
2098 preview_set_format(sd, fh, &format); 2096 preview_set_format(sd, fh, &format);
diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c
index 05d1ace57451..2b9bc4839876 100644
--- a/drivers/media/platform/omap3isp/ispresizer.c
+++ b/drivers/media/platform/omap3isp/ispresizer.c
@@ -198,17 +198,16 @@ static void resizer_set_bilinear(struct isp_res_device *res,
198 * @res: Device context. 198 * @res: Device context.
199 * @pixelcode: pixel code. 199 * @pixelcode: pixel code.
200 */ 200 */
201static void resizer_set_ycpos(struct isp_res_device *res, 201static void resizer_set_ycpos(struct isp_res_device *res, u32 pixelcode)
202 enum v4l2_mbus_pixelcode pixelcode)
203{ 202{
204 struct isp_device *isp = to_isp_device(res); 203 struct isp_device *isp = to_isp_device(res);
205 204
206 switch (pixelcode) { 205 switch (pixelcode) {
207 case V4L2_MBUS_FMT_YUYV8_1X16: 206 case MEDIA_BUS_FMT_YUYV8_1X16:
208 isp_reg_set(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, 207 isp_reg_set(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT,
209 ISPRSZ_CNT_YCPOS); 208 ISPRSZ_CNT_YCPOS);
210 break; 209 break;
211 case V4L2_MBUS_FMT_UYVY8_1X16: 210 case MEDIA_BUS_FMT_UYVY8_1X16:
212 isp_reg_clr(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, 211 isp_reg_clr(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT,
213 ISPRSZ_CNT_YCPOS); 212 ISPRSZ_CNT_YCPOS);
214 break; 213 break;
@@ -1348,8 +1347,8 @@ static int resizer_set_selection(struct v4l2_subdev *sd,
1348 1347
1349/* resizer pixel formats */ 1348/* resizer pixel formats */
1350static const unsigned int resizer_formats[] = { 1349static const unsigned int resizer_formats[] = {
1351 V4L2_MBUS_FMT_UYVY8_1X16, 1350 MEDIA_BUS_FMT_UYVY8_1X16,
1352 V4L2_MBUS_FMT_YUYV8_1X16, 1351 MEDIA_BUS_FMT_YUYV8_1X16,
1353}; 1352};
1354 1353
1355static unsigned int resizer_max_in_width(struct isp_res_device *res) 1354static unsigned int resizer_max_in_width(struct isp_res_device *res)
@@ -1385,9 +1384,9 @@ static void resizer_try_format(struct isp_res_device *res,
1385 1384
1386 switch (pad) { 1385 switch (pad) {
1387 case RESZ_PAD_SINK: 1386 case RESZ_PAD_SINK:
1388 if (fmt->code != V4L2_MBUS_FMT_YUYV8_1X16 && 1387 if (fmt->code != MEDIA_BUS_FMT_YUYV8_1X16 &&
1389 fmt->code != V4L2_MBUS_FMT_UYVY8_1X16) 1388 fmt->code != MEDIA_BUS_FMT_UYVY8_1X16)
1390 fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; 1389 fmt->code = MEDIA_BUS_FMT_YUYV8_1X16;
1391 1390
1392 fmt->width = clamp_t(u32, fmt->width, MIN_IN_WIDTH, 1391 fmt->width = clamp_t(u32, fmt->width, MIN_IN_WIDTH,
1393 resizer_max_in_width(res)); 1392 resizer_max_in_width(res));
@@ -1571,7 +1570,7 @@ static int resizer_init_formats(struct v4l2_subdev *sd,
1571 memset(&format, 0, sizeof(format)); 1570 memset(&format, 0, sizeof(format));
1572 format.pad = RESZ_PAD_SINK; 1571 format.pad = RESZ_PAD_SINK;
1573 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; 1572 format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
1574 format.format.code = V4L2_MBUS_FMT_YUYV8_1X16; 1573 format.format.code = MEDIA_BUS_FMT_YUYV8_1X16;
1575 format.format.width = 4096; 1574 format.format.width = 4096;
1576 format.format.height = 4096; 1575 format.format.height = 4096;
1577 resizer_set_format(sd, fh, &format); 1576 resizer_set_format(sd, fh, &format);
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index bc38c88c7bd9..b463fe172d16 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -39,74 +39,74 @@
39 * corresponding in-memory formats to the table below!!! 39 * corresponding in-memory formats to the table below!!!
40 */ 40 */
41static struct isp_format_info formats[] = { 41static struct isp_format_info formats[] = {
42 { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, 42 { MEDIA_BUS_FMT_Y8_1X8, MEDIA_BUS_FMT_Y8_1X8,
43 V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, 43 MEDIA_BUS_FMT_Y8_1X8, MEDIA_BUS_FMT_Y8_1X8,
44 V4L2_PIX_FMT_GREY, 8, 1, }, 44 V4L2_PIX_FMT_GREY, 8, 1, },
45 { V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y10_1X10, 45 { MEDIA_BUS_FMT_Y10_1X10, MEDIA_BUS_FMT_Y10_1X10,
46 V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y8_1X8, 46 MEDIA_BUS_FMT_Y10_1X10, MEDIA_BUS_FMT_Y8_1X8,
47 V4L2_PIX_FMT_Y10, 10, 2, }, 47 V4L2_PIX_FMT_Y10, 10, 2, },
48 { V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y10_1X10, 48 { MEDIA_BUS_FMT_Y12_1X12, MEDIA_BUS_FMT_Y10_1X10,
49 V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y8_1X8, 49 MEDIA_BUS_FMT_Y12_1X12, MEDIA_BUS_FMT_Y8_1X8,
50 V4L2_PIX_FMT_Y12, 12, 2, }, 50 V4L2_PIX_FMT_Y12, 12, 2, },
51 { V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, 51 { MEDIA_BUS_FMT_SBGGR8_1X8, MEDIA_BUS_FMT_SBGGR8_1X8,
52 V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, 52 MEDIA_BUS_FMT_SBGGR8_1X8, MEDIA_BUS_FMT_SBGGR8_1X8,
53 V4L2_PIX_FMT_SBGGR8, 8, 1, }, 53 V4L2_PIX_FMT_SBGGR8, 8, 1, },
54 { V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, 54 { MEDIA_BUS_FMT_SGBRG8_1X8, MEDIA_BUS_FMT_SGBRG8_1X8,
55 V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, 55 MEDIA_BUS_FMT_SGBRG8_1X8, MEDIA_BUS_FMT_SGBRG8_1X8,
56 V4L2_PIX_FMT_SGBRG8, 8, 1, }, 56 V4L2_PIX_FMT_SGBRG8, 8, 1, },
57 { V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, 57 { MEDIA_BUS_FMT_SGRBG8_1X8, MEDIA_BUS_FMT_SGRBG8_1X8,
58 V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, 58 MEDIA_BUS_FMT_SGRBG8_1X8, MEDIA_BUS_FMT_SGRBG8_1X8,
59 V4L2_PIX_FMT_SGRBG8, 8, 1, }, 59 V4L2_PIX_FMT_SGRBG8, 8, 1, },
60 { V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, 60 { MEDIA_BUS_FMT_SRGGB8_1X8, MEDIA_BUS_FMT_SRGGB8_1X8,
61 V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, 61 MEDIA_BUS_FMT_SRGGB8_1X8, MEDIA_BUS_FMT_SRGGB8_1X8,
62 V4L2_PIX_FMT_SRGGB8, 8, 1, }, 62 V4L2_PIX_FMT_SRGGB8, 8, 1, },
63 { V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, 63 { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8,
64 V4L2_MBUS_FMT_SBGGR10_1X10, 0, 64 MEDIA_BUS_FMT_SBGGR10_1X10, 0,
65 V4L2_PIX_FMT_SBGGR10DPCM8, 8, 1, }, 65 V4L2_PIX_FMT_SBGGR10DPCM8, 8, 1, },
66 { V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, 66 { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8,
67 V4L2_MBUS_FMT_SGBRG10_1X10, 0, 67 MEDIA_BUS_FMT_SGBRG10_1X10, 0,
68 V4L2_PIX_FMT_SGBRG10DPCM8, 8, 1, }, 68 V4L2_PIX_FMT_SGBRG10DPCM8, 8, 1, },
69 { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, 69 { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
70 V4L2_MBUS_FMT_SGRBG10_1X10, 0, 70 MEDIA_BUS_FMT_SGRBG10_1X10, 0,
71 V4L2_PIX_FMT_SGRBG10DPCM8, 8, 1, }, 71 V4L2_PIX_FMT_SGRBG10DPCM8, 8, 1, },
72 { V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, 72 { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8,
73 V4L2_MBUS_FMT_SRGGB10_1X10, 0, 73 MEDIA_BUS_FMT_SRGGB10_1X10, 0,
74 V4L2_PIX_FMT_SRGGB10DPCM8, 8, 1, }, 74 V4L2_PIX_FMT_SRGGB10DPCM8, 8, 1, },
75 { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, 75 { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SBGGR10_1X10,
76 V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR8_1X8, 76 MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SBGGR8_1X8,
77 V4L2_PIX_FMT_SBGGR10, 10, 2, }, 77 V4L2_PIX_FMT_SBGGR10, 10, 2, },
78 { V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10, 78 { MEDIA_BUS_FMT_SGBRG10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10,
79 V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG8_1X8, 79 MEDIA_BUS_FMT_SGBRG10_1X10, MEDIA_BUS_FMT_SGBRG8_1X8,
80 V4L2_PIX_FMT_SGBRG10, 10, 2, }, 80 V4L2_PIX_FMT_SGBRG10, 10, 2, },
81 { V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG10_1X10, 81 { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SGRBG10_1X10,
82 V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG8_1X8, 82 MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SGRBG8_1X8,
83 V4L2_PIX_FMT_SGRBG10, 10, 2, }, 83 V4L2_PIX_FMT_SGRBG10, 10, 2, },
84 { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10, 84 { MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10,
85 V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB8_1X8, 85 MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SRGGB8_1X8,
86 V4L2_PIX_FMT_SRGGB10, 10, 2, }, 86 V4L2_PIX_FMT_SRGGB10, 10, 2, },
87 { V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR10_1X10, 87 { MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SBGGR10_1X10,
88 V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR8_1X8, 88 MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SBGGR8_1X8,
89 V4L2_PIX_FMT_SBGGR12, 12, 2, }, 89 V4L2_PIX_FMT_SBGGR12, 12, 2, },
90 { V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG10_1X10, 90 { MEDIA_BUS_FMT_SGBRG12_1X12, MEDIA_BUS_FMT_SGBRG10_1X10,
91 V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG8_1X8, 91 MEDIA_BUS_FMT_SGBRG12_1X12, MEDIA_BUS_FMT_SGBRG8_1X8,
92 V4L2_PIX_FMT_SGBRG12, 12, 2, }, 92 V4L2_PIX_FMT_SGBRG12, 12, 2, },
93 { V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG10_1X10, 93 { MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SGRBG10_1X10,
94 V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG8_1X8, 94 MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SGRBG8_1X8,
95 V4L2_PIX_FMT_SGRBG12, 12, 2, }, 95 V4L2_PIX_FMT_SGRBG12, 12, 2, },
96 { V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB10_1X10, 96 { MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_SRGGB10_1X10,
97 V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB8_1X8, 97 MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_SRGGB8_1X8,
98 V4L2_PIX_FMT_SRGGB12, 12, 2, }, 98 V4L2_PIX_FMT_SRGGB12, 12, 2, },
99 { V4L2_MBUS_FMT_UYVY8_1X16, V4L2_MBUS_FMT_UYVY8_1X16, 99 { MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_UYVY8_1X16,
100 V4L2_MBUS_FMT_UYVY8_1X16, 0, 100 MEDIA_BUS_FMT_UYVY8_1X16, 0,
101 V4L2_PIX_FMT_UYVY, 16, 2, }, 101 V4L2_PIX_FMT_UYVY, 16, 2, },
102 { V4L2_MBUS_FMT_YUYV8_1X16, V4L2_MBUS_FMT_YUYV8_1X16, 102 { MEDIA_BUS_FMT_YUYV8_1X16, MEDIA_BUS_FMT_YUYV8_1X16,
103 V4L2_MBUS_FMT_YUYV8_1X16, 0, 103 MEDIA_BUS_FMT_YUYV8_1X16, 0,
104 V4L2_PIX_FMT_YUYV, 16, 2, }, 104 V4L2_PIX_FMT_YUYV, 16, 2, },
105 { V4L2_MBUS_FMT_UYVY8_2X8, V4L2_MBUS_FMT_UYVY8_2X8, 105 { MEDIA_BUS_FMT_UYVY8_2X8, MEDIA_BUS_FMT_UYVY8_2X8,
106 V4L2_MBUS_FMT_UYVY8_2X8, 0, 106 MEDIA_BUS_FMT_UYVY8_2X8, 0,
107 V4L2_PIX_FMT_UYVY, 8, 2, }, 107 V4L2_PIX_FMT_UYVY, 8, 2, },
108 { V4L2_MBUS_FMT_YUYV8_2X8, V4L2_MBUS_FMT_YUYV8_2X8, 108 { MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_YUYV8_2X8,
109 V4L2_MBUS_FMT_YUYV8_2X8, 0, 109 MEDIA_BUS_FMT_YUYV8_2X8, 0,
110 V4L2_PIX_FMT_YUYV, 8, 2, }, 110 V4L2_PIX_FMT_YUYV, 8, 2, },
111 /* Empty entry to catch the unsupported pixel code (0) used by the CCDC 111 /* Empty entry to catch the unsupported pixel code (0) used by the CCDC
112 * module and avoid NULL pointer dereferences. 112 * module and avoid NULL pointer dereferences.
@@ -114,8 +114,7 @@ static struct isp_format_info formats[] = {
114 { 0, } 114 { 0, }
115}; 115};
116 116
117const struct isp_format_info * 117const struct isp_format_info *omap3isp_video_format_info(u32 code)
118omap3isp_video_format_info(enum v4l2_mbus_pixelcode code)
119{ 118{
120 unsigned int i; 119 unsigned int i;
121 120
diff --git a/drivers/media/platform/omap3isp/ispvideo.h b/drivers/media/platform/omap3isp/ispvideo.h
index 0b7efedc3da9..4071dd7060ea 100644
--- a/drivers/media/platform/omap3isp/ispvideo.h
+++ b/drivers/media/platform/omap3isp/ispvideo.h
@@ -44,10 +44,10 @@ struct v4l2_pix_format;
44 * @bpp: Bytes per pixel (when stored in memory) 44 * @bpp: Bytes per pixel (when stored in memory)
45 */ 45 */
46struct isp_format_info { 46struct isp_format_info {
47 enum v4l2_mbus_pixelcode code; 47 u32 code;
48 enum v4l2_mbus_pixelcode truncated; 48 u32 truncated;
49 enum v4l2_mbus_pixelcode uncompressed; 49 u32 uncompressed;
50 enum v4l2_mbus_pixelcode flavor; 50 u32 flavor;
51 u32 pixelformat; 51 u32 pixelformat;
52 unsigned int width; 52 unsigned int width;
53 unsigned int bpp; 53 unsigned int bpp;
@@ -206,6 +206,6 @@ void omap3isp_video_resume(struct isp_video *video, int continuous);
206struct media_pad *omap3isp_video_remote_pad(struct isp_video *video); 206struct media_pad *omap3isp_video_remote_pad(struct isp_video *video);
207 207
208const struct isp_format_info * 208const struct isp_format_info *
209omap3isp_video_format_info(enum v4l2_mbus_pixelcode code); 209omap3isp_video_format_info(u32 code);
210 210
211#endif /* OMAP3_ISP_VIDEO_H */ 211#endif /* OMAP3_ISP_VIDEO_H */
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index 4f81b4c9d113..aa40c8269ab8 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -1218,11 +1218,11 @@ void s3c_camif_unregister_video_node(struct camif_dev *camif, int idx)
1218} 1218}
1219 1219
1220/* Media bus pixel formats supported at the camif input */ 1220/* Media bus pixel formats supported at the camif input */
1221static const enum v4l2_mbus_pixelcode camif_mbus_formats[] = { 1221static const u32 camif_mbus_formats[] = {
1222 V4L2_MBUS_FMT_YUYV8_2X8, 1222 MEDIA_BUS_FMT_YUYV8_2X8,
1223 V4L2_MBUS_FMT_YVYU8_2X8, 1223 MEDIA_BUS_FMT_YVYU8_2X8,
1224 V4L2_MBUS_FMT_UYVY8_2X8, 1224 MEDIA_BUS_FMT_UYVY8_2X8,
1225 V4L2_MBUS_FMT_VYUY8_2X8, 1225 MEDIA_BUS_FMT_VYUY8_2X8,
1226}; 1226};
1227 1227
1228/* 1228/*
diff --git a/drivers/media/platform/s3c-camif/camif-regs.c b/drivers/media/platform/s3c-camif/camif-regs.c
index 6e0c9988a191..812fb3a7c4e3 100644
--- a/drivers/media/platform/s3c-camif/camif-regs.c
+++ b/drivers/media/platform/s3c-camif/camif-regs.c
@@ -96,10 +96,10 @@ void camif_hw_set_effect(struct camif_dev *camif, unsigned int effect,
96} 96}
97 97
98static const u32 src_pixfmt_map[8][2] = { 98static const u32 src_pixfmt_map[8][2] = {
99 { V4L2_MBUS_FMT_YUYV8_2X8, CISRCFMT_ORDER422_YCBYCR }, 99 { MEDIA_BUS_FMT_YUYV8_2X8, CISRCFMT_ORDER422_YCBYCR },
100 { V4L2_MBUS_FMT_YVYU8_2X8, CISRCFMT_ORDER422_YCRYCB }, 100 { MEDIA_BUS_FMT_YVYU8_2X8, CISRCFMT_ORDER422_YCRYCB },
101 { V4L2_MBUS_FMT_UYVY8_2X8, CISRCFMT_ORDER422_CBYCRY }, 101 { MEDIA_BUS_FMT_UYVY8_2X8, CISRCFMT_ORDER422_CBYCRY },
102 { V4L2_MBUS_FMT_VYUY8_2X8, CISRCFMT_ORDER422_CRYCBY }, 102 { MEDIA_BUS_FMT_VYUY8_2X8, CISRCFMT_ORDER422_CRYCBY },
103}; 103};
104 104
105/* Set camera input pixel format and resolution */ 105/* Set camera input pixel format and resolution */
diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c
index 37c8bd694c5f..1d1ef211e113 100644
--- a/drivers/media/platform/s5p-tv/hdmi_drv.c
+++ b/drivers/media/platform/s5p-tv/hdmi_drv.c
@@ -660,7 +660,7 @@ static int hdmi_g_mbus_fmt(struct v4l2_subdev *sd,
660 memset(fmt, 0, sizeof(*fmt)); 660 memset(fmt, 0, sizeof(*fmt));
661 fmt->width = t->hact.end - t->hact.beg; 661 fmt->width = t->hact.end - t->hact.beg;
662 fmt->height = t->vact[0].end - t->vact[0].beg; 662 fmt->height = t->vact[0].end - t->vact[0].beg;
663 fmt->code = V4L2_MBUS_FMT_FIXED; /* means RGB888 */ 663 fmt->code = MEDIA_BUS_FMT_FIXED; /* means RGB888 */
664 fmt->colorspace = V4L2_COLORSPACE_SRGB; 664 fmt->colorspace = V4L2_COLORSPACE_SRGB;
665 if (t->interlaced) { 665 if (t->interlaced) {
666 fmt->field = V4L2_FIELD_INTERLACED; 666 fmt->field = V4L2_FIELD_INTERLACED;
diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c
index 72cf892dd008..46f4d56aaa1b 100644
--- a/drivers/media/platform/s5p-tv/sdo_drv.c
+++ b/drivers/media/platform/s5p-tv/sdo_drv.c
@@ -170,7 +170,7 @@ static int sdo_g_mbus_fmt(struct v4l2_subdev *sd,
170 /* all modes are 720 pixels wide */ 170 /* all modes are 720 pixels wide */
171 fmt->width = 720; 171 fmt->width = 720;
172 fmt->height = sdev->fmt->height; 172 fmt->height = sdev->fmt->height;
173 fmt->code = V4L2_MBUS_FMT_FIXED; 173 fmt->code = MEDIA_BUS_FMT_FIXED;
174 fmt->field = V4L2_FIELD_INTERLACED; 174 fmt->field = V4L2_FIELD_INTERLACED;
175 fmt->colorspace = V4L2_COLORSPACE_JPEG; 175 fmt->colorspace = V4L2_COLORSPACE_JPEG;
176 return 0; 176 return 0;
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index e5f1d4c14f2c..047669609458 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -680,7 +680,7 @@ static int sh_vou_s_fmt_vid_out(struct file *file, void *priv,
680 struct sh_vou_geometry geo; 680 struct sh_vou_geometry geo;
681 struct v4l2_mbus_framefmt mbfmt = { 681 struct v4l2_mbus_framefmt mbfmt = {
682 /* Revisit: is this the correct code? */ 682 /* Revisit: is this the correct code? */
683 .code = V4L2_MBUS_FMT_YUYV8_2X8, 683 .code = MEDIA_BUS_FMT_YUYV8_2X8,
684 .field = V4L2_FIELD_INTERLACED, 684 .field = V4L2_FIELD_INTERLACED,
685 .colorspace = V4L2_COLORSPACE_SMPTE170M, 685 .colorspace = V4L2_COLORSPACE_SMPTE170M,
686 }; 686 };
@@ -733,7 +733,7 @@ static int sh_vou_s_fmt_vid_out(struct file *file, void *priv,
733 /* Sanity checks */ 733 /* Sanity checks */
734 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || 734 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH ||
735 (unsigned)mbfmt.height > img_height_max || 735 (unsigned)mbfmt.height > img_height_max ||
736 mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) 736 mbfmt.code != MEDIA_BUS_FMT_YUYV8_2X8)
737 return -EIO; 737 return -EIO;
738 738
739 if (mbfmt.width != geo.output.width || 739 if (mbfmt.width != geo.output.width ||
@@ -943,7 +943,7 @@ static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a)
943 struct sh_vou_geometry geo; 943 struct sh_vou_geometry geo;
944 struct v4l2_mbus_framefmt mbfmt = { 944 struct v4l2_mbus_framefmt mbfmt = {
945 /* Revisit: is this the correct code? */ 945 /* Revisit: is this the correct code? */
946 .code = V4L2_MBUS_FMT_YUYV8_2X8, 946 .code = MEDIA_BUS_FMT_YUYV8_2X8,
947 .field = V4L2_FIELD_INTERLACED, 947 .field = V4L2_FIELD_INTERLACED,
948 .colorspace = V4L2_COLORSPACE_SMPTE170M, 948 .colorspace = V4L2_COLORSPACE_SMPTE170M,
949 }; 949 };
@@ -994,7 +994,7 @@ static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a)
994 /* Sanity checks */ 994 /* Sanity checks */
995 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || 995 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH ||
996 (unsigned)mbfmt.height > img_height_max || 996 (unsigned)mbfmt.height > img_height_max ||
997 mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) 997 mbfmt.code != MEDIA_BUS_FMT_YUYV8_2X8)
998 return -EIO; 998 return -EIO;
999 999
1000 geo.output.width = mbfmt.width; 1000 geo.output.width = mbfmt.width;
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index c5291b001057..ee5650f4ea2d 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -105,25 +105,25 @@ static u32 isi_readl(struct atmel_isi *isi, u32 reg)
105} 105}
106 106
107static int configure_geometry(struct atmel_isi *isi, u32 width, 107static int configure_geometry(struct atmel_isi *isi, u32 width,
108 u32 height, enum v4l2_mbus_pixelcode code) 108 u32 height, u32 code)
109{ 109{
110 u32 cfg2, cr; 110 u32 cfg2, cr;
111 111
112 switch (code) { 112 switch (code) {
113 /* YUV, including grey */ 113 /* YUV, including grey */
114 case V4L2_MBUS_FMT_Y8_1X8: 114 case MEDIA_BUS_FMT_Y8_1X8:
115 cr = ISI_CFG2_GRAYSCALE; 115 cr = ISI_CFG2_GRAYSCALE;
116 break; 116 break;
117 case V4L2_MBUS_FMT_VYUY8_2X8: 117 case MEDIA_BUS_FMT_VYUY8_2X8:
118 cr = ISI_CFG2_YCC_SWAP_MODE_3; 118 cr = ISI_CFG2_YCC_SWAP_MODE_3;
119 break; 119 break;
120 case V4L2_MBUS_FMT_UYVY8_2X8: 120 case MEDIA_BUS_FMT_UYVY8_2X8:
121 cr = ISI_CFG2_YCC_SWAP_MODE_2; 121 cr = ISI_CFG2_YCC_SWAP_MODE_2;
122 break; 122 break;
123 case V4L2_MBUS_FMT_YVYU8_2X8: 123 case MEDIA_BUS_FMT_YVYU8_2X8:
124 cr = ISI_CFG2_YCC_SWAP_MODE_1; 124 cr = ISI_CFG2_YCC_SWAP_MODE_1;
125 break; 125 break;
126 case V4L2_MBUS_FMT_YUYV8_2X8: 126 case MEDIA_BUS_FMT_YUYV8_2X8:
127 cr = ISI_CFG2_YCC_SWAP_DEFAULT; 127 cr = ISI_CFG2_YCC_SWAP_DEFAULT;
128 break; 128 break;
129 /* RGB, TODO */ 129 /* RGB, TODO */
@@ -645,7 +645,7 @@ static int isi_camera_get_formats(struct soc_camera_device *icd,
645 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 645 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
646 int formats = 0, ret; 646 int formats = 0, ret;
647 /* sensor format */ 647 /* sensor format */
648 enum v4l2_mbus_pixelcode code; 648 u32 code;
649 /* soc camera host format */ 649 /* soc camera host format */
650 const struct soc_mbus_pixelfmt *fmt; 650 const struct soc_mbus_pixelfmt *fmt;
651 651
@@ -670,10 +670,10 @@ static int isi_camera_get_formats(struct soc_camera_device *icd,
670 } 670 }
671 671
672 switch (code) { 672 switch (code) {
673 case V4L2_MBUS_FMT_UYVY8_2X8: 673 case MEDIA_BUS_FMT_UYVY8_2X8:
674 case V4L2_MBUS_FMT_VYUY8_2X8: 674 case MEDIA_BUS_FMT_VYUY8_2X8:
675 case V4L2_MBUS_FMT_YUYV8_2X8: 675 case MEDIA_BUS_FMT_YUYV8_2X8:
676 case V4L2_MBUS_FMT_YVYU8_2X8: 676 case MEDIA_BUS_FMT_YVYU8_2X8:
677 formats++; 677 formats++;
678 if (xlate) { 678 if (xlate) {
679 xlate->host_fmt = &isi_camera_formats[0]; 679 xlate->host_fmt = &isi_camera_formats[0];
diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 2347612a4cc1..ce72bd26a6ac 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -211,7 +211,7 @@ struct emma_prp_resize {
211 211
212/* prp configuration for a client-host fmt pair */ 212/* prp configuration for a client-host fmt pair */
213struct mx2_fmt_cfg { 213struct mx2_fmt_cfg {
214 enum v4l2_mbus_pixelcode in_fmt; 214 u32 in_fmt;
215 u32 out_fmt; 215 u32 out_fmt;
216 struct mx2_prp_cfg cfg; 216 struct mx2_prp_cfg cfg;
217}; 217};
@@ -309,7 +309,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
309 } 309 }
310 }, 310 },
311 { 311 {
312 .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, 312 .in_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
313 .out_fmt = V4L2_PIX_FMT_YUYV, 313 .out_fmt = V4L2_PIX_FMT_YUYV,
314 .cfg = { 314 .cfg = {
315 .channel = 1, 315 .channel = 1,
@@ -323,7 +323,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
323 } 323 }
324 }, 324 },
325 { 325 {
326 .in_fmt = V4L2_MBUS_FMT_YUYV8_2X8, 326 .in_fmt = MEDIA_BUS_FMT_YUYV8_2X8,
327 .out_fmt = V4L2_PIX_FMT_YUYV, 327 .out_fmt = V4L2_PIX_FMT_YUYV,
328 .cfg = { 328 .cfg = {
329 .channel = 1, 329 .channel = 1,
@@ -337,7 +337,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
337 } 337 }
338 }, 338 },
339 { 339 {
340 .in_fmt = V4L2_MBUS_FMT_YUYV8_2X8, 340 .in_fmt = MEDIA_BUS_FMT_YUYV8_2X8,
341 .out_fmt = V4L2_PIX_FMT_YUV420, 341 .out_fmt = V4L2_PIX_FMT_YUV420,
342 .cfg = { 342 .cfg = {
343 .channel = 2, 343 .channel = 2,
@@ -351,7 +351,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
351 } 351 }
352 }, 352 },
353 { 353 {
354 .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, 354 .in_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
355 .out_fmt = V4L2_PIX_FMT_YUV420, 355 .out_fmt = V4L2_PIX_FMT_YUV420,
356 .cfg = { 356 .cfg = {
357 .channel = 2, 357 .channel = 2,
@@ -366,9 +366,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
366 }, 366 },
367}; 367};
368 368
369static struct mx2_fmt_cfg *mx27_emma_prp_get_format( 369static struct mx2_fmt_cfg *mx27_emma_prp_get_format(u32 in_fmt, u32 out_fmt)
370 enum v4l2_mbus_pixelcode in_fmt,
371 u32 out_fmt)
372{ 370{
373 int i; 371 int i;
374 372
@@ -945,7 +943,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
945 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 943 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
946 const struct soc_mbus_pixelfmt *fmt; 944 const struct soc_mbus_pixelfmt *fmt;
947 struct device *dev = icd->parent; 945 struct device *dev = icd->parent;
948 enum v4l2_mbus_pixelcode code; 946 u32 code;
949 int ret, formats = 0; 947 int ret, formats = 0;
950 948
951 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 949 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -959,8 +957,8 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
959 return 0; 957 return 0;
960 } 958 }
961 959
962 if (code == V4L2_MBUS_FMT_YUYV8_2X8 || 960 if (code == MEDIA_BUS_FMT_YUYV8_2X8 ||
963 code == V4L2_MBUS_FMT_UYVY8_2X8) { 961 code == MEDIA_BUS_FMT_UYVY8_2X8) {
964 formats++; 962 formats++;
965 if (xlate) { 963 if (xlate) {
966 /* 964 /*
@@ -968,7 +966,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
968 * soc_mediabus.c 966 * soc_mediabus.c
969 */ 967 */
970 xlate->host_fmt = 968 xlate->host_fmt =
971 soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_1_5X8); 969 soc_mbus_get_fmtdesc(MEDIA_BUS_FMT_YUYV8_1_5X8);
972 xlate->code = code; 970 xlate->code = code;
973 dev_dbg(dev, "Providing host format %s for sensor code %d\n", 971 dev_dbg(dev, "Providing host format %s for sensor code %d\n",
974 xlate->host_fmt->name, code); 972 xlate->host_fmt->name, code);
@@ -976,11 +974,11 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
976 } 974 }
977 } 975 }
978 976
979 if (code == V4L2_MBUS_FMT_UYVY8_2X8) { 977 if (code == MEDIA_BUS_FMT_UYVY8_2X8) {
980 formats++; 978 formats++;
981 if (xlate) { 979 if (xlate) {
982 xlate->host_fmt = 980 xlate->host_fmt =
983 soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_2X8); 981 soc_mbus_get_fmtdesc(MEDIA_BUS_FMT_YUYV8_2X8);
984 xlate->code = code; 982 xlate->code = code;
985 dev_dbg(dev, "Providing host format %s for sensor code %d\n", 983 dev_dbg(dev, "Providing host format %s for sensor code %d\n",
986 xlate->host_fmt->name, code); 984 xlate->host_fmt->name, code);
diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c
index 7696a873510d..8e52ccce66de 100644
--- a/drivers/media/platform/soc_camera/mx3_camera.c
+++ b/drivers/media/platform/soc_camera/mx3_camera.c
@@ -656,7 +656,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
656 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 656 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
657 struct device *dev = icd->parent; 657 struct device *dev = icd->parent;
658 int formats = 0, ret; 658 int formats = 0, ret;
659 enum v4l2_mbus_pixelcode code; 659 u32 code;
660 const struct soc_mbus_pixelfmt *fmt; 660 const struct soc_mbus_pixelfmt *fmt;
661 661
662 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 662 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -677,7 +677,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
677 return 0; 677 return 0;
678 678
679 switch (code) { 679 switch (code) {
680 case V4L2_MBUS_FMT_SBGGR10_1X10: 680 case MEDIA_BUS_FMT_SBGGR10_1X10:
681 formats++; 681 formats++;
682 if (xlate) { 682 if (xlate) {
683 xlate->host_fmt = &mx3_camera_formats[0]; 683 xlate->host_fmt = &mx3_camera_formats[0];
@@ -687,7 +687,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
687 mx3_camera_formats[0].name, code); 687 mx3_camera_formats[0].name, code);
688 } 688 }
689 break; 689 break;
690 case V4L2_MBUS_FMT_Y10_1X10: 690 case MEDIA_BUS_FMT_Y10_1X10:
691 formats++; 691 formats++;
692 if (xlate) { 692 if (xlate) {
693 xlate->host_fmt = &mx3_camera_formats[1]; 693 xlate->host_fmt = &mx3_camera_formats[1];
diff --git a/drivers/media/platform/soc_camera/omap1_camera.c b/drivers/media/platform/soc_camera/omap1_camera.c
index 74ce8b6b79fa..e6b93281f246 100644
--- a/drivers/media/platform/soc_camera/omap1_camera.c
+++ b/drivers/media/platform/soc_camera/omap1_camera.c
@@ -140,7 +140,7 @@
140/* buffer for one video frame */ 140/* buffer for one video frame */
141struct omap1_cam_buf { 141struct omap1_cam_buf {
142 struct videobuf_buffer vb; 142 struct videobuf_buffer vb;
143 enum v4l2_mbus_pixelcode code; 143 u32 code;
144 int inwork; 144 int inwork;
145 struct scatterlist *sgbuf; 145 struct scatterlist *sgbuf;
146 int sgcount; 146 int sgcount;
@@ -980,7 +980,7 @@ static void omap1_cam_clock_stop(struct soc_camera_host *ici)
980/* Duplicate standard formats based on host capability of byte swapping */ 980/* Duplicate standard formats based on host capability of byte swapping */
981static const struct soc_mbus_lookup omap1_cam_formats[] = { 981static const struct soc_mbus_lookup omap1_cam_formats[] = {
982{ 982{
983 .code = V4L2_MBUS_FMT_UYVY8_2X8, 983 .code = MEDIA_BUS_FMT_UYVY8_2X8,
984 .fmt = { 984 .fmt = {
985 .fourcc = V4L2_PIX_FMT_YUYV, 985 .fourcc = V4L2_PIX_FMT_YUYV,
986 .name = "YUYV", 986 .name = "YUYV",
@@ -990,7 +990,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
990 .layout = SOC_MBUS_LAYOUT_PACKED, 990 .layout = SOC_MBUS_LAYOUT_PACKED,
991 }, 991 },
992}, { 992}, {
993 .code = V4L2_MBUS_FMT_VYUY8_2X8, 993 .code = MEDIA_BUS_FMT_VYUY8_2X8,
994 .fmt = { 994 .fmt = {
995 .fourcc = V4L2_PIX_FMT_YVYU, 995 .fourcc = V4L2_PIX_FMT_YVYU,
996 .name = "YVYU", 996 .name = "YVYU",
@@ -1000,7 +1000,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1000 .layout = SOC_MBUS_LAYOUT_PACKED, 1000 .layout = SOC_MBUS_LAYOUT_PACKED,
1001 }, 1001 },
1002}, { 1002}, {
1003 .code = V4L2_MBUS_FMT_YUYV8_2X8, 1003 .code = MEDIA_BUS_FMT_YUYV8_2X8,
1004 .fmt = { 1004 .fmt = {
1005 .fourcc = V4L2_PIX_FMT_UYVY, 1005 .fourcc = V4L2_PIX_FMT_UYVY,
1006 .name = "UYVY", 1006 .name = "UYVY",
@@ -1010,7 +1010,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1010 .layout = SOC_MBUS_LAYOUT_PACKED, 1010 .layout = SOC_MBUS_LAYOUT_PACKED,
1011 }, 1011 },
1012}, { 1012}, {
1013 .code = V4L2_MBUS_FMT_YVYU8_2X8, 1013 .code = MEDIA_BUS_FMT_YVYU8_2X8,
1014 .fmt = { 1014 .fmt = {
1015 .fourcc = V4L2_PIX_FMT_VYUY, 1015 .fourcc = V4L2_PIX_FMT_VYUY,
1016 .name = "VYUY", 1016 .name = "VYUY",
@@ -1020,7 +1020,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1020 .layout = SOC_MBUS_LAYOUT_PACKED, 1020 .layout = SOC_MBUS_LAYOUT_PACKED,
1021 }, 1021 },
1022}, { 1022}, {
1023 .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, 1023 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
1024 .fmt = { 1024 .fmt = {
1025 .fourcc = V4L2_PIX_FMT_RGB555, 1025 .fourcc = V4L2_PIX_FMT_RGB555,
1026 .name = "RGB555", 1026 .name = "RGB555",
@@ -1030,7 +1030,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1030 .layout = SOC_MBUS_LAYOUT_PACKED, 1030 .layout = SOC_MBUS_LAYOUT_PACKED,
1031 }, 1031 },
1032}, { 1032}, {
1033 .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, 1033 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
1034 .fmt = { 1034 .fmt = {
1035 .fourcc = V4L2_PIX_FMT_RGB555X, 1035 .fourcc = V4L2_PIX_FMT_RGB555X,
1036 .name = "RGB555X", 1036 .name = "RGB555X",
@@ -1040,7 +1040,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1040 .layout = SOC_MBUS_LAYOUT_PACKED, 1040 .layout = SOC_MBUS_LAYOUT_PACKED,
1041 }, 1041 },
1042}, { 1042}, {
1043 .code = V4L2_MBUS_FMT_RGB565_2X8_BE, 1043 .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
1044 .fmt = { 1044 .fmt = {
1045 .fourcc = V4L2_PIX_FMT_RGB565, 1045 .fourcc = V4L2_PIX_FMT_RGB565,
1046 .name = "RGB565", 1046 .name = "RGB565",
@@ -1050,7 +1050,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
1050 .layout = SOC_MBUS_LAYOUT_PACKED, 1050 .layout = SOC_MBUS_LAYOUT_PACKED,
1051 }, 1051 },
1052}, { 1052}, {
1053 .code = V4L2_MBUS_FMT_RGB565_2X8_LE, 1053 .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
1054 .fmt = { 1054 .fmt = {
1055 .fourcc = V4L2_PIX_FMT_RGB565X, 1055 .fourcc = V4L2_PIX_FMT_RGB565X,
1056 .name = "RGB565X", 1056 .name = "RGB565X",
@@ -1068,7 +1068,7 @@ static int omap1_cam_get_formats(struct soc_camera_device *icd,
1068 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1068 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1069 struct device *dev = icd->parent; 1069 struct device *dev = icd->parent;
1070 int formats = 0, ret; 1070 int formats = 0, ret;
1071 enum v4l2_mbus_pixelcode code; 1071 u32 code;
1072 const struct soc_mbus_pixelfmt *fmt; 1072 const struct soc_mbus_pixelfmt *fmt;
1073 1073
1074 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 1074 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -1088,14 +1088,14 @@ static int omap1_cam_get_formats(struct soc_camera_device *icd,
1088 return 0; 1088 return 0;
1089 1089
1090 switch (code) { 1090 switch (code) {
1091 case V4L2_MBUS_FMT_YUYV8_2X8: 1091 case MEDIA_BUS_FMT_YUYV8_2X8:
1092 case V4L2_MBUS_FMT_YVYU8_2X8: 1092 case MEDIA_BUS_FMT_YVYU8_2X8:
1093 case V4L2_MBUS_FMT_UYVY8_2X8: 1093 case MEDIA_BUS_FMT_UYVY8_2X8:
1094 case V4L2_MBUS_FMT_VYUY8_2X8: 1094 case MEDIA_BUS_FMT_VYUY8_2X8:
1095 case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: 1095 case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE:
1096 case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: 1096 case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE:
1097 case V4L2_MBUS_FMT_RGB565_2X8_BE: 1097 case MEDIA_BUS_FMT_RGB565_2X8_BE:
1098 case V4L2_MBUS_FMT_RGB565_2X8_LE: 1098 case MEDIA_BUS_FMT_RGB565_2X8_LE:
1099 formats++; 1099 formats++;
1100 if (xlate) { 1100 if (xlate) {
1101 xlate->host_fmt = soc_mbus_find_fmtdesc(code, 1101 xlate->host_fmt = soc_mbus_find_fmtdesc(code,
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
index 66178fc9f9eb..951226af0eba 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -187,7 +187,7 @@ struct pxa_cam_dma {
187struct pxa_buffer { 187struct pxa_buffer {
188 /* common v4l buffer stuff -- must be first */ 188 /* common v4l buffer stuff -- must be first */
189 struct videobuf_buffer vb; 189 struct videobuf_buffer vb;
190 enum v4l2_mbus_pixelcode code; 190 u32 code;
191 /* our descriptor lists for Y, U and V channels */ 191 /* our descriptor lists for Y, U and V channels */
192 struct pxa_cam_dma dmas[3]; 192 struct pxa_cam_dma dmas[3];
193 int inwork; 193 int inwork;
@@ -1253,7 +1253,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id
1253 struct device *dev = icd->parent; 1253 struct device *dev = icd->parent;
1254 int formats = 0, ret; 1254 int formats = 0, ret;
1255 struct pxa_cam *cam; 1255 struct pxa_cam *cam;
1256 enum v4l2_mbus_pixelcode code; 1256 u32 code;
1257 const struct soc_mbus_pixelfmt *fmt; 1257 const struct soc_mbus_pixelfmt *fmt;
1258 1258
1259 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 1259 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -1283,7 +1283,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id
1283 } 1283 }
1284 1284
1285 switch (code) { 1285 switch (code) {
1286 case V4L2_MBUS_FMT_UYVY8_2X8: 1286 case MEDIA_BUS_FMT_UYVY8_2X8:
1287 formats++; 1287 formats++;
1288 if (xlate) { 1288 if (xlate) {
1289 xlate->host_fmt = &pxa_camera_formats[0]; 1289 xlate->host_fmt = &pxa_camera_formats[0];
@@ -1292,11 +1292,11 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id
1292 dev_dbg(dev, "Providing format %s using code %d\n", 1292 dev_dbg(dev, "Providing format %s using code %d\n",
1293 pxa_camera_formats[0].name, code); 1293 pxa_camera_formats[0].name, code);
1294 } 1294 }
1295 case V4L2_MBUS_FMT_VYUY8_2X8: 1295 case MEDIA_BUS_FMT_VYUY8_2X8:
1296 case V4L2_MBUS_FMT_YUYV8_2X8: 1296 case MEDIA_BUS_FMT_YUYV8_2X8:
1297 case V4L2_MBUS_FMT_YVYU8_2X8: 1297 case MEDIA_BUS_FMT_YVYU8_2X8:
1298 case V4L2_MBUS_FMT_RGB565_2X8_LE: 1298 case MEDIA_BUS_FMT_RGB565_2X8_LE:
1299 case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: 1299 case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE:
1300 if (xlate) 1300 if (xlate)
1301 dev_dbg(dev, "Providing format %s packed\n", 1301 dev_dbg(dev, "Providing format %s packed\n",
1302 fmt->name); 1302 fmt->name);
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 20defcb8b31b..8d8438b10b87 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -272,16 +272,16 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
272 272
273 /* input interface */ 273 /* input interface */
274 switch (icd->current_fmt->code) { 274 switch (icd->current_fmt->code) {
275 case V4L2_MBUS_FMT_YUYV8_1X16: 275 case MEDIA_BUS_FMT_YUYV8_1X16:
276 /* BT.601/BT.1358 16bit YCbCr422 */ 276 /* BT.601/BT.1358 16bit YCbCr422 */
277 vnmc |= VNMC_INF_YUV16; 277 vnmc |= VNMC_INF_YUV16;
278 break; 278 break;
279 case V4L2_MBUS_FMT_YUYV8_2X8: 279 case MEDIA_BUS_FMT_YUYV8_2X8:
280 /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ 280 /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */
281 vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? 281 vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ?
282 VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; 282 VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601;
283 break; 283 break;
284 case V4L2_MBUS_FMT_YUYV10_2X10: 284 case MEDIA_BUS_FMT_YUYV10_2X10:
285 /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ 285 /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */
286 vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? 286 vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ?
287 VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601; 287 VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601;
@@ -921,7 +921,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
921 int ret, k, n; 921 int ret, k, n;
922 int formats = 0; 922 int formats = 0;
923 struct rcar_vin_cam *cam; 923 struct rcar_vin_cam *cam;
924 enum v4l2_mbus_pixelcode code; 924 u32 code;
925 const struct soc_mbus_pixelfmt *fmt; 925 const struct soc_mbus_pixelfmt *fmt;
926 926
927 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 927 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -1010,9 +1010,9 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
1010 cam->extra_fmt = NULL; 1010 cam->extra_fmt = NULL;
1011 1011
1012 switch (code) { 1012 switch (code) {
1013 case V4L2_MBUS_FMT_YUYV8_1X16: 1013 case MEDIA_BUS_FMT_YUYV8_1X16:
1014 case V4L2_MBUS_FMT_YUYV8_2X8: 1014 case MEDIA_BUS_FMT_YUYV8_2X8:
1015 case V4L2_MBUS_FMT_YUYV10_2X10: 1015 case MEDIA_BUS_FMT_YUYV10_2X10:
1016 if (cam->extra_fmt) 1016 if (cam->extra_fmt)
1017 break; 1017 break;
1018 1018
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 20ad4a571d37..5f58ed995320 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -149,7 +149,7 @@ struct sh_mobile_ceu_cam {
149 /* Camera cropping rectangle */ 149 /* Camera cropping rectangle */
150 struct v4l2_rect rect; 150 struct v4l2_rect rect;
151 const struct soc_mbus_pixelfmt *extra_fmt; 151 const struct soc_mbus_pixelfmt *extra_fmt;
152 enum v4l2_mbus_pixelcode code; 152 u32 code;
153}; 153};
154 154
155static struct sh_mobile_ceu_buffer *to_ceu_vb(struct vb2_buffer *vb) 155static struct sh_mobile_ceu_buffer *to_ceu_vb(struct vb2_buffer *vb)
@@ -861,16 +861,16 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd)
861 case V4L2_PIX_FMT_NV16: 861 case V4L2_PIX_FMT_NV16:
862 case V4L2_PIX_FMT_NV61: 862 case V4L2_PIX_FMT_NV61:
863 switch (cam->code) { 863 switch (cam->code) {
864 case V4L2_MBUS_FMT_UYVY8_2X8: 864 case MEDIA_BUS_FMT_UYVY8_2X8:
865 value = 0x00000000; /* Cb0, Y0, Cr0, Y1 */ 865 value = 0x00000000; /* Cb0, Y0, Cr0, Y1 */
866 break; 866 break;
867 case V4L2_MBUS_FMT_VYUY8_2X8: 867 case MEDIA_BUS_FMT_VYUY8_2X8:
868 value = 0x00000100; /* Cr0, Y0, Cb0, Y1 */ 868 value = 0x00000100; /* Cr0, Y0, Cb0, Y1 */
869 break; 869 break;
870 case V4L2_MBUS_FMT_YUYV8_2X8: 870 case MEDIA_BUS_FMT_YUYV8_2X8:
871 value = 0x00000200; /* Y0, Cb0, Y1, Cr0 */ 871 value = 0x00000200; /* Y0, Cb0, Y1, Cr0 */
872 break; 872 break;
873 case V4L2_MBUS_FMT_YVYU8_2X8: 873 case MEDIA_BUS_FMT_YVYU8_2X8:
874 value = 0x00000300; /* Y0, Cr0, Y1, Cb0 */ 874 value = 0x00000300; /* Y0, Cr0, Y1, Cb0 */
875 break; 875 break;
876 default: 876 default:
@@ -1048,7 +1048,7 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int
1048 int ret, k, n; 1048 int ret, k, n;
1049 int formats = 0; 1049 int formats = 0;
1050 struct sh_mobile_ceu_cam *cam; 1050 struct sh_mobile_ceu_cam *cam;
1051 enum v4l2_mbus_pixelcode code; 1051 u32 code;
1052 const struct soc_mbus_pixelfmt *fmt; 1052 const struct soc_mbus_pixelfmt *fmt;
1053 1053
1054 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); 1054 ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
@@ -1141,10 +1141,10 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int
1141 cam->extra_fmt = NULL; 1141 cam->extra_fmt = NULL;
1142 1142
1143 switch (code) { 1143 switch (code) {
1144 case V4L2_MBUS_FMT_UYVY8_2X8: 1144 case MEDIA_BUS_FMT_UYVY8_2X8:
1145 case V4L2_MBUS_FMT_VYUY8_2X8: 1145 case MEDIA_BUS_FMT_VYUY8_2X8:
1146 case V4L2_MBUS_FMT_YUYV8_2X8: 1146 case MEDIA_BUS_FMT_YUYV8_2X8:
1147 case V4L2_MBUS_FMT_YVYU8_2X8: 1147 case MEDIA_BUS_FMT_YVYU8_2X8:
1148 if (cam->extra_fmt) 1148 if (cam->extra_fmt)
1149 break; 1149 break;
1150 1150
diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
index 05dd21a35d63..c738e27a75d7 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
@@ -59,28 +59,28 @@ static int sh_csi2_try_fmt(struct v4l2_subdev *sd,
59 switch (pdata->type) { 59 switch (pdata->type) {
60 case SH_CSI2C: 60 case SH_CSI2C:
61 switch (mf->code) { 61 switch (mf->code) {
62 case V4L2_MBUS_FMT_UYVY8_2X8: /* YUV422 */ 62 case MEDIA_BUS_FMT_UYVY8_2X8: /* YUV422 */
63 case V4L2_MBUS_FMT_YUYV8_1_5X8: /* YUV420 */ 63 case MEDIA_BUS_FMT_YUYV8_1_5X8: /* YUV420 */
64 case V4L2_MBUS_FMT_Y8_1X8: /* RAW8 */ 64 case MEDIA_BUS_FMT_Y8_1X8: /* RAW8 */
65 case V4L2_MBUS_FMT_SBGGR8_1X8: 65 case MEDIA_BUS_FMT_SBGGR8_1X8:
66 case V4L2_MBUS_FMT_SGRBG8_1X8: 66 case MEDIA_BUS_FMT_SGRBG8_1X8:
67 break; 67 break;
68 default: 68 default:
69 /* All MIPI CSI-2 devices must support one of primary formats */ 69 /* All MIPI CSI-2 devices must support one of primary formats */
70 mf->code = V4L2_MBUS_FMT_YUYV8_2X8; 70 mf->code = MEDIA_BUS_FMT_YUYV8_2X8;
71 } 71 }
72 break; 72 break;
73 case SH_CSI2I: 73 case SH_CSI2I:
74 switch (mf->code) { 74 switch (mf->code) {
75 case V4L2_MBUS_FMT_Y8_1X8: /* RAW8 */ 75 case MEDIA_BUS_FMT_Y8_1X8: /* RAW8 */
76 case V4L2_MBUS_FMT_SBGGR8_1X8: 76 case MEDIA_BUS_FMT_SBGGR8_1X8:
77 case V4L2_MBUS_FMT_SGRBG8_1X8: 77 case MEDIA_BUS_FMT_SGRBG8_1X8:
78 case V4L2_MBUS_FMT_SBGGR10_1X10: /* RAW10 */ 78 case MEDIA_BUS_FMT_SBGGR10_1X10: /* RAW10 */
79 case V4L2_MBUS_FMT_SBGGR12_1X12: /* RAW12 */ 79 case MEDIA_BUS_FMT_SBGGR12_1X12: /* RAW12 */
80 break; 80 break;
81 default: 81 default:
82 /* All MIPI CSI-2 devices must support one of primary formats */ 82 /* All MIPI CSI-2 devices must support one of primary formats */
83 mf->code = V4L2_MBUS_FMT_SBGGR8_1X8; 83 mf->code = MEDIA_BUS_FMT_SBGGR8_1X8;
84 } 84 }
85 break; 85 break;
86 } 86 }
@@ -104,21 +104,21 @@ static int sh_csi2_s_fmt(struct v4l2_subdev *sd,
104 return -EINVAL; 104 return -EINVAL;
105 105
106 switch (mf->code) { 106 switch (mf->code) {
107 case V4L2_MBUS_FMT_UYVY8_2X8: 107 case MEDIA_BUS_FMT_UYVY8_2X8:
108 tmp |= 0x1e; /* YUV422 8 bit */ 108 tmp |= 0x1e; /* YUV422 8 bit */
109 break; 109 break;
110 case V4L2_MBUS_FMT_YUYV8_1_5X8: 110 case MEDIA_BUS_FMT_YUYV8_1_5X8:
111 tmp |= 0x18; /* YUV420 8 bit */ 111 tmp |= 0x18; /* YUV420 8 bit */
112 break; 112 break;
113 case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: 113 case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE:
114 tmp |= 0x21; /* RGB555 */ 114 tmp |= 0x21; /* RGB555 */
115 break; 115 break;
116 case V4L2_MBUS_FMT_RGB565_2X8_BE: 116 case MEDIA_BUS_FMT_RGB565_2X8_BE:
117 tmp |= 0x22; /* RGB565 */ 117 tmp |= 0x22; /* RGB565 */
118 break; 118 break;
119 case V4L2_MBUS_FMT_Y8_1X8: 119 case MEDIA_BUS_FMT_Y8_1X8:
120 case V4L2_MBUS_FMT_SBGGR8_1X8: 120 case MEDIA_BUS_FMT_SBGGR8_1X8:
121 case V4L2_MBUS_FMT_SGRBG8_1X8: 121 case MEDIA_BUS_FMT_SGRBG8_1X8:
122 tmp |= 0x2a; /* RAW8 */ 122 tmp |= 0x2a; /* RAW8 */
123 break; 123 break;
124 default: 124 default:
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 8e61b976da19..f4be2a1c659a 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -460,7 +460,7 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd)
460 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 460 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
461 unsigned int i, fmts = 0, raw_fmts = 0; 461 unsigned int i, fmts = 0, raw_fmts = 0;
462 int ret; 462 int ret;
463 enum v4l2_mbus_pixelcode code; 463 u32 code;
464 464
465 while (!v4l2_subdev_call(sd, video, enum_mbus_fmt, raw_fmts, &code)) 465 while (!v4l2_subdev_call(sd, video, enum_mbus_fmt, raw_fmts, &code))
466 raw_fmts++; 466 raw_fmts++;
diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c b/drivers/media/platform/soc_camera/soc_camera_platform.c
index ceaddfb85e49..f2ce1ab06d53 100644
--- a/drivers/media/platform/soc_camera/soc_camera_platform.c
+++ b/drivers/media/platform/soc_camera/soc_camera_platform.c
@@ -62,7 +62,7 @@ static struct v4l2_subdev_core_ops platform_subdev_core_ops = {
62}; 62};
63 63
64static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int index, 64static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
65 enum v4l2_mbus_pixelcode *code) 65 u32 *code)
66{ 66{
67 struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); 67 struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
68 68
diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
index dc02deca7563..1dbcd426683c 100644
--- a/drivers/media/platform/soc_camera/soc_mediabus.c
+++ b/drivers/media/platform/soc_camera/soc_mediabus.c
@@ -17,7 +17,7 @@
17 17
18static const struct soc_mbus_lookup mbus_fmt[] = { 18static const struct soc_mbus_lookup mbus_fmt[] = {
19{ 19{
20 .code = V4L2_MBUS_FMT_YUYV8_2X8, 20 .code = MEDIA_BUS_FMT_YUYV8_2X8,
21 .fmt = { 21 .fmt = {
22 .fourcc = V4L2_PIX_FMT_YUYV, 22 .fourcc = V4L2_PIX_FMT_YUYV,
23 .name = "YUYV", 23 .name = "YUYV",
@@ -27,7 +27,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
27 .layout = SOC_MBUS_LAYOUT_PACKED, 27 .layout = SOC_MBUS_LAYOUT_PACKED,
28 }, 28 },
29}, { 29}, {
30 .code = V4L2_MBUS_FMT_YVYU8_2X8, 30 .code = MEDIA_BUS_FMT_YVYU8_2X8,
31 .fmt = { 31 .fmt = {
32 .fourcc = V4L2_PIX_FMT_YVYU, 32 .fourcc = V4L2_PIX_FMT_YVYU,
33 .name = "YVYU", 33 .name = "YVYU",
@@ -37,7 +37,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
37 .layout = SOC_MBUS_LAYOUT_PACKED, 37 .layout = SOC_MBUS_LAYOUT_PACKED,
38 }, 38 },
39}, { 39}, {
40 .code = V4L2_MBUS_FMT_UYVY8_2X8, 40 .code = MEDIA_BUS_FMT_UYVY8_2X8,
41 .fmt = { 41 .fmt = {
42 .fourcc = V4L2_PIX_FMT_UYVY, 42 .fourcc = V4L2_PIX_FMT_UYVY,
43 .name = "UYVY", 43 .name = "UYVY",
@@ -47,7 +47,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
47 .layout = SOC_MBUS_LAYOUT_PACKED, 47 .layout = SOC_MBUS_LAYOUT_PACKED,
48 }, 48 },
49}, { 49}, {
50 .code = V4L2_MBUS_FMT_VYUY8_2X8, 50 .code = MEDIA_BUS_FMT_VYUY8_2X8,
51 .fmt = { 51 .fmt = {
52 .fourcc = V4L2_PIX_FMT_VYUY, 52 .fourcc = V4L2_PIX_FMT_VYUY,
53 .name = "VYUY", 53 .name = "VYUY",
@@ -57,7 +57,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
57 .layout = SOC_MBUS_LAYOUT_PACKED, 57 .layout = SOC_MBUS_LAYOUT_PACKED,
58 }, 58 },
59}, { 59}, {
60 .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, 60 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
61 .fmt = { 61 .fmt = {
62 .fourcc = V4L2_PIX_FMT_RGB555, 62 .fourcc = V4L2_PIX_FMT_RGB555,
63 .name = "RGB555", 63 .name = "RGB555",
@@ -67,7 +67,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
67 .layout = SOC_MBUS_LAYOUT_PACKED, 67 .layout = SOC_MBUS_LAYOUT_PACKED,
68 }, 68 },
69}, { 69}, {
70 .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, 70 .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
71 .fmt = { 71 .fmt = {
72 .fourcc = V4L2_PIX_FMT_RGB555X, 72 .fourcc = V4L2_PIX_FMT_RGB555X,
73 .name = "RGB555X", 73 .name = "RGB555X",
@@ -77,7 +77,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
77 .layout = SOC_MBUS_LAYOUT_PACKED, 77 .layout = SOC_MBUS_LAYOUT_PACKED,
78 }, 78 },
79}, { 79}, {
80 .code = V4L2_MBUS_FMT_RGB565_2X8_LE, 80 .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
81 .fmt = { 81 .fmt = {
82 .fourcc = V4L2_PIX_FMT_RGB565, 82 .fourcc = V4L2_PIX_FMT_RGB565,
83 .name = "RGB565", 83 .name = "RGB565",
@@ -87,7 +87,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
87 .layout = SOC_MBUS_LAYOUT_PACKED, 87 .layout = SOC_MBUS_LAYOUT_PACKED,
88 }, 88 },
89}, { 89}, {
90 .code = V4L2_MBUS_FMT_RGB565_2X8_BE, 90 .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
91 .fmt = { 91 .fmt = {
92 .fourcc = V4L2_PIX_FMT_RGB565X, 92 .fourcc = V4L2_PIX_FMT_RGB565X,
93 .name = "RGB565X", 93 .name = "RGB565X",
@@ -97,7 +97,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
97 .layout = SOC_MBUS_LAYOUT_PACKED, 97 .layout = SOC_MBUS_LAYOUT_PACKED,
98 }, 98 },
99}, { 99}, {
100 .code = V4L2_MBUS_FMT_RGB666_1X18, 100 .code = MEDIA_BUS_FMT_RGB666_1X18,
101 .fmt = { 101 .fmt = {
102 .fourcc = V4L2_PIX_FMT_RGB32, 102 .fourcc = V4L2_PIX_FMT_RGB32,
103 .name = "RGB666/32bpp", 103 .name = "RGB666/32bpp",
@@ -106,7 +106,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
106 .order = SOC_MBUS_ORDER_LE, 106 .order = SOC_MBUS_ORDER_LE,
107 }, 107 },
108}, { 108}, {
109 .code = V4L2_MBUS_FMT_RGB888_1X24, 109 .code = MEDIA_BUS_FMT_RGB888_1X24,
110 .fmt = { 110 .fmt = {
111 .fourcc = V4L2_PIX_FMT_RGB32, 111 .fourcc = V4L2_PIX_FMT_RGB32,
112 .name = "RGB888/32bpp", 112 .name = "RGB888/32bpp",
@@ -115,7 +115,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
115 .order = SOC_MBUS_ORDER_LE, 115 .order = SOC_MBUS_ORDER_LE,
116 }, 116 },
117}, { 117}, {
118 .code = V4L2_MBUS_FMT_RGB888_2X12_BE, 118 .code = MEDIA_BUS_FMT_RGB888_2X12_BE,
119 .fmt = { 119 .fmt = {
120 .fourcc = V4L2_PIX_FMT_RGB32, 120 .fourcc = V4L2_PIX_FMT_RGB32,
121 .name = "RGB888/32bpp", 121 .name = "RGB888/32bpp",
@@ -124,7 +124,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
124 .order = SOC_MBUS_ORDER_BE, 124 .order = SOC_MBUS_ORDER_BE,
125 }, 125 },
126}, { 126}, {
127 .code = V4L2_MBUS_FMT_RGB888_2X12_LE, 127 .code = MEDIA_BUS_FMT_RGB888_2X12_LE,
128 .fmt = { 128 .fmt = {
129 .fourcc = V4L2_PIX_FMT_RGB32, 129 .fourcc = V4L2_PIX_FMT_RGB32,
130 .name = "RGB888/32bpp", 130 .name = "RGB888/32bpp",
@@ -133,7 +133,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
133 .order = SOC_MBUS_ORDER_LE, 133 .order = SOC_MBUS_ORDER_LE,
134 }, 134 },
135}, { 135}, {
136 .code = V4L2_MBUS_FMT_SBGGR8_1X8, 136 .code = MEDIA_BUS_FMT_SBGGR8_1X8,
137 .fmt = { 137 .fmt = {
138 .fourcc = V4L2_PIX_FMT_SBGGR8, 138 .fourcc = V4L2_PIX_FMT_SBGGR8,
139 .name = "Bayer 8 BGGR", 139 .name = "Bayer 8 BGGR",
@@ -143,7 +143,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
143 .layout = SOC_MBUS_LAYOUT_PACKED, 143 .layout = SOC_MBUS_LAYOUT_PACKED,
144 }, 144 },
145}, { 145}, {
146 .code = V4L2_MBUS_FMT_SBGGR10_1X10, 146 .code = MEDIA_BUS_FMT_SBGGR10_1X10,
147 .fmt = { 147 .fmt = {
148 .fourcc = V4L2_PIX_FMT_SBGGR10, 148 .fourcc = V4L2_PIX_FMT_SBGGR10,
149 .name = "Bayer 10 BGGR", 149 .name = "Bayer 10 BGGR",
@@ -153,7 +153,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
153 .layout = SOC_MBUS_LAYOUT_PACKED, 153 .layout = SOC_MBUS_LAYOUT_PACKED,
154 }, 154 },
155}, { 155}, {
156 .code = V4L2_MBUS_FMT_Y8_1X8, 156 .code = MEDIA_BUS_FMT_Y8_1X8,
157 .fmt = { 157 .fmt = {
158 .fourcc = V4L2_PIX_FMT_GREY, 158 .fourcc = V4L2_PIX_FMT_GREY,
159 .name = "Grey", 159 .name = "Grey",
@@ -163,7 +163,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
163 .layout = SOC_MBUS_LAYOUT_PACKED, 163 .layout = SOC_MBUS_LAYOUT_PACKED,
164 }, 164 },
165}, { 165}, {
166 .code = V4L2_MBUS_FMT_Y10_1X10, 166 .code = MEDIA_BUS_FMT_Y10_1X10,
167 .fmt = { 167 .fmt = {
168 .fourcc = V4L2_PIX_FMT_Y10, 168 .fourcc = V4L2_PIX_FMT_Y10,
169 .name = "Grey 10bit", 169 .name = "Grey 10bit",
@@ -173,7 +173,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
173 .layout = SOC_MBUS_LAYOUT_PACKED, 173 .layout = SOC_MBUS_LAYOUT_PACKED,
174 }, 174 },
175}, { 175}, {
176 .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, 176 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,
177 .fmt = { 177 .fmt = {
178 .fourcc = V4L2_PIX_FMT_SBGGR10, 178 .fourcc = V4L2_PIX_FMT_SBGGR10,
179 .name = "Bayer 10 BGGR", 179 .name = "Bayer 10 BGGR",
@@ -183,7 +183,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
183 .layout = SOC_MBUS_LAYOUT_PACKED, 183 .layout = SOC_MBUS_LAYOUT_PACKED,
184 }, 184 },
185}, { 185}, {
186 .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, 186 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,
187 .fmt = { 187 .fmt = {
188 .fourcc = V4L2_PIX_FMT_SBGGR10, 188 .fourcc = V4L2_PIX_FMT_SBGGR10,
189 .name = "Bayer 10 BGGR", 189 .name = "Bayer 10 BGGR",
@@ -193,7 +193,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
193 .layout = SOC_MBUS_LAYOUT_PACKED, 193 .layout = SOC_MBUS_LAYOUT_PACKED,
194 }, 194 },
195}, { 195}, {
196 .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, 196 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,
197 .fmt = { 197 .fmt = {
198 .fourcc = V4L2_PIX_FMT_SBGGR10, 198 .fourcc = V4L2_PIX_FMT_SBGGR10,
199 .name = "Bayer 10 BGGR", 199 .name = "Bayer 10 BGGR",
@@ -203,7 +203,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
203 .layout = SOC_MBUS_LAYOUT_PACKED, 203 .layout = SOC_MBUS_LAYOUT_PACKED,
204 }, 204 },
205}, { 205}, {
206 .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, 206 .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,
207 .fmt = { 207 .fmt = {
208 .fourcc = V4L2_PIX_FMT_SBGGR10, 208 .fourcc = V4L2_PIX_FMT_SBGGR10,
209 .name = "Bayer 10 BGGR", 209 .name = "Bayer 10 BGGR",
@@ -213,7 +213,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
213 .layout = SOC_MBUS_LAYOUT_PACKED, 213 .layout = SOC_MBUS_LAYOUT_PACKED,
214 }, 214 },
215}, { 215}, {
216 .code = V4L2_MBUS_FMT_JPEG_1X8, 216 .code = MEDIA_BUS_FMT_JPEG_1X8,
217 .fmt = { 217 .fmt = {
218 .fourcc = V4L2_PIX_FMT_JPEG, 218 .fourcc = V4L2_PIX_FMT_JPEG,
219 .name = "JPEG", 219 .name = "JPEG",
@@ -223,7 +223,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
223 .layout = SOC_MBUS_LAYOUT_PACKED, 223 .layout = SOC_MBUS_LAYOUT_PACKED,
224 }, 224 },
225}, { 225}, {
226 .code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, 226 .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
227 .fmt = { 227 .fmt = {
228 .fourcc = V4L2_PIX_FMT_RGB444, 228 .fourcc = V4L2_PIX_FMT_RGB444,
229 .name = "RGB444", 229 .name = "RGB444",
@@ -233,7 +233,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
233 .layout = SOC_MBUS_LAYOUT_PACKED, 233 .layout = SOC_MBUS_LAYOUT_PACKED,
234 }, 234 },
235}, { 235}, {
236 .code = V4L2_MBUS_FMT_YUYV8_1_5X8, 236 .code = MEDIA_BUS_FMT_YUYV8_1_5X8,
237 .fmt = { 237 .fmt = {
238 .fourcc = V4L2_PIX_FMT_YUV420, 238 .fourcc = V4L2_PIX_FMT_YUV420,
239 .name = "YUYV 4:2:0", 239 .name = "YUYV 4:2:0",
@@ -243,7 +243,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
243 .layout = SOC_MBUS_LAYOUT_PACKED, 243 .layout = SOC_MBUS_LAYOUT_PACKED,
244 }, 244 },
245}, { 245}, {
246 .code = V4L2_MBUS_FMT_YVYU8_1_5X8, 246 .code = MEDIA_BUS_FMT_YVYU8_1_5X8,
247 .fmt = { 247 .fmt = {
248 .fourcc = V4L2_PIX_FMT_YVU420, 248 .fourcc = V4L2_PIX_FMT_YVU420,
249 .name = "YVYU 4:2:0", 249 .name = "YVYU 4:2:0",
@@ -253,7 +253,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
253 .layout = SOC_MBUS_LAYOUT_PACKED, 253 .layout = SOC_MBUS_LAYOUT_PACKED,
254 }, 254 },
255}, { 255}, {
256 .code = V4L2_MBUS_FMT_UYVY8_1X16, 256 .code = MEDIA_BUS_FMT_UYVY8_1X16,
257 .fmt = { 257 .fmt = {
258 .fourcc = V4L2_PIX_FMT_UYVY, 258 .fourcc = V4L2_PIX_FMT_UYVY,
259 .name = "UYVY 16bit", 259 .name = "UYVY 16bit",
@@ -263,7 +263,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
263 .layout = SOC_MBUS_LAYOUT_PACKED, 263 .layout = SOC_MBUS_LAYOUT_PACKED,
264 }, 264 },
265}, { 265}, {
266 .code = V4L2_MBUS_FMT_VYUY8_1X16, 266 .code = MEDIA_BUS_FMT_VYUY8_1X16,
267 .fmt = { 267 .fmt = {
268 .fourcc = V4L2_PIX_FMT_VYUY, 268 .fourcc = V4L2_PIX_FMT_VYUY,
269 .name = "VYUY 16bit", 269 .name = "VYUY 16bit",
@@ -273,7 +273,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
273 .layout = SOC_MBUS_LAYOUT_PACKED, 273 .layout = SOC_MBUS_LAYOUT_PACKED,
274 }, 274 },
275}, { 275}, {
276 .code = V4L2_MBUS_FMT_YUYV8_1X16, 276 .code = MEDIA_BUS_FMT_YUYV8_1X16,
277 .fmt = { 277 .fmt = {
278 .fourcc = V4L2_PIX_FMT_YUYV, 278 .fourcc = V4L2_PIX_FMT_YUYV,
279 .name = "YUYV 16bit", 279 .name = "YUYV 16bit",
@@ -283,7 +283,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
283 .layout = SOC_MBUS_LAYOUT_PACKED, 283 .layout = SOC_MBUS_LAYOUT_PACKED,
284 }, 284 },
285}, { 285}, {
286 .code = V4L2_MBUS_FMT_YVYU8_1X16, 286 .code = MEDIA_BUS_FMT_YVYU8_1X16,
287 .fmt = { 287 .fmt = {
288 .fourcc = V4L2_PIX_FMT_YVYU, 288 .fourcc = V4L2_PIX_FMT_YVYU,
289 .name = "YVYU 16bit", 289 .name = "YVYU 16bit",
@@ -293,7 +293,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
293 .layout = SOC_MBUS_LAYOUT_PACKED, 293 .layout = SOC_MBUS_LAYOUT_PACKED,
294 }, 294 },
295}, { 295}, {
296 .code = V4L2_MBUS_FMT_SGRBG8_1X8, 296 .code = MEDIA_BUS_FMT_SGRBG8_1X8,
297 .fmt = { 297 .fmt = {
298 .fourcc = V4L2_PIX_FMT_SGRBG8, 298 .fourcc = V4L2_PIX_FMT_SGRBG8,
299 .name = "Bayer 8 GRBG", 299 .name = "Bayer 8 GRBG",
@@ -303,7 +303,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
303 .layout = SOC_MBUS_LAYOUT_PACKED, 303 .layout = SOC_MBUS_LAYOUT_PACKED,
304 }, 304 },
305}, { 305}, {
306 .code = V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, 306 .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
307 .fmt = { 307 .fmt = {
308 .fourcc = V4L2_PIX_FMT_SGRBG10DPCM8, 308 .fourcc = V4L2_PIX_FMT_SGRBG10DPCM8,
309 .name = "Bayer 10 BGGR DPCM 8", 309 .name = "Bayer 10 BGGR DPCM 8",
@@ -313,7 +313,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
313 .layout = SOC_MBUS_LAYOUT_PACKED, 313 .layout = SOC_MBUS_LAYOUT_PACKED,
314 }, 314 },
315}, { 315}, {
316 .code = V4L2_MBUS_FMT_SGBRG10_1X10, 316 .code = MEDIA_BUS_FMT_SGBRG10_1X10,
317 .fmt = { 317 .fmt = {
318 .fourcc = V4L2_PIX_FMT_SGBRG10, 318 .fourcc = V4L2_PIX_FMT_SGBRG10,
319 .name = "Bayer 10 GBRG", 319 .name = "Bayer 10 GBRG",
@@ -323,7 +323,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
323 .layout = SOC_MBUS_LAYOUT_PACKED, 323 .layout = SOC_MBUS_LAYOUT_PACKED,
324 }, 324 },
325}, { 325}, {
326 .code = V4L2_MBUS_FMT_SGRBG10_1X10, 326 .code = MEDIA_BUS_FMT_SGRBG10_1X10,
327 .fmt = { 327 .fmt = {
328 .fourcc = V4L2_PIX_FMT_SGRBG10, 328 .fourcc = V4L2_PIX_FMT_SGRBG10,
329 .name = "Bayer 10 GRBG", 329 .name = "Bayer 10 GRBG",
@@ -333,7 +333,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
333 .layout = SOC_MBUS_LAYOUT_PACKED, 333 .layout = SOC_MBUS_LAYOUT_PACKED,
334 }, 334 },
335}, { 335}, {
336 .code = V4L2_MBUS_FMT_SRGGB10_1X10, 336 .code = MEDIA_BUS_FMT_SRGGB10_1X10,
337 .fmt = { 337 .fmt = {
338 .fourcc = V4L2_PIX_FMT_SRGGB10, 338 .fourcc = V4L2_PIX_FMT_SRGGB10,
339 .name = "Bayer 10 RGGB", 339 .name = "Bayer 10 RGGB",
@@ -343,7 +343,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
343 .layout = SOC_MBUS_LAYOUT_PACKED, 343 .layout = SOC_MBUS_LAYOUT_PACKED,
344 }, 344 },
345}, { 345}, {
346 .code = V4L2_MBUS_FMT_SBGGR12_1X12, 346 .code = MEDIA_BUS_FMT_SBGGR12_1X12,
347 .fmt = { 347 .fmt = {
348 .fourcc = V4L2_PIX_FMT_SBGGR12, 348 .fourcc = V4L2_PIX_FMT_SBGGR12,
349 .name = "Bayer 12 BGGR", 349 .name = "Bayer 12 BGGR",
@@ -353,7 +353,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
353 .layout = SOC_MBUS_LAYOUT_PACKED, 353 .layout = SOC_MBUS_LAYOUT_PACKED,
354 }, 354 },
355}, { 355}, {
356 .code = V4L2_MBUS_FMT_SGBRG12_1X12, 356 .code = MEDIA_BUS_FMT_SGBRG12_1X12,
357 .fmt = { 357 .fmt = {
358 .fourcc = V4L2_PIX_FMT_SGBRG12, 358 .fourcc = V4L2_PIX_FMT_SGBRG12,
359 .name = "Bayer 12 GBRG", 359 .name = "Bayer 12 GBRG",
@@ -363,7 +363,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
363 .layout = SOC_MBUS_LAYOUT_PACKED, 363 .layout = SOC_MBUS_LAYOUT_PACKED,
364 }, 364 },
365}, { 365}, {
366 .code = V4L2_MBUS_FMT_SGRBG12_1X12, 366 .code = MEDIA_BUS_FMT_SGRBG12_1X12,
367 .fmt = { 367 .fmt = {
368 .fourcc = V4L2_PIX_FMT_SGRBG12, 368 .fourcc = V4L2_PIX_FMT_SGRBG12,
369 .name = "Bayer 12 GRBG", 369 .name = "Bayer 12 GRBG",
@@ -373,7 +373,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
373 .layout = SOC_MBUS_LAYOUT_PACKED, 373 .layout = SOC_MBUS_LAYOUT_PACKED,
374 }, 374 },
375}, { 375}, {
376 .code = V4L2_MBUS_FMT_SRGGB12_1X12, 376 .code = MEDIA_BUS_FMT_SRGGB12_1X12,
377 .fmt = { 377 .fmt = {
378 .fourcc = V4L2_PIX_FMT_SRGGB12, 378 .fourcc = V4L2_PIX_FMT_SRGGB12,
379 .name = "Bayer 12 RGGB", 379 .name = "Bayer 12 RGGB",
@@ -458,7 +458,7 @@ s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf,
458EXPORT_SYMBOL(soc_mbus_image_size); 458EXPORT_SYMBOL(soc_mbus_image_size);
459 459
460const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( 460const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
461 enum v4l2_mbus_pixelcode code, 461 u32 code,
462 const struct soc_mbus_lookup *lookup, 462 const struct soc_mbus_lookup *lookup,
463 int n) 463 int n)
464{ 464{
@@ -473,7 +473,7 @@ const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
473EXPORT_SYMBOL(soc_mbus_find_fmtdesc); 473EXPORT_SYMBOL(soc_mbus_find_fmtdesc);
474 474
475const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( 475const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
476 enum v4l2_mbus_pixelcode code) 476 u32 code)
477{ 477{
478 return soc_mbus_find_fmtdesc(code, mbus_fmt, ARRAY_SIZE(mbus_fmt)); 478 return soc_mbus_find_fmtdesc(code, mbus_fmt, ARRAY_SIZE(mbus_fmt));
479} 479}
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index ae6870cb8339..2616483fce0b 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -101,7 +101,7 @@ struct via_camera {
101 */ 101 */
102 struct v4l2_pix_format sensor_format; 102 struct v4l2_pix_format sensor_format;
103 struct v4l2_pix_format user_format; 103 struct v4l2_pix_format user_format;
104 enum v4l2_mbus_pixelcode mbus_code; 104 u32 mbus_code;
105}; 105};
106 106
107/* 107/*
@@ -143,12 +143,12 @@ static struct via_format {
143 __u8 *desc; 143 __u8 *desc;
144 __u32 pixelformat; 144 __u32 pixelformat;
145 int bpp; /* Bytes per pixel */ 145 int bpp; /* Bytes per pixel */
146 enum v4l2_mbus_pixelcode mbus_code; 146 u32 mbus_code;
147} via_formats[] = { 147} via_formats[] = {
148 { 148 {
149 .desc = "YUYV 4:2:2", 149 .desc = "YUYV 4:2:2",
150 .pixelformat = V4L2_PIX_FMT_YUYV, 150 .pixelformat = V4L2_PIX_FMT_YUYV,
151 .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, 151 .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
152 .bpp = 2, 152 .bpp = 2,
153 }, 153 },
154 /* RGB444 and Bayer should be doable, but have never been 154 /* RGB444 and Bayer should be doable, but have never been
@@ -849,7 +849,7 @@ static const struct v4l2_pix_format viacam_def_pix_format = {
849 .sizeimage = VGA_WIDTH * VGA_HEIGHT * 2, 849 .sizeimage = VGA_WIDTH * VGA_HEIGHT * 2,
850}; 850};
851 851
852static const enum v4l2_mbus_pixelcode via_def_mbus_code = V4L2_MBUS_FMT_YUYV8_2X8; 852static const u32 via_def_mbus_code = MEDIA_BUS_FMT_YUYV8_2X8;
853 853
854static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv, 854static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv,
855 struct v4l2_fmtdesc *fmt) 855 struct v4l2_fmtdesc *fmt)
diff --git a/drivers/media/platform/vsp1/vsp1_bru.c b/drivers/media/platform/vsp1/vsp1_bru.c
index a0c1984c733e..b21f381a9862 100644
--- a/drivers/media/platform/vsp1/vsp1_bru.c
+++ b/drivers/media/platform/vsp1/vsp1_bru.c
@@ -187,8 +187,8 @@ static int bru_enum_mbus_code(struct v4l2_subdev *subdev,
187 struct v4l2_subdev_mbus_code_enum *code) 187 struct v4l2_subdev_mbus_code_enum *code)
188{ 188{
189 static const unsigned int codes[] = { 189 static const unsigned int codes[] = {
190 V4L2_MBUS_FMT_ARGB8888_1X32, 190 MEDIA_BUS_FMT_ARGB8888_1X32,
191 V4L2_MBUS_FMT_AYUV8_1X32, 191 MEDIA_BUS_FMT_AYUV8_1X32,
192 }; 192 };
193 struct v4l2_mbus_framefmt *format; 193 struct v4l2_mbus_framefmt *format;
194 194
@@ -215,8 +215,8 @@ static int bru_enum_frame_size(struct v4l2_subdev *subdev,
215 if (fse->index) 215 if (fse->index)
216 return -EINVAL; 216 return -EINVAL;
217 217
218 if (fse->code != V4L2_MBUS_FMT_ARGB8888_1X32 && 218 if (fse->code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
219 fse->code != V4L2_MBUS_FMT_AYUV8_1X32) 219 fse->code != MEDIA_BUS_FMT_AYUV8_1X32)
220 return -EINVAL; 220 return -EINVAL;
221 221
222 fse->min_width = BRU_MIN_SIZE; 222 fse->min_width = BRU_MIN_SIZE;
@@ -261,9 +261,9 @@ static void bru_try_format(struct vsp1_bru *bru, struct v4l2_subdev_fh *fh,
261 switch (pad) { 261 switch (pad) {
262 case BRU_PAD_SINK(0): 262 case BRU_PAD_SINK(0):
263 /* Default to YUV if the requested format is not supported. */ 263 /* Default to YUV if the requested format is not supported. */
264 if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && 264 if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
265 fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) 265 fmt->code != MEDIA_BUS_FMT_AYUV8_1X32)
266 fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; 266 fmt->code = MEDIA_BUS_FMT_AYUV8_1X32;
267 break; 267 break;
268 268
269 default: 269 default:
diff --git a/drivers/media/platform/vsp1/vsp1_hsit.c b/drivers/media/platform/vsp1/vsp1_hsit.c
index db2950a73c60..80bedc554ee3 100644
--- a/drivers/media/platform/vsp1/vsp1_hsit.c
+++ b/drivers/media/platform/vsp1/vsp1_hsit.c
@@ -70,9 +70,9 @@ static int hsit_enum_mbus_code(struct v4l2_subdev *subdev,
70 70
71 if ((code->pad == HSIT_PAD_SINK && !hsit->inverse) | 71 if ((code->pad == HSIT_PAD_SINK && !hsit->inverse) |
72 (code->pad == HSIT_PAD_SOURCE && hsit->inverse)) 72 (code->pad == HSIT_PAD_SOURCE && hsit->inverse))
73 code->code = V4L2_MBUS_FMT_ARGB8888_1X32; 73 code->code = MEDIA_BUS_FMT_ARGB8888_1X32;
74 else 74 else
75 code->code = V4L2_MBUS_FMT_AHSV8888_1X32; 75 code->code = MEDIA_BUS_FMT_AHSV8888_1X32;
76 76
77 return 0; 77 return 0;
78} 78}
@@ -136,8 +136,8 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
136 return 0; 136 return 0;
137 } 137 }
138 138
139 format->code = hsit->inverse ? V4L2_MBUS_FMT_AHSV8888_1X32 139 format->code = hsit->inverse ? MEDIA_BUS_FMT_AHSV8888_1X32
140 : V4L2_MBUS_FMT_ARGB8888_1X32; 140 : MEDIA_BUS_FMT_ARGB8888_1X32;
141 format->width = clamp_t(unsigned int, fmt->format.width, 141 format->width = clamp_t(unsigned int, fmt->format.width,
142 HSIT_MIN_SIZE, HSIT_MAX_SIZE); 142 HSIT_MIN_SIZE, HSIT_MAX_SIZE);
143 format->height = clamp_t(unsigned int, fmt->format.height, 143 format->height = clamp_t(unsigned int, fmt->format.height,
@@ -151,8 +151,8 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
151 format = vsp1_entity_get_pad_format(&hsit->entity, fh, HSIT_PAD_SOURCE, 151 format = vsp1_entity_get_pad_format(&hsit->entity, fh, HSIT_PAD_SOURCE,
152 fmt->which); 152 fmt->which);
153 *format = fmt->format; 153 *format = fmt->format;
154 format->code = hsit->inverse ? V4L2_MBUS_FMT_ARGB8888_1X32 154 format->code = hsit->inverse ? MEDIA_BUS_FMT_ARGB8888_1X32
155 : V4L2_MBUS_FMT_AHSV8888_1X32; 155 : MEDIA_BUS_FMT_AHSV8888_1X32;
156 156
157 return 0; 157 return 0;
158} 158}
diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c
index d4fb23e9c4a8..17a6ca7dafe6 100644
--- a/drivers/media/platform/vsp1/vsp1_lif.c
+++ b/drivers/media/platform/vsp1/vsp1_lif.c
@@ -78,8 +78,8 @@ static int lif_enum_mbus_code(struct v4l2_subdev *subdev,
78 struct v4l2_subdev_mbus_code_enum *code) 78 struct v4l2_subdev_mbus_code_enum *code)
79{ 79{
80 static const unsigned int codes[] = { 80 static const unsigned int codes[] = {
81 V4L2_MBUS_FMT_ARGB8888_1X32, 81 MEDIA_BUS_FMT_ARGB8888_1X32,
82 V4L2_MBUS_FMT_AYUV8_1X32, 82 MEDIA_BUS_FMT_AYUV8_1X32,
83 }; 83 };
84 84
85 if (code->pad == LIF_PAD_SINK) { 85 if (code->pad == LIF_PAD_SINK) {
@@ -147,9 +147,9 @@ static int lif_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh,
147 struct v4l2_mbus_framefmt *format; 147 struct v4l2_mbus_framefmt *format;
148 148
149 /* Default to YUV if the requested format is not supported. */ 149 /* Default to YUV if the requested format is not supported. */
150 if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && 150 if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
151 fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) 151 fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
152 fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; 152 fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
153 153
154 format = vsp1_entity_get_pad_format(&lif->entity, fh, fmt->pad, 154 format = vsp1_entity_get_pad_format(&lif->entity, fh, fmt->pad,
155 fmt->which); 155 fmt->which);
diff --git a/drivers/media/platform/vsp1/vsp1_lut.c b/drivers/media/platform/vsp1/vsp1_lut.c
index fea36ebe2565..6f185c3621fe 100644
--- a/drivers/media/platform/vsp1/vsp1_lut.c
+++ b/drivers/media/platform/vsp1/vsp1_lut.c
@@ -86,9 +86,9 @@ static int lut_enum_mbus_code(struct v4l2_subdev *subdev,
86 struct v4l2_subdev_mbus_code_enum *code) 86 struct v4l2_subdev_mbus_code_enum *code)
87{ 87{
88 static const unsigned int codes[] = { 88 static const unsigned int codes[] = {
89 V4L2_MBUS_FMT_ARGB8888_1X32, 89 MEDIA_BUS_FMT_ARGB8888_1X32,
90 V4L2_MBUS_FMT_AHSV8888_1X32, 90 MEDIA_BUS_FMT_AHSV8888_1X32,
91 V4L2_MBUS_FMT_AYUV8_1X32, 91 MEDIA_BUS_FMT_AYUV8_1X32,
92 }; 92 };
93 struct v4l2_mbus_framefmt *format; 93 struct v4l2_mbus_framefmt *format;
94 94
@@ -158,10 +158,10 @@ static int lut_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh,
158 struct v4l2_mbus_framefmt *format; 158 struct v4l2_mbus_framefmt *format;
159 159
160 /* Default to YUV if the requested format is not supported. */ 160 /* Default to YUV if the requested format is not supported. */
161 if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && 161 if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
162 fmt->format.code != V4L2_MBUS_FMT_AHSV8888_1X32 && 162 fmt->format.code != MEDIA_BUS_FMT_AHSV8888_1X32 &&
163 fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) 163 fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
164 fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; 164 fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
165 165
166 format = vsp1_entity_get_pad_format(&lut->entity, fh, fmt->pad, 166 format = vsp1_entity_get_pad_format(&lut->entity, fh, fmt->pad,
167 fmt->which); 167 fmt->which);
diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c b/drivers/media/platform/vsp1/vsp1_rwpf.c
index ec3dab6a9b9b..1f1ba26a834a 100644
--- a/drivers/media/platform/vsp1/vsp1_rwpf.c
+++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
@@ -29,8 +29,8 @@ int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
29 struct v4l2_subdev_mbus_code_enum *code) 29 struct v4l2_subdev_mbus_code_enum *code)
30{ 30{
31 static const unsigned int codes[] = { 31 static const unsigned int codes[] = {
32 V4L2_MBUS_FMT_ARGB8888_1X32, 32 MEDIA_BUS_FMT_ARGB8888_1X32,
33 V4L2_MBUS_FMT_AYUV8_1X32, 33 MEDIA_BUS_FMT_AYUV8_1X32,
34 }; 34 };
35 35
36 if (code->index >= ARRAY_SIZE(codes)) 36 if (code->index >= ARRAY_SIZE(codes))
@@ -103,9 +103,9 @@ int vsp1_rwpf_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh,
103 struct v4l2_rect *crop; 103 struct v4l2_rect *crop;
104 104
105 /* Default to YUV if the requested format is not supported. */ 105 /* Default to YUV if the requested format is not supported. */
106 if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && 106 if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
107 fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) 107 fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
108 fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; 108 fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
109 109
110 format = vsp1_entity_get_pad_format(&rwpf->entity, fh, fmt->pad, 110 format = vsp1_entity_get_pad_format(&rwpf->entity, fh, fmt->pad,
111 fmt->which); 111 fmt->which);
diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c
index b7d3c8b9f189..1129494c7cfc 100644
--- a/drivers/media/platform/vsp1/vsp1_sru.c
+++ b/drivers/media/platform/vsp1/vsp1_sru.c
@@ -139,7 +139,7 @@ static int sru_s_stream(struct v4l2_subdev *subdev, int enable)
139 input = &sru->entity.formats[SRU_PAD_SINK]; 139 input = &sru->entity.formats[SRU_PAD_SINK];
140 output = &sru->entity.formats[SRU_PAD_SOURCE]; 140 output = &sru->entity.formats[SRU_PAD_SOURCE];
141 141
142 if (input->code == V4L2_MBUS_FMT_ARGB8888_1X32) 142 if (input->code == MEDIA_BUS_FMT_ARGB8888_1X32)
143 ctrl0 = VI6_SRU_CTRL0_PARAM2 | VI6_SRU_CTRL0_PARAM3 143 ctrl0 = VI6_SRU_CTRL0_PARAM2 | VI6_SRU_CTRL0_PARAM3
144 | VI6_SRU_CTRL0_PARAM4; 144 | VI6_SRU_CTRL0_PARAM4;
145 else 145 else
@@ -170,8 +170,8 @@ static int sru_enum_mbus_code(struct v4l2_subdev *subdev,
170 struct v4l2_subdev_mbus_code_enum *code) 170 struct v4l2_subdev_mbus_code_enum *code)
171{ 171{
172 static const unsigned int codes[] = { 172 static const unsigned int codes[] = {
173 V4L2_MBUS_FMT_ARGB8888_1X32, 173 MEDIA_BUS_FMT_ARGB8888_1X32,
174 V4L2_MBUS_FMT_AYUV8_1X32, 174 MEDIA_BUS_FMT_AYUV8_1X32,
175 }; 175 };
176 struct v4l2_mbus_framefmt *format; 176 struct v4l2_mbus_framefmt *format;
177 177
@@ -248,9 +248,9 @@ static void sru_try_format(struct vsp1_sru *sru, struct v4l2_subdev_fh *fh,
248 switch (pad) { 248 switch (pad) {
249 case SRU_PAD_SINK: 249 case SRU_PAD_SINK:
250 /* Default to YUV if the requested format is not supported. */ 250 /* Default to YUV if the requested format is not supported. */
251 if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && 251 if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
252 fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) 252 fmt->code != MEDIA_BUS_FMT_AYUV8_1X32)
253 fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; 253 fmt->code = MEDIA_BUS_FMT_AYUV8_1X32;
254 254
255 fmt->width = clamp(fmt->width, SRU_MIN_SIZE, SRU_MAX_SIZE); 255 fmt->width = clamp(fmt->width, SRU_MIN_SIZE, SRU_MAX_SIZE);
256 fmt->height = clamp(fmt->height, SRU_MIN_SIZE, SRU_MAX_SIZE); 256 fmt->height = clamp(fmt->height, SRU_MIN_SIZE, SRU_MAX_SIZE);
diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
index de92ef4944b3..a4afec133800 100644
--- a/drivers/media/platform/vsp1/vsp1_uds.c
+++ b/drivers/media/platform/vsp1/vsp1_uds.c
@@ -173,8 +173,8 @@ static int uds_enum_mbus_code(struct v4l2_subdev *subdev,
173 struct v4l2_subdev_mbus_code_enum *code) 173 struct v4l2_subdev_mbus_code_enum *code)
174{ 174{
175 static const unsigned int codes[] = { 175 static const unsigned int codes[] = {
176 V4L2_MBUS_FMT_ARGB8888_1X32, 176 MEDIA_BUS_FMT_ARGB8888_1X32,
177 V4L2_MBUS_FMT_AYUV8_1X32, 177 MEDIA_BUS_FMT_AYUV8_1X32,
178 }; 178 };
179 179
180 if (code->pad == UDS_PAD_SINK) { 180 if (code->pad == UDS_PAD_SINK) {
@@ -246,9 +246,9 @@ static void uds_try_format(struct vsp1_uds *uds, struct v4l2_subdev_fh *fh,
246 switch (pad) { 246 switch (pad) {
247 case UDS_PAD_SINK: 247 case UDS_PAD_SINK:
248 /* Default to YUV if the requested format is not supported. */ 248 /* Default to YUV if the requested format is not supported. */
249 if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && 249 if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 &&
250 fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) 250 fmt->code != MEDIA_BUS_FMT_AYUV8_1X32)
251 fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; 251 fmt->code = MEDIA_BUS_FMT_AYUV8_1X32;
252 252
253 fmt->width = clamp(fmt->width, UDS_MIN_SIZE, UDS_MAX_SIZE); 253 fmt->width = clamp(fmt->width, UDS_MIN_SIZE, UDS_MAX_SIZE);
254 fmt->height = clamp(fmt->height, UDS_MIN_SIZE, UDS_MAX_SIZE); 254 fmt->height = clamp(fmt->height, UDS_MIN_SIZE, UDS_MAX_SIZE);
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 915a20eb003e..d91f19a9e1c1 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -48,85 +48,85 @@
48 */ 48 */
49 49
50static const struct vsp1_format_info vsp1_video_formats[] = { 50static const struct vsp1_format_info vsp1_video_formats[] = {
51 { V4L2_PIX_FMT_RGB332, V4L2_MBUS_FMT_ARGB8888_1X32, 51 { V4L2_PIX_FMT_RGB332, MEDIA_BUS_FMT_ARGB8888_1X32,
52 VI6_FMT_RGB_332, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 52 VI6_FMT_RGB_332, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
53 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 53 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
54 1, { 8, 0, 0 }, false, false, 1, 1, false }, 54 1, { 8, 0, 0 }, false, false, 1, 1, false },
55 { V4L2_PIX_FMT_ARGB444, V4L2_MBUS_FMT_ARGB8888_1X32, 55 { V4L2_PIX_FMT_ARGB444, MEDIA_BUS_FMT_ARGB8888_1X32,
56 VI6_FMT_ARGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 56 VI6_FMT_ARGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
57 VI6_RPF_DSWAP_P_WDS, 57 VI6_RPF_DSWAP_P_WDS,
58 1, { 16, 0, 0 }, false, false, 1, 1, true }, 58 1, { 16, 0, 0 }, false, false, 1, 1, true },
59 { V4L2_PIX_FMT_XRGB444, V4L2_MBUS_FMT_ARGB8888_1X32, 59 { V4L2_PIX_FMT_XRGB444, MEDIA_BUS_FMT_ARGB8888_1X32,
60 VI6_FMT_XRGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 60 VI6_FMT_XRGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
61 VI6_RPF_DSWAP_P_WDS, 61 VI6_RPF_DSWAP_P_WDS,
62 1, { 16, 0, 0 }, false, false, 1, 1, true }, 62 1, { 16, 0, 0 }, false, false, 1, 1, true },
63 { V4L2_PIX_FMT_ARGB555, V4L2_MBUS_FMT_ARGB8888_1X32, 63 { V4L2_PIX_FMT_ARGB555, MEDIA_BUS_FMT_ARGB8888_1X32,
64 VI6_FMT_ARGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 64 VI6_FMT_ARGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
65 VI6_RPF_DSWAP_P_WDS, 65 VI6_RPF_DSWAP_P_WDS,
66 1, { 16, 0, 0 }, false, false, 1, 1, true }, 66 1, { 16, 0, 0 }, false, false, 1, 1, true },
67 { V4L2_PIX_FMT_XRGB555, V4L2_MBUS_FMT_ARGB8888_1X32, 67 { V4L2_PIX_FMT_XRGB555, MEDIA_BUS_FMT_ARGB8888_1X32,
68 VI6_FMT_XRGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 68 VI6_FMT_XRGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
69 VI6_RPF_DSWAP_P_WDS, 69 VI6_RPF_DSWAP_P_WDS,
70 1, { 16, 0, 0 }, false, false, 1, 1, false }, 70 1, { 16, 0, 0 }, false, false, 1, 1, false },
71 { V4L2_PIX_FMT_RGB565, V4L2_MBUS_FMT_ARGB8888_1X32, 71 { V4L2_PIX_FMT_RGB565, MEDIA_BUS_FMT_ARGB8888_1X32,
72 VI6_FMT_RGB_565, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 72 VI6_FMT_RGB_565, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
73 VI6_RPF_DSWAP_P_WDS, 73 VI6_RPF_DSWAP_P_WDS,
74 1, { 16, 0, 0 }, false, false, 1, 1, false }, 74 1, { 16, 0, 0 }, false, false, 1, 1, false },
75 { V4L2_PIX_FMT_BGR24, V4L2_MBUS_FMT_ARGB8888_1X32, 75 { V4L2_PIX_FMT_BGR24, MEDIA_BUS_FMT_ARGB8888_1X32,
76 VI6_FMT_BGR_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 76 VI6_FMT_BGR_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
77 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 77 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
78 1, { 24, 0, 0 }, false, false, 1, 1, false }, 78 1, { 24, 0, 0 }, false, false, 1, 1, false },
79 { V4L2_PIX_FMT_RGB24, V4L2_MBUS_FMT_ARGB8888_1X32, 79 { V4L2_PIX_FMT_RGB24, MEDIA_BUS_FMT_ARGB8888_1X32,
80 VI6_FMT_RGB_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 80 VI6_FMT_RGB_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
81 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 81 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
82 1, { 24, 0, 0 }, false, false, 1, 1, false }, 82 1, { 24, 0, 0 }, false, false, 1, 1, false },
83 { V4L2_PIX_FMT_ABGR32, V4L2_MBUS_FMT_ARGB8888_1X32, 83 { V4L2_PIX_FMT_ABGR32, MEDIA_BUS_FMT_ARGB8888_1X32,
84 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS, 84 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS,
85 1, { 32, 0, 0 }, false, false, 1, 1, true }, 85 1, { 32, 0, 0 }, false, false, 1, 1, true },
86 { V4L2_PIX_FMT_XBGR32, V4L2_MBUS_FMT_ARGB8888_1X32, 86 { V4L2_PIX_FMT_XBGR32, MEDIA_BUS_FMT_ARGB8888_1X32,
87 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS, 87 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS,
88 1, { 32, 0, 0 }, false, false, 1, 1, false }, 88 1, { 32, 0, 0 }, false, false, 1, 1, false },
89 { V4L2_PIX_FMT_ARGB32, V4L2_MBUS_FMT_ARGB8888_1X32, 89 { V4L2_PIX_FMT_ARGB32, MEDIA_BUS_FMT_ARGB8888_1X32,
90 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 90 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
91 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 91 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
92 1, { 32, 0, 0 }, false, false, 1, 1, true }, 92 1, { 32, 0, 0 }, false, false, 1, 1, true },
93 { V4L2_PIX_FMT_XRGB32, V4L2_MBUS_FMT_ARGB8888_1X32, 93 { V4L2_PIX_FMT_XRGB32, MEDIA_BUS_FMT_ARGB8888_1X32,
94 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 94 VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
95 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 95 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
96 1, { 32, 0, 0 }, false, false, 1, 1, false }, 96 1, { 32, 0, 0 }, false, false, 1, 1, false },
97 { V4L2_PIX_FMT_UYVY, V4L2_MBUS_FMT_AYUV8_1X32, 97 { V4L2_PIX_FMT_UYVY, MEDIA_BUS_FMT_AYUV8_1X32,
98 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 98 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
99 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 99 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
100 1, { 16, 0, 0 }, false, false, 2, 1, false }, 100 1, { 16, 0, 0 }, false, false, 2, 1, false },
101 { V4L2_PIX_FMT_VYUY, V4L2_MBUS_FMT_AYUV8_1X32, 101 { V4L2_PIX_FMT_VYUY, MEDIA_BUS_FMT_AYUV8_1X32,
102 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 102 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
103 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 103 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
104 1, { 16, 0, 0 }, false, true, 2, 1, false }, 104 1, { 16, 0, 0 }, false, true, 2, 1, false },
105 { V4L2_PIX_FMT_YUYV, V4L2_MBUS_FMT_AYUV8_1X32, 105 { V4L2_PIX_FMT_YUYV, MEDIA_BUS_FMT_AYUV8_1X32,
106 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 106 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
107 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 107 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
108 1, { 16, 0, 0 }, true, false, 2, 1, false }, 108 1, { 16, 0, 0 }, true, false, 2, 1, false },
109 { V4L2_PIX_FMT_YVYU, V4L2_MBUS_FMT_AYUV8_1X32, 109 { V4L2_PIX_FMT_YVYU, MEDIA_BUS_FMT_AYUV8_1X32,
110 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 110 VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
111 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 111 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
112 1, { 16, 0, 0 }, true, true, 2, 1, false }, 112 1, { 16, 0, 0 }, true, true, 2, 1, false },
113 { V4L2_PIX_FMT_NV12M, V4L2_MBUS_FMT_AYUV8_1X32, 113 { V4L2_PIX_FMT_NV12M, MEDIA_BUS_FMT_AYUV8_1X32,
114 VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 114 VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
115 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 115 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
116 2, { 8, 16, 0 }, false, false, 2, 2, false }, 116 2, { 8, 16, 0 }, false, false, 2, 2, false },
117 { V4L2_PIX_FMT_NV21M, V4L2_MBUS_FMT_AYUV8_1X32, 117 { V4L2_PIX_FMT_NV21M, MEDIA_BUS_FMT_AYUV8_1X32,
118 VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 118 VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
119 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 119 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
120 2, { 8, 16, 0 }, false, true, 2, 2, false }, 120 2, { 8, 16, 0 }, false, true, 2, 2, false },
121 { V4L2_PIX_FMT_NV16M, V4L2_MBUS_FMT_AYUV8_1X32, 121 { V4L2_PIX_FMT_NV16M, MEDIA_BUS_FMT_AYUV8_1X32,
122 VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 122 VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
123 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 123 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
124 2, { 8, 16, 0 }, false, false, 2, 1, false }, 124 2, { 8, 16, 0 }, false, false, 2, 1, false },
125 { V4L2_PIX_FMT_NV61M, V4L2_MBUS_FMT_AYUV8_1X32, 125 { V4L2_PIX_FMT_NV61M, MEDIA_BUS_FMT_AYUV8_1X32,
126 VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 126 VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
127 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 127 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
128 2, { 8, 16, 0 }, false, true, 2, 1, false }, 128 2, { 8, 16, 0 }, false, true, 2, 1, false },
129 { V4L2_PIX_FMT_YUV420M, V4L2_MBUS_FMT_AYUV8_1X32, 129 { V4L2_PIX_FMT_YUV420M, MEDIA_BUS_FMT_AYUV8_1X32,
130 VI6_FMT_Y_U_V_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | 130 VI6_FMT_Y_U_V_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS |
131 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 131 VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS,
132 3, { 8, 8, 8 }, false, false, 2, 2, false }, 132 3, { 8, 8, 8 }, false, false, 2, 2, false },
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
index 57585c7004a4..4376beeb28c2 100644
--- a/include/media/davinci/vpbe.h
+++ b/include/media/davinci/vpbe.h
@@ -63,7 +63,7 @@ struct vpbe_output {
63 * output basis. If per mode is needed, we may have to move this to 63 * output basis. If per mode is needed, we may have to move this to
64 * mode_info structure 64 * mode_info structure
65 */ 65 */
66 enum v4l2_mbus_pixelcode if_params; 66 u32 if_params;
67}; 67};
68 68
69/* encoder configuration info */ 69/* encoder configuration info */
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
index 476fafc2f522..3dbd20026107 100644
--- a/include/media/davinci/vpbe_venc.h
+++ b/include/media/davinci/vpbe_venc.h
@@ -30,11 +30,10 @@
30#define VENC_SECOND_FIELD BIT(2) 30#define VENC_SECOND_FIELD BIT(2)
31 31
32struct venc_platform_data { 32struct venc_platform_data {
33 int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, 33 int (*setup_pinmux)(u32 if_type, int field);
34 int field);
35 int (*setup_clock)(enum vpbe_enc_timings_type type, 34 int (*setup_clock)(enum vpbe_enc_timings_type type,
36 unsigned int pixclock); 35 unsigned int pixclock);
37 int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode); 36 int (*setup_if_config)(u32 pixcode);
38 /* Number of LCD outputs supported */ 37 /* Number of LCD outputs supported */
39 int num_lcd_outputs; 38 int num_lcd_outputs;
40 struct vpbe_if_params *lcd_if_params; 39 struct vpbe_if_params *lcd_if_params;
diff --git a/include/media/exynos-fimc.h b/include/media/exynos-fimc.h
index aa44660e2041..69bcd2a07d5c 100644
--- a/include/media/exynos-fimc.h
+++ b/include/media/exynos-fimc.h
@@ -101,7 +101,7 @@ struct fimc_source_info {
101 * @flags: flags indicating which operation mode format applies to 101 * @flags: flags indicating which operation mode format applies to
102 */ 102 */
103struct fimc_fmt { 103struct fimc_fmt {
104 enum v4l2_mbus_pixelcode mbus_code; 104 u32 mbus_code;
105 char *name; 105 char *name;
106 u32 fourcc; 106 u32 fourcc;
107 u32 color; 107 u32 color;
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 865246b00127..2f6261f3e570 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -296,7 +296,7 @@ const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
296 * format setup. 296 * format setup.
297 */ 297 */
298struct soc_camera_format_xlate { 298struct soc_camera_format_xlate {
299 enum v4l2_mbus_pixelcode code; 299 u32 code;
300 const struct soc_mbus_pixelfmt *host_fmt; 300 const struct soc_mbus_pixelfmt *host_fmt;
301}; 301};
302 302
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index d33f6d059692..2ff773785fb6 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -91,16 +91,16 @@ struct soc_mbus_pixelfmt {
91 * @fmt: pixel format description 91 * @fmt: pixel format description
92 */ 92 */
93struct soc_mbus_lookup { 93struct soc_mbus_lookup {
94 enum v4l2_mbus_pixelcode code; 94 u32 code;
95 struct soc_mbus_pixelfmt fmt; 95 struct soc_mbus_pixelfmt fmt;
96}; 96};
97 97
98const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( 98const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
99 enum v4l2_mbus_pixelcode code, 99 u32 code,
100 const struct soc_mbus_lookup *lookup, 100 const struct soc_mbus_lookup *lookup,
101 int n); 101 int n);
102const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( 102const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
103 enum v4l2_mbus_pixelcode code); 103 u32 code);
104s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); 104s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
105s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, 105s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf,
106 u32 bytes_per_line, u32 height); 106 u32 bytes_per_line, u32 height);