GPIO LIB API support for OF and PowerPC
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | OF helpers for the GPIO APIdrivers/ drivers/ drivers/ +1 more | +305 | 0 replies | |
| 2/4 | Implement support for the GPIO LIB APIDocumentation/ arch/ include/ | +112 | 2 replies | |
| 3/4 | QE: split par_io_config_pin()arch/ | +39 | 0 replies | |
| 4/4 | QE: implement support for the GPIO LIB APIDocumentation/ arch/ arch/ | +158 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] GPIO LIB API support for OF and PowerPC
Hi all,
Here are few patches needed to support GPIO LIB API on PowerPC. It would be great to see these applied for the 2.6.26...
For now we use static gpio base allocation, later we'll switch to the dynamic bases. The patch below shows the idea of what needs to be done when dynamic gpio base allocation patch[1] will hit the mainline.
[1] http://lkml.org/lkml/2008/3/11/261
- - - -
Subject: of/gpio: use dynamic base allocation
Signed-off-by not yet
---
depends on http://lkml.org/lkml/2008/3/11/261
drivers/of/gpio.c | 38 +------------------------------------- 1 files changed, 1 insertions(+), 37 deletions(-)
drivers/of/gpio.c +1 -37
@@ -118,38 +118,6 @@ static int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,return *gpio; } -/* Should be sufficient for now, later we'll use dynamic bases. */ -#if defined(CONFIG_PPC32 ) || defined(CONFIG_SPARC32 ) -#define GPIOS_PER_CHIP 32 -#else -#define GPIOS_PER_CHIP 64 -#endif - -static int of_get_gpiochip_base (struct device_node *np) -{ -struct device_node *gc =NULL ; -int gpiochip_base =0 ; - -while ((gc =of_find_all_nodes (gc))) { -if (!of_get_property (gc,"gpio-controller" ,NULL )) -continue ; - -if (gc != np) { - gpiochip_base +=GPIOS_PER_CHIP ; -continue ; - } - -of_node_put (gc); - -if (gpiochip_base >=ARCH_NR_GPIOS ) -return -ENOSPC ; - -return gpiochip_base; - } - -return -ENOENT ; -} -int of_mm_gpiochip_add (struct device_node *np,struct of_mm_gpio_chip *mm_gc) {
@@ -165,11 +133,7 @@ int of_mm_gpiochip_add(struct device_node *np,if (!mm_gc->regs) goto err1; - gc->base =of_get_gpiochip_base (np); -if (gc->base <0 ) { - ret = gc->base; - goto err1; - } + gc->base =-1 ;if (!of_gc->xlate) of_gc->xlate = of_gpio_simple_xlate;
Signature · 1 line
1.5.2.2