Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 241772
b: refs/heads/master
c: 3d0ce7e
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Mar 21, 2011
1 parent d2819e8 commit de051fc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df7e09a351199ad9a70eb9ae3b072cc4fc59a9bb
refs/heads/master: 3d0ce7ed037af9bafec498246d0e4af8302d993a
49 changes: 27 additions & 22 deletions trunk/drivers/media/video/s5p-fimc/fimc-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,37 +561,42 @@ int fimc_hw_set_camera_source(struct fimc_dev *fimc,
{
struct fimc_frame *f = &fimc->vid_cap.ctx->s_frame;
u32 cfg = 0;
u32 bus_width;
int i;

static const struct {
u32 pixelcode;
u32 cisrcfmt;
u16 bus_width;
} pix_desc[] = {
{ V4L2_MBUS_FMT_YUYV8_2X8, S5P_CISRCFMT_ORDER422_YCBYCR, 8 },
{ V4L2_MBUS_FMT_YVYU8_2X8, S5P_CISRCFMT_ORDER422_YCRYCB, 8 },
{ V4L2_MBUS_FMT_VYUY8_2X8, S5P_CISRCFMT_ORDER422_CRYCBY, 8 },
{ V4L2_MBUS_FMT_UYVY8_2X8, S5P_CISRCFMT_ORDER422_CBYCRY, 8 },
/* TODO: Add pixel codes for 16-bit bus width */
};

if (cam->bus_type == FIMC_ITU_601 || cam->bus_type == FIMC_ITU_656) {
for (i = 0; i < ARRAY_SIZE(pix_desc); i++) {
if (fimc->vid_cap.fmt.code == pix_desc[i].pixelcode) {
cfg = pix_desc[i].cisrcfmt;
bus_width = pix_desc[i].bus_width;
break;
}
}

switch (fimc->vid_cap.fmt.code) {
case V4L2_MBUS_FMT_YUYV8_2X8:
cfg = S5P_CISRCFMT_ORDER422_YCBYCR;
break;
case V4L2_MBUS_FMT_YVYU8_2X8:
cfg = S5P_CISRCFMT_ORDER422_YCRYCB;
break;
case V4L2_MBUS_FMT_VYUY8_2X8:
cfg = S5P_CISRCFMT_ORDER422_CRYCBY;
break;
case V4L2_MBUS_FMT_UYVY8_2X8:
cfg = S5P_CISRCFMT_ORDER422_CBYCRY;
break;
default:
err("camera image format not supported: %d",
fimc->vid_cap.fmt.code);
if (i == ARRAY_SIZE(pix_desc)) {
v4l2_err(&fimc->vid_cap.v4l2_dev,
"Camera color format not supported: %d\n",
fimc->vid_cap.fmt.code);
return -EINVAL;
}

if (cam->bus_type == FIMC_ITU_601) {
if (cam->bus_width == 8) {
if (bus_width == 8)
cfg |= S5P_CISRCFMT_ITU601_8BIT;
} else if (cam->bus_width == 16) {
else if (bus_width == 16)
cfg |= S5P_CISRCFMT_ITU601_16BIT;
} else {
err("invalid bus width: %d", cam->bus_width);
return -EINVAL;
}
} /* else defaults to ITU-R BT.656 8-bit */
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/media/s5p_fimc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ struct i2c_board_info;
* @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
* @i2c_bus_num: i2c control bus id the sensor is attached to
* @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
* @bus_width: camera data bus width in bits
* @flags: flags defining bus signals polarity inversion (High by default)
*/
struct s5p_fimc_isp_info {
struct i2c_board_info *board_info;
enum cam_bus_type bus_type;
u16 i2c_bus_num;
u16 mux_id;
u16 bus_width;
u16 flags;
};

Expand Down

0 comments on commit de051fc

Please sign in to comment.