Received: by 10.223.185.116 with SMTP id b49csp1189478wrg; Wed, 21 Feb 2018 13:48:58 -0800 (PST) X-Google-Smtp-Source: AH8x227ZsB+zbZYwZUCku0lYKSEwpDNCyLZ/+XrWRkuAhlKTsXuDnfZB0lnBthe2FuFlEdwoXl77 X-Received: by 10.101.102.73 with SMTP id z9mr3796743pgv.448.1519249738285; Wed, 21 Feb 2018 13:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519249738; cv=none; d=google.com; s=arc-20160816; b=l3bIFpuIOLasWbv3WjIpk1r1hyWBP180bPhNjopZ+yjwZ4vaFvEu2IlrUmnFGPYPgP MLOTATGP+9Nrcbg670aKdxarXfoaaJNaKwHmpch0DFXTzrXsWYVIOUbai4sMr9u4+pjs 4ERp0Dxeux34e3AyWIfa+gRJZX/SGWsmKx0+8IgfVfDxIT6LfN2IAgAz4eVj3QHTa3Zq 668GTLFS+30w/5jZTiI08CRlS04Ng2TJiyztt4/p6FR7/6Fh0vDPdqYiwJInl2UX3ycs TzCNIsCTR6nHBlYxTr2Yh/tmJg0B0bEaDa7m6atL/afAucRn93wzzfSkewFpxTnefbMT KYWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7o8MP1uLiKfAm9nXH1wdPZ1jTTZMVygMl7osiI2mqAg=; b=K2tLcN//HVi0IuNwqy0nwWodTpSeWwYOv/Md3feIWDHg0TfPDNOblVjYl2hlUG6voK O8AuxWTpRsYTS9jPahbups5PyuYMnQBxhYQDaaCWRc4OTfvk8rFxQonmAB+8PbVT9fae hfmogsH9kzLD4GcQzNyvfalD0jwDj+JDzmulh7wwuW8HDeAMfW3nzN0nr7rxts1N0662 e7aEktjCmYnMWhEeKiXC5JAkgCV20AYlxlnBV6MXGCp7Qp89Fhr9tT6MKCZqRaq9pNzs 6bSLUm54gWtl4/3IfvII9fH9LG3iBWndfHO+DnzHHgymRqdj/RpzUJIc2CjzwNVk8bF2 SoHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MCgKZBgD; 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 e92-v6si272977pld.359.2018.02.21.13.48.43; Wed, 21 Feb 2018 13:48:58 -0800 (PST) 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=MCgKZBgD; 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 S1751411AbeBUVrY (ORCPT + 99 others); Wed, 21 Feb 2018 16:47:24 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54252 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbeBUVrV (ORCPT ); Wed, 21 Feb 2018 16:47:21 -0500 Received: by mail-wm0-f68.google.com with SMTP id t74so171325wme.3; Wed, 21 Feb 2018 13:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7o8MP1uLiKfAm9nXH1wdPZ1jTTZMVygMl7osiI2mqAg=; b=MCgKZBgDJeqZ2yMnjt9Bw0nYIrhcfi3v5WCvchpvM8cS5jSuTZfTWOQ8XRcDX+i8iu QqoAHvrE4qzfSvvL17B5C/pZ+qhpv0xhRWl6LF6Y4dV8QkdCtIJDL21IBydcYU/HFG+D w4Ndq4AZZeWIMV5Mimce5GFOAp56I5qT0DU8gG2tPqOxuE64rZ07fwC42S07oOmuq4G/ I/7qgmeQEsqnVxqI6PBw1F4C6tv4v3KiVFb53a68JprpLznWe/p3jwwJ4Fa/6rtOpn8f VSUB5wa/tLoE6hZ/ElacTm7nt3jhD5N+1tlM4U1dvep4rrVFle2+/PjZyWhuRXkwquNu dSJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7o8MP1uLiKfAm9nXH1wdPZ1jTTZMVygMl7osiI2mqAg=; b=HduL31aZYmcgxkxU/NDVh82tGP49m1DQW2KicVh8OBfaOMhYyD2H1hYvqsqLRDd3v3 KoozXnnH0VOv2N/1H51rmKhlLwwjt/0rUEM5v/tbam8AppTE7dmIxsjXGzowMdRrYjPF Qcir0oVyh2RadWl0jE2Tyb8q3agUvpG1VNzGyhAYb4aJtggMUsowh8D6Q8KOhf/52Mec YVpJPaj8xRpTK47FNsGezyvND3/9CSea1DoJE7mwLF/Za+2U8QnFVnF2L889uahoUpbC bYtKz/o+ax+zE46D+9Mji1m9bcM14Q9WN2FT0Udh8v71g68Mhc74d7L04g7UGWMlKqH8 weZg== X-Gm-Message-State: APf1xPBazq+PvSifpGVzOQCrF0TuYq41TSO4DRTb4jBNoji3QZQSG0nI uqHtCIrHEiYGHX6BF2cJcfk= X-Received: by 10.80.166.137 with SMTP id e9mr6441118edc.97.1519249640142; Wed, 21 Feb 2018 13:47:20 -0800 (PST) Received: from a23nb05.fritz.box (xdsl-31-165-160-174.adslplus.ch. [31.165.160.174]) by smtp.googlemail.com with ESMTPSA id f19sm12626223edd.84.2018.02.21.13.47.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 13:47:19 -0800 (PST) From: Florian Vaussard To: Jacek Anaszewski , Pavel Machek Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Vaussard Subject: [PATCH v4 1/2] leds: ncp5623: Add device tree binding documentation Date: Wed, 21 Feb 2018 22:46:53 +0100 Message-Id: <20180221214654.3306-2-florian.vaussard@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180221214654.3306-1-florian.vaussard@gmail.com> References: <20180221214654.3306-1-florian.vaussard@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add device tree binding documentation for On Semiconductor NCP5623 I2C LED driver. The driver can independently control the PWM of the 3 channels with 32 levels of intensity. The current delivered by the current source can also be controlled. To do so, the led-max-microamp property is used by each LED sub-node. The maximum value is then found and used as a limit to compute the final intensity of the current source. If a LED happens to have a lower limit, the PWM is then used to limit the current to the requested value. In order to control the current source, it is also necessary to know the current on the Iref pin, hence the onnn,led-iref-microamp property. It is usually set using an external bias resistor, following Iref = Vref/Rbias with Vref=0.6V. Signed-off-by: Florian Vaussard Acked-by: Rob Herring --- .../devicetree/bindings/leds/leds-ncp5623.txt | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-ncp5623.txt diff --git a/Documentation/devicetree/bindings/leds/leds-ncp5623.txt b/Documentation/devicetree/bindings/leds/leds-ncp5623.txt new file mode 100644 index 000000000000..d83e5094343e --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-ncp5623.txt @@ -0,0 +1,60 @@ +* ON Semiconductor - NCP5623 3-Channel LED Driver + +The NCP5623 is a 3-channel I2C LED driver. The brightness of each +channel can be independently set using 32 levels. Each LED is represented +as a sub-node of the device. + +Required properties: + - compatible: Should be "onnn,ncp5623" + - reg: I2C slave address (fixed to 0x38) + - #address-cells: must be 1 + - #size-cells: must be 0 + - onnn,led-iref-microamp: Current on the Iref pin in microampere. It depends + on the value of the external bias resistor Rbias, following + Iref = Vref / Rbias with Vref = 0.6V. This is used to set the intensity of + the current that can be provided by the internal current source, based on + the maximum current permitted by LED sub-nodes (see below), but no more than + Imax = 2400 * Iref. + +LED sub-nodes +============= + +Required properties: + - reg : LED channel number (0..2) + - led-max-microamp: Maximum allowable current inside the LED in microampere. + This property is used to limit the PWM ratio, based on the intensity of the + internal current source (see above). + +Optional properties: + - label: see Documentation/devicetree/bindings/leds/common.txt + - linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt + +Example +======= + +led1: ncp5623@38 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "onnn,ncp5623"; + reg = <0x38>; + onnn,led-iref-microamp = <10>; + + led1r@0 { + label = "ncp:power:red"; + linux,default-trigger = "default-on"; + reg = <0>; + led-max-microamp = <20000>; + }; + + led1b@1 { + label = "ncp:power:blue"; + reg = <1>; + led-max-microamp = <20000>; + }; + + led1g@2 { + label = "ncp:power:green"; + reg = <2>; + led-max-microamp = <20000>; + }; +}; -- 2.13.6