public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: his@kuro.is.sci.toho-u.ac.jp
Cc: linux-kernel@vger.kernel.org, kraxel@goldbach.in-berlin.de,
	Linux and Kernel Video <video4linux-list@redhat.com>
Subject: Re: [PATCH 2.6.14.3] bttv-cards: add IO-DATA GV-BCTV2/PCI
Date: Sun, 04 Dec 2005 09:44:40 -0200	[thread overview]
Message-ID: <1133696680.1192.18.camel@localhost> (raw)
In-Reply-To: <20051204.111420.74726127.his@kuro.is.sci.toho-u.ac.jp>

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 <kuro@neko.ac>
> 
> 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.


      parent reply	other threads:[~2005-12-04 11:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-04  2:14 [PATCH 2.6.14.3] bttv-cards: add IO-DATA GV-BCTV2/PCI ITO N. Hisashi
2005-12-04  3:14 ` [PATCH 2.6.14.3] hid-core: add HID quirks for Morphy USB-IO ITO N. Hisashi
2005-12-04 11:44 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1133696680.1192.18.camel@localhost \
    --to=mchehab@infradead.org \
    --cc=his@kuro.is.sci.toho-u.ac.jp \
    --cc=kraxel@goldbach.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox