Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366892
b: refs/heads/master
c: e4b7131
h: refs/heads/master
v: v3
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Mar 29, 2013
1 parent bd2368f commit b71d67e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52f1f2303f131d6d287a5316e35a4ec0d8ac8b98
refs/heads/master: e4b7131dd51c3efb2656bc5b00aa96bfef17b709
49 changes: 49 additions & 0 deletions trunk/drivers/media/usb/em28xx/em28xx-camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include <linux/i2c.h>
#include <media/soc_camera.h>
#include <media/mt9v011.h>
#include <media/v4l2-common.h>

Expand All @@ -42,6 +43,13 @@ static unsigned short omnivision_sensor_addrs[] = {
};


static struct soc_camera_link camlink = {
.bus_id = 0,
.flags = 0,
.module_name = "em28xx",
};


/* FIXME: Should be replaced by a proper mt9m111 driver */
static int em28xx_initialize_mt9m111(struct em28xx *dev)
{
Expand Down Expand Up @@ -246,6 +254,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
switch (id) {
case 0x2642:
name = "OV2640";
dev->em28xx_sensor = EM28XX_OV2640;
break;
case 0x7648:
name = "OV7648";
Expand Down Expand Up @@ -376,6 +385,46 @@ int em28xx_init_camera(struct em28xx *dev)
dev->vinctl = 0x00;

break;
case EM28XX_OV2640:
{
struct v4l2_subdev *subdev;
struct i2c_board_info ov2640_info = {
.type = "ov2640",
.flags = I2C_CLIENT_SCCB,
.addr = dev->i2c_client[dev->def_i2c_bus].addr,
.platform_data = &camlink,
};
struct v4l2_mbus_framefmt fmt;

/*
* FIXME: sensor supports resolutions up to 1600x1200, but
* resolution setting/switching needs to be modified to
* - switch sensor output resolution (including further
* configuration changes)
* - adjust bridge xclk
* - disable 16 bit (12 bit) output formats on high resolutions
*/
dev->sensor_xres = 640;
dev->sensor_yres = 480;

subdev =
v4l2_i2c_new_subdev_board(&dev->v4l2_dev,
&dev->i2c_adap[dev->def_i2c_bus],
&ov2640_info, NULL);

fmt.code = V4L2_MBUS_FMT_YUYV8_2X8;
fmt.width = 640;
fmt.height = 480;
v4l2_subdev_call(subdev, video, s_mbus_fmt, &fmt);

/* NOTE: for UXGA=1600x1200 switch to 12MHz */
dev->board.xclk = EM28XX_XCLK_FREQUENCY_24MHZ;
em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk);
dev->vinmode = 0x08;
dev->vinctl = 0x00;

break;
}
case EM28XX_NOSENSOR:
default:
return -EINVAL;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/usb/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ enum em28xx_sensor {
EM28XX_MT9V011,
EM28XX_MT9M001,
EM28XX_MT9M111,
EM28XX_OV2640,
};

enum em28xx_adecoder {
Expand Down

0 comments on commit b71d67e

Please sign in to comment.