Re: [PATCH v2 1/2] dt-bindings: Add docs for EL15203000

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oleh,

On 6/8/19 12:42 AM, Oleh Kravchenko wrote:
Jacek,

08.06.19 01:12, Oleh Kravchenko пише:
Hello Jacek,

08.06.19 00:48, Oleh Kravchenko пише:
Jacek,

For blinking you can use blink_set op. To be able to recommend
you anoptimal solution for the effect we would need more
details regarding its nature.

Thanks, I will do that.
But how to properly handle other effects? Not only blinking?

	int		(*blink_set)(struct led_classdev *led_cdev,
				     unsigned long *delay_on,
				     unsigned long *delay_off);

My LED board doesn't support any delay settings at all.
Should I always set delay_on, delay_off to zero?

See a description of blink_set op in the leds.h:

* Activate hardware accelerated blink, delays are in milliseconds
* and if both are zero then a sensible default should be chosen.
* The call should adjust the timings in that case and if it can't
* match the values specified exactly.

Does the chip documentation say something about the rate
of blinking it supports?

If yes, then your implementation of blink_set op should set
the hw blinking effect only if these specific delays are
requested (you can also do some alignment - please compare
other LED drivers) or as mentioned before if two zeros are
provided.

If not, you could try to measure the blink rate and and
proceed similarly.

If requested delays are far beyond hw capabilities than just return
-EINVAL which will make LED core using software blink callback.


How to blink from userspace?

sysfs looks like doesn't have any property for that :(
   brightness
   device -> ../../../spi0.0
   max_brightness
   power
   subsystem -> ../../../../../../../../../class/leds
   trigger
   uevent

You want to set timer trigger (first turn it on in the config):

echo "timer" > trigger

After that two files appear: delay_on and delay_off.

ledtrig-timer uses blink_set op for setting up the hw blinking.

--
Best regards,
Jacek Anaszewski



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux