newbus questions

Artem 'ZaZooBred' Ignatiev zazubrik at mail.ru
Thu Mar 16 10:59:55 UTC 2006


Hello, hackers!

I need some help regarding newbus architecture. I'm trying to write
driver for budget DVB cards. 

I have had written driver for one of those card two years ago, but it
was very specific regarding tuner that must be present on card. Now
these cards are EOL-ed, and they are replaced with more recent version
of card with another tuner. 

As far as I understand, all such cards have the same architecture: there
is bridge chip (Philips SAA7146) which interfaces with PC (using PCI)
and tuner on the card (using I2C), so in terms of newbus Properly
Written (tm) driver must be split in two parts: driver for the SAA7146
itself (which will be a ``bus-device'') and drivers for specific tuners
(which will act as a child device on a SAA7146 "bus").

I had read arch-handbook and googled, but couldn't find an answer to
some questions:

1. How to create the bus itself, and properly describe its interfaces?
skeletons of bus-driver and frontend-drivers would be a GREAT help.

2. SAA7146 uses I2C to communicate with tuners, and I know that there
are some I2C-related peaces already in kernel. I would like to reuse
that code, if possible, but can't figure out where to look and how to
link it in. 

3. Card vendors use different PCI_SUBDEVICE on SAA7146 to indicate which
tuner is (possibly) used. So, I suppose that "bus"-driver shall provide
some way to tuner-driver to get this information. How that can be done?

4. I would like to have driver, acting like "sound" -- loading one
driver loads as dependencies all present sub-drivers for tuners, so
after "bus"-driver identifies card it could try to probe sub-drivers for
tuner searching for one to match. How is that done? (I suppose it can be
something like no-op driver, that MODULE_DEPEND(9)s on modules it knows
about)? 

Thanks in advance.



More information about the freebsd-hackers mailing list