Allows the use of leds on NanoStation5 for example.

Signed-Off By: Frédéric Moulins <[email protected]>

diff --git a/target/linux/atheros/patches-2.6.28/100-board.patch 
b/target/linux/atheros/patches-2.6.28/100-board.patch
index 587094d..1d37f19 100644
--- a/target/linux/atheros/patches-2.6.28/100-board.patch
+++ b/target/linux/atheros/patches-2.6.28/100-board.patch
@@ -1,6 +1,8 @@
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -60,6 +60,19 @@ config BCM47XX
+Index: linux-2.6.28.10/arch/mips/Kconfig
+===================================================================
+--- linux-2.6.28.10.orig/arch/mips/Kconfig     2009-06-11 16:02:55.000000000 
+0200
++++ linux-2.6.28.10/arch/mips/Kconfig  2009-06-11 16:03:00.000000000 +0200
+@@ -60,6 +60,19 @@
        help
         Support for BCM47XX based boards
  
@@ -20,7 +22,7 @@
  config MIPS_COBALT
        bool "Cobalt Server"
        select CEVT_R4K
-@@ -597,6 +610,7 @@ config WR_PPMC
+@@ -597,6 +610,7 @@
  
  endchoice
  
@@ -28,9 +30,11 @@
  source "arch/mips/alchemy/Kconfig"
  source "arch/mips/basler/excite/Kconfig"
  source "arch/mips/emma/Kconfig"
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -278,6 +278,13 @@ libs-$(CONFIG_MIPS_XXS1500)       += arch/mips
+Index: linux-2.6.28.10/arch/mips/Makefile
+===================================================================
+--- linux-2.6.28.10.orig/arch/mips/Makefile    2009-06-11 16:02:57.000000000 
+0200
++++ linux-2.6.28.10/arch/mips/Makefile 2009-06-11 16:03:00.000000000 +0200
+@@ -285,6 +285,13 @@
  load-$(CONFIG_MIPS_XXS1500)   += 0xffffffff80100000
  
  #
@@ -44,8 +48,10 @@
  # Cobalt Server
  #
  core-$(CONFIG_MIPS_COBALT)    += arch/mips/cobalt/
---- /dev/null
-+++ b/arch/mips/ar231x/Kconfig
+Index: linux-2.6.28.10/arch/mips/ar231x/Kconfig
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/Kconfig   2009-06-11 16:04:11.000000000 
+0200
 @@ -0,0 +1,17 @@
 +config ATHEROS_AR5312
 +      bool "Atheros 5312/2312+ support"
@@ -64,8 +70,10 @@
 +      select SYS_SUPPORTS_BIG_ENDIAN
 +      select GENERIC_GPIO
 +      default y
---- /dev/null
-+++ b/arch/mips/ar231x/Makefile
+Index: linux-2.6.28.10/arch/mips/ar231x/Makefile
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/Makefile  2009-06-11 16:04:11.000000000 
+0200
 @@ -0,0 +1,13 @@
 +#
 +# This file is subject to the terms and conditions of the GNU General Public
@@ -80,8 +88,10 @@
 +obj-y += board.o prom.o devices.o
 +obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o
 +obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o
---- /dev/null
-+++ b/arch/mips/ar231x/board.c
+Index: linux-2.6.28.10/arch/mips/ar231x/board.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/board.c   2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,249 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -332,8 +342,10 @@
 +}
 +
 +
---- /dev/null
-+++ b/arch/mips/ar231x/prom.c
+Index: linux-2.6.28.10/arch/mips/ar231x/prom.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/prom.c    2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,37 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -372,8 +384,10 @@
 +void __init prom_free_prom_memory(void)
 +{
 +}
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar231x_platform.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar231x_platform.h        
2009-06-11 16:03:00.000000000 +0200
 @@ -0,0 +1,83 @@
 +#ifndef __AR531X_PLATFORM_H
 +#define __AR531X_PLATFORM_H
@@ -458,8 +472,10 @@
 +};
 +
 +#endif /* __AR531X_PLATFORM_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h
+Index: 
linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h  
2009-06-11 16:03:00.000000000 +0200
 @@ -0,0 +1,84 @@
 +/*
 + *  Atheros SoC specific CPU feature overrides
@@ -545,8 +561,10 @@
 +/* #define cpu_icache_line_size()     ? */
 +
 +#endif /* __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/dma-coherence.h  
2009-06-11 16:03:00.000000000 +0200
 @@ -0,0 +1,41 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -589,8 +607,10 @@
 +}
 +
 +#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/gpio.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/gpio.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/gpio.h   2009-06-11 
16:03:00.000000000 +0200
 @@ -0,0 +1,79 @@
 +#ifndef _ATHEROS_GPIO_H_
 +#define _ATHEROS_GPIO_H_
@@ -671,8 +691,10 @@
 +#include <asm-generic/gpio.h> /* cansleep wrappers */
 +
 +#endif
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/reset.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/reset.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/reset.h  2009-06-11 
16:03:00.000000000 +0200
 @@ -0,0 +1,6 @@
 +#ifndef __AR531X_RESET_H
 +#define __AR531X_RESET_H
@@ -680,8 +702,10 @@
 +void ar531x_disable_reset_button(void);
 +
 +#endif /* __AR531X_RESET_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/war.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/war.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/war.h    2009-06-11 
16:03:00.000000000 +0200
 @@ -0,0 +1,25 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -708,8 +732,10 @@
 +#define MIPS34K_MISSED_ITLB_WAR               0
 +
 +#endif /* __ASM_MIPS_MACH_ATHEROS_WAR_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/ar2315_regs.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar2315_regs.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar2315_regs.h    
2009-06-11 16:03:00.000000000 +0200
 @@ -0,0 +1,580 @@
 +/*
 + * Register definitions for AR2315+
@@ -1291,8 +1317,10 @@
 +#define PCI_DEVICE_MEM_SPACE    0x800000
 +
 +#endif /* __AR2315_REG_H */
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/ar5312_regs.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar5312_regs.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar5312_regs.h    
2009-06-11 16:03:00.000000000 +0200
 @@ -0,0 +1,236 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -1530,9 +1558,11 @@
 +
 +#endif
 +
---- /dev/null
-+++ b/arch/mips/ar231x/ar5312.c
-@@ -0,0 +1,563 @@
+Index: linux-2.6.28.10/arch/mips/ar231x/ar5312.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/ar5312.c  2009-06-11 16:23:37.000000000 
+0200
+@@ -0,0 +1,588 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
@@ -1792,11 +1822,9 @@
 +};
 +
 +#ifdef CONFIG_LEDS_GPIO
-+static struct gpio_led ar5312_leds[] = {
-+      { .name = "wlan", .gpio = 0, .active_low = 1, },
-+};
++static struct gpio_led ar5312_leds[8];
 +
-+static const struct gpio_led_platform_data ar5312_led_data = {
++static struct gpio_led_platform_data ar5312_led_data = {
 +      .num_leds = ARRAY_SIZE(ar5312_leds),
 +      .leds = (void *) ar5312_leds,
 +};
@@ -1806,6 +1834,36 @@
 +      .id = -1,
 +      .dev.platform_data = (void *) &ar5312_led_data,
 +};
++
++static void __init
++ar5312_init_gpio(void)
++{
++      static char led_names[6][6];
++      int i, led = 0;
++
++      ar5312_led_data.num_leds = 0;
++      for(i = 0; i < AR531X_NUM_GPIO; i++)
++      {
++              if(i == ar231x_board.config->resetConfigGpio)
++                      continue;
++
++              if(i == ar231x_board.config->sysLedGpio)
++                      strcpy(led_names[led], "wlan");
++              else
++                      sprintf(led_names[led], "gpio%d", i);
++
++              ar5312_leds[led].name = led_names[led];
++              ar5312_leds[led].gpio = i;
++              ar5312_leds[led].active_low = 0;
++              led++;
++      }
++      ar2315_led_data.num_leds = led;
++      platform_device_register(&ar5312_gpio_leds);
++}
++#else
++static inline void ar5312_init_gpio(void)
++{
++}
 +#endif
 +
 +/*
@@ -1896,10 +1954,7 @@
 +
 +      platform_device_register(&ar5312_physmap_flash);
 +
-+#ifdef CONFIG_LEDS_GPIO
-+      ar5312_leds[0].gpio = config->sysLedGpio;
-+      platform_device_register(&ar5312_gpio_leds);
-+#endif
++      ar5312_init_gpio();
 +
 +      /* Fix up MAC addresses if necessary */
 +      if (!memcmp(config->enet0_mac, "\xff\xff\xff\xff\xff\xff", 6))
@@ -2096,8 +2151,10 @@
 +      ar231x_serial_setup(KSEG1ADDR(AR531X_UART0), ar5312_sys_frequency());
 +}
 +
---- /dev/null
-+++ b/arch/mips/ar231x/ar2315.c
+Index: linux-2.6.28.10/arch/mips/ar231x/ar2315.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/ar2315.c  2009-06-11 16:04:11.000000000 
+0200
 @@ -0,0 +1,677 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -2776,8 +2833,10 @@
 +      _machine_restart = ar2315_restart;
 +      ar231x_serial_setup(KSEG1ADDR(AR2315_UART0), ar2315_apb_frequency());
 +}
---- /dev/null
-+++ b/arch/mips/ar231x/ar2315.h
+Index: linux-2.6.28.10/arch/mips/ar231x/ar2315.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/ar2315.h  2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,37 @@
 +#ifndef __AR2315_H
 +#define __AR2315_H
@@ -2816,8 +2875,10 @@
 +#endif
 +
 +#endif
---- /dev/null
-+++ b/arch/mips/ar231x/ar5312.h
+Index: linux-2.6.28.10/arch/mips/ar231x/ar5312.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/ar5312.h  2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,38 @@
 +#ifndef __AR5312_H
 +#define __AR5312_H
@@ -2857,8 +2918,10 @@
 +#endif
 +
 +#endif
---- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/ar231x.h
+Index: linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar231x.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/include/asm/mach-ar231x/ar231x.h 2009-06-11 
16:03:00.000000000 +0200
 @@ -0,0 +1,54 @@
 +#ifndef __AR531X_H
 +#define __AR531X_H
@@ -2914,8 +2977,10 @@
 +}
 +
 +#endif
---- /dev/null
-+++ b/arch/mips/ar231x/devices.h
+Index: linux-2.6.28.10/arch/mips/ar231x/devices.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/devices.h 2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,27 @@
 +#ifndef __AR231X_DEVICES_H
 +#define __AR231X_DEVICES_H
@@ -2944,8 +3009,10 @@
 +extern int ar231x_add_ethernet(int nr, u32 base, int irq, void *pdata);
 +
 +#endif
---- /dev/null
-+++ b/arch/mips/ar231x/devices.c
+Index: linux-2.6.28.10/arch/mips/ar231x/devices.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.28.10/arch/mips/ar231x/devices.c 2009-06-11 16:03:00.000000000 
+0200
 @@ -0,0 +1,174 @@
 +#include <linux/kernel.h>
 +#include <linux/init.h>
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to