mirror of
https://github.com/t2linux/kernel.git
synced 2026-08-16 05:22:11 -07:00
[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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
43ba464182
commit
27ffaeb0ab
@@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to
|
||||
conveniently manage these formats. A table of standard transformations is
|
||||
maintained by soc-camera core, which describes, what FOURCC pixel format will
|
||||
be obtained, if a media-bus pixel format is stored in memory according to
|
||||
certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
|
||||
certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per
|
||||
sample and stored in memory in the little-endian order with no gaps between
|
||||
bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These
|
||||
standard transformations will be used by soc-camera or by camera host drivers to
|
||||
|
||||
@@ -294,7 +294,7 @@ static struct vpbe_output dm355evm_vpbe_outputs[] = {
|
||||
.default_mode = "ntsc",
|
||||
.num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing),
|
||||
.modes = dm355evm_enc_preset_timing,
|
||||
.if_params = V4L2_MBUS_FMT_FIXED,
|
||||
.if_params = MEDIA_BUS_FMT_FIXED,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
|
||||
.default_mode = "ntsc",
|
||||
.num_modes = ARRAY_SIZE(dm365evm_enc_std_timing),
|
||||
.modes = dm365evm_enc_std_timing,
|
||||
.if_params = V4L2_MBUS_FMT_FIXED,
|
||||
.if_params = MEDIA_BUS_FMT_FIXED,
|
||||
},
|
||||
{
|
||||
.output = {
|
||||
@@ -498,7 +498,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = {
|
||||
.default_mode = "480p59_94",
|
||||
.num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing),
|
||||
.modes = dm365evm_enc_preset_timing,
|
||||
.if_params = V4L2_MBUS_FMT_FIXED,
|
||||
.if_params = MEDIA_BUS_FMT_FIXED,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -785,14 +785,13 @@ static struct resource dm355_v4l2_disp_resources[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
|
||||
int field)
|
||||
static int dm355_vpbe_setup_pinmux(u32 if_type, int field)
|
||||
{
|
||||
switch (if_type) {
|
||||
case V4L2_MBUS_FMT_SGRBG8_1X8:
|
||||
case MEDIA_BUS_FMT_SGRBG8_1X8:
|
||||
davinci_cfg_reg(DM355_VOUT_FIELD_G70);
|
||||
break;
|
||||
case V4L2_MBUS_FMT_YUYV10_1X20:
|
||||
case MEDIA_BUS_FMT_YUYV10_1X20:
|
||||
if (field)
|
||||
davinci_cfg_reg(DM355_VOUT_FIELD);
|
||||
else
|
||||
|
||||
@@ -1306,16 +1306,15 @@ static struct resource dm365_v4l2_disp_resources[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static int dm365_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
|
||||
int field)
|
||||
static int dm365_vpbe_setup_pinmux(u32 if_type, int field)
|
||||
{
|
||||
switch (if_type) {
|
||||
case V4L2_MBUS_FMT_SGRBG8_1X8:
|
||||
case MEDIA_BUS_FMT_SGRBG8_1X8:
|
||||
davinci_cfg_reg(DM365_VOUT_FIELD_G81);
|
||||
davinci_cfg_reg(DM365_VOUT_COUTL_EN);
|
||||
davinci_cfg_reg(DM365_VOUT_COUTH_EN);
|
||||
break;
|
||||
case V4L2_MBUS_FMT_YUYV10_1X20:
|
||||
case MEDIA_BUS_FMT_YUYV10_1X20:
|
||||
if (field)
|
||||
davinci_cfg_reg(DM365_VOUT_FIELD);
|
||||
else
|
||||
|
||||
@@ -1153,7 +1153,7 @@ static struct soc_camera_platform_info camera_info = {
|
||||
.format_name = "UYVY",
|
||||
.format_depth = 16,
|
||||
.format = {
|
||||
.code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
.colorspace = V4L2_COLORSPACE_SMPTE170M,
|
||||
.field = V4L2_FIELD_NONE,
|
||||
.width = 640,
|
||||
|
||||
@@ -338,7 +338,7 @@ static struct soc_camera_platform_info camera_info = {
|
||||
.format_name = "UYVY",
|
||||
.format_depth = 16,
|
||||
.format = {
|
||||
.code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
.colorspace = V4L2_COLORSPACE_SMPTE170M,
|
||||
.field = V4L2_FIELD_NONE,
|
||||
.width = 640,
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
struct bcap_format {
|
||||
char *desc;
|
||||
u32 pixelformat;
|
||||
enum v4l2_mbus_pixelcode mbus_code;
|
||||
u32 mbus_code;
|
||||
int bpp; /* bits per pixel */
|
||||
int dlen; /* data length for ppi in bits */
|
||||
};
|
||||
@@ -116,35 +116,35 @@ static const struct bcap_format bcap_formats[] = {
|
||||
{
|
||||
.desc = "YCbCr 4:2:2 Interleaved UYVY",
|
||||
.pixelformat = V4L2_PIX_FMT_UYVY,
|
||||
.mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
.bpp = 16,
|
||||
.dlen = 8,
|
||||
},
|
||||
{
|
||||
.desc = "YCbCr 4:2:2 Interleaved YUYV",
|
||||
.pixelformat = V4L2_PIX_FMT_YUYV,
|
||||
.mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
|
||||
.bpp = 16,
|
||||
.dlen = 8,
|
||||
},
|
||||
{
|
||||
.desc = "YCbCr 4:2:2 Interleaved UYVY",
|
||||
.pixelformat = V4L2_PIX_FMT_UYVY,
|
||||
.mbus_code = V4L2_MBUS_FMT_UYVY8_1X16,
|
||||
.mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
|
||||
.bpp = 16,
|
||||
.dlen = 16,
|
||||
},
|
||||
{
|
||||
.desc = "RGB 565",
|
||||
.pixelformat = V4L2_PIX_FMT_RGB565,
|
||||
.mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE,
|
||||
.mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE,
|
||||
.bpp = 16,
|
||||
.dlen = 8,
|
||||
},
|
||||
{
|
||||
.desc = "RGB 444",
|
||||
.pixelformat = V4L2_PIX_FMT_RGB444,
|
||||
.mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
|
||||
.mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE,
|
||||
.bpp = 16,
|
||||
.dlen = 8,
|
||||
},
|
||||
@@ -161,7 +161,7 @@ static struct bcap_buffer *to_bcap_vb(struct vb2_buffer *vb)
|
||||
|
||||
static int bcap_init_sensor_formats(struct bcap_device *bcap_dev)
|
||||
{
|
||||
enum v4l2_mbus_pixelcode code;
|
||||
u32 code;
|
||||
struct bcap_format *sf;
|
||||
unsigned int num_formats = 0;
|
||||
int i, j;
|
||||
|
||||
@@ -227,7 +227,7 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index)
|
||||
vpbe_current_encoder_info(vpbe_dev);
|
||||
struct vpbe_config *cfg = vpbe_dev->cfg;
|
||||
struct venc_platform_data *venc_device = vpbe_dev->venc_device;
|
||||
enum v4l2_mbus_pixelcode if_params;
|
||||
u32 if_params;
|
||||
int enc_out_index;
|
||||
int sd_index;
|
||||
int ret = 0;
|
||||
|
||||
@@ -414,13 +414,13 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
|
||||
/* assume V4L2_PIX_FMT_UYVY as default */
|
||||
pix->pixelformat = V4L2_PIX_FMT_UYVY;
|
||||
v4l2_fill_mbus_format(&mbus_fmt, pix,
|
||||
V4L2_MBUS_FMT_YUYV10_2X10);
|
||||
MEDIA_BUS_FMT_YUYV10_2X10);
|
||||
} else {
|
||||
pix->field = V4L2_FIELD_NONE;
|
||||
/* assume V4L2_PIX_FMT_SBGGR8 */
|
||||
pix->pixelformat = V4L2_PIX_FMT_SBGGR8;
|
||||
v4l2_fill_mbus_format(&mbus_fmt, pix,
|
||||
V4L2_MBUS_FMT_SBGGR8_1X8);
|
||||
MEDIA_BUS_FMT_SBGGR8_1X8);
|
||||
}
|
||||
|
||||
/* if sub device supports g_mbus_fmt, override the defaults */
|
||||
|
||||
@@ -54,7 +54,7 @@ static const struct gsc_fmt gsc_formats[] = {
|
||||
.corder = GSC_CBCR,
|
||||
.num_planes = 1,
|
||||
.num_comp = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CbYCrY",
|
||||
.pixelformat = V4L2_PIX_FMT_UYVY,
|
||||
@@ -64,7 +64,7 @@ static const struct gsc_fmt gsc_formats[] = {
|
||||
.corder = GSC_CBCR,
|
||||
.num_planes = 1,
|
||||
.num_comp = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CrYCbY",
|
||||
.pixelformat = V4L2_PIX_FMT_VYUY,
|
||||
@@ -74,7 +74,7 @@ static const struct gsc_fmt gsc_formats[] = {
|
||||
.corder = GSC_CRCB,
|
||||
.num_planes = 1,
|
||||
.num_comp = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_VYUY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, YCrYCb",
|
||||
.pixelformat = V4L2_PIX_FMT_YVYU,
|
||||
@@ -84,7 +84,7 @@ static const struct gsc_fmt gsc_formats[] = {
|
||||
.corder = GSC_CRCB,
|
||||
.num_planes = 1,
|
||||
.num_comp = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YVYU8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
|
||||
}, {
|
||||
.name = "YUV 4:4:4 planar, YCbYCr",
|
||||
.pixelformat = V4L2_PIX_FMT_YUV32,
|
||||
|
||||
@@ -117,7 +117,7 @@ enum gsc_yuv_fmt {
|
||||
* @flags: flags indicating which operation mode format applies to
|
||||
*/
|
||||
struct gsc_fmt {
|
||||
enum v4l2_mbus_pixelcode mbus_code;
|
||||
u32 mbus_code;
|
||||
char *name;
|
||||
u32 pixelformat;
|
||||
u32 color;
|
||||
|
||||
@@ -749,7 +749,7 @@ static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv,
|
||||
return -EINVAL;
|
||||
strncpy(f->description, fmt->name, sizeof(f->description) - 1);
|
||||
f->pixelformat = fmt->fourcc;
|
||||
if (fmt->fourcc == V4L2_MBUS_FMT_JPEG_1X8)
|
||||
if (fmt->fourcc == MEDIA_BUS_FMT_JPEG_1X8)
|
||||
f->flags |= V4L2_FMT_FLAG_COMPRESSED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.flags = FMT_FLAGS_M2M_OUT | FMT_HAS_ALPHA,
|
||||
}, {
|
||||
.name = "YUV 4:4:4",
|
||||
.mbus_code = V4L2_MBUS_FMT_YUV10_1X30,
|
||||
.mbus_code = MEDIA_BUS_FMT_YUV10_1X30,
|
||||
.flags = FMT_FLAGS_WRITEBACK,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, YCbYCr",
|
||||
@@ -90,7 +90,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.color = FIMC_FMT_YCBYCR422,
|
||||
.memplanes = 1,
|
||||
.colplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
|
||||
.flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CbYCrY",
|
||||
@@ -99,7 +99,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.color = FIMC_FMT_CBYCRY422,
|
||||
.memplanes = 1,
|
||||
.colplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
.flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CrYCbY",
|
||||
@@ -108,7 +108,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.color = FIMC_FMT_CRYCBY422,
|
||||
.memplanes = 1,
|
||||
.colplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_VYUY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
|
||||
.flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, YCrYCb",
|
||||
@@ -117,7 +117,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.color = FIMC_FMT_YCRYCB422,
|
||||
.memplanes = 1,
|
||||
.colplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YVYU8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
|
||||
.flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 planar, Y/Cb/Cr",
|
||||
@@ -190,7 +190,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.depth = { 8 },
|
||||
.memplanes = 1,
|
||||
.colplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_JPEG_1X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_JPEG_1X8,
|
||||
.flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED,
|
||||
}, {
|
||||
.name = "S5C73MX interleaved UYVY/JPEG",
|
||||
@@ -200,7 +200,7 @@ static struct fimc_fmt fimc_formats[] = {
|
||||
.memplanes = 2,
|
||||
.colplanes = 1,
|
||||
.mdataplanes = 0x2, /* plane 1 holds frame meta data */
|
||||
.mbus_code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8,
|
||||
.flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -579,8 +579,8 @@ static inline bool fimc_jpeg_fourcc(u32 pixelformat)
|
||||
|
||||
static inline bool fimc_user_defined_mbus_fmt(u32 code)
|
||||
{
|
||||
return (code == V4L2_MBUS_FMT_JPEG_1X8 ||
|
||||
code == V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8);
|
||||
return (code == MEDIA_BUS_FMT_JPEG_1X8 ||
|
||||
code == MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8);
|
||||
}
|
||||
|
||||
/* Return the alpha component bit mask */
|
||||
|
||||
@@ -41,21 +41,21 @@ static const struct fimc_fmt fimc_isp_formats[FIMC_ISP_NUM_FORMATS] = {
|
||||
.depth = { 8 },
|
||||
.color = FIMC_FMT_RAW8,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
|
||||
}, {
|
||||
.name = "RAW10 (GRBG)",
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG10,
|
||||
.depth = { 10 },
|
||||
.color = FIMC_FMT_RAW10,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
|
||||
}, {
|
||||
.name = "RAW12 (GRBG)",
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG12,
|
||||
.depth = { 12 },
|
||||
.color = FIMC_FMT_RAW12,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -149,7 +149,7 @@ static int fimc_isp_subdev_get_fmt(struct v4l2_subdev *sd,
|
||||
|
||||
if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) {
|
||||
mf->colorspace = V4L2_COLORSPACE_JPEG;
|
||||
mf->code = V4L2_MBUS_FMT_YUV10_1X30;
|
||||
mf->code = MEDIA_BUS_FMT_YUV10_1X30;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp,
|
||||
FIMC_ISP_SINK_WIDTH_MAX, 0,
|
||||
&mf->height, FIMC_ISP_SINK_HEIGHT_MIN,
|
||||
FIMC_ISP_SINK_HEIGHT_MAX, 0, 0);
|
||||
mf->code = V4L2_MBUS_FMT_SGRBG10_1X10;
|
||||
mf->code = MEDIA_BUS_FMT_SGRBG10_1X10;
|
||||
} else {
|
||||
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
|
||||
format = v4l2_subdev_get_try_format(fh,
|
||||
@@ -188,7 +188,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp,
|
||||
mf->height = format->height - FIMC_ISP_CAC_MARGIN_HEIGHT;
|
||||
|
||||
if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) {
|
||||
mf->code = V4L2_MBUS_FMT_YUV10_1X30;
|
||||
mf->code = MEDIA_BUS_FMT_YUV10_1X30;
|
||||
mf->colorspace = V4L2_COLORSPACE_JPEG;
|
||||
} else {
|
||||
mf->code = format->code;
|
||||
@@ -680,11 +680,11 @@ static void __isp_subdev_set_default_format(struct fimc_isp *isp)
|
||||
FIMC_ISP_CAC_MARGIN_WIDTH;
|
||||
isp->sink_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT +
|
||||
FIMC_ISP_CAC_MARGIN_HEIGHT;
|
||||
isp->sink_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10;
|
||||
isp->sink_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10;
|
||||
|
||||
isp->src_fmt.width = DEFAULT_PREVIEW_STILL_WIDTH;
|
||||
isp->src_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT;
|
||||
isp->src_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10;
|
||||
isp->src_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10;
|
||||
__is_set_frame_size(is, &isp->src_fmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -112,24 +112,24 @@ void flite_hw_set_test_pattern(struct fimc_lite *dev, bool on)
|
||||
}
|
||||
|
||||
static const u32 src_pixfmt_map[8][3] = {
|
||||
{ V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR,
|
||||
{ MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR,
|
||||
FLITE_REG_CIGCTRL_YUV422_1P },
|
||||
{ V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB,
|
||||
{ MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB,
|
||||
FLITE_REG_CIGCTRL_YUV422_1P },
|
||||
{ V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY,
|
||||
{ MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY,
|
||||
FLITE_REG_CIGCTRL_YUV422_1P },
|
||||
{ V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY,
|
||||
{ MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY,
|
||||
FLITE_REG_CIGCTRL_YUV422_1P },
|
||||
{ V4L2_MBUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 },
|
||||
{ V4L2_MBUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 },
|
||||
{ V4L2_MBUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 },
|
||||
{ V4L2_MBUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) },
|
||||
{ MEDIA_BUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 },
|
||||
{ MEDIA_BUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 },
|
||||
{ MEDIA_BUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 },
|
||||
{ MEDIA_BUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) },
|
||||
};
|
||||
|
||||
/* Set camera input pixel format and resolution */
|
||||
void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
|
||||
{
|
||||
enum v4l2_mbus_pixelcode pixelcode = f->fmt->mbus_code;
|
||||
u32 pixelcode = f->fmt->mbus_code;
|
||||
int i = ARRAY_SIZE(src_pixfmt_map);
|
||||
u32 cfg;
|
||||
|
||||
@@ -232,10 +232,10 @@ static void flite_hw_set_pack12(struct fimc_lite *dev, int on)
|
||||
static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
|
||||
{
|
||||
static const u32 pixcode[4][2] = {
|
||||
{ V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR },
|
||||
{ V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB },
|
||||
{ V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY },
|
||||
{ V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
|
||||
{ MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR },
|
||||
{ MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB },
|
||||
{ MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY },
|
||||
{ MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
|
||||
};
|
||||
u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
|
||||
int i = ARRAY_SIZE(pixcode);
|
||||
|
||||
@@ -48,7 +48,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_YCBYCR422,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YUYV8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
|
||||
.flags = FMT_FLAGS_YUV,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CbYCrY",
|
||||
@@ -57,7 +57,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_CBYCRY422,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_UYVY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
|
||||
.flags = FMT_FLAGS_YUV,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, CrYCbY",
|
||||
@@ -66,7 +66,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_CRYCBY422,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_VYUY8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_VYUY8_2X8,
|
||||
.flags = FMT_FLAGS_YUV,
|
||||
}, {
|
||||
.name = "YUV 4:2:2 packed, YCrYCb",
|
||||
@@ -75,7 +75,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_YCRYCB422,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_YVYU8_2X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_YVYU8_2X8,
|
||||
.flags = FMT_FLAGS_YUV,
|
||||
}, {
|
||||
.name = "RAW8 (GRBG)",
|
||||
@@ -84,7 +84,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 8 },
|
||||
.color = FIMC_FMT_RAW8,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
|
||||
.flags = FMT_FLAGS_RAW_BAYER,
|
||||
}, {
|
||||
.name = "RAW10 (GRBG)",
|
||||
@@ -93,7 +93,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_RAW10,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
|
||||
.flags = FMT_FLAGS_RAW_BAYER,
|
||||
}, {
|
||||
.name = "RAW12 (GRBG)",
|
||||
@@ -102,7 +102,7 @@ static const struct fimc_fmt fimc_lite_formats[] = {
|
||||
.depth = { 16 },
|
||||
.color = FIMC_FMT_RAW12,
|
||||
.memplanes = 1,
|
||||
.mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
|
||||
.flags = FMT_FLAGS_RAW_BAYER,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -592,10 +592,10 @@ struct mbus_pixfmt_desc {
|
||||
};
|
||||
|
||||
static const struct mbus_pixfmt_desc pix_desc[] = {
|
||||
{ V4L2_MBUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 },
|
||||
{ V4L2_MBUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 },
|
||||
{ V4L2_MBUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 },
|
||||
{ V4L2_MBUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 },
|
||||
{ MEDIA_BUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 },
|
||||
{ MEDIA_BUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 },
|
||||
{ MEDIA_BUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 },
|
||||
{ MEDIA_BUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 },
|
||||
};
|
||||
|
||||
int fimc_hw_set_camera_source(struct fimc_dev *fimc,
|
||||
@@ -689,11 +689,11 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
|
||||
|
||||
/* TODO: add remaining supported formats. */
|
||||
switch (vid_cap->ci_fmt.code) {
|
||||
case V4L2_MBUS_FMT_VYUY8_2X8:
|
||||
case MEDIA_BUS_FMT_VYUY8_2X8:
|
||||
tmp = FIMC_REG_CSIIMGFMT_YCBCR422_8BIT;
|
||||
break;
|
||||
case V4L2_MBUS_FMT_JPEG_1X8:
|
||||
case V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8:
|
||||
case MEDIA_BUS_FMT_JPEG_1X8:
|
||||
case MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8:
|
||||
tmp = FIMC_REG_CSIIMGFMT_USER(1);
|
||||
cfg |= FIMC_REG_CIGCTRL_CAM_JPEG;
|
||||
break;
|
||||
|
||||
@@ -238,34 +238,34 @@ struct csis_state {
|
||||
*/
|
||||
struct csis_pix_format {
|
||||
unsigned int pix_width_alignment;
|
||||
enum v4l2_mbus_pixelcode code;
|
||||
u32 code;
|
||||
u32 fmt_reg;
|
||||
u8 data_alignment;
|
||||
};
|
||||
|
||||
static const struct csis_pix_format s5pcsis_formats[] = {
|
||||
{
|
||||
.code = V4L2_MBUS_FMT_VYUY8_2X8,
|
||||
.code = MEDIA_BUS_FMT_VYUY8_2X8,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_YCBCR422_8BIT,
|
||||
.data_alignment = 32,
|
||||
}, {
|
||||
.code = V4L2_MBUS_FMT_JPEG_1X8,
|
||||
.code = MEDIA_BUS_FMT_JPEG_1X8,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_USER(1),
|
||||
.data_alignment = 32,
|
||||
}, {
|
||||
.code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8,
|
||||
.code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_USER(1),
|
||||
.data_alignment = 32,
|
||||
}, {
|
||||
.code = V4L2_MBUS_FMT_SGRBG8_1X8,
|
||||
.code = MEDIA_BUS_FMT_SGRBG8_1X8,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_RAW8,
|
||||
.data_alignment = 24,
|
||||
}, {
|
||||
.code = V4L2_MBUS_FMT_SGRBG10_1X10,
|
||||
.code = MEDIA_BUS_FMT_SGRBG10_1X10,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_RAW10,
|
||||
.data_alignment = 24,
|
||||
}, {
|
||||
.code = V4L2_MBUS_FMT_SGRBG12_1X12,
|
||||
.code = MEDIA_BUS_FMT_SGRBG12_1X12,
|
||||
.fmt_reg = S5PCSIS_CFG_FMT_RAW12,
|
||||
.data_alignment = 24,
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user