[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44CE74CA.8070504@bootc.net>
Date: Mon, 31 Jul 2006 22:23:22 +0100
From: Chris Boot <bootc@...tc.net>
To: Robert Schwebel <r.schwebel@...gutronix.de>
Cc: Ben Dooks <ben@...ff.org>,
kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] Proposal: common kernel-wide GPIO interface
Robert Schwebel wrote:
> On Mon, Jul 31, 2006 at 05:10:56PM +0100, Chris Boot wrote:
>> My current idea is to divide the interfaces by GPIO device and port.
>> I've so far not seen a GPIO device that couldn't be divided into ports
>> of <= 32 bits. How wide can a 'port' actually become?
>
> Not all GPIOs can be abstracted into "ports" in a sane way. For example,
> the PXAs have something like 80 GPIOs, which might be randomly divided
> into alternate functions and "real" GPIOs.
Hmm, now that does complicate things then. :-/
>> Somehow I think that a separate device/file for each pin or possibly
>> even port might not be a wise idea. For example, twiddling individual
>> pins on a GPIO when you connect an LCD, I2C, or SPI interface seems
>> extremely inefficient...
>
> I think you have to take care about two things: a) a registration
> infrastructure (which GPIO pin was requested, similar to mem and irq)
> and b) an access API. For slow things like LEDs you might want to have
> unified access functions, but for fast GPIOs (bitbanging i2c etc) you
> want to directly manipulate the registers once you've requested them.
Yes I was thinking that a GPIO is a resource a little like an IRQ and thinking
of a registration and ownership system as well. I'm glad somebody came up with
that suggestion!
The access API is, as you say, more difficult. The access methods for slow GPIOs
is indeed very simple but I can't think of any way to provide (near-)direct
access for faster accesses in a portable way. Does anyone have any suggestions?
--
Chris Boot
bootc@...tc.net
http://www.bootc.net/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists