Thank you for this! Is your driver something Alex started to integrate? libreelec-8.0-aarch64-vfd
Hmm, nope, this looks like a patch for the vfd driver from stock kernel.
But I don't see the vfd driver here:
linux-amlogic/drivers/amlogic/input at amlogic-3.14.y · LibreELEC/linux-amlogic · GitHub
Is this patch meant to run LibreELEC on top of the stock kernel (for which there are no sources) or what?
Also, what I see as a problem in that patch is that it references the vfd device instance number directly, e.g.:
int vfd = open("/sys/devices/m1-vfd.26/dotled", O_RDWR);
this is bad practice, as instance number may vary depending on the DTS file and is certainly different on different platforms. For example, in stock X92 kernel it's m1-vfd.15, in my kernel it's m1-vfd.14 etc. This should be either autodetected or configurable.
P.S. Here's a link to the most up-to-date original vfd driver I could find on nets:
Firmware / kernel_amlogic_meson-common |
GitLab
P.P.S. I think that patching KODI to drive the LEDs is not the best approach. Launching a small daemon (22k) directly from initramfs (in kernel.img only for supported platforms) is better, it does not impose any additional functionality on the root system.