On Thu, Jul 14, 2016 at 07:15:19PM +0200, H. Nikolaus Schaller wrote:
Have tested a little. I think we have broken something. The LEDs remain dark.
Oops.
One thing we also need to fix is the bindings (still talks about private led-max-current).
I don't understand what you mean here.
And I think about modifying
static int is31fl319x_microamp_to_cs(struct device *dev, u32 microamp) { /* invert and round down to nearest value (range check done by caller) */ const u32 max = IS31FL319X_CURRENT_MAX + IS31FL319X_CURRENT_DEFAULT + IS31FL319X_CURRENT_STEP - 1; return ((max - microamp) / IS31FL319X_CURRENT_STEP) % 8; }
Ok. But IMO CS register values map is so irregular that it requires documentation. I would add it in comment to this function.
The reason is if we really specify the max. LED current there should be no limit reported on it. If it is 3 mA it is 3 mA. If it is 100 mA it is 100 mA.
Again I don't understand what you want to say.
So the best effort the driver can do is to take the next lower available current limit.
This is currently done in line 195:
led->max_microamp -= led->max_microamp % IS31FL319X_CURRENT_STEP;
Well, we still have a problem <5mA... And should probably turn off completely? Or in that case make probing fail.
I'd leave it off, emitting a runtime warning.
I will have to take a deeper look what is wrong, but not before tomorrow morning.
I'd like to fix it myself, but just staring at diff feels not productive. It's hard to solve this telepathically. What about SSH access for me and USB webcam connected to Pyra itself and directed towards LEDs?