On Sunday 11 March 2007 14:50, Nicholas Fearnley wrote:
> Hi,
>
> I have a fixed system in which I want to allocate /dev/video devices
> based on which PCI slot my cards are placed in.  I have done this for
> DVB devices already and now I want to do this for IVTV devices.
>
> So basically if all I have is a device in say the third slot along on
> my system (0000:05:03.0) then I will tie that device to /dev/video3.
>
> Can anyone point me in the right direction?  I have found where I
> think the registering of the device occurs but can't find where to
> get which slot it belongs to , the ivtv struct only contains the
> pci_dev which describes bus and I'm not sure there is slot info in
> there.
>
> I am using 0.8.0 (on 2.16.18.1).

Slot information can be obtained as follows (I think):

int pci_slot = PCI_SLOT(itv->dev->devfn);

This assumes you do not have a PVR-500: because that is basically two 
boards in one PCI slot and the slot returned by the line above is 
the 'slot' of the PVR unit on the card, not that of the actual PCI slot 
the card is in.

There is also a ivtv_first_minor module option that might be useful:

/* If you have already X v4l cards, then set this to X. This way
   the device numbers stay matched. Example: you have a WinTV card
   without radio and a PVR-350 with. Normally this would give a
   video1 device together with a radio0 device for the PVR. By
   setting this to 1 you ensure that radio0 is now also radio1. */
int ivtv_first_minor = 0;

Regards,

        Hans

_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to