Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: Dan Murphy <dmurphy@ti.com>, <jacek.anaszewski@gmail.com>,
	<pavel@ucw.cz>, <robh+dt@kernel.org>, <mark.rutland@arm.com>,
	<daniel.thompson@linaro.org>
Cc: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] leds: Add control of the voltage/current regulator to the LED core
Date: Wed, 17 Jul 2019 15:14:21 +0200
Message-ID: <3b8e5847-6859-d78d-6274-7a879557dcae@ti.com> (raw)
In-Reply-To: <9c17e9cc-8162-7b5d-2db9-d2bed20969c5@ti.com>

Hi Dan,

On 15/07/2019 20:59, Dan Murphy wrote:
> JJ
>
> On 7/15/19 10:56 AM, Jean-Jacques Hiblot wrote:
>> A LED is usually powered by a voltage/current regulator. Let the LED 
>> core
>> know about it. This allows the LED core to turn on or off the power 
>> supply
>> as needed.
>
> This allows the LED core to turn on or off managed power supplies.
>
>
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>> ---

>>       if (led_cdev->flags & LED_BRIGHT_HW_CHANGED) {
>>           ret = led_add_brightness_hw_changed(led_cdev);
>>           if (ret) {
>> diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
>> index 7107cd7e87cf..a12b880b0a2f 100644
>> --- a/drivers/leds/led-core.c
>> +++ b/drivers/leds/led-core.c
>> @@ -23,6 +23,33 @@ EXPORT_SYMBOL_GPL(leds_list_lock);
>>   LIST_HEAD(leds_list);
>>   EXPORT_SYMBOL_GPL(leds_list);
>>   +static bool __led_need_regulator_update(struct led_classdev 
>> *led_cdev,
>> +                    int brightness)
>> +{
>> +    bool new_state = (brightness != LED_OFF);
>> +
>> +    return led_cdev->regulator && led_cdev->regulator_state != 
>> new_state;
>> +}
>> +
>> +static int __led_handle_regulator(struct led_classdev *led_cdev,
>> +                int brightness)
>> +{
>> +    int rc;
>
> Should there be a check for the regulator pointer.
>
> If (!led_cdev->regulator)
>
>     return 0;

Not required because __led_need_regulator_update() returns false if 
led_cdev->regulator is NULL.

Thanks for the review

JJ

>
>
> Otherwise
>
> Reviewed-by: Dan Murphy <dmurphy@ti.com>
>
> <snip>
>

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 15:56 [PATCH v2 0/2] " Jean-Jacques Hiblot
2019-07-15 15:56 ` [PATCH v2 1/2] dt-bindings: leds: document the "power-supply" property Jean-Jacques Hiblot
2019-07-15 18:52   ` Dan Murphy
2019-08-19 11:31   ` Pavel Machek
2019-07-15 15:56 ` [PATCH v2 2/2] leds: Add control of the voltage/current regulator to the LED core Jean-Jacques Hiblot
2019-07-15 18:59   ` Dan Murphy
2019-07-17 13:14     ` Jean-Jacques Hiblot [this message]
2019-07-15 20:42   ` Jacek Anaszewski
2019-07-17 13:23     ` Jean-Jacques Hiblot
2019-07-16 10:50   ` Daniel Thompson
2019-07-17 13:47     ` Jean-Jacques Hiblot

Reply instructions:

You may reply publically 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=3b8e5847-6859-d78d-6274-7a879557dcae@ti.com \
    --to=jjhiblot@ti.com \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@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

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org linux-leds@archiver.kernel.org
	public-inbox-index linux-leds


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/ public-inbox