[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTinWmdWgGD9ui+WVV7DyCzy73S5AkQ@mail.gmail.com>
Date: Tue, 28 Jun 2011 13:53:07 +0200
From: Stijn Devriendt <highguy@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.walleij@...ricsson.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Lee Jones <lee.jones@...aro.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Kyungmin Park <kmpark@...radead.org>,
Kurt Van Dijck <kurt.van.dijck@....be>,
Ben Nizette <bn@...sdigital.com>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Rohit Vaswani <rvaswani@...eaurora.org>,
Russell King <linux@....linux.org.uk>,
H Hartley Sweeten <hartleys@...ionengravers.com>
Subject: Re: [PATCH 0/2] RFC: gpio: driver-local pin configuration
On Mon, Jun 27, 2011 at 2:37 PM, Linus Walleij <linus.walleij@...aro.org> wrote:
> On Mon, Jun 27, 2011 at 2:02 PM, Mark Brown
> <broonie@...nsource.wolfsonmicro.com> wrote:
>> On Mon, Jun 27, 2011 at 01:44:43PM +0200, Linus Walleij wrote:
>>
>>> Yes. To make the driver platform neutral, it needs to for example
>>> provide a callback in the platform data like (* set_pin_bias) or so,
>>> and then your platform has to implement this biasing.
>>
>>> In this specific case that kind of stuff would likely be preferable
>>> to have in the platform anyway, but I understand what you mean.
>>
>> How about device tree usage? I guess there we'd end up doing it by
>> putting the configuration on the GPIO end of things rather than on the
>> GPIO user side?
>
> Sorry I can't quite understand that, please elaborate!
>
I have some code doing this as well (in a very limited fashion):
int of_request_gpio(..., int* remaining_flags)
{
of_get_gpio_flags(of_dev, i, remaining_flags)
if (flags & bias_X) {
gpio_set_bias(gpio, ...)
flags &= ~bias_X
}
// interpret all generic flags here
};
So drivers need not worry about all gpio flags and special things.
They just request the pin; what they receive is a fully configured
pin (with the exception of unknown flags passed out via
remaining_flags).
Regards,
Stijn
--
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