Re: [PATCH 2.6.14.3] bttv-cards: add IO-DATA GV-BCTV2/PCI

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

 



Hisashi,

	First of all, kraxel is not the current maintainer. Please c/c to me
instead. Also, please copy v4l mailing list. You don't need to c/c LKML
for this kind of patch.

Em Dom, 2005-12-04 às 11:14 +0900, ITO N. Hisashi escreveu:
> Add support for IO-DATA GV-BCTV/PCI and IO-DATA GV-BCTV2/PCI.
> 
> Signed-off-by: Hisashi Ito <[email protected]>
> 
> diff -U 5 -rpN linux-2.6.14.3-vanilla/drivers/media/video/bttv-cards.c linux-2.6.14.3/drivers/media/video/bttv-cards.c
	No. Newer patches should be generated against V4L tree. It is available
at http://linuxtv.org
>  
> +static void
> +gvbctv2pci_write(struct bttv *btv, int data)
> +{
> +	btwrite(0, BT848_GPIO_OUT_EN);
> +	btwrite(data, BT848_GPIO_DATA);
> +	btwrite(0xff00, BT848_GPIO_OUT_EN);
> +	data &= ~0x400;
> +	btwrite(data, BT848_GPIO_DATA);
> +	data |= 0x400;
> +	btwrite(data, BT848_GPIO_DATA);
> +	btwrite(0xff00, BT848_GPIO_DATA);
> +	btwrite(0, BT848_GPIO_OUT_EN);
> +}
> +
> +static int
> +gvbctv2pci_read(struct bttv *btv)
> +{
> +	int data;
> +
> +	btwrite(0, BT848_GPIO_OUT_EN);
> +	btwrite(0x0d00, BT848_GPIO_DATA);
> +	btwrite(0x0f00, BT848_GPIO_OUT_EN);
> +	btwrite(0x0500, BT848_GPIO_DATA);
> +	data = btread(BT848_GPIO_DATA);
> +	btwrite(0x0d00, BT848_GPIO_DATA);
> +	btwrite(0x0f00, BT848_GPIO_DATA);
> +	btwrite(0, BT848_GPIO_OUT_EN);
> +	return data;
> +}
> +
> +static void
> +gvbctv2pci_muxsel(struct bttv *btv, unsigned int input)
> +{
> +	static const int masks[] = {0x1f00, 0x0f00, 0x0f00};
> +	gvbctv2pci_write(btv, masks[input]);
> +}
> +
> +static void
> +gvbctv2pci_init(struct bttv *btv)
> +{
> +	gvbctv2pci_write(btv, 0x4d00); /* mute */
> +}

> +gvbctv2pci_audio(struct bttv *btv, struct video_audio *v, int set)
> +{
> +	if (set) {
> +		int con = 0x0d00;
> +
> +		if (v->mode & VIDEO_SOUND_LANG2) {
> +			con = 0x3d00; /* LANG2 */
> +			if (v->mode & VIDEO_SOUND_LANG1)
> +				con = 0x1d00; /* LANG1+LANG2 */
> +		}
> +		/* Set BCTV2 mute here since we can't do via direct gpio. */
> +		if (v->flags & VIDEO_AUDIO_MUTE)
> +			con = 0x4d00;
> +		gvbctv2pci_write(btv, con);
> +	} else {
> +		switch (gvbctv2pci_read(btv) & 0x7000) {
> +		case 0x3000:
> +			v->mode = VIDEO_SOUND_STEREO;
> +			break;
> +		case 0x4000:
> +			v->mode = VIDEO_SOUND_LANG1|VIDEO_SOUND_LANG2;
> +			break;
> +		case 0x5000:
> +			v->mode = VIDEO_SOUND_LANG2;
> +			break;
> +		case 0x6000:
> +			v->mode = VIDEO_SOUND_LANG1;
> +			break;
> +		case 0x7000:
> +			v->mode = VIDEO_SOUND_MONO;
> +			break;
> +		default:
> +			v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
> +				  VIDEO_SOUND_LANG1  | VIDEO_SOUND_LANG2;
> +		}
> +	}
> +}
> +
> +static void

	Am I wrong, or do you have a different audio chip? If so, the best
practice is to create a separate file for handling it (like we have for
msp34xx, wm8775 and others). 

> +#define BTTV_GVBCTV2PCI     0x89

	No. Today's last board is 0x8f. This is because you've used 2.6.14 instead of the v4l tree.

Cheers, 
Mauro.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux