[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50CF32E3.90305@grandegger.com>
Date: Mon, 17 Dec 2012 15:57:39 +0100
From: Wolfgang Grandegger <wg@...ndegger.com>
To: Russell King - ARM Linux <linux@....linux.org.uk>
CC: Roland Stigge <stigge@...com.de>, rmallon@...il.com,
gregkh@...uxfoundation.org, linus.walleij@...aro.org,
broonie@...nsource.wolfsonmicro.com, w.sang@...gutronix.de,
linux-kernel@...r.kernel.org, grant.likely@...retlab.ca,
daniel-gl@....net, sr@...x.de, plagnioj@...osoft.com,
linux-arm-kernel@...ts.infradead.org, highguy@...il.com
Subject: Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO
On 12/17/2012 01:10 PM, Russell King - ARM Linux wrote:
> On Mon, Dec 17, 2012 at 12:51:32PM +0100, Wolfgang Grandegger wrote:
>> +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long val)
>> +{
>> + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
>> + void __iomem *pio = at91_gpio->regbase;
>> + u32 set_bits = val & mask;
>> + u32 clr_bits = ~val & mask;
>> +
>> + /* GPIO outputs can only be set at once or cleared at once */
>> + if (set_bits)
>> + __raw_writel(set_bits, pio + PIO_SODR);
>> + if (clr_bits)
>> + __raw_writel(clr_bits, pio + PIO_CODR);
>> +}
>
> You obviously didn't see my email...
Well, I did read you mail but it was not obvious to me how to maintain
compatibility with the existing "set" method... at a first glance.
But the synchronous data output is important and it's even simpler than
I thought. The block-set callback can directly write to ODSR because
"at91_set_gpio_output()" already has set OWER. Will give that a try
later today.
Wolfgang.
--
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