Message ID | 20230621185949.2068-3-quic_amelende@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4578409vqr; Wed, 21 Jun 2023 12:03:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wt1ykSUN8EsxsYmK1qBvu2bk2a8cqZV2Mqas73OhvIQ8/5ivj05UKtUXpPUJrwYRpnamT X-Received: by 2002:a05:6a20:748c:b0:11f:39e2:d08c with SMTP id p12-20020a056a20748c00b0011f39e2d08cmr17245014pzd.30.1687374187528; Wed, 21 Jun 2023 12:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687374187; cv=none; d=google.com; s=arc-20160816; b=rcgX/LbudIQrV8dIxk83a5BzLNeFJexYLXswPrp/Xy4eE7YBkR3cFXOkHOht1R78RD JYLW9ZPe/+0ZAy4db5NB3pJiXYcDp0JvMGfa7ngvXl9yPsxrBQI2vFE2YFyrbcLjpjsP NaJmgQLE51G8aNPt/NzP3jN8KKWbka2LaCCtpd8PINXIDdFJAF6CEHy/A2whXSKkEjNw 1HENyf0lEiMkTlPa3zrQq5E+yNuyJCR+xZ22RCKQqNM0OFpqPTmC1sU3J3e+C7NtSi5w s8bccsDQbOzWhVwen4pUOpWHQrybJUjLOMILleEojxIjtc6mOjAaq5lw7pTzVgH89AgA melg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4R2bJlHYDEGr4/mjxRpMwCImvTQm2+G87251Ne6eFSo=; b=gX+znTXfAU8IpsOmYf/eIpdrDSrhUYcuVHkJQQwU6whlJqLXYbL32VyIX3/V8bqQwE ndOVEMAbZ+ca3Xl79cypDN2y1ALLZGmsDagv8GhBwaxBelihEXHLG2LGu/kKQbdL4kQc UUsVmBCaWQSSSVPfrLqm032zGs9ucK1pZVnuH2xf59qv9NY99CgXacJwwHaBJvb/74Il 4qCQqtbkZ55zEgwtbWRpPul3TxsXsBAoN9Urt3i4RiCRMoYC/N7n9qOSEIGCwGFoqHqp es91+PEOxMIHwQZ/ycgQDiznwAcIB9KfBy9Y2TjqOyAIN68BibP07maPKTzCDq1F/joU cEJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="GSaSH/F1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l123-20020a633e81000000b00540ca6239a0si4462389pga.538.2023.06.21.12.02.54; Wed, 21 Jun 2023 12:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="GSaSH/F1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231699AbjFUTB0 (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Wed, 21 Jun 2023 15:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbjFUTBU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Jun 2023 15:01:20 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4044C1BC1; Wed, 21 Jun 2023 12:01:14 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35LIhN49016783; Wed, 21 Jun 2023 19:01:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=4R2bJlHYDEGr4/mjxRpMwCImvTQm2+G87251Ne6eFSo=; b=GSaSH/F1BOW5jLut88bxvDtuw3Ko+T4kRq1ePI2p+n6M75H2rDimHUNdR4GQ1ftyFt8z GcKtLPcf9wsDgzd1G9Wzz5Z6BTEm4gnUkt5lc0nrU3zIFPQYQ9CwQCKYJEGBRoIlnHN5 lxzt6bjBRYpoganZgSGdBpcOYY4icGS+GOB+I/1dAkriFdosnm/CJw2OzPQEEzVpb/5a NzI0f9marJ64JC9Hkp6ZEBWcyR2jWQsTUK8YfE1HmuwBEroGZneQFgNqNgQyv83eBJB4 S5oOIx2NbBKujW/otdbpc32bEuPNfXrbcUOukRy6tBv4WVZODxDP3VGAJz1jB/KC/DlN 5g== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rbqkh25s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 19:01:02 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35LJ11nh026648 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 19:01:01 GMT Received: from hu-amelende-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Wed, 21 Jun 2023 12:01:00 -0700 From: Anjelique Melendez <quic_amelende@quicinc.com> To: <pavel@ucw.cz>, <lee@kernel.org>, <thierry.reding@gmail.com>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <agross@kernel.org>, <andersson@kernel.org> CC: <konrad.dybcio@linaro.org>, <u.kleine-koenig@pengutronix.de>, <linux-leds@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <linux-pwm@vger.kernel.org>, Anjelique Melendez <quic_amelende@quicinc.com> Subject: [PATCH 2/7] dt-bindings: leds: leds-qcom-lpg: Add support for LUT through NVMEM devices Date: Wed, 21 Jun 2023 11:59:46 -0700 Message-ID: <20230621185949.2068-3-quic_amelende@quicinc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230621185949.2068-1-quic_amelende@quicinc.com> References: <20230621185949.2068-1-quic_amelende@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: n3BcHyTMgfqA6mNZSHifdpjiySY_VBFg X-Proofpoint-GUID: n3BcHyTMgfqA6mNZSHifdpjiySY_VBFg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-21_11,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=860 priorityscore=1501 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306210159 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769340075582772774?= X-GMAIL-MSGID: =?utf-8?q?1769340075582772774?= |
Series |
Add support for LUT PPG
|
|
Commit Message
Anjelique Melendez
June 21, 2023, 6:59 p.m. UTC
Update leds-qcom-lpg bindings to support LUT patterns through NVMEM
devices.
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
.../bindings/leds/leds-qcom-lpg.yaml | 85 +++++++++++++++++++
1 file changed, 85 insertions(+)
Comments
On Wed, 21 Jun 2023 11:59:46 -0700, Anjelique Melendez wrote: > Update leds-qcom-lpg bindings to support LUT patterns through NVMEM > devices. > > Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> > --- > .../bindings/leds/leds-qcom-lpg.yaml | 85 +++++++++++++++++++ > 1 file changed, 85 insertions(+) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: Documentation/devicetree/bindings/leds/leds-qcom-lpg.example.dtb: /example-4/led-controller: failed to match any schema with compatible: ['qcom,pmi632-lpg'] doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230621185949.2068-3-quic_amelende@quicinc.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On 21/06/2023 20:59, Anjelique Melendez wrote: > Update leds-qcom-lpg bindings to support LUT patterns through NVMEM > devices. > > Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> > --- > .../bindings/leds/leds-qcom-lpg.yaml | 85 +++++++++++++++++++ > 1 file changed, 85 insertions(+) > > diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml > index e6f1999cb22f..c9d53820bf83 100644 > --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml > +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml > @@ -63,6 +63,31 @@ properties: > - description: dtest line to attach > - description: flags for the attachment > > + nvmem: > + description: > > + Phandle(s) of the nvmem device(s) to access the LUT stored in the SDAM module(s). It's the first time in this binding the "LUT" appears. Drop redundant parts like "Phandle(s) of ...." and describe what do you expect there and why the hardware needs it. > + This property is required only when LUT mode is supported and the LUT pattern is > + stored in SDAM modules instead of a LUT module. > + minItems: 1 > + maxItems: 2 > + > + nvmem-names: > + description: > > + The nvmem device name(s) for the SDAM module(s) where the LUT pattern data is stored. > + This property is required only when LUT mode is supported with SDAM module instead of > + LUT module. > + minItems: 1 > + items: > + - const: lpg_chan_sdam > + - const: lut_sdam > + > + qcom,pbs-client: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > > + Phandle of the PBS client used for sending the PBS trigger. This property is You need to explain what is PBS and what this property is doing. Phandle of PBS client? This is the PBS client! It does not make sense. > + required when LUT mode is supported and the LUT pattern is stored in a single > + SDAM module instead of a LUT module. Which devices support LUT? Why this is not constrained per variant? > + > multi-led: > type: object > $ref: leds-class-multicolor.yaml# > @@ -191,4 +216,64 @@ examples: > compatible = "qcom,pm8916-pwm"; > #pwm-cells = <2>; > }; > + - | > + #include <dt-bindings/leds/common.h> > + > + led-controller { > + compatible = "qcom,pm8350c-pwm"; > + #address-cells = <1>; > + #size-cells = <0>; > + #pwm-cells = <2>; > + nvmem-names = "lpg_chan_sdam" , "lut_sdam"; Fix your whitespaces. > + nvmem = <&pmk8550_sdam_21 &pmk8550_sdam_22>; Two entries, not one. Anyway, adding one property does not justify new example. Integrate it into existing one. > + > + led@1 { > + reg = <1>; > + color = <LED_COLOR_ID_RED>; > + label = "red"; > + }; > + > + led@2 { > + reg = <2>; > + color = <LED_COLOR_ID_GREEN>; > + label = "green"; > + }; > + > + led@3 { > + reg = <3>; > + color = <LED_COLOR_ID_BLUE>; > + label = "blue"; > + }; > + }; > + - | > + #include <dt-bindings/leds/common.h> > + > + led-controller { > + compatible = "qcom,pmi632-lpg"; > + #address-cells = <1>; > + #size-cells = <0>; > + #pwm-cells = <2>; > + nvmem-names = "lpg_chan_sdam"; > + nvmem = <&pmi632_sdam7>; > + qcom,pbs-client = <&pmi632_pbs_client3>; One more example? Why? Why do you have here only one NVMEM cell? Aren't you missing constraints in the binding? Best regards, Krzysztof
On 6/24/2023 2:42 AM, Krzysztof Kozlowski wrote: > On 21/06/2023 20:59, Anjelique Melendez wrote: >> Update leds-qcom-lpg bindings to support LUT patterns through NVMEM >> devices. >> >> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> >> --- >> .../bindings/leds/leds-qcom-lpg.yaml | 85 +++++++++++++++++++ >> 1 file changed, 85 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml >> index e6f1999cb22f..c9d53820bf83 100644 >> --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml >> +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml >> @@ -63,6 +63,31 @@ properties: >> - description: dtest line to attach >> - description: flags for the attachment >> >> + nvmem: >> + description: > >> + Phandle(s) of the nvmem device(s) to access the LUT stored in the SDAM module(s). > > It's the first time in this binding the "LUT" appears. Drop redundant > parts like "Phandle(s) of ...." and describe what do you expect there > and why the hardware needs it. LUT is a "lookup table"(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml?h=v6.4#n14) and in this case holds pattern data i.e LUT patterns. Currently, qcom,pm660l-lpg, qcom,pm8150b-lpg, qcom,pm8150l-lpg, qcom,pm8941-lpg, qcom,pm8994-lpg, qcom,pmc8180c-lpg, qcom,pmi8994-lpg, and qcom,pmi8998-lpg all have an a specific LUT peripheral (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/leds/rgb/leds-qcom-lpg.c?h=v6.4-rc7#n1382) and this is already being handled in leds-qcom-lpg. What is new with this patch set is that instead of having a LUT peripheral, some PMICs use nvmem to hold LUT pattern and other lpg per channel data. The use of nvmems to store LUT pattern and lpg data is called PPG. You can either have a single nvmem PPG (a single nvmem device that holds LUT pattern and lpg per channel data) or two-nvmem PPG(1 nvmem for LUT pattern and 1 nvmem for lpg per channel data) I can update the descritpion for the entire binding to mention PPG and LUT so this is more clear. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml?h=v6.4#n12 >> + This property is required only when LUT mode is supported and the LUT pattern is >> + stored in SDAM modules instead of a LUT module. >> + minItems: 1 >> + maxItems: 2 >> + >> + nvmem-names: >> + description: > >> + The nvmem device name(s) for the SDAM module(s) where the LUT pattern data is stored. >> + This property is required only when LUT mode is supported with SDAM module instead of >> + LUT module. >> + minItems: 1 >> + items: >> + - const: lpg_chan_sdam >> + - const: lut_sdam >> + >> + qcom,pbs-client: >> + $ref: /schemas/types.yaml#/definitions/phandle >> + description: > >> + Phandle of the PBS client used for sending the PBS trigger. This property is > > > You need to explain what is PBS and what this property is doing. > > Phandle of PBS client? This is the PBS client! It does not make sense. Ack > > > >> + required when LUT mode is supported and the LUT pattern is stored in a single >> + SDAM module instead of a LUT module. > > Which devices support LUT? Why this is not constrained per variant? When you say constrained per variant, are you looking for something more like this? i.e. allOf: - if: properties: compatible: contains: const: qcom,pmi632-lpg then: properties: nvmem: maxItems: 1 nvmem-names: items: - const: lpg_chan_sdam required: - nvmem - qcom,pbs-client - if: properties: compatible: contains: const: qcom,pm8350c-pwm then: properties: nvmem: maxItems: 2 nvmem-names: items: - const: lpg_chan_sdam - const: lut_sdam required: - nvmem > >> + >> multi-led: >> type: object >> $ref: leds-class-multicolor.yaml# >> @@ -191,4 +216,64 @@ examples: >> compatible = "qcom,pm8916-pwm"; >> #pwm-cells = <2>; >> }; >> + - | >> + #include <dt-bindings/leds/common.h> >> + >> + led-controller { >> + compatible = "qcom,pm8350c-pwm"; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + #pwm-cells = <2>; >> + nvmem-names = "lpg_chan_sdam" , "lut_sdam"; > > Fix your whitespaces. Ack > >> + nvmem = <&pmk8550_sdam_21 &pmk8550_sdam_22>; > > Two entries, not one> > Anyway, adding one property does not justify new example. Integrate it > into existing one. So we actually cannot integrate these properties into existing examples. The current examples are for PMICs that use LUT peripherals (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/leds/rgb/leds-qcom-lpg.c?h=v6.4#n1417). This patch series is adding support for PMICs that do not have a LUT peripheral and instead store LUT patterns and LPG configurations in either 1 or 2 NVMEM(s). > >> + >> + led@1 { >> + reg = <1>; >> + color = <LED_COLOR_ID_RED>; >> + label = "red"; >> + }; >> + >> + led@2 { >> + reg = <2>; >> + color = <LED_COLOR_ID_GREEN>; >> + label = "green"; >> + }; >> + >> + led@3 { >> + reg = <3>; >> + color = <LED_COLOR_ID_BLUE>; >> + label = "blue"; >> + }; >> + }; >> + - | >> + #include <dt-bindings/leds/common.h> >> + >> + led-controller { >> + compatible = "qcom,pmi632-lpg"; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + #pwm-cells = <2>; >> + nvmem-names = "lpg_chan_sdam"; >> + nvmem = <&pmi632_sdam7>; >> + qcom,pbs-client = <&pmi632_pbs_client3>; > > One more example? Why? > > Why do you have here only one NVMEM cell? Aren't you missing constraints > in the binding?The use of the qcom,pbs-client is only used when we have a PMIC device that has a single PPG NVMEM, which is why this was not included in the above 2 nvmem PPG example. I see how these two PPG examples are repetitive so I am ok with getting rid of one of them but I do think we should have at least one PPG example. > > Best regards, > Krzysztof > Thanks, Anjelique
On 29/06/2023 02:12, Anjelique Melendez wrote: >> >> >> >>> + required when LUT mode is supported and the LUT pattern is stored in a single >>> + SDAM module instead of a LUT module. >> >> Which devices support LUT? Why this is not constrained per variant? > When you say constrained per variant, are you looking for something more like this? > i.e. > allOf: > - if: > properties: > compatible: > contains: > const: qcom,pmi632-lpg > then: > properties: > nvmem: > maxItems: 1 > nvmem-names: > items: > - const: lpg_chan_sdam > required: > - nvmem > - qcom,pbs-client > - if: > properties: > compatible: > contains: > const: qcom,pm8350c-pwm > then: > properties: > nvmem: > maxItems: 2 > nvmem-names: > items: > - const: lpg_chan_sdam > - const: lut_sdam > required: > - nvmem Yes. > >> >>> + >>> multi-led: >>> type: object >>> $ref: leds-class-multicolor.yaml# >>> @@ -191,4 +216,64 @@ examples: >>> compatible = "qcom,pm8916-pwm"; >>> #pwm-cells = <2>; >>> }; >>> + - | >>> + #include <dt-bindings/leds/common.h> >>> + >>> + led-controller { >>> + compatible = "qcom,pm8350c-pwm"; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + #pwm-cells = <2>; >>> + nvmem-names = "lpg_chan_sdam" , "lut_sdam"; >> >> Fix your whitespaces. > Ack >> >>> + nvmem = <&pmk8550_sdam_21 &pmk8550_sdam_22>; >> >> Two entries, not one> >> Anyway, adding one property does not justify new example. Integrate it >> into existing one. > > So we actually cannot integrate these properties into existing examples. > The current examples are for PMICs that use LUT peripherals (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/leds/rgb/leds-qcom-lpg.c?h=v6.4#n1417). > This patch series is adding support for PMICs that do not have a LUT peripheral > and instead store LUT patterns and LPG configurations in either 1 or 2 NVMEM(s). >> >>> + >>> + led@1 { >>> + reg = <1>; >>> + color = <LED_COLOR_ID_RED>; >>> + label = "red"; >>> + }; >>> + >>> + led@2 { >>> + reg = <2>; >>> + color = <LED_COLOR_ID_GREEN>; >>> + label = "green"; >>> + }; >>> + >>> + led@3 { >>> + reg = <3>; >>> + color = <LED_COLOR_ID_BLUE>; >>> + label = "blue"; >>> + }; >>> + }; >>> + - | >>> + #include <dt-bindings/leds/common.h> >>> + >>> + led-controller { >>> + compatible = "qcom,pmi632-lpg"; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + #pwm-cells = <2>; >>> + nvmem-names = "lpg_chan_sdam"; >>> + nvmem = <&pmi632_sdam7>; >>> + qcom,pbs-client = <&pmi632_pbs_client3>; >> >> One more example? Why? >> >> Why do you have here only one NVMEM cell? Aren't you missing constraints >> in the binding?The use of the qcom,pbs-client is only used when we have a PMIC device that has a single PPG NVMEM, > which is why this was not included in the above 2 nvmem PPG example. I see how these two PPG examples > are repetitive so I am ok with getting rid of one of them but I do think we should have at least one PPG example. This example probably should replace one of the previous ones, because it is bigger / more complete. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml index e6f1999cb22f..c9d53820bf83 100644 --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml @@ -63,6 +63,31 @@ properties: - description: dtest line to attach - description: flags for the attachment + nvmem: + description: > + Phandle(s) of the nvmem device(s) to access the LUT stored in the SDAM module(s). + This property is required only when LUT mode is supported and the LUT pattern is + stored in SDAM modules instead of a LUT module. + minItems: 1 + maxItems: 2 + + nvmem-names: + description: > + The nvmem device name(s) for the SDAM module(s) where the LUT pattern data is stored. + This property is required only when LUT mode is supported with SDAM module instead of + LUT module. + minItems: 1 + items: + - const: lpg_chan_sdam + - const: lut_sdam + + qcom,pbs-client: + $ref: /schemas/types.yaml#/definitions/phandle + description: > + Phandle of the PBS client used for sending the PBS trigger. This property is + required when LUT mode is supported and the LUT pattern is stored in a single + SDAM module instead of a LUT module. + multi-led: type: object $ref: leds-class-multicolor.yaml# @@ -191,4 +216,64 @@ examples: compatible = "qcom,pm8916-pwm"; #pwm-cells = <2>; }; + - | + #include <dt-bindings/leds/common.h> + + led-controller { + compatible = "qcom,pm8350c-pwm"; + #address-cells = <1>; + #size-cells = <0>; + #pwm-cells = <2>; + nvmem-names = "lpg_chan_sdam" , "lut_sdam"; + nvmem = <&pmk8550_sdam_21 &pmk8550_sdam_22>; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_RED>; + label = "red"; + }; + + led@2 { + reg = <2>; + color = <LED_COLOR_ID_GREEN>; + label = "green"; + }; + + led@3 { + reg = <3>; + color = <LED_COLOR_ID_BLUE>; + label = "blue"; + }; + }; + - | + #include <dt-bindings/leds/common.h> + + led-controller { + compatible = "qcom,pmi632-lpg"; + #address-cells = <1>; + #size-cells = <0>; + #pwm-cells = <2>; + nvmem-names = "lpg_chan_sdam"; + nvmem = <&pmi632_sdam7>; + qcom,pbs-client = <&pmi632_pbs_client3>; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_RED>; + label = "red"; + }; + + led@2 { + reg = <2>; + color = <LED_COLOR_ID_GREEN>; + label = "green"; + }; + + led@3 { + reg = <3>; + color = <LED_COLOR_ID_BLUE>; + label = "blue"; + }; + }; + ...