Re: [PATCH 2/8] leds: gpio: set max_brightness to 1

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

 



Am 13.09.2016 um 15:35 schrieb Jacek Anaszewski:
> Hi Heiner,
> 
> Thanks for the patches. I'll happily take them all except this
> one, as it could break existing userspace clients.
> 
You mean if there are userspace programs expecting the brightness
to be 255 if the LED is on? I see ..

> Could you please remove this patch and rebase the rest of the
> patch set on top of patch 1/8?
> 
Sure. Then I'll resend the remaining 6 patches with new
numbering (1/6 .. 6/6).

> Besides, please also cc linux-kernel@xxxxxxxxxxxxxxx list.
> 
OK

Rgds, Heiner
> Thanks,
> Jacek Anaszewski
> 
> On 09/13/2016 08:03 AM, Heiner Kallweit wrote:
>> GPIO-controlled LED's just have the status on or off.
>> Set max_brightness to 1 to reflect this.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx>
>> ---
>>  drivers/leds/leds-gpio.c | 13 ++++---------
>>  1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
>> index 3599b2e..3f64544 100644
>> --- a/drivers/leds/leds-gpio.c
>> +++ b/drivers/leds/leds-gpio.c
>> @@ -34,22 +34,16 @@ static void gpio_led_set(struct led_classdev *led_cdev,
>>  {
>>      struct gpio_led_data *led_dat =
>>          container_of(led_cdev, struct gpio_led_data, cdev);
>> -    int level;
>> -
>> -    if (value == LED_OFF)
>> -        level = 0;
>> -    else
>> -        level = 1;
>>
>>      if (led_dat->blinking) {
>> -        led_dat->platform_gpio_blink_set(led_dat->gpiod, level,
>> +        led_dat->platform_gpio_blink_set(led_dat->gpiod, value,
>>                           NULL, NULL);
>>          led_dat->blinking = 0;
>>      } else {
>>          if (led_dat->can_sleep)
>> -            gpiod_set_value_cansleep(led_dat->gpiod, level);
>> +            gpiod_set_value_cansleep(led_dat->gpiod, value);
>>          else
>> -            gpiod_set_value(led_dat->gpiod, level);
>> +            gpiod_set_value(led_dat->gpiod, value);
>>      }
>>  }
>>
>> @@ -106,6 +100,7 @@ static int create_gpio_led(const struct gpio_led *template,
>>              return -EINVAL;
>>      }
>>
>> +    led_dat->cdev.max_brightness = 1;
>>      led_dat->cdev.name = template->name;
>>      led_dat->cdev.default_trigger = template->default_trigger;
>>      led_dat->can_sleep = gpiod_cansleep(led_dat->gpiod);
>>
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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