Skip to contentSkip to conversation

heartbeat for leds on i2c bus

DISCUSSION Rodolfo Giometti 2 participants 2 messages Dec 3, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

on my custom board I have some leds mapped on a dedicated chip connected via i2c bus.

If I try to use the heartbeat trigger I hang the system... I suppose it is due the fact the led_set_brightness() function is called inside a kernel timer.

How I can solve this problem? I thought to modify the trigger adding a kernel thread who manage the led which in turn is controlled by the kernel timer. It could be the right solution?

Thanks in advance,

Rodolfo

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127
#1 lore raw
Quoted 7 lines · Rodolfo Giometti

If I try to use the heartbeat trigger I hang the system... I suppose it is due the fact the led_set_brightness() function is called inside a kernel timer.

How I can solve this problem? I thought to modify the trigger adding a kernel thread who manage the led which in turn is controlled by the kernel timer. It could be the right solution?

Yes, the heartbeat trigger driver assumes brightness_set() routine can be called from timer. Other led-triggers also have this assumption.

So I'd suggest using workqueue for your led driver, as like as the leds-gpio driver. Or you can just use the leds-gpio driver and implement the gpio interface (gpio_set_value_cansleep) instead of the led interface.

---
Atsushi Nemoto