From patchwork Thu Mar 23 05:54:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 95884 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp616178qgd; Thu, 23 Mar 2017 00:37:25 -0700 (PDT) X-Received: by 10.99.121.77 with SMTP id u74mr1296272pgc.200.1490254645825; Thu, 23 Mar 2017 00:37:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si1896836pli.5.2017.03.23.00.37.25 for ; Thu, 23 Mar 2017 00:37:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-leds-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=@linaro.org; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753685AbdCWHhZ (ORCPT ); Thu, 23 Mar 2017 03:37:25 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35535 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679AbdCWHhW (ORCPT ); Thu, 23 Mar 2017 03:37:22 -0400 Received: by mail-pf0-f175.google.com with SMTP id 20so54116525pfk.2 for ; Thu, 23 Mar 2017 00:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vT6jR605SYIeQT8luSONbK4M3J4cp+RGm//MhFbs7+E=; b=Uj6ycxhd78xoiJgCtvKU0sxgxPjtiWn6YWRnFFrmKkMZAj+ljaJ9b+hNgIHk/x57ws g879xQRoLZd2U+/gi6TNcRMUNfry8j6QOVLD1d7hBwWqyE4GjEgcWuLd9tWBYJI/FqSv R/0PZrFY4fRsAO7yGYuVOtYpZLsGckTzU/5uE= 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=vT6jR605SYIeQT8luSONbK4M3J4cp+RGm//MhFbs7+E=; b=Ojp3NPvDevNwpQXJRxXTsqEpT5FCnuAbR/cFAnB56FAE+F0HwvgAlWO4vELd1RNhnL hyVtCNY8ElSsHhaounKDgOVRTMBlWl99tpU84v3hkngqg1yOtxdgJmwGG0e0QsW6cZJp xUThTfVzq4oCuWXQZXAJMTLoo8RLrF8rhfWDVN9NVbrbknBJFE1EDnqpSTB4A9BxXgWx FST0ZyIdQrAV+UyKz8GgVB/sARg4aRa4pcZlGgQLFp2mGUtpM4jnBRROPO4NrTf0OV0a NupaT4h1kWDOhgTIQg00uMeJDkVJpw5VYr+vdCFUdbsvtq6hd1k3YblSDSZ7RnXjLB/q jNtg== X-Gm-Message-State: AFeK/H2K7WLht9aSCnK69trpKiKfJ/4ozyQHYtc78akO0oRCnP1YiXa8R6hSdQbQeP1+U9o4 X-Received: by 10.98.252.211 with SMTP id e202mr953205pfh.118.1490248481725; Wed, 22 Mar 2017 22:54:41 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id s65sm7265707pgb.64.2017.03.22.22.54.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 22:54:41 -0700 (PDT) From: Bjorn Andersson To: Richard Purdie , Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/2] DT: leds: Add Qualcomm Light Pulse Generator binding Date: Wed, 22 Mar 2017 22:54:35 -0700 Message-Id: <20170323055435.29197-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170323055435.29197-1-bjorn.andersson@linaro.org> References: <20170323055435.29197-1-bjorn.andersson@linaro.org> Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This adds the binding document describing the three hardware blocks related to the Light Pulse Generator found in a wide range of Qualcomm PMICs. Signed-off-by: Bjorn Andersson --- .../devicetree/bindings/leds/leds-qcom-lpg.txt | 194 +++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt -- 2.12.0 diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt new file mode 100644 index 000000000000..fb9edd89119d --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt @@ -0,0 +1,194 @@ +Binding for Qualcomm Light Pulse Generator + +The Qualcomm Light Pulse Generator consists of three different hardware blocks; +a ramp generator with lookup table, the light pulse generator and a three +channel current sink. These blocks are found in a wide range of Qualcomm PMICs. +Each of these are described individually below. + += Lookup Table (LUT) + +- compatible: + Usage: required + Value type: + Definition: must be "qcom,spmi-lpg-lut" + +- reg: + Usage: required + Value type: + Definition: base address of the LUT block + +- qcom,lut-size: + Usage: required + Value type: + Definition: number of elements available in the lookup table + += Light Pulse Generator (LPG) +The Light Pulse Generator can operate either as a standard PWM controller or in +a more advanced lookup-table based mode. These are described separately below. + +- compatible: + Usage: required + Value type: + Definition: must be "qcom,spmi-lpg" + +- reg: + Usage: required + Value type: + Definition: base address of the LPG block + +== PWM mode + +- #pwm-cells: + Usage: required + Value type: + Definition: must be 1 + +== Lookup-table mode + +- cell-index: + Usage: required, when referencing a LUT + Value type: + Definition: id of the LPG, used to associate the LPG with a particular + ramp generator in the LUT block + +- default-state: + Usage: optional + Value type: + Definition: default state, as defined in common.txt + +- label: + Usage: optional + Value type: + Definition: label of the LED, as defined in common.txt + +- linux,default-trigger: + Usage: optional + Value type: + Definition: default trigger, as defined in common.txt + +- qcom,tri-led: + Usage: optional + Value type: + Definition: a phandle of a TRILED node and a single u32 denoting which + output channel to control + +- qcom,lut: + Usage: optional + Value type: + Definition: phandle of a LUT node + +- qcom,dtest: + Usage: optional + Value type: + Definition: configures the output into an internal test line of the + pmic. A first u32 defines which test line to use and the + second cell configures how the value should be outputed + (available lines and configuration differs between PMICs) + +- qcom,pattern: + Usage: optional + Value type: + Definition: list of 16 bit duty cycle values to make up the pattern to + be programmed into the LUT. Values should be in the range + [0,512). + +- qcom,pattern-length-ms: + Usage: optional + Value type: + Definition: duration, in milliseconds, of the ramp generator running + one pass over the defined pattern + +- qcom,pattern-pause-lo-ms: + Usage: optional + Value type: + Definition: duration, in milliseconds, for the ramp generator to pause + before iterating over the pattern + +- qcom,pattern-pause-hi-ms: + Usage: optional + Value type: + Definition: duration, in milliseconds, for the ramp generator to pause + after iterating over the pattern + +- qcom,pattern-ping-pong: + Usage: optional + Value type: + Definition: denotes that the ramp generator should reverse direction + when reaching the end of the pattern, instead of wrapping + to the beginning + +- qcom,pattern-oneshot: + Usage: optional + Value type: + Definition: denotes that the ramp generator should stop after a single + pass over the pattern + +- qcom,pattern-reverse: + Usage: optional + Value type: + Definition: denotes that the ramp generator should operate backwards + over the pattern + += LED Current Sink (TRILED) + +- compatible: + Usage: required + Value type: + Definition: must be "qcom,spmi-tri-led" + +- reg: + Usage: required + Value type: + Definition: base address of the TRILED block + +- qcom,power-source: + Usage: required + Value type: + Definition: power-source used to drive the output, as defined in the + datasheet + += EXAMPLE: +The following example defines a single output of the PMI8994, sinking current +into a LED in a natural pulsating pattern: + +&spmi_bus { + pmic@3 { + compatible = "qcom,pmi8994", "qcom,spmi-pmic"; + reg = <0x3 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + + pmi8994_lpg_lut: lpg-lut@b000 { + compatible = "qcom,spmi-lpg-lut"; + reg = <0xb000>; + + qcom,lut-size = <24>; + }; + + lpg@b200 { + compatible = "qcom,spmi-lpg"; + reg = <0xb200>; + + cell-index = <2>; + + label = "lpg:green:user0"; + + qcom,tri-led = <&pmi8994_tri_led 1>; + qcom,lut = <&pmi8994_lpg_lut>; + + qcom,pattern = /bits/ 16 <9 20 42 86 158 256 353 + 425 469 491 502 507>; + qcom,pattern-length-ms = <1337>; + qcom,pattern-ping-pong; + + default-state = "on"; + }; + + pmi8994_tri_led: tri-led@d000 { + compatible = "qcom,spmi-tri-led"; + reg = <0xd000>; + + qcom,power-source = <1>; + }; + }; +};