Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3097/arch/powerpc/platforms/embedded6xx
Modified Files:
starlet-gpio.c
Log Message:
[PATCH] wii: gpio: try to honour gpio cells property
From: Albert Herranz <alb...@ya...>
Date: Wed, 4 Feb 2009 19:24:32 +0100
Subject: [PATCH] wii: gpio: try to honour gpio cells property
Take into account the optional device tree "#gpio-cells" property,
if specified, for the gpio controller.
Signed-off-by: Albert Herranz <alb...@ya...>
Index: starlet-gpio.c
===================================================================
RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-gpio.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** starlet-gpio.c 1 Feb 2009 18:50:33 -0000 1.3
--- starlet-gpio.c 2 Mar 2009 18:54:57 -0000 1.4
***************
*** 97,100 ****
--- 97,101 ----
struct gpio_chip *gc;
struct stgpio_chip *st_gc;
+ const unsigned long *prop;
st_gc = kzalloc(sizeof(*st_gc), GFP_KERNEL);
***************
*** 107,111 ****
gc = &of_gc->gc;
! of_gc->gpio_cells = 1;
gc->ngpio = 32;
--- 108,116 ----
gc = &of_gc->gc;
! prop = of_get_property(np, "#gpio-cells", NULL);
! if (prop && *prop >= 2)
! of_gc->gpio_cells = *prop;
! else
! of_gc->gpio_cells = 2; /* gpio pin number, flags */
gc->ngpio = 32;
|