Hello everybody reading this, as outline attachment I send: A. the unfinished driver called cx878, to be implied into the current mercurial tree instead of /drivers/media/dvb/bt8xx it should be: /drivers/media/dvb/cx878 (cx878.tar.bz2). Makefile and Kconfig need to be changed then. B. a dummy driver to show how to enhance the pci_probe function (dummy.c) C. a kern.log with the two modules (i. e. cx878_core and cx878_budget) loaded with verbose=5. This will give you some hints about what function works and what function does not work (file = kern.log.bz2) D. a console.txt that shows that the I2C bus part, working on the video controller part (i. e. device=0x036e) works excellently fine (i. e. FRONTEND LOCKED, proved by using szap) There do exist two alternatives on how to finish / complete that project: Alternative A: 1. Using the dummy.c example to extend the capabilities of pci_probe (i. e. probe TWO devices instead of ONE) Alternative B: 2. Generating a separate module for the audio controller (i. e. the RISC DMA engine) with a separate header file Right now, the pci_probe function is only used to probe seven different bt8xx-based cards to ensure that the adequate frontend is loaded. But this is not enough to make the whole driver work fine. Excerpt of cx878_budget.c shows that: static struct pci_device_id cx878_budget_pci_table[] = { MAKE_ENTRY(0x11bd, 0x001c, &cx878_pctvsat_config), /* Pinnacle Sat */ MAKE_ENTRY(0x1461, 0x0761, &cx878_aver761_config), /* Avermedia 761 */ MAKE_ENTRY(0x1461, 0x0771, &cx878_aver771_config), /* Avermedia 771 */ MAKE_ENTRY(0x0071, 0x0101, &cx878_nebula_dtv_config), /* Nebula DigiTV */ MAKE_ENTRY(0x18ac, 0xdb10, &cx878_dvico_dvbt_config), /* DViCO Fusion DVB-T */ MAKE_ENTRY(0x18ac, 0xd500, &cx878_dvico_hdtv_config), /* DViCO Fusion HDTV5 */ MAKE_ENTRY(0x7063, 0x2000, &cx878_pchdtv_config), /* PCHDTV-2000 */ }; MODULE_DEVICE_TABLE(pci, cx878_budget_pci_table); static struct pci_driver cx878_budget_pci_driver = { .name = "CX878 Budget", .id_table = cx878_budget_pci_table, .probe = cx878_budget_pci_probe, .remove = cx878_budget_pci_remove, }; Excerpt of cx878_common.h shows that also: #define MAKE_ENTRY(subven, subdev, configptr) { \ .vendor = 0x109e, \ .device = 0x036e, \ .subvendor = (subven), \ .subdevice = (subdev), \ .driver_data = (unsigned long) (configptr) \ } Please note: As stated in dummy.c, all seven cards have a common video controller address (device=0x036e - I2C bus) and a common audio controller address (device=0x0878 - RISC DMA engine). So please where is the appropriate solution? Is it Alternative A or Alternative B? If this is being finished or even can be finished there will be a driver for bt8xx-based DVB cards consuming less than 2 / 7 of RAM in comparison to the existing driver being dependent of some GPIO and I2C functions (derived from the traditional bttv concept which provides a lot of RAM-wasting dependency-nonsense) who AFAICS do work fine in the existing cx878 model. The only decisive question is how to imply the DMA RISC engine (i. e. audio controller - device=0x0878) under the same roof without conflicts and thus getting out video and audio streams, which is not possible at the current development state. As I said already: Everybody's help is deeply appreciated. Cheers everybody and thanks for reading this Uwe
brian:~# szap -r ZDF reading channels from file '/root/.szap/channels.conf' zapping to 7 'ZDF': sat 0, frequency = 11953 MHz H, symbolrate 27500000, vpid = 0x006e, apid = 0x0078 using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' status 03 | signal 9797 | snr 0000 | ber 00000000 | unc 0000f8b4 | status 1f | signal 9797 | snr 1c9c | ber 00007ce0 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1d5b | ber 0000779d | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1e4e | ber 000084d7 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1db9 | ber 0000828a | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1dd6 | ber 000086c7 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1e8a | ber 000083cf | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1d13 | ber 00008009 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1cc6 | ber 00007ad5 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1dc4 | ber 00007f08 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1f17 | ber 00008d54 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1e63 | ber 00008757 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1dc3 | ber 00007dc9 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1f49 | ber 00008b64 | unc 00000000 | FE_HAS_LOCK status 1f | signal 9797 | snr 1e28 | ber 000083fe | unc 00000000 | FE_HAS_LOCK
Attachment:
cx878.tar.bz2
Description: application/tbz
#include <linux/pci.h> #include <linux/init.h> #include <linux/slab.h> static LIST_HEAD(cx878_pci_list); static DEFINE_MUTEX(cx878_pci_list_lock); struct pci_cx878_data { int cx878_counter; int id; struct list_head cx878_list; }; // Pinnacle PCTVSAT, Avermedia AverTV DVB-T 771 and 761, TT 1.6 DVB-S FF, TwinHan DST and clones, all other bt8xx-based DVB cards equally static struct pci_device_id pci_cx878_ids[]={ { 0x109e, 0x036e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, // function 0, video controller (I2C bus) { 0x109e, 0x0878, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, // function 1, audio controller (RISC DMA engine) {} }; static int __devinit pci_cx878_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) { struct list_head *list = NULL; struct pci_cx878_data *h = NULL, *dev = NULL; int id; id = (pdev->bus->number<<8) | PCI_SLOT(pdev->devfn); printk("ID: %04x\n",id); mutex_lock(&cx878_pci_list_lock); list_for_each(list, &cx878_pci_list) { h = list_entry(list, struct pci_cx878_data, cx878_list); if (h->id == id) dev=h; } if (h != NULL) { dev->cx878_counter++; printk("found cx878 list (ID: %04x)! : %d\n",dev->id,dev->cx878_counter); } else { h=kmalloc(sizeof(struct pci_cx878_data), GFP_KERNEL); h->cx878_counter=5; h->id=id; list_add_tail(&h->cx878_list, &cx878_pci_list); printk("no list available initializing new one (id: %04x): %d\n",h->id, h->cx878_counter); } mutex_unlock(&cx878_pci_list_lock); return 0; } static struct pci_driver driver = { .name = "cx878", .id_table = pci_cx878_ids, .probe = pci_cx878_probe, }; static int __init pci_driver_init(void) { printk("=============== LOADING MODULE ===============\n"); return pci_register_driver(&driver); } static void __exit pci_driver_exit(void) { pci_unregister_driver(&driver); } module_init(pci_driver_init); module_exit(pci_driver_exit);
Attachment:
kern.log.bz2
Description: BZip2 compressed data
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb