Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1552081ybj; Fri, 20 Sep 2019 12:19:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjHo4ctNRuxVfuFAHzFwh9QVCNavRNT5lPzjvbhZeIeg4kf/YfHXhvmJxrX9UcHq+fcAho X-Received: by 2002:a05:6402:1a52:: with SMTP id bf18mr14392487edb.67.1569007159323; Fri, 20 Sep 2019 12:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569007159; cv=none; d=google.com; s=arc-20160816; b=IKt0O0jASUuXfK38NljMuQX1CN6DhOIyHlmAdUcQM2ajD1UEC181Fm3nH7hLCo4rbe DOgxHwUE4evmuKAXPPeYpmnZB+Du7m+Ykm4XAn4DZeeeJg5zYoZLX34wM2XqswEGy4sR Zvs/wjriZxiXF5iCzhCw7cjr297Qhrc6HwnmEv5OtFXbXyfz7Tp6l4vdDQnTdZKQ/D2v 5advB/AdSKpOvfLl8kLzJspohn3/eOtVlynh04AxcmElf6MMLSWTpuq9txCnKBDoQyED b2rxzNa6IhkkTxwn2fIJClaqmzx2W+4Jp1tGnBCGlOFWxnrLu3eUxUap2JvZk/napWsk 1vYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=4TyJ5sizsTzi/H33Mo1wWvezZRRG5B0ADthV0dE35aI=; b=FB9jPN0MC/ifQ3moyGsVuTNi3VAyyws4rFCJMNZW8iHaRj/WUEbbyUh/rqvBA2K4x6 HG+7KPDlzMjgjsiQhR2q2+WX1MKo7dh9iSAoS9lLlzAvUX+OF67U3fdUC2BgNSngRzEt MMH00hMcTF0tLbuFLlq4MJei7T9Co3aH8n/CcBnXCLuv4znA+sPSzgh3HL343Ul7Nuog +sWNm6Vf30mz1wd8rAT+Z0AvI8fscdnHshGNpyZoxZjBgCHoriAScS+GIOdGlYf8KJsa Pa/VNrwwotGcWlocgYAMoE4sYuEyESGaj0ViNLyyRvUAcLOjhwDjreDlr4FGYCcdINNF ARZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IdJ6fdlL; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 29si1714816eje.235.2019.09.20.12.18.56; Fri, 20 Sep 2019 12:19:19 -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=@ti.com header.s=ti-com-17Q1 header.b=IdJ6fdlL; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438325AbfITMZv (ORCPT + 99 others); Fri, 20 Sep 2019 08:25:51 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:49434 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408945AbfITMZu (ORCPT ); Fri, 20 Sep 2019 08:25:50 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8KCPjSE071956; Fri, 20 Sep 2019 07:25:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568982346; bh=4TyJ5sizsTzi/H33Mo1wWvezZRRG5B0ADthV0dE35aI=; h=From:To:CC:Subject:Date; b=IdJ6fdlLW78lRCYMwbOIiIJJH0hm/utSpaDmuL7BnOW0hrXUBEs8hNmJEcrFlfHrg vBGuPCRihgLp7Vc0vqbafd1xUib/UxZhh9VnpIiKb6my1chGPfrvpHjXyXdv10eem9 UKbql1OR93ipflY4bQ/FpbA91lUqlRPdfDTleveY= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8KCPj2X095282; Fri, 20 Sep 2019 07:25:45 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 20 Sep 2019 07:25:41 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 20 Sep 2019 07:25:41 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8KCPiY1016302; Fri, 20 Sep 2019 07:25:45 -0500 From: Jean-Jacques Hiblot To: , , CC: , , , , Jean-Jacques Hiblot Subject: [PATCH v4 0/3] leds: Add control of the voltage/current regulator to the LED core Date: Fri, 20 Sep 2019 14:25:22 +0200 Message-ID: <20190920122525.15712-1-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series makes it possible for the LED core to manage the power supply of a LED. It uses the regulator API to disable/enable the power if when the LED is turned on/off. This is especially useful in situations where the LED driver/controller is not supplying the power. Because updating a regulator state can block, it is always defered to set_brightness_delayed(). changes in v4: - Add a new patch to make led_set_brightness_sync() use led_set_brightness_nosleep() and then wait the work to be done - Rework how the core knows how the regulator needs to be updated. changes in v3: - reword device-tree description - reword commit log - remove regulator updates from functions used in atomic context. If the regulator must be updated, it is defered to a workqueue. - Fix led_set_brightness_sync() to work with the non-blocking function __led_set_brightness() changes in v2: - use devm_regulator_get_optional() to avoid using the dummy regulator and do some unnecessary work Jean-Jacques Hiblot (3): led: make led_set_brightness_sync() use led_set_brightness_nosleep() dt-bindings: leds: document the "power-supply" property leds: Add control of the voltage/current regulator to the LED core .../devicetree/bindings/leds/common.txt | 6 ++ drivers/leds/led-class.c | 17 ++++ drivers/leds/led-core.c | 77 +++++++++++++++++-- drivers/leds/leds.h | 3 + include/linux/leds.h | 5 ++ 5 files changed, 101 insertions(+), 7 deletions(-) -- 2.17.1