Hi Nino,
Am 01.09.2017 um 08:49 schrieb Nino Bock askarus@openpandora.org:
On 31.08.2017 11:44, H. Nikolaus Schaller wrote:
Hi Nino,
Am 31.08.2017 um 08:34 schrieb Nino Bock askarus@openpandora.org:
Hello,
I have been working on scripts and a settings menu for the LEDs. I came across 2 issues:
1: Logo Red and Green swapped The green and red logo LED are swapped. So whenever I turn on /sys/class/leds/logo:green:bottom the red bottom logo LED will light up and vice versa. Same for logo:green:top.
Yes, I know. I am not sure which kernel version you are using. It might be fixed in the latest kernel (or not - we didn't open an #issue in the tracker).
Ah, yes it is fixed:
http://git.goldelico.com/?p=gta04-kernel.git;a=commit;h=97746d7bed842531be85...
Fine. I use Kernel 4.10.17-letux-zmatt-pyra.
Ah, I would not recommend to use 4.10. It has some bugs that have already been fixed in later kernels. Finding them again is just double work...
4.12.9 is quite good: http://projects.goldelico.com/p/gta04-kernel/
Unfortunately I can't recommend any 4.13 yet because the TILER patches are broken and I had to disable them.
That's what apt-get upgade did install for me some days ago.
Ok. Someone should update the gpt-get package then.
2: Trigger and Brightness overwrite each other I set a trigger with /sys/class/leds/$led/trigger and brightness with /sys/class/leds/$led/brightness.
If I set a trigger: The trigger will always trigger at full brightness, no mather what brightness I set afterwards. Except I set the brightness to Zero, then the trigger will be disabled.
Having no trigger set lets me adjust the brightness. However after setting a trigger, it triggers at full brightness, no matter the brightness I set before.
This may be more fundamental. AFAIR a trigger swaps brightness between 0 and 255 and is not a separate enable/disable keeping the brightness value untouched. For that one has to look into the general trigger driver code.
Maybe I'll do that later when I want to learn driver programming.
One more thing: The red LEDs besides the Power button are always turned on at full brightness when the Unit is running. I can't turn them off or set the brightness as I do with the other LEDs. That's annoying, especially in the dark.
Oops. They should go off... Or indicate over-load on the left/right USB socket.
Or if the tca6424 instructs them to go on. We might be missing to turn the tca6424 off (=> high-Z) in the kernel. Although I remember that we had some DT code ("gpio-hog") but can't find it any more. Maybe we did have explicit LED settings for it and then they would be off by default.
I have added an #issue: http://projects.goldelico.com/p/gta04-kernel/issues/833/
---
I was interrupted and did not yet send the mail...
So got a chance to boot the Pyra and run the /root/ledtest script. Here, all the red LEDs went off after a while.
But it also shows an explanation for your problem:
pyra-old:blue:mid pyra-old:green:mid pyra-old:red:left pyra-old:red:mid pyra-old:red:right
For historical/compatibility reasons with 4.9 and 5.0 boards these LEDs can not only activated through the brightness capable is31 chip (pyra:), but also through the tca6424 (pyra-old:). This has only brightness 100% or 0%.
Any of both chips/settings can make the LED go on.
So you should set the brightness of all pyra-old LEDs to 0 and disable triggers. This should also be the default:
http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=arch/arm/boot/dts/pyra...
BR and thanks, Nikolaus