-+
-+#endif /* __LED_PLATFORM__ */
-diff -urN kernel-old/drivers/char/avalanche_led/led_wrapper.c kernel-current/drivers/char/avalanche_led/led_wrapper.c
---- kernel-old/drivers/char/avalanche_led/led_wrapper.c 1970-01-01 01:00:00.000000000 +0100
-+++ kernel-current/drivers/char/avalanche_led/led_wrapper.c 2005-07-10 18:25:14.657069936 +0200
-@@ -0,0 +1,561 @@
-+/******************************************************************************
-+ * FILE PURPOSE: - LED Wrapper file for DSL module support
-+ ******************************************************************************
-+ * FILE NAME: led_wrapper.c
-+ *
-+ * DESCRIPTION: LED Wrapper file for DSL module support
-+ * This is to provide backward compatibility to the ADSL module
-+ * using OLD LED driver. The numbers mapped for DSL LEDs in the
-+ * previous implementation is 3,4,5,6. Since these numbers overlap
-+ * with the existing numbering scheme, the following numbers need to
-+ * be used in the led configuration file - 32,33,34,35.
-+ *
-+ * (C) Copyright 2002, Texas Instruments, Inc
-+ *******************************************************************************/
-+#include <linux/config.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <asm/ar7/sangam.h>
-+#include "led_platform.h"
-+#include "led_config.h"
-+
-+#define BITS_PER_INT (8 * sizeof(int))
-+#define GPIOS_PER_INT BITS_PER_INT
-+#define GPIO_MAP_LEN ((MAX_GPIO_PIN_NUM + GPIOS_PER_INT -1)/GPIOS_PER_INT)
-+#define MODULE_MAP_LEN ((MAX_MODULE_ENTRIES + BITS_PER_INT -1)/BITS_PER_INT)
-+
-+
-+#define REQUIRES_TIMER(x) (x > 1)
-+
-+#define gpio_on(gpio) do \
-+ { \
-+ if(gpio >= 32 && adsl_led_objs[gpio - 32].onfunc) \
-+ adsl_led_objs[gpio - 32].onfunc(adsl_led_objs[gpio - 32].param);\
-+ } while(0)
-+
-+
-+
-+#define gpio_off(gpio) \
-+ do \
-+ { \
-+ if(gpio >= 32 && adsl_led_objs[gpio - 32].offfunc) \
-+ adsl_led_objs[gpio - 32].offfunc(adsl_led_objs[gpio - 32].param);\
-+ } while(0)
-+
-+
-+
-+
-+
-+
-+/********************TYPEDEFS***********************************************/
-+
-+typedef struct gpio_module
-+{
-+ volatile unsigned int *gpio_write_reg;
-+ volatile unsigned int *gpio_dir_reg;
-+ volatile unsigned int *gpio_mode_reg;
-+}GPIO_REGS_T;
-+
-+typedef struct {
-+ unsigned int gpio_id;
-+ unsigned int gpio_state;
-+ int module_map[MODULE_MAP_LEN];
-+}GPIO_OBJ_T;
-+
-+
-+typedef struct state_entry STATE_ENTRY_T;
-+
-+struct state_entry{
-+ unsigned int timer_running;
-+ STATE_ENTRY_T *next;
-+ void (*handler)(STATE_ENTRY_T *state);
-+ GPIO_OBJ_T *gpio;
-+ void *os_timer;
-+ unsigned int param;
-+ unsigned int module_id;
-+ unsigned int mode;
-+};
-+
-+
-+typedef struct module_instance{
-+ int module_id;
-+ int instance;
-+ STATE_ENTRY_T *states[MAX_STATE_ENTRIES];
-+}MODULE_INSTANCE_T;
-+
-+typedef struct module_entry{
-+ unsigned char *name;
-+ MODULE_INSTANCE_T *module_instance[MAX_MODULE_INSTANCES];
-+}MODULE_ENTRY_T;
-+
-+
-+
-+typedef struct led_reg{
-+ unsigned int param;
-+ void (*init)(unsigned long param);
-+ void (*onfunc)(unsigned long param);
-+ void (*offfunc)(unsigned long param);
-+}led_reg_t;
-+
-+
-+
-+/* Interface prototypes */
-+static int led_hal_init(GPIO_REGS_T gpio_mod, unsigned int *gpio_off_value,int num_gpio_pins);
-+static int avalanche_led_set_config(LED_CONFIG_T *led_cfg);
-+static void *avalanche_led_register(const char *module_name, int instance_num);
-+static int avalanche_led_action(void *handle,int state_id);
-+int avalanche_led_config_get (LED_CONFIG_T *led_cfg,int module_id,int instance, int state);
-+
-+led_reg_t adsl_led_objs[4];
-+MODULE_INSTANCE_T *dsl_mod = NULL;
-+static int gpio_off_state[GPIO_MAP_LEN] = AVALANCHE_GPIO_OFF_MAP;
-+
-+
-+
-+static unsigned int num_gpios;
-+static GPIO_OBJ_T *gpio_arr;
-+GPIO_REGS_T gpio_regs;
-+
-+/* GPIO OFF STATE */
-+static unsigned int gpio_off_val[GPIO_MAP_LEN];
-+
-+
-+MODULE_ENTRY_T *modules[MAX_MODULE_ENTRIES];
-+
-+/* LED handlers */
-+void (*led_mode_handler[NUM_LED_MODES])(STATE_ENTRY_T *state);
-+
-+
-+/******************static functions*****************************************/
-+static void *led_malloc(int n)