From patchwork Fri Jul 14 22:45:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 107830 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1504529qge; Fri, 14 Jul 2017 15:45:36 -0700 (PDT) X-Received: by 10.98.218.20 with SMTP id c20mr7713822pfh.112.1500072336287; Fri, 14 Jul 2017 15:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500072336; cv=none; d=google.com; s=arc-20160816; b=dtZFYhvLmXUJgNRd8W2Om8tpLAPeNeTT0DpK8+18VH4Q/V3Xhin4mGoQYiS37aPbUJ nW8p25+ITNlzcP+zcH2Aj0QIHBzIFwHC6en7vAUERhvaSl8EfprMZ1kFJqvNTd4ZAn1L Fvfz0j4cNT/WSwh844I62foANOn3YpGuzqBERDTvXZs8mio6zTMhnKYmJ6tQG0Vjln3u P/3npoarNkh70YUwoybpEBZOlXrGp6pCKb6gjHWN2tG8ob0YEcinWsvdl0Kt8BPJm4Cb /l6bNSTBYvlv10mU94OEqNIT8/SyEd/nfgKd7vBKpdcVZ740cyslPYMagyATpomeSdBA 4/iA== 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=G/o2rrxvvJlXVpU6QLWc3/2HnOSiyinPn3UHPKDDyK4=; b=AdK0HNAMguZAACP8XtWlZTJAYhDmfzDAjFTa+9JVcDdP9xwkx95S4sLtKrYQ2PBf5f unnupDHq/bqqJoQ+ACPZB2LHfiYHE5gSGOJIolluXtimEtPXwAajKNtykTufOHWD0RR3 RvtOFNRSneksV7AcxmVkvPRdiDbXMgTn0kkgBkPmDzVKjWS62jKOlhiSaN7iMqAUhYZE Lx+zQHZdG2Z6TxO0e+cAO2UN7eDxGFgYNxrSwW7RgpYqVfD4/9oThnGcn5CGU3FzhLDy OiYhIwRB/sG2K/+sBLPKu8cn+TDXvDn8FZFPQ9Uz24R5vAKslBOAFolbSUle2ndby2l6 Hoig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=bvAuPwTy; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c75si7309646pfl.487.2017.07.14.15.45.36; Fri, 14 Jul 2017 15:45:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=bvAuPwTy; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbdGNWpd (ORCPT + 10 others); Fri, 14 Jul 2017 18:45:33 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:33356 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbdGNWp3 (ORCPT ); Fri, 14 Jul 2017 18:45:29 -0400 Received: by mail-pg0-f43.google.com with SMTP id k14so51952650pgr.0 for ; Fri, 14 Jul 2017 15:45:28 -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=QufhrjysgjkuQL4AIlChwpwQ3jY915PkE4opI6OwJaA=; b=bvAuPwTyla1J+tglkp3xixpVcgFurajBaZpHsxVALIkoJZGtu+DgebEPgBO5LNWzrZ nC1B0fEa/pwurN8x0Pa18mxe4EttkGxqEarGYKXu07K8NRhyNpZ387bI+OrKEmNp2Q/Y ngYA920E2Nc/Nf5ysTsznONKgCU0h7X8FePCs= 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=QufhrjysgjkuQL4AIlChwpwQ3jY915PkE4opI6OwJaA=; b=Ntr2xIKgs5XsICycMyqYVEkwLur/RjdhVr6jumcgZK8QQ4z9/A7w2V0E8OtCb81iGV 2mHUVOdOQwk66VRGT14ughQIHzfF5JbSbLreNIpb1KxXRaJnmN7M1yfKRWSYOk82dzVc /k9HM5lD4feRVMWqYAW8DsG8m9v2x6kh6Cwu6IF2Shpbf8kXSVdgn4Yno05XRLqNDSN4 A1i6mTM0PE9v19qU2IkFmXnmTBlJa94sJyYHdSsfcYqqsNTObOF+FqdKSMity5LHwlyA +lFHQUBJGmaeRaTBAJg+xENfp4atJJkcpaF+VFIf7NM6F/ezIocIrBiFeVmM6QYb6mIa M/5Q== X-Gm-Message-State: AIVw110/bJzcTsobZQpz70DLgTZhh6YPzPvSPLvaTv67UqrqWKnbfteB jK0g0gT4vnnVLnRA X-Received: by 10.98.156.14 with SMTP id f14mr7488784pfe.77.1500072328390; Fri, 14 Jul 2017 15:45:28 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id t70sm21393588pfk.111.2017.07.14.15.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 15:45:27 -0700 (PDT) From: Bjorn Andersson To: Richard Purdie , Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Fenglin Wu Subject: [PATCH v2 3/3] DT: leds: Add Qualcomm Light Pulse Generator binding Date: Fri, 14 Jul 2017 15:45:20 -0700 Message-Id: <20170714224520.467-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170714224520.467-1-bjorn.andersson@linaro.org> References: <20170714224520.467-1-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 --- Changes since v1: - Dropped custom pattern properties - Renamed cell-index to qcom,lpg-channel to clarify its purpose .../devicetree/bindings/leds/leds-qcom-lpg.txt | 145 +++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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..cc9ffee6586b --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.txt @@ -0,0 +1,145 @@ +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 + +- qcom,lpg-channel: + Usage: required, when referencing a LUT + Value type: + Definition: identifier of the LPG channel, 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) + += 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. + +&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>; + + default-state = "on"; + }; + + pmi8994_tri_led: tri-led@d000 { + compatible = "qcom,spmi-tri-led"; + reg = <0xd000>; + + qcom,power-source = <1>; + }; + }; +};