Re: [RESEND LEDs] leds: remove led_brightness

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

 



 Lee Jones <lee@xxxxxxxxxx> writes:

> >
> > The includes/linux/leds.h diff:
> > -/* This is obsolete/useless. We now support variable maximum brightness. */
> > -enum led_brightness {
> > -       LED_OFF         = 0,
> > -       LED_ON          = 1,
> > -       LED_HALF        = 127,
> > -       LED_FULL        = 255,
> > -};
> > +// default values for leds brightness
> > +#define LED_OFF  0
> > +#define LED_ON   1
> > +#define LED_HALF 127
> > +#define LED_FULL 255
> >
> I'm not aware of the history of this, however I'm even less sure how
> converting these from an enum to #defines makes this any better.
>

Yeah. The TODO says:
-* On/off LEDs should have max_brightness of 1
-* Get rid of enum led_brightness
-
-It is really an integer, as maximum is configurable. Get rid of it, or
-make it into typedef or something.

I could only remove enum led_brightness, but in some places, the
LED_FULL, LED_HALF...
are used. This is why I created this #defines.
I don't know what we can do in these cases that LED_FULL, FULL_HALF is used.
For example, in the drivers/leds/leds-ss4200.c on line 223 have this code

u32 setting = 0;
if (brightness >= LED_HALF)
    setting = 1;

In TODO where say "LEDs sould have max_brightness of 1" , I don't know
how this can work.
Because if the file needs to test if led brightness is half, the
integer number does not work in these cases
because, 0.5 (half of 1) is a double/float number.

If the max brightness is configurable, what drivers can do this?




[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