Re: Multiple Zoran MJPEG cards and i2c misattachments

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jean Delvare
Date: Sunday, June 8, 2008 - 11:51 pm

Hi Sam,

On Mon, 2 Jun 2008 11:32:37 +0200, Martin Samuelsson wrote:

"New-style" i2c drivers are drivers which follow the device driver
model and do not create their own devices (i2c_client). As opposed to
"legacy" i2c drivers in 2.4 kernels and early 2.6 kernels (and still a
lot of drivers in the current 2.6 kernel) which create their own
i2c_client.

Ben wrote a guide about converting legacy drivers to new-style drivers:
  http://marc.info/?l=i2c&m=121250094017709&w=2
It's not finalized yet. Ben, any chance you could send an updated
version of the document in the form of a patch, so that I can push it
upstream?

If you want to go that route for the zoran driver, you'll have to
convert some of the chip drivers (at least bt866 and saa7185 if they
are the ones causing trouble), and also modify the main zoran driver to
create these devices (using i2c_new_device or i2c_new_probed_device) and
remove them (using i2c_unregister_device) as needed.

One problem may be if some of the chip drivers are shared with other
V4L adapters (apparently the bt866 driver is zoran-only, but I'm not
sure about the saa7185 driver). In that case you can't just convert
them to new-style, or you would break the other adapters which expect
the legacy drivers. So you'd have to make hybrid chip drivers, keeping
the legacy driver (for other adapters) and adding a new-style driver
(for zoran.)

In that case, you probably want to look at what Hans Verkuil did for
the ivtv and cx18 adapters, and maybe talk to him. He wrote helper
wrappers to write such hybrid chip drivers easily.

I am working on merging the legacy driver behavior into new-style
drivers to make that kind of migration easier, but that's still work in
progress.


That's not possible with legacy drivers. All legacy chip drivers "see"
all i2c buses, by design. New-style drivers only "see" what they are
told to, that's a major difference.

Note that I have a DC10+ somewhere in a drawer, so if you're going to
convert the zoran drivers to the new-style model, I can help you with
testing. And if you have questions in the process, feel free to ask.
I'll be happy to review your patches.

P.S.: I don't know how much energy you are going to put in the zoran
driver, but I have a number of patches for it, which never made it
upstream, if you're interested.

-- 
Jean Delvare
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Multiple Zoran MJPEG cards and i2c misattachments, Martin Samuelsson, (Sat May 31, 11:39 am)
Re: Multiple Zoran MJPEG cards and i2c misattachments, Martin Samuelsson, (Mon Jun 2, 2:32 am)
Re: Multiple Zoran MJPEG cards and i2c misattachments, Jean Delvare, (Sun Jun 8, 11:51 pm)
Re: Multiple Zoran MJPEG cards and i2c misattachments, Martin Samuelsson, (Tue Jun 10, 10:48 am)