On Tue, 2006-01-31 13:41:37 +0000, Richard Purdie <[email protected]> wrote: > Index: linux-2.6.15/drivers/leds/ledtrig-timer.c > =================================================================== > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ linux-2.6.15/drivers/leds/ledtrig-timer.c 2006-01-29 17:40:11.000000000 +0000 > @@ -0,0 +1,204 @@ > +/* led_dev write lock needs to be held */ > +static void led_timer_setdata(struct led_device *led_dev, unsigned long duty, unsigned long frequency) > +{ > + struct timer_trig_data *timer_data = led_dev->trigger_data; > + signed long duty1; > + > + if (frequency > 500) > + frequency = 500; Why? ...and especially: why, without complaining? > + if (duty > 100) > + duty = 100; Dito. > + duty1 = duty - 50; > + > + timer_data->duty = duty; > + timer_data->frequency = frequency; > + if (frequency != 0) { > + timer_data->delay_on = (50 - duty1) * 1000 / 50 / frequency; > + timer_data->delay_off = (50 + duty1) * 1000 / 50 / frequency; > + } Nice math :-) > + mod_timer(&timer_data->timer, jiffies); > +} > + MfG, JBG -- Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: [PATCH 4/11] LED: Add LED Timer Trigger
- From: Richard Purdie <[email protected]>
- Re: [PATCH 4/11] LED: Add LED Timer Trigger
- References:
- [PATCH 0/11] LED Class, Triggers and Drivers
- From: Richard Purdie <[email protected]>
- [PATCH 4/11] LED: Add LED Timer Trigger
- From: Richard Purdie <[email protected]>
- [PATCH 0/11] LED Class, Triggers and Drivers
- Prev by Date: Re: 2.6.16-rc1-mm4: ACX=y, ACX_USB=n compile error
- Next by Date: Re: [patch 3/5] MMC OMAP driver
- Previous by thread: [PATCH 4/11] LED: Add LED Timer Trigger
- Next by thread: Re: [PATCH 4/11] LED: Add LED Timer Trigger
- Index(es):
![]() |