Commit 4763fa84 authored by Erik Andrén's avatar Erik Andrén Committed by Mauro Carvalho Chehab

V4L/DVB (11635): gspca - m5602-ov7660: Initial checkin of sensor skeleton code

Signed-off-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c41507ba
...@@ -2,6 +2,7 @@ obj-$(CONFIG_USB_M5602) += gspca_m5602.o ...@@ -2,6 +2,7 @@ obj-$(CONFIG_USB_M5602) += gspca_m5602.o
gspca_m5602-objs := m5602_core.o \ gspca_m5602-objs := m5602_core.o \
m5602_ov9650.o \ m5602_ov9650.o \
m5602_ov7660.o \
m5602_mt9m111.o \ m5602_mt9m111.o \
m5602_po1030.o \ m5602_po1030.o \
m5602_s5k83a.o \ m5602_s5k83a.o \
......
/*
* Driver for the ov7660 sensor
*
* Copyright (C) 2009 Erik Andrén
* Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
* Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
*
* Portions of code to USB interface and ALi driver software,
* Copyright (c) 2006 Willem Duinker
* v4l2 interface modeled after the V4L2 driver
* for SN9C10x PC Camera Controllers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*
*/
#include "m5602_ov7660.h"
const static struct ctrl ov7660_ctrls[] = {};
static struct v4l2_pix_format ov7660_modes[] = {
{
640,
480,
V4L2_PIX_FMT_SBGGR8,
V4L2_FIELD_NONE,
.sizeimage =
640 * 480,
.bytesperline = 640,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 0
}
};
static void ov7660_dump_registers(struct sd *sd);
int ov7660_probe(struct sd *sd)
{
return -ENODEV;
}
int ov7660_init(struct sd *sd)
{
return 0;
}
int ov7660_start(struct sd *sd)
{
return 0;
}
int ov7660_stop(struct sd *sd)
{
return 0;
}
void ov7660_disconnect(struct sd *sd) {}
static void ov7660_dump_registers(struct sd *sd)
{
int address;
info("Dumping the ov7660 register state");
for (address = 0; address < 0xa9; address++) {
u8 value;
m5602_read_sensor(sd, address, &value, 1);
info("register 0x%x contains 0x%x",
address, value);
}
info("ov7660 register state dump complete");
info("Probing for which registers that are read/write");
for (address = 0; address < 0xff; address++) {
u8 old_value, ctrl_value;
u8 test_value[2] = {0xff, 0xff};
m5602_read_sensor(sd, address, &old_value, 1);
m5602_write_sensor(sd, address, test_value, 1);
m5602_read_sensor(sd, address, &ctrl_value, 1);
if (ctrl_value == test_value[0])
info("register 0x%x is writeable", address);
else
info("register 0x%x is read only", address);
/* Restore original value */
m5602_write_sensor(sd, address, &old_value, 1);
}
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment