[2nd send, probably the original message got lost - my mail server is in
trouble these days]
Harald wrote:
> Hi Silvio,
>
> It should be very easy.
> macam already incorporates the gspca code, most of it is used
> directly. Some basic glue has to be added for each camera,
> sometimes this is very minimal, sometimes a little more.
>
> Please send me your gspca patch, or updated files.
> I'll add it to the macam source, and then you can
> test it! Or you can do it, look at the SonixDriver.m
> file if you are interested (always use latest CVS).
I attached the patch against the latest gspca. The code is by Leandro
Costantino from the gspca mailing list, so all credits go to him.
I don't think to have the necessary skill to modify macam by myself, but
I'll be very happy to help testing the driver. Just send me the patch or
commit it to the CVS and I'll compile it myself.
Thank you very much,
--
Silvio Moioli
www.moioli.net
silvio at moioli dot net
"Things should be as simple as possible, but not any simpler" Einstein
diff -Nru gspcav1-20071224/gspca_core.c gspcav1-20071224-sn9c102g-ov6650-rxart/gspca_core.c
--- gspcav1-20071224/gspca_core.c 2007-12-24 17:56:47.000000000 +0100
+++ gspcav1-20071224-sn9c102g-ov6650-rxart/gspca_core.c 2008-03-03 18:45:54.000000000 +0100
@@ -422,6 +422,7 @@
Lenovo,
LogitechQC4Notebooks,
PhilipsSPC220NC,
+ MaxSonixCamera,
LastCamera
};
static struct cam_list clist[] = {
@@ -620,6 +621,7 @@
{Lenovo,"lenovo MI1310_SOC"},
{LogitechQC4Notebooks,"Logitech QuickCam for Notebooks"},
{PhilipsSPC220NC,"Philips SPC220NC PAC207"},
+ {MaxSonixCamera,"Max Webcam (SN9C101G-OV6650-352x288)"},
{-1, NULL}
};
static __devinitdata struct usb_device_id device_table[] = {
@@ -834,6 +836,7 @@
{USB_DEVICE(0x046d, 0x08af)}, /* Logitech QuickCam Cool */
{USB_DEVICE(0x093a, 0x2472)}, /* PAC207 Genius VideoCam ge110 */
{USB_DEVICE(0x093a, 0x2463)}, /* Philips spc200nc pac207 */
+ {USB_DEVICE(0x0c45, 0x6011)}, /* MAX Webcam ( OV 6650 - SN9C101G ( works only with SONIX BRIDGE ) */
{USB_DEVICE(0x0000, 0x0000)}, /* MystFromOri Unknow Camera */
{} /* Terminating entry */
};
@@ -3889,6 +3892,14 @@
spca50x->i2c_ctrl_reg = 0x20;
spca50x->i2c_base = 0x11;
break;
+ case 0x6011:
+ spca50x->desc = MaxSonixCamera;
+ spca50x->bridge = BRIDGE_SONIX;
+ spca50x->sensor = SENSOR_OV6650;
+ spca50x->customid = SN9C101; //SN9C101G
+ spca50x->i2c_ctrl_reg = 0x81;
+ spca50x->i2c_base = 0x21;
+ break;
case 0x6024:
case 0x6025:
spca50x->desc = Sonix6025;
diff -Nru gspcav1-20071224/gspca.h gspcav1-20071224-sn9c102g-ov6650-rxart/gspca.h
--- gspcav1-20071224/gspca.h 2007-12-24 17:56:47.000000000 +0100
+++ gspcav1-20071224-sn9c102g-ov6650-rxart/gspca.h 2008-03-03 18:45:54.000000000 +0100
@@ -129,6 +129,7 @@
#define SENSOR_OV7670 29
#define SENSOR_MI1310_SOC 30
#define SENSOR_MC501CB 31
+#define SENSOR_OV6650 32
/* Alternate interface transfer sizes */
#define SPCA50X_ALT_SIZE_0 0
diff -Nru gspcav1-20071224/Sonix/sonix.h gspcav1-20071224-sn9c102g-ov6650-rxart/Sonix/sonix.h
--- gspcav1-20071224/Sonix/sonix.h 2007-11-22 15:52:16.000000000 +0100
+++ gspcav1-20071224-sn9c102g-ov6650-rxart/Sonix/sonix.h 2008-03-03 18:48:29.000000000 +0100
@@ -243,6 +243,13 @@
0x00, 0x00, 0x02, 0x03, 0x0F, 0x0C
};
+static __u8 initOv6650[] =
+{
+ 0x44, 0x44 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x80 ,0x60 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
+ 0x00 ,0x02 ,0x01 ,0x0a ,0x16 ,0x12 ,0x68 ,0x0b ,0x10 ,0x1d ,0x10 ,0x00 ,0x06 ,0x1f ,0x00
+
+};
+
//compression 0x86 mckinit1 0x2b
static __u8 pas106_data[][2] = {
{0x02, 0x04}, /* Pixel Clock Divider 6 */
@@ -337,6 +344,42 @@
{0, 0, 0, 0, 0, 0, 0, 0}
};
+static __u8 ov6650_sensor_init[][8] =
+{
+
+ {0xA0,0x60,0x12,0x80,0x00,0x00,0x00,0x10},
+ {0xD0,0x60,0x11,0xC0,0x1B,0x18,0xC1,0x10},
+ {0xB0,0x60,0x15,0x00,0x02,0x18,0xC1,0x10},
+ //{0xA0,0x60,0x1B,0x01,0x02,0x18,0xC1,0x10}, //THIS SET GREEN SCREEN ( pixels could be innverted indecode kind of "brg", but blue wont be there. Avoid this data ...
+ {0xD0,0x60,0x26,0x01,0x14,0xD8,0xA4,0x10}, //format out?
+ {0xD0,0x60,0x26,0x01,0x14,0xD8,0xA4,0x10},
+ {0xA0,0x60,0x30,0x3D,0x0A,0xD8,0xA4,0x10},
+ {0xB0,0x60,0x60,0x66,0x68,0xD8,0xA4,0x10},
+ {0xA0,0x60,0x68,0x04,0x68,0xD8,0xA4,0x10},
+ {0xD0,0x60,0x17,0x24,0xD6,0x04,0x94,0x10}, //Clipreg
+ {0xA0,0x60,0x10,0x5D,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x2D,0x0A,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x32,0x00,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x33,0x40,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x11,0xC0,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x00,0x16,0x99,0x04,0x94,0x15}, //bright / Lumino
+ {0xA0,0x60,0x2B,0xAB,0x99,0x04,0x94,0x15}, //?flicker o brillo
+ {0xA0,0x60,0x2D,0x2A,0x99,0x04,0x94,0x15},
+ {0xA0,0x60,0x2D,0x2B,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x32,0x00,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x33,0x00,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x10,0x57,0x99,0x04,0x94,0x16},
+// {0xA0,0x60,0x33,0x9D,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x2D,0x2B,0x99,0x04,0x94,0x16},
+ {0xA0,0x60,0x32,0x00,0x99,0x04,0x94,0x16}, // Low Light ( Enabled: 0x32 0x1 | Disabled: 0x32 0x00 )
+ {0xA0,0x60,0x33,0x29,0x99,0x04,0x94,0x16}, // Low Ligth ( Enabled: 0x33 0x13 | Disabled: 0x33 0x29 )
+// {0xA0,0x60,0x11,0xC1,0x99,0x04,0x94,0x16},
+// {0xA0,0x60,0x00,0x16,0x99,0x04,0x94,0x15},
+ {0xA0,0x60,0x00,0x17,0x99,0x04,0x94,0x15},
+ {0xA0,0x60,0x00,0x18,0x99,0x04,0x94,0x15},
+ {0 , 0, 0, 0, 0, 0, 0, 0},
+}
+;
static int
sonix_i2cwrite(struct usb_device *dev, __u8 * buffer, __u16 length)
{
@@ -380,6 +423,7 @@
__u8 i2cpdoit[] = { 0xA0, 0x40, 0x11, 0x01, 0x31, 0x00, 0x63, 0x16 };
//__u8 i2cpexpo1[] = { 0xB0,0x40,0x04,0x07,0x2A,0x00,0x63,0x16 };
__u8 i2cpexpo[] = { 0xB0, 0x40, 0x0e, 0x01, 0xab, 0x00, 0x63, 0x16 };
+ __u8 i2cOV6650[] = { 0xa0, 0x60, 0x06,0x11, 0x99, 0x04, 0x94, 0x15 };
if (spca50x->sensor == SENSOR_TAS5130CXX ||
spca50x->sensor == SENSOR_TAS5110) {
value = (0xFF - (spca50x->brightness >> 8));
@@ -416,6 +460,12 @@
if (sonix_i2cwrite(spca50x->dev, i2cpdoit, 8) < 0)
PDEBUG(0, "i2c error brightness");
}
+ else if( spca50x->sensor == SENSOR_OV6650 )
+ {
+ i2cOV6650[3] =spca50x->brightness>> 8;
+ if (sonix_i2cwrite(spca50x->dev, i2cOV6650, 8) < 0)
+ PDEBUG(0, "i2c error brightness");
+ }
}
static void
sonix_setcontrast(struct usb_spca50x *spca50x)
@@ -513,6 +563,17 @@
}
return 0;
}
+static int
+ov6650_I2cinit(struct usb_spca50x *spca50x)
+{
+ int i = 0;
+ while (ov6650_sensor_init[i][0]) {
+ if (sonix_i2cwrite(spca50x->dev, ov6650_sensor_init[i], 8) < 0)
+ PDEBUG(0, "i2c error ov665-");
+ i++;
+ }
+ return 0;
+}
static void
sonix_start(struct usb_spca50x *spca50x)
{
@@ -588,6 +649,17 @@
CompressCtrl[1] = 0x20; //reg19 30
MCK_SIZE = 0x20;
break;
+ case SENSOR_OV6650:
+ sn9c10x = initOv6650;
+ if( spca50x->mode )
+ compress = 0x9b;
+ else
+ compress = 0x8b;
+ CompressCtrl[0] = compress;
+ frmult = 0x68;
+ CompressCtrl[1] = 0x20;
+ MCK_SIZE = 0x20;
+ break;
}
/* reg 0x01 bit 2 video transfert on */
@@ -615,6 +687,9 @@
case SENSOR_PAS202:
err = pas202_I2cinit(spca50x);
break;
+ case SENSOR_OV6650:
+ err = ov6650_I2cinit(spca50x);
+ break;
default:
err = -EINVAL;
break;
@@ -658,7 +733,8 @@
break;
case SENSOR_PAS106:
case SENSOR_TAS5110:
- set_sonixSIF(spca50x);
+ case SENSOR_OV6650:
+ set_sonixSIF(spca50x);
break;
default:
return -EINVAL;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
webcam-osx-devs mailing list
webcam-osx-devs@...
https://lists.sourceforge.net/lists/listinfo/webcam-osx-devs