Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219533
b: refs/heads/master
c: cdff10a
h: refs/heads/master
i:
  219531: b7a74f2
v: v3
  • Loading branch information
Daniel Drake authored and Mauro Carvalho Chehab committed Oct 23, 2010
1 parent ec1bce5 commit e254c08
Show file tree
Hide file tree
Showing 2 changed files with 30 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: 75e2bdad8901a0b599e01a96229be922eef1e488
refs/heads/master: cdff10a18d005eac83524917e7789d57b20877ef
29 changes: 29 additions & 0 deletions trunk/drivers/media/video/cafe_ccic.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/dmi.h>
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/i2c.h>
Expand All @@ -46,6 +47,7 @@
#include <asm/uaccess.h>
#include <asm/io.h>

#include "ov7670.h"
#include "cafe_ccic-regs.h"

#define CAFE_VERSION 0x000002
Expand Down Expand Up @@ -1974,11 +1976,33 @@ static irqreturn_t cafe_irq(int irq, void *data)
* PCI interface stuff.
*/

static const struct dmi_system_id olpc_xo1_dmi[] = {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "1"),
},
},
{ }
};

static int cafe_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
int ret;
struct cafe_camera *cam;
struct ov7670_config sensor_cfg = {
/* This controller only does SMBUS */
.use_smbus = true,

/*
* Exclude QCIF mode, because it only captures a tiny portion
* of the sensor FOV
*/
.min_width = 320,
.min_height = 240,
};

/*
* Start putting together one of our big camera structures.
Expand Down Expand Up @@ -2036,13 +2060,18 @@ static int cafe_pci_probe(struct pci_dev *pdev,
if (ret)
goto out_freeirq;

/* Apply XO-1 clock speed */
if (dmi_check_system(olpc_xo1_dmi))
sensor_cfg.clock_speed = 45;

cam->sensor_addr = 0x42;
cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, &cam->i2c_adapter,
NULL, "ov7670", cam->sensor_addr, NULL);
if (cam->sensor == NULL) {
ret = -ENODEV;
goto out_smbus;
}

ret = cafe_cam_init(cam);
if (ret)
goto out_smbus;
Expand Down

0 comments on commit e254c08

Please sign in to comment.