Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4723777ybi; Mon, 15 Jul 2019 13:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyr3tXOVYwk5oEq4MNIQk3Flt4uevKDc4kKz7H7fkrQAjh6YweNOcujvZ56L5lu0CwgD7YP X-Received: by 2002:a63:ea50:: with SMTP id l16mr29420768pgk.160.1563223425774; Mon, 15 Jul 2019 13:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563223425; cv=none; d=google.com; s=arc-20160816; b=VkC9xg6tNHzUZC4HX1eYSosLe5eQVJegeh2RveUV4Ja0Hc8f1EllTPM2TJPweN+vUx 4VqI9HZHqOA1CtyQZOIuA095T8CS4Cl+rZAUOcikyQdDg8+fWMq45BEGRVefDHIYh5S6 TiXq8NRmpiGK+dRn0FE+qxOmePX3Mhp/oySJyIlPyYIRb4xCc2ur4EizuBR22Y2Lh9dh ynJQ4mqr6jRvAbC0pl8v2abTa5ri5lq7b1TLeAXVf1gfOfVpRngEiKPttvDZWDK4LIcR oEPhucIYdOvTPELg8SG/3kKuHADztSsfbrBjPJk9vYLpiew1VmAcwcRlVUzE4O9CP0T4 GuqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=GMZ3SZewevmADI672iQmV5vDJrQLuZ0c6mO3B4G0LK0=; b=SoDhqkvoNe1vgZK4WoqGX8HLvoBcAir+yjKiXEv/wwzL2S+0m5MlfaZCRoRR6QDtKx SnOIMsIXTQLpiHtb49V7cu2bs7kr9QBt1GGguY7TbnfgfdWKq5LbHKa7HHzMAiChI/iQ JLlS6mTZZsMUn9Qd8QF945N7IXGfO7pueZCbKXo1Wi34V53+MeDb2D45LH/cHV4jBqLA Q7nQsNFo6ffsas2LjngPIvAlFPZzkxv2kMuBErjEYKa7u0TRvL5W4KcCEjintHJhtVy6 cOKoB58TrU7mSrDm5iKERiJwPCcVK2JYjutDcYyMVEmP2qe1+MAJLO+vvHjz67fMUOeA KvOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q4KJGgGv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i133si16785565pgc.109.2019.07.15.13.43.29; Mon, 15 Jul 2019 13:43:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q4KJGgGv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729574AbfGOUm7 (ORCPT + 99 others); Mon, 15 Jul 2019 16:42:59 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40570 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729505AbfGOUm7 (ORCPT ); Mon, 15 Jul 2019 16:42:59 -0400 Received: by mail-wm1-f65.google.com with SMTP id v19so16509794wmj.5; Mon, 15 Jul 2019 13:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GMZ3SZewevmADI672iQmV5vDJrQLuZ0c6mO3B4G0LK0=; b=q4KJGgGv99ytKHkdBQBb9xz11Bd+4S61duDz6SFCRdGTlWc/wobU91TaXpSGiAilOU nuQR4CrTGgxRWZd9PCHiHiaox/Up2GcReLer7/36HO2DWvGwaTFNWLhT4s0XxUhtn3CW /AXioVdVK8n44uM3CHIpX/lsewwO291cQoOoKdoXWGKLed+VAgpVylslwOPkh8s0BEpz tUHccjMjat7lXF4VuC8RaR5MMqbgrVOG27h1PVO48Ajfj7JRDNuC5h9Z959WhW+wxSGr uivYgUSsalpL2k9h519k2gn3ImeAmDmJeZOS9S14Xl/ISYXLbor780l7kQO6gkj2t40D QBlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=GMZ3SZewevmADI672iQmV5vDJrQLuZ0c6mO3B4G0LK0=; b=P/sZayTX7P7ProZCxEcBzoWSn/E73fkL7crgTZ9DRBe+EX6YhzJaoMCRXx3aWZCnoE yAD/4QQyu0Pf5YObn6w/8b70A3rhP9MHvJA9CIbDWl6BR8GFurnlnolkYtgA19Fl/PZ7 ap46zOuS6uP84AEbILss/HWBnIzqOqzUdHQ/xIbuP1fRlQsnvQB673p0Bd14wi8Jc+kY W3qrsFCSMCA4FhOQcAqlPCUQBxaxH2ta+3HldzSH8GFsZbgfFmE8cMWL8erkNaOV/GLq sUT/V3vFF5P0yxUMvOObUcCNsboGXsgu4KJM7goUnlyo14Mw8AgWYJQWvRg+hS2l6/Dg yybQ== X-Gm-Message-State: APjAAAV6EMsA0+De0NQdGRc8Nt323vxfB0OwyKBYU+7CpbVo7H/BxvUz ySmj9fscBd5lySnGENSPOSxAh8yKiu0= X-Received: by 2002:a1c:1d4f:: with SMTP id d76mr27375124wmd.127.1563223375220; Mon, 15 Jul 2019 13:42:55 -0700 (PDT) Received: from [192.168.1.19] (chk118.neoplus.adsl.tpnet.pl. [83.31.8.118]) by smtp.gmail.com with ESMTPSA id c3sm19874540wrx.19.2019.07.15.13.42.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 13:42:54 -0700 (PDT) Subject: Re: [PATCH v2 2/2] leds: Add control of the voltage/current regulator to the LED core To: Jean-Jacques Hiblot , pavel@ucw.cz, robh+dt@kernel.org, mark.rutland@arm.com, daniel.thompson@linaro.org Cc: dmurphy@ti.com, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20190715155657.22976-1-jjhiblot@ti.com> <20190715155657.22976-3-jjhiblot@ti.com> From: Jacek Anaszewski Openpgp: preference=signencrypt Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= mQINBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jwcnqr4h/ygosvhP X3gkRzJLSFYekmEv+WHieeKXLrJdsUPUvPJTZtvi3ELUxHNOZwX2oRJStWpmL2QGMwPokRNQ 29GvnueQdQrIl2ylhul6TSrClMrKZqOajDFng7TLgvNfyVZE8WQwmrkTrdzBLfu3kScjE14Q Volq8OtQpTsw5570D4plVKh2ahlhrwXdneSot0STk9Dh1grEB/Jfw8dknvqkdjALUrrM45eF FM4FSMxIlNV8WxueHDss9vXRbCUxzGw37Ck9JWYo0EpcpcvwPf33yntYCbnt+RQRjv7vy3w5 osVwRR4hpbL/fWt1AnZ+RvbP4kYSptOCPQ+Pp1tCw16BOaPjtlqSTcrlD2fo2IbaB5D21SUa IsdZ/XkD+V2S9jCrN1yyK2iKgxtDoUkWiqlfRgH2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Tv9oyThOsK3HQjI7NCIsDzVpolaGQPd9E7xwOVHhhDcXRqqNjLzHUSe eGGiEQ== Message-ID: <4ae4d83b-8dee-72e4-3860-dd420a29115e@gmail.com> Date: Mon, 15 Jul 2019 22:42:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190715155657.22976-3-jjhiblot@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jean, Thank you for the patch. I have one issue. Please refer below. On 7/15/19 5:56 PM, 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. > > Signed-off-by: Jean-Jacques Hiblot > --- > drivers/leds/led-class.c | 15 ++++++++++++ > drivers/leds/led-core.c | 50 +++++++++++++++++++++++++++++++++++++--- > drivers/leds/leds.h | 1 + > include/linux/leds.h | 4 ++++ > 4 files changed, 67 insertions(+), 3 deletions(-) > > diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c > index 4793e77808e2..cadd43c30d50 100644 > --- a/drivers/leds/led-class.c > +++ b/drivers/leds/led-class.c > @@ -253,6 +253,7 @@ int of_led_classdev_register(struct device *parent, struct device_node *np, > { > char name[LED_MAX_NAME_SIZE]; > int ret; > + struct regulator *regulator; > > ret = led_classdev_next_name(led_cdev->name, name, sizeof(name)); > if (ret < 0) > @@ -272,6 +273,20 @@ int of_led_classdev_register(struct device *parent, struct device_node *np, > dev_warn(parent, "Led %s renamed to %s due to name collision", > led_cdev->name, dev_name(led_cdev->dev)); > > + regulator = devm_regulator_get_optional(led_cdev->dev, "power"); > + if (IS_ERR(regulator)) { > + if (PTR_ERR(regulator) != -ENODEV) { > + dev_err(led_cdev->dev, "Cannot get the power supply for %s\n", > + led_cdev->name); > + device_unregister(led_cdev->dev); > + mutex_unlock(&led_cdev->led_access); > + return PTR_ERR(regulator); > + } > + led_cdev->regulator = NULL; > + } else { > + led_cdev->regulator = regulator; > + } > + > 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; > + > + if (__led_need_regulator_update(led_cdev, brightness)) { > + > + if (brightness != LED_OFF) > + rc = regulator_enable(led_cdev->regulator); > + else > + rc = regulator_disable(led_cdev->regulator); > + if (rc) > + return rc; > + > + led_cdev->regulator_state = (brightness != LED_OFF); > + } > + return 0; > +} > + > static int __led_set_brightness(struct led_classdev *led_cdev, > enum led_brightness value) > { > @@ -80,6 +107,7 @@ static void led_timer_function(struct timer_list *t) > } > > led_set_brightness_nosleep(led_cdev, brightness); > + __led_handle_regulator(led_cdev, brightness); This cannot be called from atomic context since regulator_enable/disable use mutex beneath, that can sleep on contention. Therefore this call has to be made in two places instead: __led_set_brightness() __led_set_brightness_blocking() > > /* Return in next iteration if led is in one-shot mode and we are in > * the final blink state so that the led is toggled each delay_on + > @@ -115,6 +143,8 @@ static void set_brightness_delayed(struct work_struct *ws) > if (ret == -ENOTSUPP) > ret = __led_set_brightness_blocking(led_cdev, > led_cdev->delayed_set_value); > + __led_handle_regulator(led_cdev, led_cdev->delayed_set_value); > + > if (ret < 0 && > /* LED HW might have been unplugged, therefore don't warn */ > !(ret == -ENODEV && (led_cdev->flags & LED_UNREGISTERING) && > @@ -141,6 +171,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev, > /* never on - just set to off */ > if (!delay_on) { > led_set_brightness_nosleep(led_cdev, LED_OFF); > + __led_handle_regulator(led_cdev, LED_OFF); > return; > } > > @@ -148,6 +179,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev, > if (!delay_off) { > led_set_brightness_nosleep(led_cdev, > led_cdev->blink_brightness); > + __led_handle_regulator(led_cdev, led_cdev->blink_brightness); > return; > } > > @@ -256,8 +288,14 @@ void led_set_brightness_nopm(struct led_classdev *led_cdev, > enum led_brightness value) > { > /* Use brightness_set op if available, it is guaranteed not to sleep */ > - if (!__led_set_brightness(led_cdev, value)) > - return; > + if (!__led_set_brightness(led_cdev, value)) { > + /* > + * if regulator state doesn't need to be changed, that is all/ > + * Otherwise delegate the change to a work queue > + */ > + if (!__led_need_regulator_update(led_cdev, value)) > + return; > + } > > /* If brightness setting can sleep, delegate it to a work queue task */ > led_cdev->delayed_set_value = value; > @@ -280,6 +318,8 @@ EXPORT_SYMBOL_GPL(led_set_brightness_nosleep); > int led_set_brightness_sync(struct led_classdev *led_cdev, > enum led_brightness value) > { > + int ret; > + > if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) > return -EBUSY; > > @@ -288,7 +328,11 @@ int led_set_brightness_sync(struct led_classdev *led_cdev, > if (led_cdev->flags & LED_SUSPENDED) > return 0; > > - return __led_set_brightness_blocking(led_cdev, led_cdev->brightness); > + ret = __led_set_brightness_blocking(led_cdev, led_cdev->brightness); > + if (ret) > + return ret; > + > + return __led_handle_regulator(led_cdev, led_cdev->brightness); > } > EXPORT_SYMBOL_GPL(led_set_brightness_sync); > > diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h > index 47b229469069..5aa5c038bd38 100644 > --- a/drivers/leds/leds.h > +++ b/drivers/leds/leds.h > @@ -11,6 +11,7 @@ > > #include > #include > +#include > > static inline int led_get_brightness(struct led_classdev *led_cdev) > { > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 9b2bf574a17a..bee8e3f8dddd 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -123,6 +123,10 @@ struct led_classdev { > > /* Ensures consistent access to the LED Flash Class device */ > struct mutex led_access; > + > + /* regulator */ > + struct regulator *regulator; > + bool regulator_state; > }; > > extern int of_led_classdev_register(struct device *parent, > -- Best regards, Jacek Anaszewski