phjz / AS6704T

Asustor AS6704T kernel modules & Node.js Display driver
GNU General Public License v3.0
3 stars 2 forks source link

Green led GPIO location and usage #1

Open phjz opened 1 year ago

phjz commented 1 year ago

Determine where is a green LED gpio (probably on the IT8625E, but I'm bot found it). Any clue?

DanielGibson commented 1 year ago

You don't happen to have found out anything in the meantime?

https://github.com/mafredri/asustor-platform-driver/issues/2#issuecomment-1370636769 looks like it might have relevant information, but I haven't tried to understand and match it to the kernel driver source (yet?).

By diffing asustors released kernel source with the upstream kernel I found the diffs shown here: https://github.com/mafredri/asustor-platform-driver/issues/3#issuecomment-1749051752

in gpio-it87.c

+#define GPLED_TO_LOCATION(GP_LED) ({ ((GP_LED / 10) << 3) + (GP_LED % 10); })
+#define LOCATION_TO_GPLED(LOCATION) ({ ((LOCATION >> 3) * 10) + (LOCATION & 0x07); })
+
+static const u8 IT87_REG_GP_LED_CTRL_PIN_MAPPING[] = {0xf8, 0xfa};

might be interesting, but unfortunately the really interesting code (non-stub implementation of int it87_gpio_led_blink_set(u8 index, u32 gpio) etc) is missing :-/

By the way, I can confirm that these kernel modules also work on the AS5402T (Nimbustor 2 Gen2), which is also Jasper Lake -based and generally extremely similar to the AS6702T (except for being cheaper, having a different case made of plastic instead of metal, and one more USB3 port) - I assume the same is true for AS5404T vs AS6704T.

DanielGibson commented 1 year ago

I found a way, see https://github.com/mafredri/asustor-platform-driver/pull/6