[pvrusb2] driver status; incompatible change coming...

Mike Isely isely at isely.net
Sat Oct 15 23:29:20 CDT 2005


The pvrusb2 driver has been calling directly into the eeprom parsing code 
within tveeprom.c in order to detect various things about the tuner. 
Unfortunately with kernel version 2.6.14, tveeprom.c between kernel 
version 2.6.14 and ivtv version 0.4.0 have now diverged far enough that I 
can't keep the driver compatible with both at the same time.  The core 
problem is that both versions of tveeprom.c's parsing function work with a 
"struct tveeprom" type and the struct definitions are incompatibly 
different between the two.  There's no way to support both anymore.

There is another way to get eeprom information out of tveeprom.c.  Rather 
than calling directly into it, the driver can operate it just like another 
chip level driver (e.g. tuner.ko, msp3400.ko, etc).  The interface for 
this style of operation is more stable and remains compatible. 
Unfortunately, this more stable interface provides less information; it 
provides no means for retrieving the device's serial number, and sysfs 
uses that in constructing the path to the sysfs control interface.

At this point I don't think I have any choice.  In order to support 2.6.14 
with some semblence of sanity while still playing nice with ivtv, I have 
to switch the driver over towards using tveeprom.ko like another I2C chip 
driver, but in doing so I will lose the ability to retrieve the device's 
serial number.  I can use the unit number (just an instance ID starting at 
'a' or zero as devices are found) in place of the serial number for 
constructing that sysfs path.  So instead of "/sys/class/pvrusb2/sn-XXXX" 
(where "XXXX" is the serial number) the sysfs path would become something 
like "/sys/class/pvrusb2/unit-uu" (where "uu" becomes just a letter or 
number which increments with the number of tuners in use).

Anyone have any opinion on this?  I imagine the only ones who would really 
be affected are those trying multiple tuners, but even in that case it 
will still be possible to continue using multiple tuners.

I've already committed a whole bunch of minor tweaks needed for operation 
in the 2.6.14 kernel, and I have a number of changes that need to happen 
in the driver for this to work.  The tveeprom.c that's part of the 2.6.14 
kernel sources indeed expects to be able to read the entire eeprom in a 
single call (see earlier thread today) and I'll have to emulate that with 
the pvrusb2 driver's I2C adapter.  Also, I need to adjust the driver to 
not require the serial number anymore, and most of pvrusb2-eeprom.c will 
have to be rewritten.  Hopefully I can get it all done tomorrow.  After 
that is all in place, then the pvrusb2 driver should work correctly under 
the 2.6.14 kernel and/or with ivtv 0.4.0.

   -Mike


-- 
                         |         Mike Isely          |     PGP fingerprint
      Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                         |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                         |                             |


More information about the pvrusb2 mailing list