Message ID | 20221101161801.1058969-2-luca@z3ntu.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3074850wru; Tue, 1 Nov 2022 09:31:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6y3BIC0CXmhsHJxG2tEDon+oONj+g2TtV3Dpp92G0x0c30SwDBExsIlaIidIPlxCb9yDEO X-Received: by 2002:a17:907:8a07:b0:7ad:e111:9f1f with SMTP id sc7-20020a1709078a0700b007ade1119f1fmr8202148ejc.748.1667320305598; Tue, 01 Nov 2022 09:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667320305; cv=none; d=google.com; s=arc-20160816; b=Qlks4QnYYDFB77d9MOT6L3XsEjA7bWnuFy9ZKUrf790taHxGdNIDEF5tTLqbYMW1W6 Hr13rmlbOx0BjUoWQvmJ02ME4IKyrG6p99Ql4JTflcs/bxVHhxfJ6Gw1uWW1WeDr+l88 XLwSURgGEES0nwGtZhYdYfL5fCv9l6ICacNeXBJxvYLI2EBwQ/rPt4kiG3jTQsA4SoAG 8R0wNsCN19taQSQm5iCktkOGam7nlxeOqoYNXhGOCNsRKrpwMbJrOu9fWdnpt0tcQmCl ufn9ADaA0YCIck1YbyysAMvpmFjpeg/UGDm/0PDQYnx50Xln7rL//Zt1siUGhA2sYI0j j56A== 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=qW4rZNB9p69J70BndQabioajz0wHTFK3c/rDmOQPTL8=; b=EJEtgRC1FI4qZYR1f7impUTqlU1J8kqHuh8F6rsYVR8MJEKjmB1Bb5ViKkN/FEtvFH mqaSkxHeAa050tqV3Bmf3298Pyt4+D1loAq/QlYxDYqtEf7JBNhZlNgLzXzosqk4pnqV uSojDr2Vp3X0EdN5wodgwlpXh5Mpd7mW/oM2RnSbczF+ppvA0YGloMhqxT8rvHLh180Y 2J9Ama98RHztUsPDLcxNVIltdSajFAvLgsYB/NGz4a4ueAl6wl/fN4KgS+pUW2mmkF2r DwOY6rCghrP/HCNqOPj2WEqR569CKEzYBTYxcTwQ/m3HKDC0c5/Gk1dyQcsB7tWeSspp HFQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@z3ntu.xyz header.s=z3ntu header.b=Kx3L2s3t; 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=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170906644700b0077bd074d50bsi8675358ejn.105.2022.11.01.09.31.13; Tue, 01 Nov 2022 09:31:45 -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=fail header.i=@z3ntu.xyz header.s=z3ntu header.b=Kx3L2s3t; 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=fail (p=NONE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbiKAQSu (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 1 Nov 2022 12:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiKAQSr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Nov 2022 12:18:47 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E991C914; Tue, 1 Nov 2022 09:18:44 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 418EDD0407; Tue, 1 Nov 2022 16:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1667319493; bh=zvhQPufC5PJD5XQqj1MudupKvZYKF2uHkrkysvJe8u0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Kx3L2s3t8otKxH6N+dczDfJnDgo+6Y/yE2+rFBiKk6SI17cJMGE4MuMuoaRARUvM1 Lhj7FoVt9ZYdo6+dP501rjkDBFUy0rF11Sz7G7HzFGQ11SWozD1dxuUkGYd8E6+wIj pPlxvdJLWIhk05io5I43Eyw4DKBcFQCqXfLufCT8= From: Luca Weiss <luca@z3ntu.xyz> To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, AngeloGioacchino Del Regno <kholk11@gmail.com>, Luca Weiss <luca@z3ntu.xyz>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] arm64: dts: qcom: Add configuration for PMI8950 peripheral Date: Tue, 1 Nov 2022 17:18:00 +0100 Message-Id: <20221101161801.1058969-2-luca@z3ntu.xyz> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221101161801.1058969-1-luca@z3ntu.xyz> References: <20221101161801.1058969-1-luca@z3ntu.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, PDS_OTHER_BAD_TLD,SPF_HELO_NONE,SPF_PASS autolearn=no 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?1748312056641615709?= X-GMAIL-MSGID: =?utf-8?q?1748312056641615709?= |
Series |
[v3,1/2] dt-bindings: backlight: qcom-wled: Add PMI8950 compatible
|
|
Commit Message
Luca Weiss
Nov. 1, 2022, 4:18 p.m. UTC
From: AngeloGioacchino Del Regno <kholk11@gmail.com> The PMI8950 features integrated peripherals like ADC, GPIO controller, MPPs and others. [luca@z3ntu.xyz: remove pm8950, style changes for 2022 standards, add wled] Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> Signed-off-by: Luca Weiss <luca@z3ntu.xyz> --- Changes since v2: * Pick up patch, and adjust as mentioned above sign-offs arch/arm64/boot/dts/qcom/pmi8950.dtsi | 97 +++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi
Comments
On 2022-11-01 17:18:00, Luca Weiss wrote: > From: AngeloGioacchino Del Regno <kholk11@gmail.com> > > The PMI8950 features integrated peripherals like ADC, GPIO controller, > MPPs and others. > > [luca@z3ntu.xyz: remove pm8950, style changes for 2022 standards, add wled] > Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > --- > Changes since v2: > * Pick up patch, and adjust as mentioned above sign-offs > > arch/arm64/boot/dts/qcom/pmi8950.dtsi | 97 +++++++++++++++++++++++++++ > 1 file changed, 97 insertions(+) > create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi > > diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > new file mode 100644 > index 000000000000..32d27e2187e3 > --- /dev/null > +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > @@ -0,0 +1,97 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com> > + > +#include <dt-bindings/iio/qcom,spmi-vadc.h> > +#include <dt-bindings/interrupt-controller/irq.h> > +#include <dt-bindings/spmi/spmi.h> > + > +&spmi_bus { > + pmic@2 { > + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; > + reg = <0x2 SPMI_USID>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + pmi8950_vadc: adc@3100 { > + compatible = "qcom,spmi-vadc"; > + reg = <0x3100>; > + interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; > + #address-cells = <1>; > + #size-cells = <0>; > + #io-channel-cells = <1>; > + > + adc-chan@0 { > + reg = <VADC_USBIN>; > + qcom,pre-scaling = <1 4>; > + label = "usbin"; I've previously sent a patch with labels in the node name instead [1], what's the preferred way nowadays? [1]: https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.suijten@somainline.org/ > + }; > + > + adc-chan@1 { > + reg = <VADC_DCIN>; > + qcom,pre-scaling = <1 4>; > + label = "dcin"; > + }; > + > + adc-chan@2 { > + reg = <VADC_VCHG_SNS>; > + qcom,pre-scaling = <1 1>; > + label = "vchg_sns"; Shall we use hyphens in labels (especially if using them as node names). > + }; > + > + adc-chan@9 { > + reg = <VADC_REF_625MV>; > + qcom,pre-scaling = <1 1>; > + label = "ref_625mv"; > + }; > + > + adc-chan@a { > + reg = <VADC_REF_1250MV>; > + qcom,pre-scaling = <1 1>; > + label = "ref_1250v"; mv* :) > + }; > + > + adc-chan@d { > + reg = <VADC_SPARE2>; > + qcom,pre-scaling = <1 1>; > + label = "chg_temp"; > + }; > + }; > + > + pmi8950_mpps: mpps@a000 { > + compatible = "qcom,pmi8950-mpp", "qcom,spmi-mpp"; > + reg = <0xa000>; > + gpio-controller; > + gpio-ranges = <&pmi8950_mpps 0 0 4>; > + #gpio-cells = <2>; > + interrupt-controller; > + #interrupt-cells = <2>; > + }; > + > + pmi8950_gpio: gpio@c000 { It seems more common to name this label plural pmi8950_gpioS? > + compatible = "qcom,pmi8950-gpio", "qcom,spmi-gpio"; > + reg = <0xc000>; > + gpio-controller; > + gpio-ranges = <&pmi8950_gpio 0 0 2>; > + #gpio-cells = <2>; > + interrupt-controller; > + #interrupt-cells = <2>; > + }; > + }; > + > + pmic@3 { > + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; > + reg = <0x3 SPMI_USID>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + pmi8950_wled: leds@d800 { > + compatible = "qcom,pmi8950-wled"; > + reg = <0xd800>, <0xd900>; > + interrupts = <0x3 0xd8 0x02 IRQ_TYPE_EDGE_RISING>; > + interrupt-names = "short"; > + label = "backlight"; Same question here about using the node name instead, and dropping the label altogether. - Marijn > + > + status = "disabled"; > + }; > + }; > +}; > -- > 2.38.1 >
On 2022-11-05 00:44:37, Marijn Suijten wrote: > On 2022-11-01 17:18:00, Luca Weiss wrote: > > From: AngeloGioacchino Del Regno <kholk11@gmail.com> > > > > The PMI8950 features integrated peripherals like ADC, GPIO controller, > > MPPs and others. > > > > [luca@z3ntu.xyz: remove pm8950, style changes for 2022 standards, add wled] > > Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > > --- > > Changes since v2: > > * Pick up patch, and adjust as mentioned above sign-offs > > > > arch/arm64/boot/dts/qcom/pmi8950.dtsi | 97 +++++++++++++++++++++++++++ > > 1 file changed, 97 insertions(+) > > create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > > diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > new file mode 100644 > > index 000000000000..32d27e2187e3 > > --- /dev/null > > +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > @@ -0,0 +1,97 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com> > > + > > +#include <dt-bindings/iio/qcom,spmi-vadc.h> > > +#include <dt-bindings/interrupt-controller/irq.h> > > +#include <dt-bindings/spmi/spmi.h> > > + > > +&spmi_bus { > > + pmic@2 { > > + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; > > + reg = <0x2 SPMI_USID>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + pmi8950_vadc: adc@3100 { > > + compatible = "qcom,spmi-vadc"; > > + reg = <0x3100>; > > + interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + #io-channel-cells = <1>; > > + > > + adc-chan@0 { > > + reg = <VADC_USBIN>; > > + qcom,pre-scaling = <1 4>; > > + label = "usbin"; > > I've previously sent a patch with labels in the node name instead [1], > what's the preferred way nowadays? > > [1]: https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.suijten@somainline.org/ As it turns out that patch relied on the ADC5 driver propagating the DT node name (and label name if set) to IIO, which doesn't happen for the legacy VADC driver used here. I sent an RFC to that effect, with a large discussion whether or not we should use node names, labels, or rely on hardcoded names in the drivers entirely. The recent migration to fwnode made the node name include the `@xx` suffix which makes for unpleasant reading in sysfs, so that's at least one reason to have generic node names *and skip node names in these drivers altogether*. https://lore.kernel.org/linux-arm-msm/20221106193018.270106-1-marijn.suijten@somainline.org/T/#u In short: we may want to hold off changing these patches until a clear-cut decision has been made (but I think your patch here is the right approach in the end: generic node name *with label*, when the label is more clear than the name hardcoded in the driver). - Marijn
On 2022-11-06 20:37:24, Marijn Suijten wrote: > On 2022-11-05 00:44:37, Marijn Suijten wrote: > > On 2022-11-01 17:18:00, Luca Weiss wrote: > > > From: AngeloGioacchino Del Regno <kholk11@gmail.com> > > > > > > The PMI8950 features integrated peripherals like ADC, GPIO controller, > > > MPPs and others. > > > > > > [luca@z3ntu.xyz: remove pm8950, style changes for 2022 standards, add wled] > > > Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> > > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > > > --- > > > Changes since v2: > > > * Pick up patch, and adjust as mentioned above sign-offs > > > > > > arch/arm64/boot/dts/qcom/pmi8950.dtsi | 97 +++++++++++++++++++++++++++ > > > 1 file changed, 97 insertions(+) > > > create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > > > > diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > new file mode 100644 > > > index 000000000000..32d27e2187e3 > > > --- /dev/null > > > +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > @@ -0,0 +1,97 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > > +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com> > > > + > > > +#include <dt-bindings/iio/qcom,spmi-vadc.h> > > > +#include <dt-bindings/interrupt-controller/irq.h> > > > +#include <dt-bindings/spmi/spmi.h> > > > + > > > +&spmi_bus { > > > + pmic@2 { > > > + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; > > > + reg = <0x2 SPMI_USID>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + pmi8950_vadc: adc@3100 { > > > + compatible = "qcom,spmi-vadc"; > > > + reg = <0x3100>; > > > + interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + #io-channel-cells = <1>; > > > + > > > + adc-chan@0 { > > > + reg = <VADC_USBIN>; > > > + qcom,pre-scaling = <1 4>; > > > + label = "usbin"; > > > > I've previously sent a patch with labels in the node name instead [1], > > what's the preferred way nowadays? > > > > [1]: https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.suijten@somainline.org/ > > As it turns out that patch relied on the ADC5 driver propagating the DT > node name (and label name if set) to IIO, which doesn't happen for the > legacy VADC driver used here. I sent an RFC to that effect, with a > large discussion whether or not we should use node names, labels, or > rely on hardcoded names in the drivers entirely. The recent migration > to fwnode made the node name include the `@xx` suffix which makes for > unpleasant reading in sysfs, so that's at least one reason to have > generic node names *and skip node names in these drivers altogether*. > > https://lore.kernel.org/linux-arm-msm/20221106193018.270106-1-marijn.suijten@somainline.org/T/#u > > In short: we may want to hold off changing these patches until a > clear-cut decision has been made (but I think your patch here is the > right approach in the end: generic node name *with label*, when the > label is more clear than the name hardcoded in the driver). We came to the conclusion in [1] that using labels is the way to go so that the name doesn't get all mangled, then we can opt for generic node names here as well. This does mean I'll have to send a followup for [2] and have to revise [3] again to use generic node names and labels. - Marijn [1]: https://lore.kernel.org/linux-arm-msm/20221112162719.0ac87998@jic23-huawei/ [2]: https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.suijten@somainline.org/ [3]: https://lore.kernel.org/linux-arm-msm/20221111120156.48040-10-angelogioacchino.delregno@collabora.com/
On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > On 2022-11-06 20:37:24, Marijn Suijten wrote: > > On 2022-11-05 00:44:37, Marijn Suijten wrote: > > > On 2022-11-01 17:18:00, Luca Weiss wrote: > > > > From: AngeloGioacchino Del Regno <kholk11@gmail.com> > > > > > > > > The PMI8950 features integrated peripherals like ADC, GPIO controller, > > > > MPPs and others. > > > > > > > > [luca@z3ntu.xyz: remove pm8950, style changes for 2022 standards, add > > > > wled] > > > > Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> > > > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > > > > --- > > > > Changes since v2: > > > > * Pick up patch, and adjust as mentioned above sign-offs > > > > > > > > arch/arm64/boot/dts/qcom/pmi8950.dtsi | 97 > > > > +++++++++++++++++++++++++++ > > > > 1 file changed, 97 insertions(+) > > > > create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > > > > > > diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > > b/arch/arm64/boot/dts/qcom/pmi8950.dtsi new file mode 100644 > > > > index 000000000000..32d27e2187e3 > > > > --- /dev/null > > > > +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi > > > > @@ -0,0 +1,97 @@ > > > > +// SPDX-License-Identifier: GPL-2.0 > > > > +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com> > > > > + > > > > +#include <dt-bindings/iio/qcom,spmi-vadc.h> > > > > +#include <dt-bindings/interrupt-controller/irq.h> > > > > +#include <dt-bindings/spmi/spmi.h> > > > > + > > > > +&spmi_bus { > > > > + pmic@2 { > > > > + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; > > > > + reg = <0x2 SPMI_USID>; > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > + > > > > + pmi8950_vadc: adc@3100 { > > > > + compatible = "qcom,spmi-vadc"; > > > > + reg = <0x3100>; > > > > + interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > + #io-channel-cells = <1>; > > > > + > > > > + adc-chan@0 { > > > > + reg = <VADC_USBIN>; > > > > + qcom,pre-scaling = <1 4>; > > > > + label = "usbin"; > > > > > > I've previously sent a patch with labels in the node name instead [1], > > > what's the preferred way nowadays? > > > > > > [1]: > > > https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.su > > > ijten@somainline.org/> > > As it turns out that patch relied on the ADC5 driver propagating the DT > > node name (and label name if set) to IIO, which doesn't happen for the > > legacy VADC driver used here. I sent an RFC to that effect, with a > > large discussion whether or not we should use node names, labels, or > > rely on hardcoded names in the drivers entirely. The recent migration > > to fwnode made the node name include the `@xx` suffix which makes for > > unpleasant reading in sysfs, so that's at least one reason to have > > generic node names *and skip node names in these drivers altogether*. > > > > https://lore.kernel.org/linux-arm-msm/20221106193018.270106-1-marijn.s > > uijten@somainline.org/T/#u> > > In short: we may want to hold off changing these patches until a > > clear-cut decision has been made (but I think your patch here is the > > right approach in the end: generic node name *with label*, when the > > label is more clear than the name hardcoded in the driver). > > We came to the conclusion in [1] that using labels is the way to go so > that the name doesn't get all mangled, then we can opt for generic node > names here as well. This does mean I'll have to send a followup for [2] > and have to revise [3] again to use generic node names and labels. So the way this patch does it is good or does it need changes? > > - Marijn > > [1]: > https://lore.kernel.org/linux-arm-msm/20221112162719.0ac87998@jic23-huawei/ > [2]: > https://lore.kernel.org/linux-arm-msm/20220926190148.283805-4-marijn.suijte > n@somainline.org/ [3]: > https://lore.kernel.org/linux-arm-msm/20221111120156.48040-10-angelogioacch > ino.delregno@collabora.com/
On 2022-12-04 17:19:05, Luca Weiss wrote: > On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > [..] > > So the way this patch does it is good or does it need changes? Except the typo(s?) pointed out in my first reply, this is good to go. If we stick with generic adc-chan node names that should be documented in the bindings IMO, as it is currently only captured implicitly in the examples. Krzysztof, what is your thought on this? - Marijn
On 08/12/2022 11:12, Marijn Suijten wrote: > On 2022-12-04 17:19:05, Luca Weiss wrote: >> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: >> [..] >> >> So the way this patch does it is good or does it need changes? > > Except the typo(s?) pointed out in my first reply, this is good to go. > > If we stick with generic adc-chan node names that should be documented > in the bindings IMO, as it is currently only captured implicitly in the > examples. Krzysztof, what is your thought on this? If I understand correctly, the outcome of other discussion [1] was to use labels and generic node names. In such case the patch was correct (except other comments). [1] https://lore.kernel.org/linux-arm-msm/20221112162719.0ac87998@jic23-huawei/ Best regards, Krzysztof
On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: > On 08/12/2022 11:12, Marijn Suijten wrote: > > On 2022-12-04 17:19:05, Luca Weiss wrote: > >> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > >> [..] > >> > >> So the way this patch does it is good or does it need changes? > > > > Except the typo(s?) pointed out in my first reply, this is good to go. > > > > If we stick with generic adc-chan node names that should be documented > > in the bindings IMO, as it is currently only captured implicitly in the > > examples. Krzysztof, what is your thought on this? > > If I understand correctly, the outcome of other discussion [1] was to > use labels and generic node names. The outcome was to use labels in the driver and disregard node names as the new fwnode API clobbers those names by including the @xx register bit. (I'll follow up with Jonathan whether or not to remove the current fallback to node names, as [1] ended up discussing many different issues and nits) > In such case the patch was correct > (except other comments). As a consequence it _doesn't matter_ how nodes are named, and we _can_ use generic node names. My question for you is whether we should, and if we should lock that in via dt-bindings to guide everyone towards using labels (which i did _not_ do in the recently-landed PM8950 and PM6125, but will send followup for). > [1] > https://lore.kernel.org/linux-arm-msm/20221112162719.0ac87998@jic23-huawei/ - Marijn
On Donnerstag, 8. Dezember 2022 12:20:55 CET Marijn Suijten wrote: > On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: > > On 08/12/2022 11:12, Marijn Suijten wrote: > > > On 2022-12-04 17:19:05, Luca Weiss wrote: > > >> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > > >> [..] > > >> > > >> So the way this patch does it is good or does it need changes? > > > > > > Except the typo(s?) pointed out in my first reply, this is good to go. > > > > > > If we stick with generic adc-chan node names that should be documented > > > in the bindings IMO, as it is currently only captured implicitly in the > > > examples. Krzysztof, what is your thought on this? > > > > If I understand correctly, the outcome of other discussion [1] was to > > use labels and generic node names. > > The outcome was to use labels in the driver and disregard node names as > the new fwnode API clobbers those names by including the @xx register > bit. > > (I'll follow up with Jonathan whether or not to remove the current > fallback to node names, as [1] ended up discussing many different issues > and nits) > > > In such case the patch was correct > > (except other comments). > > As a consequence it _doesn't matter_ how nodes are named, and we _can_ > use generic node names. My question for you is whether we should, and > if we should lock that in via dt-bindings to guide everyone towards > using labels (which i did _not_ do in the recently-landed PM8950 and > PM6125, but will send followup for). FYI the patch has been merged already and is now in linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm64/boot/dts/qcom/pmi8950.dtsi?id=0d97fdf380b478c358c94f50f1b942e87f407b9b If you have any changes that need to be done please send a follow-up patch. Regards Luca > > > [1] > > https://lore.kernel.org/linux-arm-msm/20221112162719.0ac87998@jic23-huawei > > / > > - Marijn
On 2022-12-09 17:54:50, Luca Weiss wrote: > On Donnerstag, 8. Dezember 2022 12:20:55 CET Marijn Suijten wrote: > > On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: > > > On 08/12/2022 11:12, Marijn Suijten wrote: > > > > On 2022-12-04 17:19:05, Luca Weiss wrote: > > > >> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > > > >> [..] > > > >> > > > >> So the way this patch does it is good or does it need changes? > > > > > > > > Except the typo(s?) pointed out in my first reply, this is good to go. > > > > > > > > If we stick with generic adc-chan node names that should be documented > > > > in the bindings IMO, as it is currently only captured implicitly in the > > > > examples. Krzysztof, what is your thought on this? > > > > > > If I understand correctly, the outcome of other discussion [1] was to > > > use labels and generic node names. > > > > The outcome was to use labels in the driver and disregard node names as > > the new fwnode API clobbers those names by including the @xx register > > bit. > > > > (I'll follow up with Jonathan whether or not to remove the current > > fallback to node names, as [1] ended up discussing many different issues > > and nits) > > > > > In such case the patch was correct > > > (except other comments). > > > > As a consequence it _doesn't matter_ how nodes are named, and we _can_ > > use generic node names. My question for you is whether we should, and > > if we should lock that in via dt-bindings to guide everyone towards > > using labels (which i did _not_ do in the recently-landed PM8950 and > > PM6125, but will send followup for). > > FYI the patch has been merged already and is now in linux-next > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm64/boot/dts/qcom/pmi8950.dtsi?id=0d97fdf380b478c358c94f50f1b942e87f407b9b > > If you have any changes that need to be done please send a follow-up patch. Unfortunately saw that today as well, well after sending this reply. I would've loved to correct the pmi8950_gpio label _gpios before someone starts relying on it in followup patches. Fixing the v -> mv typo isn't hard though, I'll send a followup patch regardless. - Marijn
On 09/12/2022 21:38, Marijn Suijten wrote: > On 2022-12-09 17:54:50, Luca Weiss wrote: >> On Donnerstag, 8. Dezember 2022 12:20:55 CET Marijn Suijten wrote: >>> On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: >>>> On 08/12/2022 11:12, Marijn Suijten wrote: >>>>> On 2022-12-04 17:19:05, Luca Weiss wrote: >>>>>> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: >>>>>> [..] >>>>>> >>>>>> So the way this patch does it is good or does it need changes? >>>>> >>>>> Except the typo(s?) pointed out in my first reply, this is good to go. >>>>> >>>>> If we stick with generic adc-chan node names that should be documented >>>>> in the bindings IMO, as it is currently only captured implicitly in the >>>>> examples. Krzysztof, what is your thought on this? >>>> >>>> If I understand correctly, the outcome of other discussion [1] was to >>>> use labels and generic node names. >>> >>> The outcome was to use labels in the driver and disregard node names as >>> the new fwnode API clobbers those names by including the @xx register >>> bit. >>> >>> (I'll follow up with Jonathan whether or not to remove the current >>> fallback to node names, as [1] ended up discussing many different issues >>> and nits) >>> >>>> In such case the patch was correct >>>> (except other comments). >>> >>> As a consequence it _doesn't matter_ how nodes are named, and we _can_ >>> use generic node names. My question for you is whether we should, and >>> if we should lock that in via dt-bindings to guide everyone towards >>> using labels (which i did _not_ do in the recently-landed PM8950 and >>> PM6125, but will send followup for). >> >> FYI the patch has been merged already and is now in linux-next >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm64/boot/dts/qcom/pmi8950.dtsi?id=0d97fdf380b478c358c94f50f1b942e87f407b9b >> >> If you have any changes that need to be done please send a follow-up patch. > > Unfortunately saw that today as well, well after sending this reply. I > would've loved to correct the pmi8950_gpio label _gpios before someone I don't understand what is there to correct. The "pmi8950_gpio" is a correct label. There is no single rule saying label should have "s" at the end. The only rules are: using underscores and having similar naming (e.g. mdss_ for all display labels). Best regards, Krzysztof
On 2022-12-10 11:58:24, Krzysztof Kozlowski wrote: > On 09/12/2022 21:38, Marijn Suijten wrote: > > On 2022-12-09 17:54:50, Luca Weiss wrote: > >> On Donnerstag, 8. Dezember 2022 12:20:55 CET Marijn Suijten wrote: > >>> On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: > >>>> On 08/12/2022 11:12, Marijn Suijten wrote: > >>>>> On 2022-12-04 17:19:05, Luca Weiss wrote: > >>>>>> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: > >>>>>> [..] > >>>>>> > >>>>>> So the way this patch does it is good or does it need changes? > >>>>> > >>>>> Except the typo(s?) pointed out in my first reply, this is good to go. > >>>>> > >>>>> If we stick with generic adc-chan node names that should be documented > >>>>> in the bindings IMO, as it is currently only captured implicitly in the > >>>>> examples. Krzysztof, what is your thought on this? > >>>> > >>>> If I understand correctly, the outcome of other discussion [1] was to > >>>> use labels and generic node names. > >>> > >>> The outcome was to use labels in the driver and disregard node names as > >>> the new fwnode API clobbers those names by including the @xx register > >>> bit. > >>> > >>> (I'll follow up with Jonathan whether or not to remove the current > >>> fallback to node names, as [1] ended up discussing many different issues > >>> and nits) > >>> > >>>> In such case the patch was correct > >>>> (except other comments). > >>> > >>> As a consequence it _doesn't matter_ how nodes are named, and we _can_ > >>> use generic node names. My question for you is whether we should, and > >>> if we should lock that in via dt-bindings to guide everyone towards > >>> using labels (which i did _not_ do in the recently-landed PM8950 and > >>> PM6125, but will send followup for). > >> > >> FYI the patch has been merged already and is now in linux-next > >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm64/boot/dts/qcom/pmi8950.dtsi?id=0d97fdf380b478c358c94f50f1b942e87f407b9b > >> > >> If you have any changes that need to be done please send a follow-up patch. > > > > Unfortunately saw that today as well, well after sending this reply. I > > would've loved to correct the pmi8950_gpio label _gpios before someone > > I don't understand what is there to correct. The "pmi8950_gpio" is a > correct label. There is no single rule saying label should have "s" at > the end. The only rules are: using underscores and having similar naming > (e.g. mdss_ for all display labels). If we were able to have rules for labels, would I then be allowed to "correct" this? The inconsistency between DTs is /super/ annoying (and it looks wrong to have a singular _gpio named thing contain /multiple gpios/), but just because we can't express this in dt-bindings (or so I think) we shouldn't change it? - Marijn
On 10/12/2022 17:31, Marijn Suijten wrote: > On 2022-12-10 11:58:24, Krzysztof Kozlowski wrote: >> On 09/12/2022 21:38, Marijn Suijten wrote: >>> On 2022-12-09 17:54:50, Luca Weiss wrote: >>>> On Donnerstag, 8. Dezember 2022 12:20:55 CET Marijn Suijten wrote: >>>>> On 2022-12-08 11:23:17, Krzysztof Kozlowski wrote: >>>>>> On 08/12/2022 11:12, Marijn Suijten wrote: >>>>>>> On 2022-12-04 17:19:05, Luca Weiss wrote: >>>>>>>> On Freitag, 2. Dezember 2022 10:36:58 CET Marijn Suijten wrote: >>>>>>>> [..] >>>>>>>> >>>>>>>> So the way this patch does it is good or does it need changes? >>>>>>> >>>>>>> Except the typo(s?) pointed out in my first reply, this is good to go. >>>>>>> >>>>>>> If we stick with generic adc-chan node names that should be documented >>>>>>> in the bindings IMO, as it is currently only captured implicitly in the >>>>>>> examples. Krzysztof, what is your thought on this? >>>>>> >>>>>> If I understand correctly, the outcome of other discussion [1] was to >>>>>> use labels and generic node names. >>>>> >>>>> The outcome was to use labels in the driver and disregard node names as >>>>> the new fwnode API clobbers those names by including the @xx register >>>>> bit. >>>>> >>>>> (I'll follow up with Jonathan whether or not to remove the current >>>>> fallback to node names, as [1] ended up discussing many different issues >>>>> and nits) >>>>> >>>>>> In such case the patch was correct >>>>>> (except other comments). >>>>> >>>>> As a consequence it _doesn't matter_ how nodes are named, and we _can_ >>>>> use generic node names. My question for you is whether we should, and >>>>> if we should lock that in via dt-bindings to guide everyone towards >>>>> using labels (which i did _not_ do in the recently-landed PM8950 and >>>>> PM6125, but will send followup for). >>>> >>>> FYI the patch has been merged already and is now in linux-next >>>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/arm64/boot/dts/qcom/pmi8950.dtsi?id=0d97fdf380b478c358c94f50f1b942e87f407b9b >>>> >>>> If you have any changes that need to be done please send a follow-up patch. >>> >>> Unfortunately saw that today as well, well after sending this reply. I >>> would've loved to correct the pmi8950_gpio label _gpios before someone >> >> I don't understand what is there to correct. The "pmi8950_gpio" is a >> correct label. There is no single rule saying label should have "s" at >> the end. The only rules are: using underscores and having similar naming >> (e.g. mdss_ for all display labels). > > If we were able to have rules for labels, would I then be allowed to > "correct" this? If we had rules, yes. But we do not have. That's like - I will rename all variables because of some non-existing rules... There is no rule, no coding style (except what I wrote)... > The inconsistency between DTs is /super/ annoying (and > it looks wrong to have a singular _gpio named thing contain /multiple > gpios/), What do you mean - looks wrong? It's just a label which does not matter, so how it can be wrong? > but just because we can't express this in dt-bindings (or so I > think) we shouldn't change it? No, it just does not matter, so there is no benefit to change it, in my opinion, if label is readable and follows generic convention (underscores). Of course someone might treat its readability different and maybe for someone the missing "s" at the end is important. I am just saying that, unlike the node names, the label has little impact/effect. However just be clear - this change also does not harm, so I am perfectly fine with it. Best regards, Krzysztof
On 2022-12-11 21:11:51, Krzysztof Kozlowski wrote: > On 10/12/2022 17:31, Marijn Suijten wrote: > > [..] > > If we were able to have rules for labels, would I then be allowed to > > "correct" this? > > If we had rules, yes. But we do not have. That's like - I will rename > all variables because of some non-existing rules... There is no rule, no > coding style (except what I wrote)... > > > The inconsistency between DTs is /super/ annoying (and > > it looks wrong to have a singular _gpio named thing contain /multiple > > gpios/), > > What do you mean - looks wrong? It's just a label which does not matter, > so how it can be wrong? > > > but just because we can't express this in dt-bindings (or so I > > think) we shouldn't change it? > > No, it just does not matter, so there is no benefit to change it, in my > opinion, if label is readable and follows generic convention > (underscores). Of course someone might treat its readability different > and maybe for someone the missing "s" at the end is important. That must be me. > I am just > saying that, unlike the node names, the label has little impact/effect. > > However just be clear - this change also does not harm, so I am > perfectly fine with it. Okay, I'd prefer to have it :) - Marijn
diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi new file mode 100644 index 000000000000..32d27e2187e3 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com> + +#include <dt-bindings/iio/qcom,spmi-vadc.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/spmi/spmi.h> + +&spmi_bus { + pmic@2 { + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; + reg = <0x2 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + + pmi8950_vadc: adc@3100 { + compatible = "qcom,spmi-vadc"; + reg = <0x3100>; + interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + adc-chan@0 { + reg = <VADC_USBIN>; + qcom,pre-scaling = <1 4>; + label = "usbin"; + }; + + adc-chan@1 { + reg = <VADC_DCIN>; + qcom,pre-scaling = <1 4>; + label = "dcin"; + }; + + adc-chan@2 { + reg = <VADC_VCHG_SNS>; + qcom,pre-scaling = <1 1>; + label = "vchg_sns"; + }; + + adc-chan@9 { + reg = <VADC_REF_625MV>; + qcom,pre-scaling = <1 1>; + label = "ref_625mv"; + }; + + adc-chan@a { + reg = <VADC_REF_1250MV>; + qcom,pre-scaling = <1 1>; + label = "ref_1250v"; + }; + + adc-chan@d { + reg = <VADC_SPARE2>; + qcom,pre-scaling = <1 1>; + label = "chg_temp"; + }; + }; + + pmi8950_mpps: mpps@a000 { + compatible = "qcom,pmi8950-mpp", "qcom,spmi-mpp"; + reg = <0xa000>; + gpio-controller; + gpio-ranges = <&pmi8950_mpps 0 0 4>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + pmi8950_gpio: gpio@c000 { + compatible = "qcom,pmi8950-gpio", "qcom,spmi-gpio"; + reg = <0xc000>; + gpio-controller; + gpio-ranges = <&pmi8950_gpio 0 0 2>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + + pmic@3 { + compatible = "qcom,pmi8950", "qcom,spmi-pmic"; + reg = <0x3 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + + pmi8950_wled: leds@d800 { + compatible = "qcom,pmi8950-wled"; + reg = <0xd800>, <0xd900>; + interrupts = <0x3 0xd8 0x02 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "short"; + label = "backlight"; + + status = "disabled"; + }; + }; +};