Skip to content

Commit

Permalink
Support controlling red LED strips on side of FS67xx devices
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DanielGibson committed Dec 14, 2024
1 parent 9c9cc66 commit 56176cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions asustor_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Expand All @@ -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
{}
},
};
Expand Down

0 comments on commit 56176cc

Please sign in to comment.