X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/18f226c83fe94e839e76eb6ff48e56ad3d0364e6..75bddef71ae05b51afd36fc9dab9ff9e1b8a3cd2:/openwrt/target/linux/linux-2.4/patches/ar7/002-led_driver.patch diff --git a/openwrt/target/linux/linux-2.4/patches/ar7/002-led_driver.patch b/openwrt/target/linux/linux-2.4/patches/ar7/002-led_driver.patch index d88fca1da..81fe153cc 100644 --- a/openwrt/target/linux/linux-2.4/patches/ar7/002-led_driver.patch +++ b/openwrt/target/linux/linux-2.4/patches/ar7/002-led_driver.patch @@ -1,6 +1,63 @@ -diff -urN linux.old/drivers/char/avalanche_led/gpio.c linux.dev/drivers/char/avalanche_led/gpio.c ---- linux.old/drivers/char/avalanche_led/gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/drivers/char/avalanche_led/gpio.c 2005-07-12 03:13:02.696541072 +0200 +diff -urN linux.dev/drivers/char/Config.in linux.dev2/drivers/char/Config.in +--- linux.dev/drivers/char/Config.in 2005-10-21 17:02:20.199991500 +0200 ++++ linux.dev2/drivers/char/Config.in 2005-10-21 18:03:44.541778750 +0200 +@@ -133,6 +133,10 @@ + fi + fi + fi ++if [ "$CONFIG_AR7" = "y" ]; then ++ bool 'Enable LED support' CONFIG_AR7_LED ++fi ++ + if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then + tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232 + fi +diff -urN linux.dev/drivers/char/Makefile linux.dev2/drivers/char/Makefile +--- linux.dev/drivers/char/Makefile 2005-10-21 17:02:20.199991500 +0200 ++++ linux.dev2/drivers/char/Makefile 2005-10-21 18:03:44.541778750 +0200 +@@ -190,6 +190,12 @@ + obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP) + endif + ++# ++# Texas Intruments LED driver ++# ++obj-$(CONFIG_AR7_LED) += avalanche_led/avalanche_led.o ++subdir-$(CONFIG_AR7_LED) += avalanche_led ++ + obj-$(CONFIG_HIL) += hp_keyb.o + obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o + obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o +diff -urN linux.dev/drivers/char/avalanche_led/Makefile linux.dev2/drivers/char/avalanche_led/Makefile +--- linux.dev/drivers/char/avalanche_led/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/drivers/char/avalanche_led/Makefile 2005-10-21 18:03:44.513777000 +0200 +@@ -0,0 +1,23 @@ ++# File: drivers/char/avalanche_led/Makefile ++# ++# Makefile for the Linux LED device driver. ++# ++ ++ ++O_TARGET := avalanche_led.o ++obj-m := avalanche_led.o ++list-multi := avalanche_led.o ++ ++EXTRA_CFLAGS := -I$(TOPDIR)/include/asm/ar7 ++ ++export-objs := ledmod.o leds.o ++ ++avalanche_led-objs := ledmod.o gpio.o uartled.o leds.o ++ ++include $(TOPDIR)/Rules.make ++ ++avalanche_led.o: $(avalanche_led-objs) ++ $(LD) -r -o $@ $(avalanche_led-objs) ++ ++clean: ++ rm -f core *.o *.a *.s +diff -urN linux.dev/drivers/char/avalanche_led/gpio.c linux.dev2/drivers/char/avalanche_led/gpio.c +--- linux.dev/drivers/char/avalanche_led/gpio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/drivers/char/avalanche_led/gpio.c 2005-10-21 18:03:44.513777000 +0200 @@ -0,0 +1,382 @@ +#include +#include @@ -384,9 +441,9 @@ diff -urN linux.old/drivers/char/avalanche_led/gpio.c linux.dev/drivers/char/ava + + + -diff -urN linux.old/drivers/char/avalanche_led/ledmod.c linux.dev/drivers/char/avalanche_led/ledmod.c ---- linux.old/drivers/char/avalanche_led/ledmod.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/drivers/char/avalanche_led/ledmod.c 2005-07-12 03:12:40.675888720 +0200 +diff -urN linux.dev/drivers/char/avalanche_led/ledmod.c linux.dev2/drivers/char/avalanche_led/ledmod.c +--- linux.dev/drivers/char/avalanche_led/ledmod.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/drivers/char/avalanche_led/ledmod.c 2005-10-21 18:03:44.513777000 +0200 @@ -0,0 +1,1116 @@ +#include +#include @@ -1504,9 +1561,9 @@ diff -urN linux.old/drivers/char/avalanche_led/ledmod.c linux.dev/drivers/char/a +EXPORT_SYMBOL_NOVERS(register_led_drv); +EXPORT_SYMBOL_NOVERS(deregister_led_drv); + -diff -urN linux.old/drivers/char/avalanche_led/leds.c linux.dev/drivers/char/avalanche_led/leds.c ---- linux.old/drivers/char/avalanche_led/leds.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/drivers/char/avalanche_led/leds.c 2005-07-12 03:08:48.265220512 +0200 +diff -urN linux.dev/drivers/char/avalanche_led/leds.c linux.dev2/drivers/char/avalanche_led/leds.c +--- linux.dev/drivers/char/avalanche_led/leds.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/drivers/char/avalanche_led/leds.c 2005-10-21 18:03:44.513777000 +0200 @@ -0,0 +1,133 @@ +#include +#include @@ -1641,36 +1698,9 @@ diff -urN linux.old/drivers/char/avalanche_led/leds.c linux.dev/drivers/char/ava + + + -diff -urN linux.old/drivers/char/avalanche_led/Makefile linux.dev/drivers/char/avalanche_led/Makefile ---- linux.old/drivers/char/avalanche_led/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/drivers/char/avalanche_led/Makefile 2005-07-12 03:08:48.265220512 +0200 -@@ -0,0 +1,23 @@ -+# File: drivers/char/avalanche_led/Makefile -+# -+# Makefile for the Linux LED device driver. -+# -+ -+ -+O_TARGET := avalanche_led.o -+obj-m := avalanche_led.o -+list-multi := avalanche_led.o -+ -+EXTRA_CFLAGS := -I$(TOPDIR)/include/asm/ar7 -+ -+export-objs := ledmod.o leds.o -+ -+avalanche_led-objs := ledmod.o gpio.o uartled.o leds.o -+ -+include $(TOPDIR)/Rules.make -+ -+avalanche_led.o: $(avalanche_led-objs) -+ $(LD) -r -o $@ $(avalanche_led-objs) -+ -+clean: -+ rm -f core *.o *.a *.s -diff -urN linux.old/drivers/char/avalanche_led/uartled.c linux.dev/drivers/char/avalanche_led/uartled.c ---- linux.old/drivers/char/avalanche_led/uartled.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/drivers/char/avalanche_led/uartled.c 2005-07-12 03:08:48.266220360 +0200 +diff -urN linux.dev/drivers/char/avalanche_led/uartled.c linux.dev2/drivers/char/avalanche_led/uartled.c +--- linux.dev/drivers/char/avalanche_led/uartled.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/drivers/char/avalanche_led/uartled.c 2005-10-21 18:03:44.529778000 +0200 @@ -0,0 +1,55 @@ +#include +#include @@ -1727,46 +1757,102 @@ diff -urN linux.old/drivers/char/avalanche_led/uartled.c linux.dev/drivers/char/ + return; +} + -diff -urN linux.old/drivers/char/Config.in linux.dev/drivers/char/Config.in ---- linux.old/drivers/char/Config.in 2005-07-10 20:53:55.650624032 +0200 -+++ linux.dev/drivers/char/Config.in 2005-07-12 03:07:20.861507896 +0200 -@@ -133,6 +133,10 @@ - fi - fi - fi -+if [ "$CONFIG_AR7" = "y" ]; then -+ bool 'Enable LED support' CONFIG_MIPS_AVALANCHE_LED -+fi -+ - if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then - tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232 - fi -diff -urN linux.old/drivers/char/Makefile linux.dev/drivers/char/Makefile ---- linux.old/drivers/char/Makefile 2005-07-10 20:53:55.651623880 +0200 -+++ linux.dev/drivers/char/Makefile 2005-07-12 03:07:20.861507896 +0200 -@@ -190,6 +190,19 @@ - obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP) - endif - -+# -+# Texas Intruments LED driver -+# -+ifeq ($(CONFIG_MIPS_AVALANCHE_LED),y) -+obj-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led/avalanche_led.o -+subdir-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led -+endif -+ -+ifeq ($(CONFIG_MIPS_AVALANCHE_LED),m) -+obj-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led/avalanche_led.o -+subdir-$(CONFIG_MIPS_AVALANCHE_LED) += avalanche_led -+endif -+ - obj-$(CONFIG_HIL) += hp_keyb.o - obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o - obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o -diff -urN linux.old/include/asm-mips/ar7/ledapp.h linux.dev/include/asm-mips/ar7/ledapp.h ---- linux.old/include/asm-mips/ar7/ledapp.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/include/asm-mips/ar7/ledapp.h 2005-07-12 03:08:48.266220360 +0200 +diff -urN linux.dev/include/asm-mips/ar7/led_config.h linux.dev2/include/asm-mips/ar7/led_config.h +--- linux.dev/include/asm-mips/ar7/led_config.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/include/asm-mips/ar7/led_config.h 2005-10-21 17:02:25.568327000 +0200 +@@ -0,0 +1,55 @@ ++/****************************************************************************** ++ * FILE PURPOSE: - LED config Header ++ ****************************************************************************** ++ * FILE NAME: led_config.h ++ * ++ * DESCRIPTION: Header file for LED configuration parameters ++ * and data structures ++ * ++ * REVISION HISTORY: ++ * 11 Oct 03 - PSP TII ++ * ++ * (C) Copyright 2002, Texas Instruments, Inc ++ *******************************************************************************/ ++ ++ ++#ifndef __LED_CONFIG__ ++#define __LED_CONFIG__ ++ ++/* LED config parameters */ ++#define MAX_GPIO_PIN_NUM 64 ++#define MAX_GPIOS_PER_STATE 5 ++#define MAX_MODULE_ENTRIES 25 ++#define MAX_MODULE_INSTANCES 4 ++#define MAX_STATE_ENTRIES 25 ++#define MAX_LED_ENTRIES 25 ++ ++ ++/* LED modes */ ++#define LED_OFF 0 ++#define LED_ON 1 ++#define LED_ONESHOT_OFF 2 ++#define LED_ONESHOT_ON 3 ++#define LED_FLASH 4 ++#define LED_BLINK_CODE0 5 /*--- param1: on time, param2: blink nr , (param2 > 100 blink off) ---*/ ++#define LED_BLINK_CODE1 6 ++#define LED_BLINK_CODE2 7 ++ ++#define NUM_LED_MODES 8 ++ ++ ++ ++/* Data structure for LED configuration */ ++typedef struct led_config{ ++ unsigned char name[80]; ++ unsigned int instance; ++ unsigned int state; ++ unsigned int gpio[MAX_GPIOS_PER_STATE]; ++ unsigned int mode[MAX_GPIOS_PER_STATE]; ++ unsigned int gpio_num; ++ unsigned int param1; ++ unsigned int param2; ++}LED_CONFIG_T; ++ ++ ++#endif /* __LED_CONFIG__ */ +diff -urN linux.dev/include/asm-mips/ar7/led_hal.h linux.dev2/include/asm-mips/ar7/led_hal.h +--- linux.dev/include/asm-mips/ar7/led_hal.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/include/asm-mips/ar7/led_hal.h 2005-10-21 17:02:25.568327000 +0200 +@@ -0,0 +1,30 @@ ++/****************************************************************************** ++ * FILE PURPOSE: - LED HAL module Header ++ ****************************************************************************** ++ * FILE NAME: led_hal.h ++ * ++ * DESCRIPTION: LED HAL API's. ++ * ++ * REVISION HISTORY: ++ * 11 Oct 03 - PSP TII ++ * ++ * (C) Copyright 2002, Texas Instruments, Inc ++ *******************************************************************************/ ++ ++#ifndef __LED_HAL__ ++#define __LED_HAL__ ++ ++/* Interface prototypes */ ++#include "led_config.h" ++ ++int avalanche_led_hal_init (int *gpio_off_value, int num_gpio_pins); ++int avalanche_led_config_set (LED_CONFIG_T * led_cfg); ++int avalanche_led_config_get (LED_CONFIG_T *led_cfg,int module_id,int instance, int state); ++void *avalanche_led_register (const char *module_name, int instance_num); ++void avalanche_led_action (void *handle, int state_id); ++void avalanche_led_late_actions(void); ++int avalanche_led_unregister (void *handle); ++void avalanche_led_free_all(void); ++void avalanche_led_hal_exit (void); ++ ++#endif /*__LED_HAL__ */ +diff -urN linux.dev/include/asm-mips/ar7/ledapp.h linux.dev2/include/asm-mips/ar7/ledapp.h +--- linux.dev/include/asm-mips/ar7/ledapp.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux.dev2/include/asm-mips/ar7/ledapp.h 2005-10-21 18:03:44.573780750 +0200 @@ -0,0 +1,59 @@ +#ifndef __LED_APP__ +#define __LED_APP__