Skip to contentSkip to conversation

outdated documentation for lp5523 LED driver?

DISCUSSION Pavel Machek 2 participants 5 messages Jul 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi!

Documentation says that load/leds are only visible in the load mode, but that does not seem to be true (kernel 4.4.0 on N900).

# 1) Legacy interface - enginex_mode, enginex_load and enginex_leds # Control interface for the engines:
# x is 1 .. 3

#      enginex_mode : disabled, load, run
#      enginex_load : microcode load (visible only in load mode)
#      enginex_leds : led mux control (visible only in load mode)

pavel at n900:/sys/class/leds/lp5523:r/device$ ls -al engine*

-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine1_leds
--w------- 1 root root 4096 Jul  6 22:47 engine1_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine1_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine2_leds
--w------- 1 root root 4096 Jul  6 22:47 engine2_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine2_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_leds
--w------- 1 root root 4096 Jul  6 22:47 engine3_load
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_mode

pavel at n900:/sys/class/leds/lp5523:r/device$ grep . engine*mode engine1_mode:run
engine2_mode:load
engine3_mode:run
pavel at n900:/sys/class/leds/lp5523:r/device$

I got both the legacy and the firmware interface to work... but the firmware interface only seems to work once for me.

How new and old interface are expected to interact with each other is not clear to me.

What should be done there?

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 22 lines · On Friday 15 July 2016 09:32:14 Pavel Machek wrote:

Hi!

Documentation says that load/leds are only visible in the load mode, but that does not seem to be true (kernel 4.4.0 on N900).

# 1) Legacy interface - enginex_mode, enginex_load and enginex_leds # Control interface for the engines:
# x is 1 .. 3

#      enginex_mode : disabled, load, run
#      enginex_load : microcode load (visible only in load mode)
#      enginex_leds : led mux control (visible only in load mode)

pavel at n900:/sys/class/leds/lp5523:r/device$ ls -al engine*

(quoted diff) +0 -9
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine1_leds
--w------- 1 root root 4096 Jul  6 22:47 engine1_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine1_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine2_leds
--w------- 1 root root 4096 Jul  6 22:47 engine2_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine2_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_leds
--w------- 1 root root 4096 Jul  6 22:47 engine3_load
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_mode
Quoted 5 lines

pavel at n900:/sys/class/leds/lp5523:r/device$ grep . engine*mode engine1_mode:run
engine2_mode:load
engine3_mode:run
pavel at n900:/sys/class/leds/lp5523:r/device$

On 2.6.28 kernel is present only legacy interface and for this version is above documentation correct. When engine is in "run" or "disabled", then sysfs nodes _load and _leds are invisible.

So I suspect that bug is in current kernel code and documentation is correct... So I would propose to fix kernel code to reflect documentation...

Quoted 5 lines

I got both the legacy and the firmware interface to work... but the firmware interface only seems to work once for me.

How new and old interface are expected to interact with each other is not clear to me.

In my opinion both interfaces could be used. They provide same states load/run but via different sysfs files.

Quoted 5 lines

What should be done there?

Best regards,
Pavel

Signature · 2 lines
Pali Roh?r
pali.rohar at gmail.com
#2 lore raw
Quoted 24 lines · Pali Roh?r
Quoted 23 lines · On Friday 15 July 2016 09:32:14 Pavel Machek wrote:

Hi!

Documentation says that load/leds are only visible in the load mode, but that does not seem to be true (kernel 4.4.0 on N900).

# 1) Legacy interface - enginex_mode, enginex_load and enginex_leds # Control interface for the engines:
# x is 1 .. 3

#      enginex_mode : disabled, load, run
#      enginex_load : microcode load (visible only in load mode)
#      enginex_leds : led mux control (visible only in load mode)

pavel at n900:/sys/class/leds/lp5523:r/device$ ls -al engine*

(quoted diff) +0 -9
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine1_leds
--w------- 1 root root 4096 Jul  6 22:47 engine1_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine1_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine2_leds
--w------- 1 root root 4096 Jul  6 22:47 engine2_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine2_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_leds
--w------- 1 root root 4096 Jul  6 22:47 engine3_load
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_mode

pavel at n900:/sys/class/leds/lp5523:r/device$ grep . engine*mode

Quoted 8 lines
Quoted 4 lines

engine1_mode:run
engine2_mode:load
engine3_mode:run
pavel at n900:/sys/class/leds/lp5523:r/device$

On 2.6.28 kernel is present only legacy interface and for this version is above documentation correct. When engine is in "run" or "disabled", then sysfs nodes _load and _leds are invisible.

Well, I don't think 2.6.28 is suitable kernel to compare against... and I don't think hiding sysfs attributes makes any sense.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw
Quoted 34 lines · On Friday 15 July 2016 10:54:25 Pavel Machek wrote:
Quoted 24 lines · Pali Roh?r
Quoted 23 lines · On Friday 15 July 2016 09:32:14 Pavel Machek wrote:

Hi!

Documentation says that load/leds are only visible in the load mode, but that does not seem to be true (kernel 4.4.0 on N900).

# 1) Legacy interface - enginex_mode, enginex_load and enginex_leds # Control interface for the engines:
# x is 1 .. 3

#      enginex_mode : disabled, load, run
#      enginex_load : microcode load (visible only in load mode)
#      enginex_leds : led mux control (visible only in load mode)

pavel at n900:/sys/class/leds/lp5523:r/device$ ls -al engine*

(quoted diff) +0 -9
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine1_leds
--w------- 1 root root 4096 Jul  6 22:47 engine1_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine1_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine2_leds
--w------- 1 root root 4096 Jul  6 22:47 engine2_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine2_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_leds
--w------- 1 root root 4096 Jul  6 22:47 engine3_load
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_mode

pavel at n900:/sys/class/leds/lp5523:r/device$ grep . engine*mode

Quoted 8 lines
Quoted 4 lines

engine1_mode:run
engine2_mode:load
engine3_mode:run
pavel at n900:/sys/class/leds/lp5523:r/device$

On 2.6.28 kernel is present only legacy interface and for this version is above documentation correct. When engine is in "run" or "disabled", then sysfs nodes _load and _leds are invisible.

Quoted 2 lines

Well, I don't think 2.6.28 is suitable kernel to compare against... and I don't think hiding sysfs attributes makes any sense.

It is legacy interface which was used in older kernels (like 2.6.28) and is there to not break existing applications... So comparing with kernel when that interface was not legacy is correct way to check...

Signature · 2 lines
Pali Roh?r
pali.rohar at gmail.com
#4 lore raw
Quoted 35 lines · Pali Roh?r
Quoted 34 lines · On Friday 15 July 2016 10:54:25 Pavel Machek wrote:
Quoted 32 lines · Pali Roh?r
Quoted 22 lines · On Friday 15 July 2016 09:32:14 Pavel Machek wrote:

Hi!

Documentation says that load/leds are only visible in the load mode, but that does not seem to be true (kernel 4.4.0 on N900).

# 1) Legacy interface - enginex_mode, enginex_load and enginex_leds # Control interface for the engines:
# x is 1 .. 3

#      enginex_mode : disabled, load, run
#      enginex_load : microcode load (visible only in load mode)
#      enginex_leds : led mux control (visible only in load mode)

pavel at n900:/sys/class/leds/lp5523:r/device$ ls -al engine*

(quoted diff) +0 -9
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine1_leds
--w------- 1 root root 4096 Jul  6 22:47 engine1_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine1_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine2_leds
--w------- 1 root root 4096 Jul  6 22:47 engine2_load
-rw-r--r-- 1 root root 4096 Jul  6 23:41 engine2_mode
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_leds
--w------- 1 root root 4096 Jul  6 22:47 engine3_load
-rw-r--r-- 1 root root 4096 Jul  6 22:47 engine3_mode
Quoted 5 lines

pavel at n900:/sys/class/leds/lp5523:r/device$ grep . engine*mode engine1_mode:run
engine2_mode:load
engine3_mode:run
pavel at n900:/sys/class/leds/lp5523:r/device$

On 2.6.28 kernel is present only legacy interface and for this version is above documentation correct. When engine is in "run" or "disabled", then sysfs nodes _load and _leds are invisible.

Quoted 6 lines
Quoted 2 lines

Well, I don't think 2.6.28 is suitable kernel to compare against... and I don't think hiding sysfs attributes makes any sense.

It is legacy interface which was used in older kernels (like 2.6.28) and is there to not break existing applications... So comparing with kernel when that interface was not legacy is correct way to check...

Well, not breaking legacy applications is only goal after reasonable interface is merged to mainline.

Can you test if they actually care about the change or not? I suspect they don't.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html