public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Michael Buesch <mb@bu3sch.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	David Brownell <david-b@pacbell.net>
Subject: Re: [PATCH v3] Add bt8xxgpio driver
Date: Thu, 10 Jul 2008 16:02:58 -0300	[thread overview]
Message-ID: <20080710160258.4ddb5c61@gaivota> (raw)
In-Reply-To: <200807101914.10174.mb@bu3sch.de>

Hi Michael,

On Thu, 10 Jul 2008 19:14:09 +0200
Michael Buesch <mb@bu3sch.de> wrote:

> +comment "PCI GPIO expanders:"
> +
> +config GPIO_BT8XX
> +	tristate "BT8XX GPIO abuser"
> +	depends on PCI && VIDEO_BT848=n
> +	help
> +	  The BT8xx frame grabber chip has 24 GPIO pins than can be abused
> +	  as a cheap PCI GPIO card.
> +
> +	  This chip can be found on Miro, Hauppauge and STB TV-cards.
> +
> +	  The card needs to be physically altered for using it as a
> +	  GPIO card. For more information on how to build a GPIO card
> +	  from a BT8xx TV card, see the documentation file at
> +	  Documentation/bt8xxgpio.txt
> +
> +	  If unsure, say N.
> +
>  comment "SPI GPIO expanders:"

... 

> +static struct pci_device_id bt8xxgpio_pci_tbl[] = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848) },
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849) },
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878) },
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT879) },
> +	{ 0, },

Even being an old design, there are still several new cheap boards based on
those devices (for example, I received those days a new Encore board with a
bttv chip). So, a driver for electronics hackers for using this chip as a
generic io driver shouldn't cause regressions at the real video streaming
driver, that are used by a large number of people.

However, the way you've defined the pci table, and your Kconfig allows someone
to compile both the real driver and the gpio only driver, and they are
currently incompatible.

So, this will cause a regression.

One alternative would be to make the gpio driver dependent of !VIDEO_BT848.

However, a much better alternative would be if you can rework on it to be a
module that adds this functionality to the original driver, allowing to have
both video control and gpio control, since, on a few cases like surveillance
systems, the gpio's may be used for other things, like controlling security
sensors, or switching a video commutter.

Btw, if you are thinking on using it for your electronics hacking, one very
interesting feature would be to use the bttv 8-bit high speed ADC as a generic
ADC. On its normal operation, it samples from video inputs at 27 MHz (maybe you
can sample on even higher frequencies, by properly configuring the sampling divider).


Cheers,
Mauro

  parent reply	other threads:[~2008-07-10 19:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10 17:14 [PATCH v3] Add bt8xxgpio driver Michael Buesch
2008-07-10 18:15 ` Jiri Slaby
2008-07-10 18:44   ` Michael Buesch
2008-07-10 20:02   ` David Brownell
2008-07-11 12:53     ` Michael Buesch
2008-07-10 19:02 ` Mauro Carvalho Chehab [this message]
2008-07-10 19:12   ` Michael Buesch
2008-07-10 19:33     ` Mauro Carvalho Chehab
2008-07-11 13:00       ` Michael Buesch

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=20080710160258.4ddb5c61@gaivota \
    --to=mchehab@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mb@bu3sch.de \
    --cc=sfr@canb.auug.org.au \
    /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