From: "Haavard Skinnemoen" <hskinnemoen@gmail.com>
To: "David Brownell" <david-b@pacbell.net>
Cc: hskinnemoen@atmel.com, linux-kernel@vger.kernel.org,
andrew@sanpeople.com, akpm@osdl.org
Subject: Re: [-mm patch 1/4] GPIO framework for AVR32
Date: Wed, 8 Nov 2006 23:47:36 +0100 [thread overview]
Message-ID: <1defaf580611081447t4f443657xc4058626ce0f0907@mail.gmail.com> (raw)
In-Reply-To: <20061108221220.44E6C1DC983@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
On 11/8/06, David Brownell <david-b@pacbell.net> wrote:
> > The request/free calls aren't really arch-specific, are they?
>
> Remember that where one platform may use numbers 32-159 for GPIOs, another
> might use 0-71 ... GPIO numbering has an arch-specific core, but whether
> a given board adds more GPIOs from an FPGA or other non-SOC chip is even
> more variable than "arch-specific".
Sorry, I'm having trouble expressing myself clearly today ;-)
I didn't mean to suggest that the interpretation of the numbers or the
gpio_request() implementation should be arch-independent. I was merely
suggesting that the _concept_ of requesting GPIO pins before using
them, keeping track of which pins have been allocated before, isn't
something inherently arch-specific.
I'm all for leaving it up to each arch or possibly each sub-arch how
to implement the request/free functions. They can even be implemented
as no-op stubs that always succeed for all I care. But I don't think
any arch or platform will really have much trouble with implementing
some kind of "please reserve this gpio pin represented as an unsigned
int for me" call.
> > I implement the actual allocation mechanism using atomic bitops.
>
> That's a fair way to implement it, sure; but if you look at e.g. how
> OMAP does it, the bitmap is inside a per-controller structure. When
> one chip has two different _types_ of GPIO controller, and multiple
> instances of one (plus restrictions applying to specific instances),
> the notion of an arch-neutral implementation there seems unworkable.
Agreed. The avr32 implementation also uses a per-controller bitmap and
supports any number of instances (up to a compile-time limit since it
is initialized too early to be able to allocate any memory.) It
doesn't support different type of controllers though; that would
require some kind of demuxing and should probably be avoided on
platforms that don't need it.
Haavard
next prev parent reply other threads:[~2006-11-08 22:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-07 11:25 [-mm patch 0/4] Atmel SPI driver and related AVR32 changes Haavard Skinnemoen
2006-11-07 11:27 ` [-mm patch 1/4] GPIO framework for AVR32 Haavard Skinnemoen
2006-11-07 11:31 ` [-mm patch 2/4] AVR32: spi/ethernet platform_device update Haavard Skinnemoen
2006-11-07 11:33 ` [-mm patch 3/4] AVR32: Move spi device definitions into main board setup file Haavard Skinnemoen
2006-11-07 11:41 ` [-mm patch 4/4] Atmel SPI driver Haavard Skinnemoen
2006-11-07 14:12 ` [-mm patch 5/4] Atmel SPI driver: MAINTAINERS entry Haavard Skinnemoen
2006-11-07 21:10 ` [-mm patch 1/4] GPIO framework for AVR32 Andrew Morton
2006-11-07 22:37 ` David Brownell
2006-11-08 11:48 ` Haavard Skinnemoen
2006-11-08 18:00 ` David Brownell
2006-11-08 18:57 ` Haavard Skinnemoen
2006-11-08 22:12 ` David Brownell
2006-11-08 22:47 ` Haavard Skinnemoen [this message]
2006-11-09 7:26 ` Andrew Victor
2006-11-09 20:41 ` [Bulk] " David Brownell
2006-11-07 21:36 ` David Brownell
2006-11-08 10:30 ` Haavard Skinnemoen
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=1defaf580611081447t4f443657xc4058626ce0f0907@mail.gmail.com \
--to=hskinnemoen@gmail.com \
--cc=akpm@osdl.org \
--cc=andrew@sanpeople.com \
--cc=david-b@pacbell.net \
--cc=hskinnemoen@atmel.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®