{"id":15648988,"url":"https://github.com/mafredri/asustor-platform-driver","last_synced_at":"2025-10-11T15:36:06.952Z","repository":{"id":50389068,"uuid":"440234823","full_name":"mafredri/asustor-platform-driver","owner":"mafredri","description":"Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons)","archived":false,"fork":false,"pushed_at":"2024-09-29T12:04:47.000Z","size":99,"stargazers_count":70,"open_issues_count":14,"forks_count":10,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-26T05:07:33.582Z","etag":null,"topics":["asustor","button","buttons","led","leds","linux","linux-kernel-driver","linux-kernel-module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mafredri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-20T16:24:37.000Z","updated_at":"2025-03-24T16:20:03.000Z","dependencies_parsed_at":"2024-03-17T15:25:21.695Z","dependency_job_id":"28e0f59a-25c9-44b4-9e55-b77d8ae26511","html_url":"https://github.com/mafredri/asustor-platform-driver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fasustor-platform-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fasustor-platform-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fasustor-platform-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafredri%2Fasustor-platform-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mafredri","download_url":"https://codeload.github.com/mafredri/asustor-platform-driver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785437,"owners_count":20833490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asustor","button","buttons","led","leds","linux","linux-kernel-driver","linux-kernel-module"],"created_at":"2024-10-03T12:27:18.144Z","updated_at":"2025-10-11T15:36:01.918Z","avatar_url":"https://github.com/mafredri.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asustor-platform-driver\n\nLinux kernel platform driver for ASUSTOR NAS hardware (leds, buttons).\n\nOn many systems, ASUSTOR uses a mix of IT87 and CPU GPIOs to control leds and buttons. Adding support for more systems should be fairly trivial, but may require some reverse engineering to figure out which GPIOs are responsible for what.\n\n**WARNING:** Changing GPIO input/outputs (as done by this module) without knowledge of their effects can be dangerous and lead to instability, corrupted data or a broken system. **Use at your own risk.**\n\n## Dependencies\n\n**Note:** The following dependencies from the mainline linux kernel are required, if they're not included by your distribution you may need to compile them yourself (note that some modules are only required on specific ASUSTOR models):\n\n- `gpio-ich` (AS6)\n- `hwmon-vid` (for the contained `asustor-it87` module)\n\n### Optional\n\n- `it87` (AS6, AS61, AS62, AS66XX, AS67XX, AS54XX)\n  - This project includes a patched version of `it87` called `asustor-it87` which skips fan pwm sanity checks\n    and supports more variants of IT86XX and the IT87XX chips than the kernels `it87` driver.\n    Support for timer-based blinking of up to two LEDs (only works on some models) has also been added.\n  - Also includes a patched version of `gpio-it87` called `asustor-gpio-it87`. The only change is supporting\n    the IT8625E chip that is used in several newer ASUSTOR devices.\n  - May require adding `acpi_enforce_resources=lax` to kernel boot arguments for full functionality\n  - Temperature monitoring (`lm-sensors`)\n  - Fan speed regulation via `pwm1`\n    - See [`example/fancontrol`](./example/fancontrol) for an example `/etc/fancontrol` config for a AS62 system\n    - `pwm1` etc should be in `/sys/devices/platform/asustor_it87.*/hwmon/hwmon*/`\n  - Front panel LED brightness adjustment via `pwm3`\n\n## Compatibility\n\n- AS604T\n- AS6104T (NOT TESTED!)\n- AS6204T\n- AS6602T, AS6604T (NOT TESTED!)\n- AS6702T, AS6704T\n- AS5402T, AS5404T\n- FS6706T (NOT TESTED!), FS6712X\n- .. possibly more, if they're similar enough.\n  The following DMI system-manufacturer / system-product-name combinations are currently supported\n  (see `sudo dmidecode -s system-manufacturer` and `sudo dmidecode -s system-product-name`):\n    - \"ASUSTOR Inc.\" / \"AS-6xxT\"\n    - \"Insyde\" / \"AS61xx\"\n    - \"Insyde\" / \"GeminiLake\"\n    - \"Intel Corporation\" / \"Jasper Lake Client Platform\"\n\n## Features\n\n- LEDs (front panel, disk)\n  - See [asustor.c](asustor.c).\n- Buttons\n  - USB Copy Button\n  - Power Button (AS6)\n- Power (`/sys/class/leds/power:*`)\n  - LCD\n  - Front panel\n\n## Installation\n\n```\ngit clone https://github.com/mafredri/asustor-platform-driver\ncd asustor-platform-driver\nmake\nsudo make install\n```\n\n## Tips\n\n### Control blinking LEDs with `it87`\n\n*Note:* This is probably not supported on all devices, only ones that use the IT8625E or IT8720F\nchips or similar.\n\nSwitch off that annoying blinking of the green status LED:\n```\necho 0 | sudo tee /sys/devices/platform/asustor_it87.*/hwmon/hwmon*/gpled1_blink\n```\n\nYou can re-enable it with `echo 47 | sudo tee ...` because the status led is it87_gp**47**.\nYou can also make other GPIO LEDs blink by using their GP number instead of 47.\nNote that this could even be done for two LEDs, as `gpled2_blink` also exists.\n\nIf you want the green status LED to be constantly on (without blinking),\nthe following should work, if `gpled1_blink` is still `47`:\n```\necho 11 | sudo tee /sys/devices/platform/asustor_it87.*/hwmon/hwmon*/gpled1_blink_freq\n```\n\nOr, if you set `gpled1_blink` to `0` (or to another LED), you can switch on the status LED with:\n```\necho 1 | sudo tee /sys/class/leds/green\\:status/brightness\n```\n\nYou can also configure the blinking frequency to one of 11 supported modes,\nfor example, set mode 3 with:\n```\necho 3 | sudo tee /sys/devices/platform/asustor_it87.*/hwmon/hwmon*/gpled1_blink_freq\n```\nThe following blinking frequency modes exist on the IT8625:\n* **0** - 0.125s Off 0.125s On\n* **1** - 0.5s Off 0.5s On\n* **2** - 2s\tOff\t2s On\n* **3** - 0.25s Off 0.25s On\n* **4** - 1s Off 3s On\n* **5** - 3s Off 1s On\n* **6** - 2s Off\t6s On\n* **7** - 6s Off\t2s On\n* **8** - 0.5s Off 2s On\n* **9** - 1s Off 1s On\n* **10** - 4s Off 4s On\n* **11** - Always On\n\nOther chips also support blinking control, but might support fewer modes.\nIf blink frequency setting is supported at all, mode 11 (always on) *should* always work,\nand setting the other modes won't break anything, but might have differing frequencies than\ndescribed above (and setting modes 8-10 will automatically set mode 0 instead).\n\n*Mode 11 for \"always on\" should always work, at least the bit set there was listed in\nall datasheets I checked (unfortunately, its function was never described in detail).*\n\n### Set triggers for LEDs\n\nLinux allows controlling LEDs with \"triggers\", which means that they will blink on specific events.\nBy default, the trigger is \"none\" (which means \"always on\") for most LEDs, but there are others that\nyou may enable (likely in a script that's run after boot), for example:\n```\n# make green USB LED blink on USB traffic\necho usb-host \u003e /sys/class/leds/green\\:usb/trigger\n# make LAN led light up if the first network link is up:\necho r8169-0-200:00:link \u003e /sys/class/leds/blue\\:lan\n```\n\n`cat /sys/class/leds/green\\:usb/trigger` will list the available triggers, with the currently used\none being marked with square brackes (e.g. `[none]  kbd-scrolllock kbd-numlock kbd-capslock ...`).\n\n### `it87` and PWM polarity\n\nThis project includes a patched version of the `it87` module that is part of mainline kernel (`asustor-it87`). It skips PWM sanity checks for the fan because ASUSTOR firmware correctly initializes fans in active low polarity and can be used straight with `fancontrol` or similar tools.\n\nNote that `it87` conflicts with `asustor-it87`, you may wish to add `it87` to the module blocklist or explicitly load `asustor-it87` instead.\n\n~~You may want to use [`patches/001-ignore-pwm-polarity-it87.patch`](patches/001-ignore-pwm-polarity-it87.patch) for the `it87` kernel module if it complains about PWM polarity. In this case, it's possible to use `fix_pwm_polarity=1`, however, it may reverse the polarity which is unwanted (i.e. high is low, low is high). It works fine when left as configured by the firmware.~~\n\n### Misc\n\n- `blue:power` and `red:power` can be turned on simultaneously for a pink-ish tint\n- `green:status` and `red:status` can be turned on simultaneously for a orange-ish tint\n\n## Support\n\nIf you would like additional hardware to be supported, pull requests are more than welcome. Alternatively, you can install these prerequisites:\n\n```\nsudo apt-get install -y gpiod\n```\n\nAnd then open an issue and attach outputs from the following commands:\n\n```\nsudo dmesg\nsudo dmidecode -s system-manufacturer\nsudo dmidecode -s system-product-name\nsudo dmidecode -s bios-vendor\nsudo dmidecode -s bios-version\nsudo dmidecode -s bios-release-date\nsudo dmidecode -s bios-revision\nsudo gpioinfo\n```\n\nNOTE: If `gpioinfo` does not return anything, you may need to figure out which (if any) gpio drivers to load. Also keep in mind that your distribution may not ship with all `gpio-` drivers, so you may need to compile them yourself.\n\n## TODO\n\n- Support variable amount of disk LEDs\n- ~~Create a new led trigger driver so that we can blink disk LEDs individually, the existing `disk-activity` trigger always blinks all LEDs on activity from any disk~~\n  - Pray that [[RFC PATCH v3 00/18] Add block device LED trigger](https://lore.kernel.org/linux-leds/20210819025053.222710-1-arequipeno@gmail.com/) by Ian Pilcher lands in the linux kernel\n\n## DKMS\n\nDKMS installation to enable module auto-build with kernel upgrades. \n\n```\nsudo make dkms\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafredri%2Fasustor-platform-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmafredri%2Fasustor-platform-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafredri%2Fasustor-platform-driver/lists"}