Re: [PATCH 4/11] LED: Add LED Timer Trigger
- From: Richard Purdie <rpurdie@xxxxxxxxx>
- Date: Tue, 31 Jan 2006 17:36:56 +0000
On Tue, 2006-01-31 at 16:01 +0100, Jan-Benedict Glaw wrote:
> On Tue, 2006-01-31 13:41:37 +0000, Richard Purdie <rpurdie@xxxxxxxxx> wrote:
> > +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?
We're dealing with msec delays. Any frequency > 1000 will just cause
problems. There was a reason for using half that but it escapes me and
might be unneeded now. 500Hz/1000Hz is above the frequency the human eye
can see so is unlikely to present a problem.
> ...and especially: why, without complaining?
This is the important bit. It should return an -EINVAL back to
userspace.
> > + if (duty > 100)
> > + duty = 100;
>
> Dito.
Duty cycles > 100 make no sense and would break the subsequent
calculation. Same problem/solution as above.
Thanks,
Richard
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 0/11] LED Class, Triggers and Drivers
- From: Richard Purdie
- [PATCH 4/11] LED: Add LED Timer Trigger
- From: Richard Purdie
- Re: [PATCH 4/11] LED: Add LED Timer Trigger
- From: Jan-Benedict Glaw
- [PATCH 0/11] LED Class, Triggers and Drivers
- Prev by Date: Re: more cfq spinlock badness
- Next by Date: Re: Linux 2.6.15.2
- Previous by thread: Re: [PATCH 4/11] LED: Add LED Timer Trigger
- Next by thread: [patch 1/5] MMC OMAP driver
- Index(es):
Relevant Pages
- far from registered amazing virtue
... the spirits which enter into the pores touches other nerves, ... Memory is necessary
for all the operations of reason. ... Chance gives rise to thoughts, and chance
removes them; ... In writing down my thought, it sometimes escapes me; ... (sci.crypt) - within the human nice minute
... reason well; a fly is buzzing in its ears; that is enough to render it ... chase
away that animal which holds its reason in check and disturbs that ... Chance gives
rise to thoughts, and chance removes them; ... In writing down my thought, it sometimes escapes
me; ... (sci.crypt) - by the vast elderly choir
... reason well; a fly is buzzing in its ears; that is enough to render it ... they
win battles, hinder our soul from acting, eat ... Chance gives rise to thoughts,
and chance removes them; ... In writing down my thought, it sometimes escapes me; ...
(sci.crypt) - Geoff, still refering, trades almost quite, as the lemon disagrees towards their length.
... the spirits which enter into the pores touches other nerves, ... Memory is necessary
for all the operations of reason. ... Chance gives rise to thoughts, and chance
removes them; ... In writing down my thought, it sometimes escapes me; ... (sci.crypt) - Re: Xilinx hi-speed interconnect/routing question
... The simple answer is, no, we don't publish the information you are asking for, as we have
practically no reason to support 'hand crafted' designs. ... the net delays vary
by 200 psec. ... Ideally, I'd pack the 2 flip-flops in one slice, but in my design they
... (comp.arch.fpga)