Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbYKZJQu (ORCPT ); Wed, 26 Nov 2008 04:16:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751272AbYKZJQf (ORCPT ); Wed, 26 Nov 2008 04:16:35 -0500 Received: from 81-7-68-229.static.zebra.lt ([81.7.68.229]:46294 "EHLO teltonika.lt" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751167AbYKZJQd (ORCPT ); Wed, 26 Nov 2008 04:16:33 -0500 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Wed, 26 Nov 2008 04:16:32 EST Message-ID: <492D125D.5010607@teltonika.lt> Date: Wed, 26 Nov 2008 11:09:49 +0200 From: Paulius Zaleckas User-Agent: Thunderbird 2.0.0.18 (X11/20081119) MIME-Version: 1.0 To: Jaya Kumar CC: David Brownell , David Brownell , Sam Ravnborg , Jean Delvare , Eric Miao , Haavard Skinnemoen , Philipp Zabel , Russell King , Ben Gardner , Greg KH , linux-arm-kernel@lists.arm.linux.org.uk, linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [RFC 2.6.27 1/1] gpiolib: add support for batch set of pins References: <12276535632759-git-send-email-jayakumar.lkml@gmail.com> In-Reply-To: <12276535632759-git-send-email-jayakumar.lkml@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3612 Lines: 87 Jaya Kumar wrote: > Beloved friends, > > I would like to request your feedback on the following idea. I hope I have > made sure to CC all the right people and the right lists! If not, PLEASE > let me know! I couldn't find a MAINTAINERS entry for gpiolib so I just > used what I saw in the git log and have also added people and lists that > I think may be interested. > > This is just an RFC. If you all feel it is looking like the right approach > then I'll clean it up and make it a patch. > > Thanks, > jaya > > am300epd was doing 800*600*16*gpio_set_value for each framebuffer transfer > (it uses 16-pins of gpio as its data bus). I found this caused a wee > performance limitation. This patch adds an API for gpio_set_value_bus > which allows users to set batches of consecutive gpio together in a single > call. I have done a test implementation on gumstix (pxa255) with am300epd > and it provides a nice improvement in performance. > > Signed-off-by: Jaya Kumar > Cc: David Brownell > Cc: David Brownell > Cc: Sam Ravnborg > Cc: Jean Delvare > Cc: Eric Miao > Cc: Haavard Skinnemoen > Cc: Philipp Zabel > Cc: Russell King > Cc: Ben Gardner > CC: Greg KH > Cc: linux-arm-kernel@lists.arm.linux.org.uk > Cc: linux-fbdev-devel@lists.sourceforge.net > Cc: linux-kernel@vger.kernel.org > > --- > arch/arm/mach-pxa/am300epd.c | 9 ++++++ > arch/arm/mach-pxa/gpio.c | 28 +++++++++++++++++++++ > arch/arm/mach-pxa/include/mach/gpio.h | 24 ++++++++++++++++++ > drivers/gpio/gpiolib.c | 44 +++++++++++++++++++++++++++++++++ > include/asm-generic/gpio.h | 6 ++++ > 5 files changed, 111 insertions(+), 0 deletions(-) > [...] > diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h > index 81797ec..9747517 100644 > --- a/include/asm-generic/gpio.h > +++ b/include/asm-generic/gpio.h > @@ -44,6 +44,8 @@ struct module; > * returns either the value actually sensed, or zero > * @direction_output: configures signal "offset" as output, or returns error > * @set: assigns output value for signal "offset" > + * @set_bus: batch assigns output values for consecutive signals starting at > + * "offset" with width in bits "bitwidth" > * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; > * implementation may not sleep > * @dbg_show: optional routine to show contents in debugfs; default code > @@ -84,6 +86,9 @@ struct gpio_chip { > unsigned offset, int value); > void (*set)(struct gpio_chip *chip, > unsigned offset, int value); > + void (*set_bus)(struct gpio_chip *chip, > + unsigned offset, int values, I think values should be unsigned > + int bitwidth); > > int (*to_irq)(struct gpio_chip *chip, > unsigned offset); > @@ -124,6 +129,7 @@ extern void gpio_set_value_cansleep(unsigned gpio, int value); > */ > extern int __gpio_get_value(unsigned gpio); > extern void __gpio_set_value(unsigned gpio, int value); > +extern void __gpio_set_value_bus(unsigned gpio, int values, int bitwidth); > > extern int __gpio_cansleep(unsigned gpio); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/