Re: patch to support for 0x0802 sensor in t613.c

2009-12-30 Thread leandro Costantino
Hi Nicoulau,
could you try the attached patch and add the Signed-Off by  so we can
merge it???
It's your patch, just removed some lines.

Best Regards


On Fri, Dec 18, 2009 at 4:52 PM, leandro Costantino
lcostant...@gmail.com wrote:
 Nicolau, if you need help, let me know.
 I also, sent you some mails asking for the patch for review some weeks
 ago, i thougth you were missing :)
 good woork
 best regards

 On Fri, Dec 18, 2009 at 8:13 PM, Jean-Francois Moine moin...@free.fr wrote:
 On Fri, 18 Dec 2009 16:46:04 -0200
 Nicolau Werneck nwern...@gmail.com wrote:

 Hello. I am a clueless n00b, and I can't make patches or use any
 proper development tools. But I made this modification to t613.c to
 support this new sensor. It is working fine with me. I just cleaned
 the code up a bit and compiled and tested with the 2.6.32 kernel, and
 it seems to be working fine.

 If somebody could help me creating a proper patch to submit to the
 source tree, I would be most grateful. The code is attached.

 Hello Nicolau,

 Your code seems fine. To create a patch, just go to the linux tree
 root, make a 'diff -u' from the original file to your new t613.c, edit
 it, at the head, add a comment and a 'Signed-off-by: your email', and
 submit to the mailing-list with subject '[PATCH] gspca - t613: Add new
 sensor lt168g'.

 BTW, as you know the name of your sensor, do you know the real name of
 the sensor '0x803' ('other')? (it should be in some xxx.ini file in a
 ms-win driver, but I could not find it - the table n4_other of t613.c
 should be a table 'Regxxx' in the xx.ini)

 Best regards.

 --
 Ken ar c'hentań |             ** Breizh ha Linux atav! **
 Jef             |               http://moinejf.free.fr/
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff -Nru gspca-54a57b75f98c/linux/drivers/media/video/gspca/t613.c gspca-54a57b75f98c-dev/linux/drivers/media/video/gspca/t613.c
--- gspca-54a57b75f98c/linux/drivers/media/video/gspca/t613.c	2009-12-30 02:53:07.0 -0500
+++ gspca-54a57b75f98c-dev/linux/drivers/media/video/gspca/t613.c	2009-12-30 10:52:47.0 -0500
@@ -52,6 +52,7 @@
 #define SENSOR_OM6802 0
 #define SENSOR_OTHER 1
 #define SENSOR_TAS5130A 2
+#define SENSOR_LT168G 3 /* must verify if this is the actual model */
 };
 
 /* V4L2 controls supported by the driver */
@@ -306,6 +307,17 @@
 	0xbe, 0x36, 0xbf, 0xff, 0xc2, 0x88, 0xc5, 0xc8,
 	0xc6, 0xda
 };
+static const u8 n4_lt168g[] = {
+	0x66, 0x01, 0x7f, 0x00, 0x80, 0x7c, 0x81, 0x28,
+	0x83, 0x44, 0x84, 0x20, 0x86, 0x20, 0x8a, 0x70,
+	0x8b, 0x58, 0x8c, 0x88, 0x8d, 0xa0, 0x8e, 0xb3,
+	0x8f, 0x24, 0xa1, 0xb0, 0xa2, 0x38, 0xa5, 0x20,
+	0xa6, 0x4a, 0xa8, 0xe8, 0xaf, 0x38, 0xb0, 0x68,
+	0xb1, 0x44, 0xb2, 0x88, 0xbb, 0x86, 0xbd, 0x40,
+	0xbe, 0x26, 0xc1, 0x05, 0xc2, 0x88, 0xc5, 0xc0,
+	0xda, 0x8e, 0xdb, 0xca, 0xdc, 0xa8, 0xdd, 0x8c,
+	0xde, 0x44, 0xdf, 0x0c, 0xe9, 0x80
+};
 
 static const struct additional_sensor_data sensor_data[] = {
 {/* 0: OM6802 */
@@ -422,6 +434,23 @@
 	.stream =
 		{0x0b, 0x04, 0x0a, 0x40},
 },
+{/* 3: LT168G */
+	.n3 = {0x61, 0xc2, 0x65, 0x68, 0x60, 0x00},
+	.n4 = n4_lt168g,
+	.n4sz = sizeof n4_lt168g,
+	.reg80 = 0x7c,
+	.reg8e = 0xb3,
+	.nset8 = {0xa8, 0xf0, 0xc6, 0xba, 0xc0, 0x00},
+	.data1 = {0xc0, 0x38, 0x08, 0x10, 0xc0, 0x30, 0x10, 0x40,
+		 0xb0, 0xf4},
+	.data2 = {0x40, 0x80, 0xc0, 0x50, 0xa0, 0xf0, 0x53, 0xa6,
+		 0xff},
+	.data3 = {0x40, 0x80, 0xc0, 0x50, 0xa0, 0xf0, 0x53, 0xa6,
+		 0xff},
+	.data4 = {0x66, 0x41, 0xa8, 0xf0},
+	.data5 = {0x0c, 0x03, 0xab, 0x4b, 0x81, 0x2b},
+	.stream = {0x0b, 0x04, 0x0a, 0x28},
+},
 };
 
 #define MAX_EFFECTS 7
@@ -758,6 +787,10 @@
 		PDEBUG(D_PROBE, sensor tas5130a);
 		sd-sensor = SENSOR_TAS5130A;
 		break;
+	case 0x0802:
+		PDEBUG(D_PROBE, sensor lt168g);
+		sd-sensor = SENSOR_LT168G;
+		break;
 	case 0x0803:
 		PDEBUG(D_PROBE, sensor 'other');
 		sd-sensor = SENSOR_OTHER;
@@ -800,6 +833,13 @@
 	reg_w_buf(gspca_dev, sensor-n3, sizeof sensor-n3);
 	reg_w_buf(gspca_dev, sensor-n4, sensor-n4sz);
 
+	if (sd-sensor == SENSOR_LT168G) {
+		test_byte = reg_r(gspca_dev, 0x80);
+		PDEBUG(D_STREAM, Reg 0x%02x = 0x%02x, 0x80,
+		   test_byte);
+		reg_w(gspca_dev, 0x6c80);
+	}
+
 	reg_w_ixbuf(gspca_dev, 0xd0, sensor-data1, sizeof sensor-data1);
 	reg_w_ixbuf(gspca_dev, 0xc7, sensor-data2, sizeof sensor-data2);
 	reg_w_ixbuf(gspca_dev, 0xe0, sensor-data3, sizeof sensor-data3);
@@ -824,6 +864,13 @@
 	reg_w_buf(gspca_dev, sensor-nset8, sizeof sensor-nset8);
 	reg_w_buf(gspca_dev, sensor-stream, sizeof sensor-stream);
 
+	if (sd-sensor == SENSOR_LT168G) {
+		test_byte = reg_r(gspca_dev, 0x80);
+		PDEBUG(D_STREAM, Reg 0x%02x = 0x%02x, 0x80,
+		   test_byte);
+		reg_w(gspca_dev, 0x6c80);
+	}
+
 	reg_w_ixbuf(gspca_dev, 0xd0, sensor-data1, sizeof sensor-data1);
 	reg_w_ixbuf(gspca_dev, 0xc7, sensor-data2, sizeof sensor-data2);

Re: patch to support for 0x0802 sensor in t613.c

2009-12-30 Thread Nicolau Leal Werneck
Em Wed, 30 Dec 2009 04:56:03 -0500
leandro Costantino lcostant...@gmail.com escreveu:

Hello. Thanks for the help! The problem is I'm away from home, on
vacation. Also my two computers back home are not workig. But I'm
going to work with that again at my lab next week, at most.

I'll take the chance to ask: where do the gamma correction table values
come from? Because I got slightly different values from the driver I
sniffed...

See you,
  ++nicolau


 Hi Nicoulau,
 could you try the attached patch and add the Signed-Off by  so we can
 merge it???
 It's your patch, just removed some lines.
 
 Best Regards
 
 
 On Fri, Dec 18, 2009 at 4:52 PM, leandro Costantino
 lcostant...@gmail.com wrote:
  Nicolau, if you need help, let me know.
  I also, sent you some mails asking for the patch for review some
  weeks ago, i thougth you were missing :)
  good woork
  best regards
 
  On Fri, Dec 18, 2009 at 8:13 PM, Jean-Francois Moine
  moin...@free.fr wrote:
  On Fri, 18 Dec 2009 16:46:04 -0200
  Nicolau Werneck nwern...@gmail.com wrote:
 
  Hello. I am a clueless n00b, and I can't make patches or use any
  proper development tools. But I made this modification to t613.c
  to support this new sensor. It is working fine with me. I just
  cleaned the code up a bit and compiled and tested with the 2.6.32
  kernel, and it seems to be working fine.
 
  If somebody could help me creating a proper patch to submit to the
  source tree, I would be most grateful. The code is attached.
 
  Hello Nicolau,
 
  Your code seems fine. To create a patch, just go to the linux tree
  root, make a 'diff -u' from the original file to your new t613.c,
  edit it, at the head, add a comment and a 'Signed-off-by: your
  email', and submit to the mailing-list with subject '[PATCH]
  emailgspca - t613: Add new
  sensor lt168g'.
 
  BTW, as you know the name of your sensor, do you know the real
  name of the sensor '0x803' ('other')? (it should be in some
  xxx.ini file in a ms-win driver, but I could not find it - the
  table n4_other of t613.c should be a table 'Regxxx' in the xx.ini)

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: patch to support for 0x0802 sensor in t613.c

2009-12-18 Thread Jean-Francois Moine
On Fri, 18 Dec 2009 16:46:04 -0200
Nicolau Werneck nwern...@gmail.com wrote:

 Hello. I am a clueless n00b, and I can't make patches or use any
 proper development tools. But I made this modification to t613.c to
 support this new sensor. It is working fine with me. I just cleaned
 the code up a bit and compiled and tested with the 2.6.32 kernel, and
 it seems to be working fine.
 
 If somebody could help me creating a proper patch to submit to the
 source tree, I would be most grateful. The code is attached.

Hello Nicolau,

Your code seems fine. To create a patch, just go to the linux tree
root, make a 'diff -u' from the original file to your new t613.c, edit
it, at the head, add a comment and a 'Signed-off-by: your email', and
submit to the mailing-list with subject '[PATCH] gspca - t613: Add new
sensor lt168g'.

BTW, as you know the name of your sensor, do you know the real name of
the sensor '0x803' ('other')? (it should be in some xxx.ini file in a
ms-win driver, but I could not find it - the table n4_other of t613.c
should be a table 'Regxxx' in the xx.ini)

Best regards.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: patch to support for 0x0802 sensor in t613.c

2009-12-18 Thread leandro Costantino
Nicolau, if you need help, let me know.
I also, sent you some mails asking for the patch for review some weeks
ago, i thougth you were missing :)
good woork
best regards

On Fri, Dec 18, 2009 at 8:13 PM, Jean-Francois Moine moin...@free.fr wrote:
 On Fri, 18 Dec 2009 16:46:04 -0200
 Nicolau Werneck nwern...@gmail.com wrote:

 Hello. I am a clueless n00b, and I can't make patches or use any
 proper development tools. But I made this modification to t613.c to
 support this new sensor. It is working fine with me. I just cleaned
 the code up a bit and compiled and tested with the 2.6.32 kernel, and
 it seems to be working fine.

 If somebody could help me creating a proper patch to submit to the
 source tree, I would be most grateful. The code is attached.

 Hello Nicolau,

 Your code seems fine. To create a patch, just go to the linux tree
 root, make a 'diff -u' from the original file to your new t613.c, edit
 it, at the head, add a comment and a 'Signed-off-by: your email', and
 submit to the mailing-list with subject '[PATCH] gspca - t613: Add new
 sensor lt168g'.

 BTW, as you know the name of your sensor, do you know the real name of
 the sensor '0x803' ('other')? (it should be in some xxx.ini file in a
 ms-win driver, but I could not find it - the table n4_other of t613.c
 should be a table 'Regxxx' in the xx.ini)

 Best regards.

 --
 Ken ar c'hentań |             ** Breizh ha Linux atav! **
 Jef             |               http://moinejf.free.fr/
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html