BT878 + 16 Channel multiplexer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I've mananged to borrow a bt878 card with an external 4067 multiplexer (
16input-1output, 4bit channel selection).
The 4 address lines from the 4067 are connected to the GPIO[0:3] (pins
86-83).  How can I control this thru the bttv driver (0.7.x)?

By looking at the bttv-card.c code it looks like I need something like the
following:


// I'm ignoring the fact this runs on top AUDIO stuff,
// VIDIOCSAUDIO is used to set the current channel
// VIDIOCGAUDIO is used to read the current channel
// flags (stuct video_audio)  constains the channel
{
 name: "bt878 + 16channel mux (4067)"
 video_inputs: 4,
 pll: PLL_28,
 audio_hook: external4067_muxsel
}

void external4067_muxsel(struct bttv *btv, struct video_audio *v, int set){
  int data;
  int input

  data=btread(BT848_GPIO_DATA);

  if(set){ // set mode, caused by VIDIOCSAUDIO
    //v->flags contaings the channel (4bit) from the user
    if((v->flags<16)&&(v->flags>=0))
      data&=v->flags;
  }else{   //read mode, caused by VIDIOCGAUDIO
    v->flags=data&0x000F;   //only return the [3:0] bits
  }

  btwrite(data,BT848_GPIO_DATA);
}

What does btread(BT848_GPIO_DATA) give me? Do I just set bit 0 to TRUE to
set the GPIO pin to TRUE?  I'll try the code after I get some sleep.






[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux