Skip to content

Commit 27ffaeb

Browse files
Boris BREZILLONmchehab
authored andcommitted
[media] platform: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all platform drivers. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1 parent 43ba464 commit 27ffaeb

59 files changed

Lines changed: 483 additions & 495 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/video4linux/soc-camera.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to
151151
conveniently manage these formats. A table of standard transformations is
152152
maintained by soc-camera core, which describes, what FOURCC pixel format will
153153
be obtained, if a media-bus pixel format is stored in memory according to
154-
certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
154+
certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
155155
sample and stored in memory in the little-endian order with no gaps between
156156
bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These
157157
standard transformations will be used by soc-camera or by camera host drivers to

‎arch/arm/mach-davinci/board-dm355-evm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static struct vpbe_output dm355evm_vpbe_outputs[] = {
294294
.default_mode = "ntsc",
295295
.num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing),
296296
.modes = dm355evm_enc_preset_timing,
297-
.if_params = V4L2_MBUS_FMT_FIXED,
297+
.if_params = MEDIA_BUS_FMT_FIXED,
298298
},
299299
};
300300

‎arch/arm/mach-davinci/board-dm365-evm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
485485
.default_mode = "ntsc",
486486
.num_modes = ARRAY_SIZE(dm365evm_enc_std_timing),
487487
.modes = dm365evm_enc_std_timing,
488-
.if_params = V4L2_MBUS_FMT_FIXED,
488+
.if_params = MEDIA_BUS_FMT_FIXED,
489489
},
490490
{
491491
.output = {
@@ -498,7 +498,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
498498
.default_mode = "480p59_94",
499499
.num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing),
500500
.modes = dm365evm_enc_preset_timing,
501-
.if_params = V4L2_MBUS_FMT_FIXED,
501+
.if_params = MEDIA_BUS_FMT_FIXED,
502502
},
503503
};
504504

‎arch/arm/mach-davinci/dm355.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,14 +785,13 @@ static struct resource dm355_v4l2_disp_resources[] = {
785785
},
786786
};
787787

788-
static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
789-
int field)
788+
static int dm355_vpbe_setup_pinmux(u32 if_type, int field)
790789
{
791790
switch (if_type) {
792-
case V4L2_MBUS_FMT_SGRBG8_1X8:
791+
case MEDIA_BUS_FMT_SGRBG8_1X8:
793792
davinci_cfg_reg(DM355_VOUT_FIELD_G70);
794793
break;
795-
case V4L2_MBUS_FMT_YUYV10_1X20:
794+
case MEDIA_BUS_FMT_YUYV10_1X20:
796795
if (field)
797796
davinci_cfg_reg(DM355_VOUT_FIELD);
798797
else

‎arch/arm/mach-davinci/dm365.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,16 +1306,15 @@ static struct resource dm365_v4l2_disp_resources[] = {
13061306
},
13071307
};
13081308

1309-
static int dm365_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
1310-
int field)
1309+
static int dm365_vpbe_setup_pinmux(u32 if_type, int field)
13111310
{
13121311
switch (if_type) {
1313-
case V4L2_MBUS_FMT_SGRBG8_1X8:
1312+
case MEDIA_BUS_FMT_SGRBG8_1X8:
13141313
davinci_cfg_reg(DM365_VOUT_FIELD_G81);
13151314
davinci_cfg_reg(DM365_VOUT_COUTL_EN);
13161315
davinci_cfg_reg(DM365_VOUT_COUTH_EN);
13171316
break;
1318-
case V4L2_MBUS_FMT_YUYV10_1X20:
1317+
case MEDIA_BUS_FMT_YUYV10_1X20:
13191318
if (field)
13201319
davinci_cfg_reg(DM365_VOUT_FIELD);
13211320
else

‎arch/arm/mach-shmobile/board-mackerel.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static struct soc_camera_platform_info camera_info = {
11531153
.format_name = "UYVY",
11541154
.format_depth = 16,
11551155
.format = {
1156-
.code = V4L2_MBUS_FMT_UYVY8_2X8,
1156+
.code = MEDIA_BUS_FMT_UYVY8_2X8,
11571157
.colorspace = V4L2_COLORSPACE_SMPTE170M,
11581158
.field = V4L2_FIELD_NONE,
11591159
.width = 640,

‎arch/sh/boards/mach-ap325rxa/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static struct soc_camera_platform_info camera_info = {
338338
.format_name = "UYVY",
339339
.format_depth = 16,
340340
.format = {
341-
.code = V4L2_MBUS_FMT_UYVY8_2X8,
341+
.code = MEDIA_BUS_FMT_UYVY8_2X8,
342342
.colorspace = V4L2_COLORSPACE_SMPTE170M,
343343
.field = V4L2_FIELD_NONE,
344344
.width = 640,

‎drivers/media/platform/blackfin/bfin_capture.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
struct bcap_format {
5050
char *desc;
5151
u32 pixelformat;
52-
enum v4l2_mbus_pixelcode mbus_code;
52+
u32 mbus_code;
5353
int bpp; /* bits per pixel */
5454
int dlen; /* data length for ppi in bits */
5555
};
@@ -116,35 +116,35 @@ static const struct bcap_format bcap_formats[] = {
116116
{
117117
.desc = "YCbCr 4:2:2 Interleaved UYVY",
118118
.pixelformat = V4L2_PIX_FMT_UYVY,
119-
.mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
119+
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
120120
.bpp = 16,
121121
.dlen = 8,
122122
},
123123
{
124124
.desc = "YCbCr 4:2:2 Interleaved YUYV",
125125
.pixelformat = V4L2_PIX_FMT_YUYV,
126-
.mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
126+
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
127127
.bpp = 16,
128128
.dlen = 8,
129129
},
130130
{
131131
.desc = "YCbCr 4:2:2 Interleaved UYVY",
132132
.pixelformat = V4L2_PIX_FMT_UYVY,
133-
.mbus_code = V4L2_MBUS_FMT_UYVY8_1X16,
133+
.mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
134134
.bpp = 16,
135135
.dlen = 16,
136136
},
137137
{
138138
.desc = "RGB 565",
139139
.pixelformat = V4L2_PIX_FMT_RGB565,
140-
.mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE,
140+
.mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE,
141141
.bpp = 16,
142142
.dlen = 8,
143143
},
144144
{
145145
.desc = "RGB 444",
146146
.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,
148148
.bpp = 16,
149149
.dlen = 8,
150150
},
@@ -161,7 +161,7 @@ static struct bcap_buffer *to_bcap_vb(struct vb2_buffer *vb)
161161

162162
static int bcap_init_sensor_formats(struct bcap_device *bcap_dev)
163163
{
164-
enum v4l2_mbus_pixelcode code;
164+
u32 code;
165165
struct bcap_format *sf;
166166
unsigned int num_formats = 0;
167167
int i, j;

‎drivers/media/platform/davinci/vpbe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index)
227227
vpbe_current_encoder_info(vpbe_dev);
228228
struct vpbe_config *cfg = vpbe_dev->cfg;
229229
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
230-
enum v4l2_mbus_pixelcode if_params;
230+
u32 if_params;
231231
int enc_out_index;
232232
int sd_index;
233233
int ret = 0;

‎drivers/media/platform/davinci/vpfe_capture.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
414414
/* assume V4L2_PIX_FMT_UYVY as default */
415415
pix->pixelformat = V4L2_PIX_FMT_UYVY;
416416
v4l2_fill_mbus_format(&mbus_fmt, pix,
417-
V4L2_MBUS_FMT_YUYV10_2X10);
417+
MEDIA_BUS_FMT_YUYV10_2X10);
418418
} else {
419419
pix->field = V4L2_FIELD_NONE;
420420
/* assume V4L2_PIX_FMT_SBGGR8 */
421421
pix->pixelformat = V4L2_PIX_FMT_SBGGR8;
422422
v4l2_fill_mbus_format(&mbus_fmt, pix,
423-
V4L2_MBUS_FMT_SBGGR8_1X8);
423+
MEDIA_BUS_FMT_SBGGR8_1X8);
424424
}
425425

426426
/* if sub device supports g_mbus_fmt, override the defaults */

0 commit comments

Comments
 (0)