From 1104e55a3aae548d64c25493de72e4a6db1ce6a1 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Wed, 23 Jul 2008 14:18:01 +0000 Subject: [PATCH] TS-209/TS-409 fixes svn path=/dists/trunk/linux-2.6/; revision=11874 --- debian/changelog | 2 + .../features/arm/ts409-export-leds.patch | 71 +++++++++++++++++++ .../features/arm/tsx09-fix-key-codes.patch | 38 ++++++++++ debian/patches/series/1~experimental.1 | 2 + 4 files changed, 113 insertions(+) create mode 100644 debian/patches/features/arm/ts409-export-leds.patch create mode 100644 debian/patches/features/arm/tsx09-fix-key-codes.patch diff --git a/debian/changelog b/debian/changelog index 3dbe985cb..0c876f5ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -101,6 +101,8 @@ linux-2.6 (2.6.26-1~experimental.1) UNRELEASED; urgency=low * [arm/iop32x] Unset NET_DMA since it actually leads to worse network performance. * [arm/orion5x] Fix a boot crash on the Kurobox Pro. + * [arm/orion5x] use better key codes for the TS-209/TS-409 buttons + * [arm/orion5x] export red SATA lights on TS-409, fix SATA presence/activity [ Ian Campbell ] * Readme.build updated on how to generate orig tarballs. diff --git a/debian/patches/features/arm/ts409-export-leds.patch b/debian/patches/features/arm/ts409-export-leds.patch new file mode 100644 index 000000000..566c8e6b2 --- /dev/null +++ b/debian/patches/features/arm/ts409-export-leds.patch @@ -0,0 +1,71 @@ +Export the four red SATA LEDs on the QNAP TS-409 that are connected +through gpio. Since the boot loader apparently sets the SATA LEDs 2-4 +to red and the SATA LED can only be red or green (but not both), +exporting the red SATA LEDs (which automatically turns them off upon +boot) makes the green SATA presence/activity indication visible. + +--- a/arch/arm/mach-orion5x/ts409-setup.c 2008-07-23 14:12:10.000000000 +0000 ++++ b/arch/arm/mach-orion5x/ts409-setup.c 2008-07-23 14:12:13.000000000 +0000 +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -162,6 +163,46 @@ + I2C_BOARD_INFO("s35390a", 0x30), + }; + ++/***************************************************************************** ++ * LEDs attached to GPIO ++ ****************************************************************************/ ++ ++static struct gpio_led ts409_led_pins[] = { ++ { ++ .name = "ts409:red:sata1", ++ .gpio = 4, ++ .active_low = 1, ++ }, ++ { ++ .name = "ts409:red:sata2", ++ .gpio = 5, ++ .active_low = 1, ++ }, ++ { ++ .name = "ts409:red:sata3", ++ .gpio = 6, ++ .active_low = 1, ++ }, ++ { ++ .name = "ts409:red:sata4", ++ .gpio = 7, ++ .active_low = 1, ++ }, ++}; ++ ++static struct gpio_led_platform_data ts409_led_data = { ++ .leds = ts409_led_pins, ++ .num_leds = ARRAY_SIZE(ts409_led_pins), ++}; ++ ++static struct platform_device ts409_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &ts409_led_data, ++ } ++}; ++ + /**************************************************************************** + * GPIO Attached Keys + * Power button is attached to the PIC microcontroller +@@ -254,6 +295,7 @@ + if (qnap_ts409_i2c_rtc.irq == 0) + pr_warning("qnap_ts409_init: failed to get RTC IRQ\n"); + i2c_register_board_info(0, &qnap_ts409_i2c_rtc, 1); ++ platform_device_register(&ts409_leds); + + qnap_tsx09_find_mac_addr(QNAP_TS409_NOR_BOOT_BASE + + qnap_ts409_partitions[5].offset, diff --git a/debian/patches/features/arm/tsx09-fix-key-codes.patch b/debian/patches/features/arm/tsx09-fix-key-codes.patch new file mode 100644 index 000000000..ce569eaa7 --- /dev/null +++ b/debian/patches/features/arm/tsx09-fix-key-codes.patch @@ -0,0 +1,38 @@ +Subject: [PATCH] Orion: use better key codes for the TS-209/TS-409 buttons + +Use key codes for the buttons on the TS-209/TS-409 that make more sense +than the current values. + +Signed-off-by: Martin Michlmayr + + +--- a/arch/arm/mach-orion5x/ts209-setup.c 2008-07-23 14:13:08.000000000 +0000 ++++ b/arch/arm/mach-orion5x/ts209-setup.c 2008-07-23 14:14:01.000000000 +0000 +@@ -203,13 +203,13 @@ + + static struct gpio_keys_button qnap_ts209_buttons[] = { + { +- .code = KEY_RESTART, ++ .code = KEY_COPY, + .gpio = QNAP_TS209_GPIO_KEY_MEDIA, + .desc = "USB Copy Button", + .active_low = 1, + }, + { +- .code = KEY_POWER, ++ .code = KEY_RESTART, + .gpio = QNAP_TS209_GPIO_KEY_RESET, + .desc = "Reset Button", + .active_low = 1, +--- arch/arm/mach-orion5x/ts409-setup.c~ 2008-07-23 14:13:21.000000000 +0000 ++++ arch/arm/mach-orion5x/ts409-setup.c 2008-07-23 14:14:13.000000000 +0000 +@@ -212,7 +212,7 @@ + + static struct gpio_keys_button qnap_ts409_buttons[] = { + { +- .code = KEY_RESTART, ++ .code = KEY_COPY, + .gpio = QNAP_TS409_GPIO_KEY_MEDIA, + .desc = "USB Copy Button", + .active_low = 1, + diff --git a/debian/patches/series/1~experimental.1 b/debian/patches/series/1~experimental.1 index aa6cd5fe1..dde63b72e 100644 --- a/debian/patches/series/1~experimental.1 +++ b/debian/patches/series/1~experimental.1 @@ -43,6 +43,8 @@ + features/arm/led-pca9532-fix.patch + features/arm/led-pca9532-n2100.patch + features/arm/ts409-mv2120-support.patch ++ features/arm/ts409-export-leds.patch ++ features/arm/tsx09-fix-key-codes.patch + features/arm/ixp4xx-4874-fsg-board-support.patch + features/arm/mv_dma_engine.patch + features/arm/orion_use_mv_xor.patch