Hmm odd it still claims to have a 8th and 9th bit stored in the vref
register so what it just does not use the 7th bit then? Well heres a
patch that implements a separate function for the ov7660 sensor though
it treats the gain as linear which given they way the ov9650 senor
appears to work may not be correct as well

On Tue, Jan 27, 2009 at 10:01 AM, JoJo jojo <[email protected]> wrote:
>
> Yup, ov7660 gain register 0x00 values range is 0x00 to 0x7f
> but ov9650 uses other values as well :-(
>
> -JoJo
>
> On 1/27/09, Vasily Khoruzhick <[email protected]> wrote:
>> On 27 January 2009 08:57:50 Brian Johnson wrote:
>>> Yes the ov7660 sensor that the 627b camera uses currently does not
>>> have gain support please try this quick patch and see if it works
>>> correctly for you.
>>
>> According to sensor datasheet, ov9650_set_gain will not work correctly for
>> ov76xx sensors
>>
>> Regards
>> Vasilly
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Lets make microdia webcams plug'n play, (currently plug'n pray)
To post to this group, send email to [email protected]
Visit us online https://groups.google.com/group/microdia
-~----------~----~----~----~------~----~------~--~---

From 31ed3f8b89d49720b62e1ed77a93d7771f16d442 Mon Sep 17 00:00:00 2001
From: Brian Johnson <[email protected]>
Date: Tue, 27 Jan 2009 15:24:14 -0500
Subject: [PATCH] Implement gain function for ov7660 sensor

---
 omnivision.c  |    8 ++++++++
 omnivision.h  |    2 ++
 sn9c20x-dev.c |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/omnivision.c b/omnivision.c
index 53c617f..358af20 100644
--- a/omnivision.c
+++ b/omnivision.c
@@ -707,6 +707,14 @@ int soi968_set_gain(struct usb_sn9c20x *dev)
 	return ret;
 }
 
+
+int ov7660_set_gain(struct usb_sn9c20x *dev)
+{
+	__u8 value = dev->vsettings.gain & 0x7F;
+
+	return sn9c20x_write_i2c_data(dev, 1, 0x00, &value);
+}
+
 /*
  * @brief Set gain for ov9650 sensor
  *
diff --git a/omnivision.h b/omnivision.h
index c67c237..f2a4e4f 100644
--- a/omnivision.h
+++ b/omnivision.h
@@ -543,6 +543,8 @@ int ov965x_set_hvflip(struct usb_sn9c20x *);
 int ov965x_flip_detect(struct usb_sn9c20x *dev);
 int ov9650_set_gain(struct usb_sn9c20x *dev);
 
+int ov7660_set_gain(struct usb_sn9c20x *dev);
+
 int ov_set_exposure(struct usb_sn9c20x *);
 int ov_set_autogain(struct usb_sn9c20x *dev);
 #endif
diff --git a/sn9c20x-dev.c b/sn9c20x-dev.c
index 2287d4f..4b838c4 100644
--- a/sn9c20x-dev.c
+++ b/sn9c20x-dev.c
@@ -172,6 +172,7 @@ int sn9c20x_initialize_sensor(struct usb_sn9c20x *dev)
 		sn9c20x_write_i2c_array(dev, ov7660_init, 0);
 		dev->camera.set_exposure = ov_set_exposure;
 		dev->camera.set_auto_gain = ov_set_autogain;
+		dev->camera.set_gain = ov7660_set_gain;
 		dev->camera.hstart = 1;
 		dev->camera.vstart = 1;
 		UDIA_INFO("Detected OV7660 Sensor.\n");
-- 
1.5.6.3

Reply via email to