From 56176cc1d6a5929aa2bd58799b7ef671b4797c5a Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 14 Dec 2024 22:51:32 +0100 Subject: [PATCH] Support controlling red LED strips on side of FS67xx devices It's those red strips on the left and right side of the power button. They're controlled by three GPIOs that are exposed as the new LEDs red:side_inner, red:side_mid and red:side_outer One of them was previously controlled by power:front_panel, but I changed it so it's more consistent with the other two LEDs (LED pairs?) of the strips --- README.md | 2 +- asustor_main.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a03e0f9..e46c2f1 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ On many systems, ASUSTOR uses a mix of IT87 and CPU GPIOs to control leds and bu - AS6602T, AS6604T (NOT TESTED!) - AS6702T, AS6704T, AS6706T - AS5402T, AS5404T (NOT TESTED!) -- FS6706T (NOT TESTED!), FS6712X +- FS6706T, FS6712X - .. possibly more, if they're similar enough. The following DMI system-manufacturer / system-product-name combinations are currently supported diff --git a/asustor_main.c b/asustor_main.c index e9d98b9..0d82990 100644 --- a/asustor_main.c +++ b/asustor_main.c @@ -83,6 +83,9 @@ static struct gpio_led asustor_leds[] = { DISK_ERR_LED("sata6"), // 20 NVME_ACT_LED("nvme1"), // 21 NVME_ERR_LED("nvme1"), // 22 + { .name = "red:side_inner", .default_state = LEDS_GPIO_DEFSTATE_ON }, // 23 + { .name = "red:side_mid", .default_state = LEDS_GPIO_DEFSTATE_ON }, // 24 + { .name = "red:side_outer", .default_state = LEDS_GPIO_DEFSTATE_ON }, // 25 }; static const struct gpio_led_platform_data asustor_leds_pdata = { @@ -93,10 +96,8 @@ static const struct gpio_led_platform_data asustor_leds_pdata = { static struct gpiod_lookup_table asustor_fs6700_gpio_leds_lookup = { .dev_id = "leds-gpio", .table = { - // Red LEDs to the left and right of the - // power button on the side of the unit - GPIO_LOOKUP_IDX(GPIO_IT87, 52, NULL, 0, GPIO_ACTIVE_LOW), // power:front_panel - // 1 + // 0 - no front panel on this device + // 1 - no LCD either // blue:power also controls the red LED // inside the power button on the side GPIO_LOOKUP_IDX(GPIO_IT87, 56, NULL, 2, GPIO_ACTIVE_LOW), // blue:power @@ -109,6 +110,10 @@ static struct gpiod_lookup_table asustor_fs6700_gpio_leds_lookup = { // LEDs 9 - 20 don't exist in this system GPIO_LOOKUP_IDX(GPIO_IT87, 12, NULL, 21, GPIO_ACTIVE_LOW), // nvme1:green:disk GPIO_LOOKUP_IDX(GPIO_IT87, 13, NULL, 22, GPIO_ACTIVE_LOW), // nvme1:red:disk + // red LED strip next to the power button on the side + GPIO_LOOKUP_IDX(GPIO_IT87, 46, NULL, 23, GPIO_ACTIVE_LOW), // red:side_inner + GPIO_LOOKUP_IDX(GPIO_IT87, 47, NULL, 24, GPIO_ACTIVE_LOW), // red:side_mid + GPIO_LOOKUP_IDX(GPIO_IT87, 52, NULL, 25, GPIO_ACTIVE_LOW), // red:side_outer {} }, };