Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756890Ab2JQMht (ORCPT ); Wed, 17 Oct 2012 08:37:49 -0400 Received: from mail.work-microwave.de ([62.245.205.51]:50115 "EHLO work-microwave.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756867Ab2JQMhr (ORCPT ); Wed, 17 Oct 2012 08:37:47 -0400 From: Roland Stigge To: gregkh@linuxfoundation.org, grant.likely@secretlab.ca, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de, jbe@pengutronix.de, plagnioj@jcrosoft.com, highguy@gmail.com, broonie@opensource.wolfsonmicro.com, daniel-gl@gmx.net, rmallon@gmail.com Cc: Roland Stigge Subject: [PATCH RFC 10/15 v5] gpio-pl061: Add block GPIO API Date: Wed, 17 Oct 2012 14:31:42 +0200 Message-Id: <1350477107-26512-11-git-send-email-stigge@antcom.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350477107-26512-1-git-send-email-stigge@antcom.de> References: <1350477107-26512-1-git-send-email-stigge@antcom.de> X-FEAS-SYSTEM-WL: rst@work-microwave.de, 192.168.11.78 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1606 Lines: 45 This patch adds block GPIO API support to the gpio-pl061 driver. Signed-off-by: Roland Stigge --- drivers/gpio/gpio-pl061.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- linux-2.6.orig/drivers/gpio/gpio-pl061.c +++ linux-2.6/drivers/gpio/gpio-pl061.c @@ -123,6 +123,21 @@ static void pl061_set_value(struct gpio_ writeb(!!value << offset, chip->base + (1 << (offset + 2))); } +static unsigned long pl061_get_block(struct gpio_chip *gc, unsigned long mask) +{ + struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); + + return !!readb(chip->base + (mask << 2)); +} + +static void pl061_set_block(struct gpio_chip *gc, unsigned long mask, + unsigned long values) +{ + struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); + + writeb(values & mask, chip->base + (mask << 2)); +} + static int pl061_to_irq(struct gpio_chip *gc, unsigned offset) { struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); @@ -256,6 +271,8 @@ static int pl061_probe(struct amba_devic chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value; chip->gc.set = pl061_set_value; + chip->gc.get_block = pl061_get_block; + chip->gc.set_block = pl061_set_block; chip->gc.to_irq = pl061_to_irq; chip->gc.ngpio = PL061_GPIO_NR; chip->gc.label = dev_name(&dev->dev); -- 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/