Message ID | 20230407-pm7250b-sid-v1-2-fc648478cc25@fairphone.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp124397vqo; Fri, 7 Apr 2023 01:04:15 -0700 (PDT) X-Google-Smtp-Source: AKy350ZkbrAL7kZei3sE5TKp1C8PxPn77NZWPMkr6Gz7KgCPkhc5ZdZYaatjZgiXCqckplyJ0sRs X-Received: by 2002:a17:90b:3507:b0:244:ae1e:1998 with SMTP id ls7-20020a17090b350700b00244ae1e1998mr1382445pjb.40.1680854654719; Fri, 07 Apr 2023 01:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680854654; cv=none; d=google.com; s=arc-20160816; b=NIZBo/aRdqnSj1dT4i0t1kRCa7zuZZS2SOimeixFiiDFZ3qxVnDhTOEtdbKzaHMXo5 u0YHvc/z24pz35kTz0WoyjCT3uvHiaNZtuyxgTbe6BAFiIXCbOBfHGn5HHE9MalJ3pSJ lNZQ13RmECBv4T+Mjo2f5FoTZ9rOIih2fudcfQuuTzpO0v8eFJYFh/8njjzcwXCHt1Ty tqjVEhzwzfPzUxSLg0i3xCCGzLip3udBKdgN1KQ0C2N9b4bgpHHNkhkqKjx44N9LuI9J k9VM8GpZa1JATDVCmaRv1e/dv9DNK2PeZBLTpWuMw+kawvcYWbei5rLol4qNAMC+Ir6P Hrwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZU4QEaEraDl+k3WFZpoXH7Xf2Al7n2chAXs2OYDEB0A=; b=eVYEq9+IsmAURrRenkHGRRzDA6PMbhPS4N/cHNQzGGIuphQ2ycfu8FZuQ9bQaeiBKK Dtp7fo9C3Qb8I0tvNGanwO+Ou+rCJ0HDwq/FrmAOduNQDtsPXbx+0AXSuITq7DMRtzXS pJYlbm1O5ytctEWPXMjJn+AVOWLJvuLGNzBOQpToLmkLBth7C+zaaAyanDLDdmk0Pyuq XPSLlvqCkAfWyPwQDRJEEityZ2VzBVRxDvgQsOD12/uzQqqn6Nul9xOUQidKDEA0CbpA SWdjQS35wAv5/tdIZ59qveDiEAtxVaY24Dj1LF5toVFn/kjb08ynhTmrNQ6/Oix493su GBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ft2ENGrY; 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=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a170903245200b001a051676302si3695008pls.494.2023.04.07.01.04.02; Fri, 07 Apr 2023 01:04:14 -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=@fairphone.com header.s=fair header.b=ft2ENGrY; 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=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233135AbjDGHqX (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Fri, 7 Apr 2023 03:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232724AbjDGHqR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Apr 2023 03:46:17 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A956EAD08 for <linux-kernel@vger.kernel.org>; Fri, 7 Apr 2023 00:46:15 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id g18so6713305ejj.5 for <linux-kernel@vger.kernel.org>; Fri, 07 Apr 2023 00:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1680853573; x=1683445573; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZU4QEaEraDl+k3WFZpoXH7Xf2Al7n2chAXs2OYDEB0A=; b=ft2ENGrY7IVU28h6GHwi9x6b6eum3G3wxe0Oo+4GY9MhdcnmQbqEl2ZGIW8Pmo8x8k BmwwbhFkH3StlX8MACPiWB1XZROZYCCUpknXyVZN0dE2YQcNPYE5w9H6wGIjYOvxD4Gj WAqptG84nsR+yy75WZmX7UftkYVhnQHBs4DHRK0YIIevO03ifG39ss11tf/g+rWKTNJu //gps2LFQKrf64hehcaydwnPThDoGSlJhs34GrdJ+yfqbeD10Qo/ArULBIyvU+8wvQ8e S2pF7khjDHT9hCT9kWPnTss/RyAjA5O0eS9hb7T6TuDc7gCm44DodLmZYSkEzE4sjkg7 lyRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680853573; x=1683445573; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZU4QEaEraDl+k3WFZpoXH7Xf2Al7n2chAXs2OYDEB0A=; b=3sGxE/EvLu51FH3oSYjC1SA+Fj9+t1FP+XuroqhqGKvlQrel7PO6wD1aLFCFlPGHjM sC+KOH/tDbTRUVfZQsdEcXrpk85jHofrRfPmtCwPur6KdrD+rr+Hc3HEU4z4+B/CEbQS XlgRAALyaBGULY5x8KbJie4wZbIzAokeyqh6y7eFxu3qE+J3aHPFrzlG8pXLw5i6NID6 Wrk5W9avdXSju1Hr1BrnP9SiopK3mH5z+PNkAsDiTiIHeWcANkZ3nevbUOHMQcJBJJ1r 2Jc7wfAwRePpev+b25SOQ2p9zlPlnlJ1Y0mKBqVQu2Njnwklxeq84NWtQo0ysCLYRwi4 RaVQ== X-Gm-Message-State: AAQBX9eZ1wv0v5er5AZ+sv4adYfKvTAwt+LtFaHBjGFIiblQzSVpGw9r eKX8fIA210MrMCWw0ZONqOyI3g== X-Received: by 2002:a17:907:a413:b0:91d:9745:407a with SMTP id sg19-20020a170907a41300b0091d9745407amr9851386ejc.14.1680853573270; Fri, 07 Apr 2023 00:46:13 -0700 (PDT) Received: from [172.16.220.24] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id sa28-20020a1709076d1c00b00949c04d1c64sm1762378ejc.41.2023.04.07.00.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 00:46:12 -0700 (PDT) From: Luca Weiss <luca.weiss@fairphone.com> Date: Fri, 07 Apr 2023 09:45:45 +0200 Subject: [PATCH 2/2] arm64: dts: qcom: pm7250b: make SID configurable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230407-pm7250b-sid-v1-2-fc648478cc25@fairphone.com> References: <20230407-pm7250b-sid-v1-0-fc648478cc25@fairphone.com> In-Reply-To: <20230407-pm7250b-sid-v1-0-fc648478cc25@fairphone.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Konrad Dybcio <konrad.dybcio@somainline.org> Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss <luca.weiss@fairphone.com> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1762503850417943923?= X-GMAIL-MSGID: =?utf-8?q?1762503850417943923?= |
Series |
Make SID for PM7250B configurable (and a small fixup)
|
|
Commit Message
Luca Weiss
April 7, 2023, 7:45 a.m. UTC
Like other Qualcomm PMICs the PM7250B can be used on different addresses
on the SPMI bus. Use similar defines like the PMK8350 to make this
possible.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
Comments
On 07/04/2023 09:45, Luca Weiss wrote: > Like other Qualcomm PMICs the PM7250B can be used on different addresses > on the SPMI bus. Use similar defines like the PMK8350 to make this > possible. > > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > --- > arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > 1 file changed, 16 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > index daa6f1d30efa..eeb476edc79a 100644 > --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > @@ -7,6 +7,15 @@ > #include <dt-bindings/interrupt-controller/irq.h> > #include <dt-bindings/spmi/spmi.h> > > +/* This PMIC can be configured to be at different SIDs */ > +#ifndef PM7250B_SID > + #define PM7250B_SID 2 Drop indentation, although anyway I am against this. Please don't bring new patterns of this at least till we settle previous discussion. https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ Best regards, Krzysztof
On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > On 07/04/2023 09:45, Luca Weiss wrote: > > Like other Qualcomm PMICs the PM7250B can be used on different addresses > > on the SPMI bus. Use similar defines like the PMK8350 to make this > > possible. > > > > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > > --- > > arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > > 1 file changed, 16 insertions(+), 7 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > index daa6f1d30efa..eeb476edc79a 100644 > > --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > @@ -7,6 +7,15 @@ > > #include <dt-bindings/interrupt-controller/irq.h> > > #include <dt-bindings/spmi/spmi.h> > > > > +/* This PMIC can be configured to be at different SIDs */ > > +#ifndef PM7250B_SID > > + #define PM7250B_SID 2 > > Drop indentation, although anyway I am against this. Please don't bring > new patterns of this at least till we settle previous discussion. > > https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ Ok I'll wait for that to conclude then. Let's only consider patch 1/2 from this series then for now. Regards Luca > > > Best regards, > Krzysztof
Hi Krzysztof, On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > On 07/04/2023 09:45, Luca Weiss wrote: > > Like other Qualcomm PMICs the PM7250B can be used on different addresses > > on the SPMI bus. Use similar defines like the PMK8350 to make this > > possible. > > > > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > > --- > > arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > > 1 file changed, 16 insertions(+), 7 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > index daa6f1d30efa..eeb476edc79a 100644 > > --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > @@ -7,6 +7,15 @@ > > #include <dt-bindings/interrupt-controller/irq.h> > > #include <dt-bindings/spmi/spmi.h> > > > > +/* This PMIC can be configured to be at different SIDs */ > > +#ifndef PM7250B_SID > > + #define PM7250B_SID 2 > > Drop indentation, although anyway I am against this. Please don't bring > new patterns of this at least till we settle previous discussion. > > https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ What's the outcome of the discussion? For this PMIC it's totally enough to have the SID configurable like in this patch, I don't think this PMIC will be included twice in a board - at least I'm not aware of such a configuration. Regards Luca > > > Best regards, > Krzysztof
On 10/05/2023 08:47, Luca Weiss wrote: > Hi Krzysztof, > > On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: >> On 07/04/2023 09:45, Luca Weiss wrote: >>> Like other Qualcomm PMICs the PM7250B can be used on different addresses >>> on the SPMI bus. Use similar defines like the PMK8350 to make this >>> possible. >>> >>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> >>> --- >>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- >>> 1 file changed, 16 insertions(+), 7 deletions(-) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>> index daa6f1d30efa..eeb476edc79a 100644 >>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>> @@ -7,6 +7,15 @@ >>> #include <dt-bindings/interrupt-controller/irq.h> >>> #include <dt-bindings/spmi/spmi.h> >>> >>> +/* This PMIC can be configured to be at different SIDs */ >>> +#ifndef PM7250B_SID >>> + #define PM7250B_SID 2 >> >> Drop indentation, although anyway I am against this. Please don't bring >> new patterns of this at least till we settle previous discussion. >> >> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ > > What's the outcome of the discussion? For this PMIC it's totally enough > to have the SID configurable like in this patch, I don't think this PMIC > will be included twice in a board - at least I'm not aware of such a > configuration. We did not reach consensus and I still disagree with complex macros or macros depending on order of inclusion. Best regards, Krzysztof
On Wed, 10 May 2023 at 09:55, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 10/05/2023 08:47, Luca Weiss wrote: > > Hi Krzysztof, > > > > On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > >> On 07/04/2023 09:45, Luca Weiss wrote: > >>> Like other Qualcomm PMICs the PM7250B can be used on different addresses > >>> on the SPMI bus. Use similar defines like the PMK8350 to make this > >>> possible. > >>> > >>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > >>> --- > >>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > >>> 1 file changed, 16 insertions(+), 7 deletions(-) > >>> > >>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>> index daa6f1d30efa..eeb476edc79a 100644 > >>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>> @@ -7,6 +7,15 @@ > >>> #include <dt-bindings/interrupt-controller/irq.h> > >>> #include <dt-bindings/spmi/spmi.h> > >>> > >>> +/* This PMIC can be configured to be at different SIDs */ > >>> +#ifndef PM7250B_SID > >>> + #define PM7250B_SID 2 > >> > >> Drop indentation, although anyway I am against this. Please don't bring > >> new patterns of this at least till we settle previous discussion. > >> > >> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ > > > > What's the outcome of the discussion? For this PMIC it's totally enough > > to have the SID configurable like in this patch, I don't think this PMIC > > will be included twice in a board - at least I'm not aware of such a > > configuration. > > We did not reach consensus and I still disagree with complex macros or > macros depending on order of inclusion. I still think we should find a way to parametrise PMIC dtsi, however I agree with Krzysztof that complex CPP is not a way to go.
On Wed May 10, 2023 at 10:07 AM CEST, Dmitry Baryshkov wrote: > On Wed, 10 May 2023 at 09:55, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > > > On 10/05/2023 08:47, Luca Weiss wrote: > > > Hi Krzysztof, > > > > > > On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > > >> On 07/04/2023 09:45, Luca Weiss wrote: > > >>> Like other Qualcomm PMICs the PM7250B can be used on different addresses > > >>> on the SPMI bus. Use similar defines like the PMK8350 to make this > > >>> possible. > > >>> > > >>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > > >>> --- > > >>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > > >>> 1 file changed, 16 insertions(+), 7 deletions(-) > > >>> > > >>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > >>> index daa6f1d30efa..eeb476edc79a 100644 > > >>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > >>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > >>> @@ -7,6 +7,15 @@ > > >>> #include <dt-bindings/interrupt-controller/irq.h> > > >>> #include <dt-bindings/spmi/spmi.h> > > >>> > > >>> +/* This PMIC can be configured to be at different SIDs */ > > >>> +#ifndef PM7250B_SID > > >>> + #define PM7250B_SID 2 > > >> > > >> Drop indentation, although anyway I am against this. Please don't bring > > >> new patterns of this at least till we settle previous discussion. > > >> > > >> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ > > > > > > What's the outcome of the discussion? For this PMIC it's totally enough > > > to have the SID configurable like in this patch, I don't think this PMIC > > > will be included twice in a board - at least I'm not aware of such a > > > configuration. > > > > We did not reach consensus and I still disagree with complex macros or > > macros depending on order of inclusion. > > I still think we should find a way to parametrise PMIC dtsi, however I > agree with Krzysztof that complex CPP is not a way to go. What about the macro already used in-tree and proposed with this patch? I wouldn't say this is a "complex macro" since it's just a single number being replaced in a few places. Could we get this in now, and if we find a new & better way in the future we can adjust all the dtsi upstream?
On Wed, 10 May 2023 at 11:34, Luca Weiss <luca.weiss@fairphone.com> wrote: > > On Wed May 10, 2023 at 10:07 AM CEST, Dmitry Baryshkov wrote: > > On Wed, 10 May 2023 at 09:55, Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > > > > > > On 10/05/2023 08:47, Luca Weiss wrote: > > > > Hi Krzysztof, > > > > > > > > On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > > > >> On 07/04/2023 09:45, Luca Weiss wrote: > > > >>> Like other Qualcomm PMICs the PM7250B can be used on different addresses > > > >>> on the SPMI bus. Use similar defines like the PMK8350 to make this > > > >>> possible. > > > >>> > > > >>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > > > >>> --- > > > >>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > > > >>> 1 file changed, 16 insertions(+), 7 deletions(-) > > > >>> > > > >>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > > >>> index daa6f1d30efa..eeb476edc79a 100644 > > > >>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > > >>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > > > >>> @@ -7,6 +7,15 @@ > > > >>> #include <dt-bindings/interrupt-controller/irq.h> > > > >>> #include <dt-bindings/spmi/spmi.h> > > > >>> > > > >>> +/* This PMIC can be configured to be at different SIDs */ > > > >>> +#ifndef PM7250B_SID > > > >>> + #define PM7250B_SID 2 > > > >> > > > >> Drop indentation, although anyway I am against this. Please don't bring > > > >> new patterns of this at least till we settle previous discussion. > > > >> > > > >> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ > > > > > > > > What's the outcome of the discussion? For this PMIC it's totally enough > > > > to have the SID configurable like in this patch, I don't think this PMIC > > > > will be included twice in a board - at least I'm not aware of such a > > > > configuration. > > > > > > We did not reach consensus and I still disagree with complex macros or > > > macros depending on order of inclusion. > > > > I still think we should find a way to parametrise PMIC dtsi, however I > > agree with Krzysztof that complex CPP is not a way to go. > > What about the macro already used in-tree and proposed with this patch? > I wouldn't say this is a "complex macro" since it's just a single number > being replaced in a few places. My 2c: in my opinion it is fine (and it follows parameterization that we already have for some PMICs). > Could we get this in now, and if we find a new & better way in the > future we can adjust all the dtsi upstream? And this depends on the decision of RobH and Krzysztof.
On 10/05/2023 10:34, Luca Weiss wrote: > On Wed May 10, 2023 at 10:07 AM CEST, Dmitry Baryshkov wrote: >> On Wed, 10 May 2023 at 09:55, Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> wrote: >>> >>> On 10/05/2023 08:47, Luca Weiss wrote: >>>> Hi Krzysztof, >>>> >>>> On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: >>>>> On 07/04/2023 09:45, Luca Weiss wrote: >>>>>> Like other Qualcomm PMICs the PM7250B can be used on different addresses >>>>>> on the SPMI bus. Use similar defines like the PMK8350 to make this >>>>>> possible. >>>>>> >>>>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> >>>>>> --- >>>>>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- >>>>>> 1 file changed, 16 insertions(+), 7 deletions(-) >>>>>> >>>>>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>>>>> index daa6f1d30efa..eeb476edc79a 100644 >>>>>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>>>>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi >>>>>> @@ -7,6 +7,15 @@ >>>>>> #include <dt-bindings/interrupt-controller/irq.h> >>>>>> #include <dt-bindings/spmi/spmi.h> >>>>>> >>>>>> +/* This PMIC can be configured to be at different SIDs */ >>>>>> +#ifndef PM7250B_SID >>>>>> + #define PM7250B_SID 2 >>>>> >>>>> Drop indentation, although anyway I am against this. Please don't bring >>>>> new patterns of this at least till we settle previous discussion. >>>>> >>>>> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ >>>> >>>> What's the outcome of the discussion? For this PMIC it's totally enough >>>> to have the SID configurable like in this patch, I don't think this PMIC >>>> will be included twice in a board - at least I'm not aware of such a >>>> configuration. >>> >>> We did not reach consensus and I still disagree with complex macros or >>> macros depending on order of inclusion. >> >> I still think we should find a way to parametrise PMIC dtsi, however I >> agree with Krzysztof that complex CPP is not a way to go. > > What about the macro already used in-tree and proposed with this patch? > I wouldn't say this is a "complex macro" since it's just a single number > being replaced in a few places. Are you talking about the macro to which I responded: "or macros depending on order of inclusion." or something else? Best regards, Krzysztof
On Wed May 10, 2023 at 12:05 PM CEST, Krzysztof Kozlowski wrote: > On 10/05/2023 10:34, Luca Weiss wrote: > > On Wed May 10, 2023 at 10:07 AM CEST, Dmitry Baryshkov wrote: > >> On Wed, 10 May 2023 at 09:55, Krzysztof Kozlowski > >> <krzysztof.kozlowski@linaro.org> wrote: > >>> > >>> On 10/05/2023 08:47, Luca Weiss wrote: > >>>> Hi Krzysztof, > >>>> > >>>> On Fri Apr 7, 2023 at 10:27 AM CEST, Krzysztof Kozlowski wrote: > >>>>> On 07/04/2023 09:45, Luca Weiss wrote: > >>>>>> Like other Qualcomm PMICs the PM7250B can be used on different addresses > >>>>>> on the SPMI bus. Use similar defines like the PMK8350 to make this > >>>>>> possible. > >>>>>> > >>>>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> > >>>>>> --- > >>>>>> arch/arm64/boot/dts/qcom/pm7250b.dtsi | 23 ++++++++++++++++------- > >>>>>> 1 file changed, 16 insertions(+), 7 deletions(-) > >>>>>> > >>>>>> diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>>>>> index daa6f1d30efa..eeb476edc79a 100644 > >>>>>> --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>>>>> +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi > >>>>>> @@ -7,6 +7,15 @@ > >>>>>> #include <dt-bindings/interrupt-controller/irq.h> > >>>>>> #include <dt-bindings/spmi/spmi.h> > >>>>>> > >>>>>> +/* This PMIC can be configured to be at different SIDs */ > >>>>>> +#ifndef PM7250B_SID > >>>>>> + #define PM7250B_SID 2 > >>>>> > >>>>> Drop indentation, although anyway I am against this. Please don't bring > >>>>> new patterns of this at least till we settle previous discussion. > >>>>> > >>>>> https://lore.kernel.org/linux-arm-msm/46658cbb-fff5-e98b-fdad-88fa683a9c75@linaro.org/ > >>>> > >>>> What's the outcome of the discussion? For this PMIC it's totally enough > >>>> to have the SID configurable like in this patch, I don't think this PMIC > >>>> will be included twice in a board - at least I'm not aware of such a > >>>> configuration. > >>> > >>> We did not reach consensus and I still disagree with complex macros or > >>> macros depending on order of inclusion. > >> > >> I still think we should find a way to parametrise PMIC dtsi, however I > >> agree with Krzysztof that complex CPP is not a way to go. > > > > What about the macro already used in-tree and proposed with this patch? > > I wouldn't say this is a "complex macro" since it's just a single number > > being replaced in a few places. > > Are you talking about the macro to which I responded: "or macros > depending on order of inclusion." or something else? I thought you mean with .. > >>> We did not reach consensus and I still disagree with complex macros or > >>> macros depending on order of inclusion. .. the macros proprosed in the patch you linked (that version that also adjusts the labels based on the SID). I was asking if the patch I sent (with #define PM7250B_SID) would be okay to take in at least until the bigger discussion has come to a conclusion, since we already have upstream occurances of such a macro so it's not a new concept. Otherwise I'll just carry this patch in my local tree until this situation has cleared up. Regards Luca > > Best regards, > Krzysztof
diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index daa6f1d30efa..eeb476edc79a 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -7,6 +7,15 @@ #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/spmi/spmi.h> +/* This PMIC can be configured to be at different SIDs */ +#ifndef PM7250B_SID + #define PM7250B_SID 2 +#endif + +#ifndef PM7250B_SID1 + #define PM7250B_SID1 3 +#endif + / { thermal-zones { pm7250b-thermal { @@ -39,16 +48,16 @@ trip2 { }; &spmi_bus { - pmic@2 { + pmic@PM7250B_SID { compatible = "qcom,pm7250b", "qcom,spmi-pmic"; - reg = <0x2 SPMI_USID>; + reg = <PM7250B_SID SPMI_USID>; #address-cells = <1>; #size-cells = <0>; pm7250b_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; - interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; + interrupts = <PM7250B_SID 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; io-channels = <&pm7250b_adc ADC5_DIE_TEMP>; io-channel-names = "thermal"; #thermal-sensor-cells = <0>; @@ -60,7 +69,7 @@ pm7250b_adc: adc@3100 { #address-cells = <1>; #size-cells = <0>; #io-channel-cells = <1>; - interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; + interrupts = <PM7250B_SID 0x31 0x0 IRQ_TYPE_EDGE_RISING>; adc-chan@0 { reg = <ADC5_REF_GND>; @@ -141,7 +150,7 @@ adc-chan@99 { pm7250b_adc_tm: adc-tm@3500 { compatible = "qcom,spmi-adc-tm5"; reg = <0x3500>; - interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>; + interrupts = <PM7250B_SID 0x35 0x0 IRQ_TYPE_EDGE_RISING>; #thermal-sensor-cells = <1>; #address-cells = <1>; #size-cells = <0>; @@ -149,9 +158,9 @@ pm7250b_adc_tm: adc-tm@3500 { }; }; - pmic@3 { + pmic@PM7250B_SID1 { compatible = "qcom,pm7250b", "qcom,spmi-pmic"; - reg = <0x3 SPMI_USID>; + reg = <PM7250B_SID1 SPMI_USID>; #address-cells = <1>; #size-cells = <0>; };