Thread (12 messages) 12 messages, 5 authors, 2012-08-16

Re: [PATCH v2 3/3] MIPS: BCM47xx: rewrite GPIO handling and use gpiolib

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: 2012-08-16 22:34:03
Also in: linux-mips

On 08/16/2012 09:35 PM, John Crispin wrote:
On 16/08/12 18:00, Hauke Mehrtens wrote:
quoted
int gpio_get_value(unsigned gpio)
+{
+	if (gpio < bcm47xx_gpio_count)
+		return bcm47xx_gpio_in(1 << gpio);
+
+	return __gpio_get_value(gpio);
+}
+EXPORT_SYMBOL(gpio_get_value);
Hi,

You are using a gpio_chip. simply doing this

#define gpio_get_value __gpio_get_value

inside your arch/mips/include/asm/mach-bcm47xx/gpio.h will be enough.
__gpio_get_value() will then automatically find and use
bcm47xx_gpio_get_value() via the gpio_chip.
With this code gpio_get_value() is faster as the hole gpiolib is not
called for the get and set methods. I assume then these gpios are the
first being registered and all calls to these gpios are directly handled
by this methods and are not going through the gpiolib code.
This is based on the way it is done for ath79.

Hauke

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help