From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 1/4] leds: core: add generic support for color LED's
Date: Fri, 19 Feb 2016 14:59:11 +0100 [thread overview]
Message-ID: <56C71FAF.50602@samsung.com> (raw)
In-Reply-To: <56C62AEC.4080208@gmail.com>
On 02/18/2016 09:34 PM, Heiner Kallweit wrote:
[...]
>>>>> /* Time to switch the LED on. */
>>>>> brightness = led_cdev->blink_brightness;
>>>>> delay = led_cdev->blink_delay_on;
>>>>> @@ -133,8 +133,8 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
>>>>> if (current_brightness)
>>>>> led_cdev->blink_brightness = current_brightness;
>>>>> if (!led_cdev->blink_brightness)
>>>>> - led_cdev->blink_brightness = led_cdev->max_brightness;
>>>>> -
>>>>> + led_cdev->blink_brightness =
>>>>> + led_validate_brightness(led_cdev, LED_FULL);
>>>>
>>>> This function name doesn't fit here, since term "validation" usually
>>>> refers to validating user provided data.
>>>>
>>>> led_confine_brightness() ?
>>>>
>>>> And why LED_FULL and not led_cdev->max_brightness?
>>>>
>>> LED_FULL is reduced to max_brightness anyway by led_validate_brightness.
>>> IMHO LED_FULL makes clearer that the intention is: switch it on.
>>> max_brightness is a device-specific property that I'd like to hide
>>> as far as possible in the generic core code.
>>
>> Without checking led_validate_brightness() internals it looks like this
>> patch was changing led_set_software_blink() semantics.
>>
> As far as I can see it doesn't. In monochrome mode
> led_validate_brightness(led_cdev, LED_FULL) evaluates to
> led_cdev->max_brightness.
I meant that looking at this change alone makes such an impression.
Besides, if we now have led_confine_brightness(), then it implies that
brightness will be limited up to LED_FULL level, whereas in fact
the upper limit will be max_brightness for monochrome LEDs.
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2016-02-19 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 19:27 [PATCH v2 1/4] leds: core: add generic support for color LED's Heiner Kallweit
2016-02-17 12:33 ` Jacek Anaszewski
2016-02-17 20:40 ` Heiner Kallweit
2016-02-18 10:17 ` Jacek Anaszewski
2016-02-18 20:34 ` Heiner Kallweit
2016-02-19 13:59 ` Jacek Anaszewski [this message]
2016-02-23 18:58 ` Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C71FAF.50602@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=hkallweit1@gmail.com \
--cc=linux-leds@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.