Changeset 36561


Ignore:
Timestamp:
2013-05-06T18:45:12+02:00 (5 years ago)
Author:
blogic
Message:

ramips: fix gpio base numbering

make banks 0 based to unbreak userland ABI

Signed-off-by: John Crispin <blogic@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/patches-3.8/0130-GPIO-MIPS-ralink-adds-ralink-gpio-support.patch

    r36431 r36561  
    1818 create mode 100644 drivers/gpio/gpio-ralink.c 
    1919 
    20 --- a/arch/mips/Kconfig 
    21 +++ b/arch/mips/Kconfig 
    22 @@ -449,6 +449,7 @@ config RALINK 
     20Index: linux-3.8.11/arch/mips/Kconfig 
     21=================================================================== 
     22--- linux-3.8.11.orig/arch/mips/Kconfig 2013-05-04 13:20:48.399042973 +0200 
     23+++ linux-3.8.11/arch/mips/Kconfig      2013-05-04 13:20:54.963043258 +0200 
     24@@ -449,6 +449,7 @@ 
    2325        select SYS_HAS_EARLY_PRINTK 
    2426        select HAVE_MACH_CLKDEV 
     
    2830 config SGI_IP22 
    2931        bool "SGI IP22 (Indy/Indigo2)" 
    30 --- /dev/null 
    31 +++ b/arch/mips/include/asm/mach-ralink/gpio.h 
     32Index: linux-3.8.11/arch/mips/include/asm/mach-ralink/gpio.h 
     33=================================================================== 
     34--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     35+++ linux-3.8.11/arch/mips/include/asm/mach-ralink/gpio.h       2013-05-04 13:20:54.963043258 +0200 
    3236@@ -0,0 +1,24 @@ 
    3337+/* 
     
    5559+ 
    5660+#endif /* __ASM_MACH_RALINK_GPIO_H */ 
    57 --- a/drivers/gpio/Kconfig 
    58 +++ b/drivers/gpio/Kconfig 
    59 @@ -201,6 +201,12 @@ config GPIO_PXA 
     61Index: linux-3.8.11/drivers/gpio/Kconfig 
     62=================================================================== 
     63--- linux-3.8.11.orig/drivers/gpio/Kconfig      2013-05-04 13:20:48.399042973 +0200 
     64+++ linux-3.8.11/drivers/gpio/Kconfig   2013-05-04 13:20:54.963043258 +0200 
     65@@ -201,6 +201,12 @@ 
    6066        help 
    6167          Say yes here to support the PXA GPIO device 
     
    7076        bool "ST SPEAr13xx SPI Chip Select as GPIO support" 
    7177        depends on PLAT_SPEAR 
    72 --- a/drivers/gpio/Makefile 
    73 +++ b/drivers/gpio/Makefile 
    74 @@ -54,6 +54,7 @@ obj-$(CONFIG_GPIO_PCF857X)    += gpio-pcf85 
     78Index: linux-3.8.11/drivers/gpio/Makefile 
     79=================================================================== 
     80--- linux-3.8.11.orig/drivers/gpio/Makefile     2013-05-04 13:20:48.399042973 +0200 
     81+++ linux-3.8.11/drivers/gpio/Makefile  2013-05-04 13:20:54.963043258 +0200 
     82@@ -54,6 +54,7 @@ 
    7583 obj-$(CONFIG_GPIO_PCH)         += gpio-pch.o 
    7684 obj-$(CONFIG_GPIO_PL061)       += gpio-pl061.o 
     
    8088 obj-$(CONFIG_GPIO_RDC321X)     += gpio-rdc321x.o 
    8189 obj-$(CONFIG_PLAT_SAMSUNG)     += gpio-samsung.o 
    82 --- /dev/null 
    83 +++ b/drivers/gpio/gpio-ralink.c 
    84 @@ -0,0 +1,176 @@ 
     90Index: linux-3.8.11/drivers/gpio/gpio-ralink.c 
     91=================================================================== 
     92--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
     93+++ linux-3.8.11/drivers/gpio/gpio-ralink.c     2013-05-06 11:39:24.816485479 +0200 
     94@@ -0,0 +1,182 @@ 
    8595+/* 
    8696+ * This program is free software; you can redistribute it and/or modify it 
     
    190200+       struct ralink_gpio_chip *gc; 
    191201+       const __be32 *ngpio; 
     202+       const __be32 *gpiobase; 
    192203+ 
    193204+       if (!res) { 
     
    219230+       } 
    220231+ 
    221 +       spin_lock_init(&gc->lock); 
     232+       gpiobase = of_get_property(np, "ralink,gpio-base", NULL); 
     233+       if (gpiobase) 
     234+               gc->chip.base = be32_to_cpu(*gpiobase); 
     235+       else 
     236+               gc->chip.base = -1; 
    222237+ 
    223238+       gc->chip.label = dev_name(&pdev->dev); 
    224239+       gc->chip.of_node = np; 
    225 +       gc->chip.base = -1; 
    226240+       gc->chip.ngpio = be32_to_cpu(*ngpio); 
    227241+       gc->chip.direction_input = ralink_gpio_direction_input; 
     
    229243+       gc->chip.get = ralink_gpio_get; 
    230244+       gc->chip.set = ralink_gpio_set; 
     245+ 
     246+       spin_lock_init(&gc->lock); 
    231247+ 
    232248+       /* set polarity to low for all lines */ 
Note: See TracChangeset for help on using the changeset viewer.