From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
To: David Brownell <david-b@pacbell.net>
Cc: Jean Delvare <khali@linux-fr.org>,
video4linux-list@redhat.com, i2c@lm-sensors.org
Subject: Re: [i2c] [RFC PATCH 3/8] Add PCA9536 4 bit I2C GPIO extender support to the pca9539 GPIO driver
Date: Thu, 31 Jan 2008 12:30:19 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0801311204280.6494@axis700.grange> (raw)
In-Reply-To: <200801310248.41076.david-b@pacbell.net>
On Thu, 31 Jan 2008, David Brownell wrote:
> On Thursday 31 January 2008, Guennadi Liakhovetski wrote:
> > patch-1: git-mv
> > patch-2: sed -e "s/pca9539/pca953x/"
> > patch-3: pca953[678]
> >
> > ?
>
> I think that last would be clearest in terms of GIT history
> and patch reviewability... that's why you listed it, right? :)
> So that one, given my druthers.
Was my preference too.
> > > > > depends on I2C
> > > > > help
> > > > > - Say yes here to support the PCA9539 16-bit I/O port. These
> > > > > - parts are made by NXP and TI.
> > > > > + Say yes here to support PCA9539 16-bit and PCA9536 4-bit I/O ports.
> > >
> > > This should IMO list the '38 (8-bit) and '37 (4-bit) parts too.
> > > Same register layout as the '36 (4-bit). Otherwise the "x" seems
> > > misleading...
> >
> > Ok, I don't want to look through all datasheets ATM, so, I'll just trust
> > you, ok?
>
> OK by me. The NXP website makes them easy enough to find, but
> it's another one of those sites that tries to be too clever by
> overusing JavaScript.
I'm actually adding 9534 (8-bit) and 9535 (16-bit) too atm, if you don't
mind:-)
> > > What I'd do is save those four offsets directly in pca953x_chip,
> > > initialized near when gpio_chip.ngpio is set up and with no need
> > > for a separate "desc" type or table. Eventually there'd be:
> > >
> > > struct i2c_device_id chips [] = {
> > > { "pca9536", 4, },
> > > { "pca9537", 4, },
> > > { "pca9538", 8, },
> > > { "pca9539", 16, },
> > > };
> > > MODULE_DEVICE_TABLE(i2c, chips);
> > >
> > > Meanwhile, the equivalent of that table can come from a few strcmp()
> > > tests in the probe() logic -- like what you already have, except
> > > not using a "desc" type.
> >
> > I introduced the descriptor array, to contain _constant_ chip
> > descriptions, much like your "struct i2c_device_id chips []" array above.
> > So, actually, using my descriptor array is nearer to what it eventually
> > should become, I think. Under 2.6.26 you'd also, probably, just have a
> > "struct i2c_device_id *" member in your pca953x_chip.
>
> Well, I was also pointing out that all you need is the number of GPIOs;
> no need to save any ID struct at all. These chips are VERY similar.
Ok, agreed, let's remove it then. For now I just use an array of structs
similar to i2c_device_id only to avoid a long sequence of strcmp calls in
probe() and compare the name in a loop. Is this alright?
> > > > > +#ifndef NO_GPIO
> > > > > +#define NO_GPIO ((unsigned int)-1)
> > > > > +#endif
> > > > > +
> > > >
> > > > I don't understand this.
> > >
> > > Me either; *ANY* negative number is invalid as a GPIO number,
> > > not just "-1"...
> >
> > Ok, this one should rather go into a separate patch. I'd like to have such
> > a macro to check whether the platform is using a GPIO with this specific
> > camera or not. Similar to NO_IRQ.
>
> Then maybe there should be an is_valid_gpio() predicate.
> Anything not between 0..MAX_INT would fail. And there
> should be a Documentation/gpio.txt update to match.
Good, will do that.
Thanks
Guennadi
---
Guennadi Liakhovetski
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next prev parent reply other threads:[~2008-01-31 11:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0801231646090.4932@axis700.grange>
2008-01-23 17:41 ` [RFC PATCH 3/8] Philips PCA9536 4 bit I2C GPIO extender driver Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.0801231820060.4932-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2008-01-27 21:45 ` Jean Delvare
2008-01-27 22:27 ` [i2c] " Guennadi Liakhovetski
[not found] ` <20080127224559.4eed7cea-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-01-28 6:18 ` David Brownell
2008-01-30 16:48 ` [i2c] [RFC PATCH 3/8] Add PCA9536 4 bit I2C GPIO extender support to the pca9539 GPIO driver Guennadi Liakhovetski
2008-01-31 1:31 ` eric miao
[not found] ` <f17812d70801301731n62597f12kc151d01c320e3dec-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-01-31 4:52 ` David Brownell
2008-01-31 10:13 ` [i2c] " Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.0801311025210.6494-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2008-01-31 10:48 ` David Brownell
2008-01-31 11:30 ` Guennadi Liakhovetski [this message]
[not found] ` <Pine.LNX.4.64.0801311204280.6494-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2008-01-31 11:46 ` David Brownell
2008-01-31 11:49 ` David Brownell
2008-01-31 13:30 ` [i2c] " Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.0801311425300.6494-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2008-01-31 23:56 ` David Brownell
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=Pine.LNX.4.64.0801311204280.6494@axis700.grange \
--to=g.liakhovetski@pengutronix.de \
--cc=david-b@pacbell.net \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.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