Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92401
b: refs/heads/master
c: bb55de3
h: refs/heads/master
i:
  92399: 0464461
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 71867e2 commit 6c8059e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 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: b1daf7e1233845db556ace20f80c7c531143498c
refs/heads/master: bb55de3b0e3523469491a48c51dcf7c6738162b2
17 changes: 14 additions & 3 deletions trunk/drivers/media/video/mt9m001.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,23 @@
#define MT9M001_CHIP_ENABLE 0xF1

static const struct soc_camera_data_format mt9m001_colour_formats[] = {
/* Order important: first natively supported,
* second supported with a GPIO extender */
{
.name = "RGB Bayer (sRGB)",
.depth = 16,
.name = "Bayer (sRGB) 10 bit",
.depth = 10,
.fourcc = V4L2_PIX_FMT_SBGGR16,
.colorspace = V4L2_COLORSPACE_SRGB,
}, {
.name = "Bayer (sRGB) 8 bit",
.depth = 8,
.fourcc = V4L2_PIX_FMT_SBGGR8,
.colorspace = V4L2_COLORSPACE_SRGB,
}
};

static const struct soc_camera_data_format mt9m001_monochrome_formats[] = {
/* Order important - see above */
{
.name = "Monochrome 10 bit",
.depth = 10,
Expand Down Expand Up @@ -547,7 +555,10 @@ static int mt9m001_video_probe(struct soc_camera_device *icd)
case 0x8421:
mt9m001->model = V4L2_IDENT_MT9M001C12ST;
mt9m001_ops.formats = mt9m001_colour_formats;
mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats);
if (mt9m001->client->dev.platform_data)
mt9m001_ops.num_formats = ARRAY_SIZE(mt9m001_colour_formats);
else
mt9m001_ops.num_formats = 1;
break;
case 0x8431:
mt9m001->model = V4L2_IDENT_MT9M001C12STM;
Expand Down
35 changes: 26 additions & 9 deletions trunk/drivers/media/video/mt9v022.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,25 @@ MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"\n");
/* Progressive scan, master, defaults */
#define MT9V022_CHIP_CONTROL_DEFAULT 0x188

static const struct soc_camera_data_format mt9v022_formats[] = {
static const struct soc_camera_data_format mt9v022_colour_formats[] = {
/* Order important: first natively supported,
* second supported with a GPIO extender */
{
.name = "RGB Bayer (sRGB)",
.depth = 8,
.fourcc = V4L2_PIX_FMT_SBGGR8,
.colorspace = V4L2_COLORSPACE_SRGB,
}, {
.name = "RGB Bayer (sRGB)",
.name = "Bayer (sRGB) 10 bit",
.depth = 10,
.fourcc = V4L2_PIX_FMT_SBGGR16,
.colorspace = V4L2_COLORSPACE_SRGB,
}, {
.name = "Bayer (sRGB) 8 bit",
.depth = 8,
.fourcc = V4L2_PIX_FMT_SBGGR8,
.colorspace = V4L2_COLORSPACE_SRGB,
}
};

static const struct soc_camera_data_format mt9v022_monochrome_formats[] = {
/* Order important - see above */
{
.name = "Monochrome 10 bit",
.depth = 10,
.fourcc = V4L2_PIX_FMT_Y16,
Expand Down Expand Up @@ -486,8 +493,8 @@ static struct soc_camera_ops mt9v022_ops = {
.stop_capture = mt9v022_stop_capture,
.set_capture_format = mt9v022_set_capture_format,
.try_fmt_cap = mt9v022_try_fmt_cap,
.formats = mt9v022_formats,
.num_formats = ARRAY_SIZE(mt9v022_formats),
.formats = NULL, /* Filled in later depending on the */
.num_formats = 0, /* sensor type and data widths */
.get_datawidth = mt9v022_get_datawidth,
.controls = mt9v022_controls,
.num_controls = ARRAY_SIZE(mt9v022_controls),
Expand Down Expand Up @@ -671,9 +678,19 @@ static int mt9v022_video_probe(struct soc_camera_device *icd)
!strcmp("color", sensor_type))) {
ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11);
mt9v022->model = V4L2_IDENT_MT9V022IX7ATC;
mt9v022_ops.formats = mt9v022_colour_formats;
if (mt9v022->client->dev.platform_data)
mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_colour_formats);
else
mt9v022_ops.num_formats = 1;
} else {
ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11);
mt9v022->model = V4L2_IDENT_MT9V022IX7ATM;
mt9v022_ops.formats = mt9v022_monochrome_formats;
if (mt9v022->client->dev.platform_data)
mt9v022_ops.num_formats = ARRAY_SIZE(mt9v022_monochrome_formats);
else
mt9v022_ops.num_formats = 1;
}

if (ret >= 0)
Expand Down

0 comments on commit 6c8059e

Please sign in to comment.