Skip to contentSkip to conversation

support for ivtv drivers?

DISCUSSION * 2 participants 3 messages May 19, 2005

lore
Share & tools
lore

*

author
#0 lore raw

Hello, thanks for your work on i2c! I have a driver request for i2c 2.8.0, when you have the time to work on it, or if enough other people request it. It's for the ivtv drivers, which are for the WinTV PVR-250 (TV card with hardware decoding) which are also used by MythTV:

http://ivtv.sourceforge.net/
http://sourceforge.net/projects/ivtv/

This creates modules named:
msp3400.o saa7115.o tveeprom.o ivtv.o saa7127.o

I think perhaps the msp3400 is also not the same as the one included with linux.

I tried this weekend to port them using your documention, and got them to compile, but when I try loading them there are unresolved symbols. This is the only thing stopping me from going to the 2.5/2.6 kernels. The ivtv drivers are officially beta, but they seem very stable to me, and I think there are quite a few people using this card.

Thanks!
Jonah

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

#1 lore raw
Quoted 8 lines

Hello, thanks for your work on i2c! I have a driver request for i2c 2.8.0, when you have the time to work on it, or if enough other people request it. It's for the ivtv drivers, which are for the WinTV PVR-250(TV card with hardware decoding) which are also used by MythTV:

http://ivtv.sourceforge.net/
http://sourceforge.net/projects/ivtv/

Patch attached. Note that this patch ports the driver for use with a 2.4.21 kernel with the i2c-2.8.0 subsystem. It is *not* meant for Linux 2.5/2.6. You can still try, but I fear much more work would be needed (and this is *not* our job, it is the driver author's one).

Signature · 175 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
-------------- next part --------------
diff -ru ivtv-orig/driver/ivtv-i2c.c ivtv-i2c/driver/ivtv-i2c.c
--- ivtv-orig/driver/ivtv-i2c.c	Thu Jul 24 05:48:55 2003
+++ ivtv-i2c/driver/ivtv-i2c.c	Thu Jul 24 17:06:53 2003
@@ -41,14 +41,13 @@
 }
 
 static struct i2c_adapter ivtv_i2c_adapter_template = {
-        "ivtv i2c driver",	/*name*/
-        I2C_HW_B_BT848,		/*id?? (algo-bit is OR'd with this)*/
-        NULL, 			/*algorighm (set by i2c-algo-bit)*/
-        NULL,		 	/*algodata, filled from template*/
-        ivtv_i2c_inc, 		/*inc usage*/
-        ivtv_i2c_dec, 		/*dec usage*/
-	client_register:	attach_inform,
-	client_unregister:	detach_inform,
+	.owner = THIS_MODULE,
+	.name = "ivtv i2c driver",
+	.id = I2C_HW_B_BT848, /*algo-bit is OR'd with this*/
+	.algo = NULL, /*set by i2c-algo-bit*/
+	.algo_data = NULL, /*filled from template*/
+	.client_register = attach_inform,
+	.client_unregister = detach_inform,
 };
 
 static struct i2c_algo_bit_data ivtv_i2c_algo_template = {
@@ -175,16 +174,6 @@
 	}
 
 	return 0;
-}
-
-void ivtv_i2c_inc(struct i2c_adapter *adapter) {
-	IVTV_DEBUG(IVTV_DEBUG_I2C, "i2c increasing usage count\n");
-	MOD_INC_USE_COUNT;
-}
-
-void ivtv_i2c_dec(struct i2c_adapter *adapter) {
-	IVTV_DEBUG(IVTV_DEBUG_I2C, "i2c decreasing usage count\n");
-	MOD_DEC_USE_COUNT;
 }
 
 /* init + register i2c algo-bit adapter */
diff -ru ivtv-orig/driver/saa7115.c ivtv-i2c/driver/saa7115.c
--- ivtv-orig/driver/saa7115.c	Thu Jul 24 05:16:53 2003
+++ ivtv-i2c/driver/saa7115.c	Thu Jul 24 17:02:02 2003
@@ -958,22 +958,6 @@
 
 /* ----------------------------------------------------------------------- */
 
-static void
-saa7114_inc_use (struct i2c_client *client)
-{
-#ifdef MODULE
-	MOD_INC_USE_COUNT;
-#endif
-}
-
-static void
-saa7114_dec_use (struct i2c_client *client)
-{
-#ifdef MODULE
-	MOD_DEC_USE_COUNT;
-#endif
-}
-
 /*
  * Generic i2c probe
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
@@ -1094,6 +1078,7 @@
 /* ----------------------------------------------------------------------- */
 
 struct i2c_driver i2c_driver_saa7114 = {
+	.owner = THIS_MODULE,
 	.name = "saa7115",
 
 	.id = I2C_DRIVERID_SAA7114,
@@ -1102,8 +1087,6 @@
 	.attach_adapter = saa7114_attach_adapter,
 	.detach_client = saa7114_detach_client,
 	.command = saa7114_command,
-	.inc_use = saa7114_inc_use,
-	.dec_use = saa7114_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;
diff -ru ivtv-orig/driver/saa7127.c ivtv-i2c/driver/saa7127.c
--- ivtv-orig/driver/saa7127.c	Thu Jul 24 05:16:53 2003
+++ ivtv-i2c/driver/saa7127.c	Thu Jul 24 17:02:34 2003
@@ -878,25 +878,6 @@
 /* ----------------------------------------------------------------------- */
 
 
-static void saa7127_inc_use (struct i2c_client *client)
-{
-  #ifdef MODULE
-    MOD_INC_USE_COUNT;
-  #endif
-}
-
-
-/* ----------------------------------------------------------------------- */
-
-static void saa7127_dec_use (struct i2c_client *client)
-{
-  #ifdef MODULE
-    MOD_DEC_USE_COUNT;
-  #endif
-}
-
-
-
 /*
  * Generic i2c probe
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
@@ -1071,14 +1052,13 @@
 
 struct i2c_driver i2c_driver_saa7127  {
+  .owner          = THIS_MODULE,
   .name           = "saa7127",
   .id             = I2C_DRIVERID_SAA7127,
   .flags          = I2C_DF_NOTIFY,
   .attach_adapter = saa7127_attach_adapter,
   .detach_client  = saa7127_detach_client,
   .command        = saa7127_command,
-  .inc_use        = saa7127_inc_use,
-  .dec_use        = saa7127_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;
diff -ru ivtv-orig/driver/tveeprom.c ivtv-i2c/driver/tveeprom.c
--- ivtv-orig/driver/tveeprom.c	Tue Apr  1 06:42:35 2003
+++ ivtv-i2c/driver/tveeprom.c	Thu Jul 24 17:02:57 2003
@@ -450,22 +450,6 @@
 
 /* ----------------------------------------------------------------------- */
 
-static void
-tveeprom_inc_use (struct i2c_client *client)
-{
-#ifdef MODULE
-/*	MOD_INC_USE_COUNT; */
-#endif
-}
-
-static void
-tveeprom_dec_use (struct i2c_client *client)
-{
-#ifdef MODULE
-/*	MOD_DEC_USE_COUNT; */
-#endif
-}
-
 /*
  * Generic i2c probe
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
@@ -557,6 +541,7 @@
 /* ----------------------------------------------------------------------- */
 
 struct i2c_driver i2c_driver_tveeprom = {
+	.owner = THIS_MODULE,
 	.name = "tveeprom",
 
 	.id = I2C_DRIVERID_TVEEPROM,
@@ -565,8 +550,6 @@
 	.attach_adapter = tveeprom_attach_adapter,
 	.detach_client = tveeprom_detach_client,
 	.command = tveeprom_command,
-	.inc_use = tveeprom_inc_use,
-	.dec_use = tveeprom_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;
author
#2 lore raw
In reply to *

Hello, sorry for the late reply. I wanted to report that this patch works beautifully with 2.4.21! I tried with 2.6.0-test2 and it wouldn't compile but at least I can use the latest lm_sensors now. Maybe I will inquire about 2.6 support on the ivtv list.

Thanks again,
Jonah

Quoted 188 lines · --- Jean Delvare
Quoted 8 lines

Hello, thanks for your work on i2c! I have a driver request for i2c 2.8.0, when you have the time to work on it, or if enough other people request it. It's for the ivtv drivers, which are for the WinTV PVR-250(TV card with hardware decoding) which are also used by MythTV:

http://ivtv.sourceforge.net/
http://sourceforge.net/projects/ivtv/

Patch attached. Note that this patch ports the driver for use with a 2.4.21 kernel with the i2c-2.8.0 subsystem. It is *not* meant for Linux 2.5/2.6. You can still try, but I fear much more work would be needed (and this is *not* our job, it is the driver author's one).

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
Quoted 1 line

diff -ru ivtv-orig/driver/ivtv-i2c.c ivtv-i2c/driver/ivtv-i2c.c

driver/ivtv-i2c.c +7 -18
@@ -41,14 +41,13 @@
 }
 
 static struct i2c_adapter ivtv_i2c_adapter_template = {
-        "ivtv i2c driver",	/*name*/
-        I2C_HW_B_BT848,		/*id?? (algo-bit is OR'd with this)*/
-        NULL, 			/*algorighm (set by i2c-algo-bit)*/
-        NULL,		 	/*algodata, filled from template*/
-        ivtv_i2c_inc, 		/*inc usage*/
-        ivtv_i2c_dec, 		/*dec usage*/
-	client_register:	attach_inform,
-	client_unregister:	detach_inform,
+	.owner = THIS_MODULE,
+	.name = "ivtv i2c driver",
+	.id = I2C_HW_B_BT848, /*algo-bit is OR'd with this*/
+	.algo = NULL, /*set by i2c-algo-bit*/
+	.algo_data = NULL, /*filled from template*/
+	.client_register = attach_inform,
+	.client_unregister = detach_inform,
 };
 
 static struct i2c_algo_bit_data ivtv_i2c_algo_template = {
@@ -175,16 +174,6 @@
 	}
 
 	return 0;
-}
-
-void ivtv_i2c_inc(struct i2c_adapter *adapter) {
-	IVTV_DEBUG(IVTV_DEBUG_I2C, "i2c increasing usage count\n");
-	MOD_INC_USE_COUNT;
-}
-
-void ivtv_i2c_dec(struct i2c_adapter *adapter) {
-	IVTV_DEBUG(IVTV_DEBUG_I2C, "i2c decreasing usage count\n");
-	MOD_DEC_USE_COUNT;
 }
 
 /* init + register i2c algo-bit adapter */

diff -ru ivtv-orig/driver/saa7115.c ivtv-i2c/driver/saa7115.c

driver/saa7115.c +0 -16
@@ -958,22 +958,6 @@
 
 /* -----------------------------------------------------------------------
 */
 
-static void
-saa7114_inc_use (struct i2c_client *client)
-{
-#ifdef MODULE
-	MOD_INC_USE_COUNT;
-#endif
-}
-
-static void
-saa7114_dec_use (struct i2c_client *client)
-{
-#ifdef MODULE
-	MOD_DEC_USE_COUNT;
-#endif
-}
-
 /*
  * Generic i2c probe

* concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'

driver/saa7115.c +1 -0
@@ -1094,6 +1078,7 @@
 /* -----------------------------------------------------------------------
 */
 
 struct i2c_driver i2c_driver_saa7114 = {
+	.owner = THIS_MODULE,
 	.name = "saa7115",
 
driver/saa7115.c +0 -2
 	.id = I2C_DRIVERID_SAA7114,
@@ -1102,8 +1087,6 @@
 	.attach_adapter = saa7114_attach_adapter,
 	.detach_client = saa7114_detach_client,
 	.command = saa7114_command,
-	.inc_use = saa7114_inc_use,
-	.dec_use = saa7114_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;

diff -ru ivtv-orig/driver/saa7127.c ivtv-i2c/driver/saa7127.c

driver/saa7127.c +0 -19
@@ -878,25 +878,6 @@
 /* -----------------------------------------------------------------------
 */
 
 
-static void saa7127_inc_use (struct i2c_client *client)
-{
-  #ifdef MODULE
-    MOD_INC_USE_COUNT;
-  #endif
-}
-
-
-/* -----------------------------------------------------------------------
 */
-
-static void saa7127_dec_use (struct i2c_client *client)
-{
-  #ifdef MODULE
-    MOD_DEC_USE_COUNT;
-  #endif
-}
-
-
-
 /*

* Generic i2c probe
* concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'

driver/saa7127.c +1 -2
@@ -1071,14 +1052,13 @@
 
 struct i2c_driver i2c_driver_saa7127 >  {
+  .owner          = THIS_MODULE,
   .name           = "saa7127",
   .id             = I2C_DRIVERID_SAA7127,
   .flags          = I2C_DF_NOTIFY,
   .attach_adapter = saa7127_attach_adapter,
   .detach_client  = saa7127_detach_client,
   .command        = saa7127_command,
-  .inc_use        = saa7127_inc_use,
-  .dec_use        = saa7127_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;

diff -ru ivtv-orig/driver/tveeprom.c ivtv-i2c/driver/tveeprom.c

driver/tveeprom.c +0 -16
@@ -450,22 +450,6 @@
 
 /* -----------------------------------------------------------------------
 */
 
-static void
-tveeprom_inc_use (struct i2c_client *client)
-{
-#ifdef MODULE
-/*	MOD_INC_USE_COUNT; */
-#endif
-}
-
-static void
-tveeprom_dec_use (struct i2c_client *client)
-{
-#ifdef MODULE
-/*	MOD_DEC_USE_COUNT; */
-#endif
-}
-
 /*
  * Generic i2c probe

* concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'

driver/tveeprom.c +1 -0
@@ -557,6 +541,7 @@
 /* -----------------------------------------------------------------------
 */
 
 struct i2c_driver i2c_driver_tveeprom = {
+	.owner = THIS_MODULE,
 	.name = "tveeprom",
 
driver/tveeprom.c +0 -0
 	.id = I2C_DRIVERID_TVEEPROM,

driver/tveeprom.c line 555

Quoted 8 lines
driver/tveeprom.c +0 -2
@@ -565,8 +550,6 @@
 	.attach_adapter = tveeprom_attach_adapter,
 	.detach_client = tveeprom_detach_client,
 	.command = tveeprom_command,
-	.inc_use = tveeprom_inc_use,
-	.dec_use = tveeprom_dec_use,
 };
 
 EXPORT_NO_SYMBOLS;

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com