devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Vinod Koul <vkoul@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	David Collins <quic_collinsd@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	David Collins <collinsd@codeaurora.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	David Dai <daidavid1@codeaurora.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] spmi: pmic-arb: Add support for PMIC v7
Date: Tue, 30 Aug 2022 01:45:20 +0300	[thread overview]
Message-ID: <0ac86ecb-bff4-6f13-1109-0410c8050cab@linaro.org> (raw)
In-Reply-To: <20220201134108.2677578-3-vkoul@kernel.org>

On 01/02/2022 16:41, Vinod Koul wrote:
> From: David Collins <collinsd@codeaurora.org>
> 
> PMIC v7 has different offset values and seqeunces, so add support for
> this new version of PMIC
> 
> Signed-off-by: David Collins <collinsd@codeaurora.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>   drivers/spmi/spmi-pmic-arb.c | 233 ++++++++++++++++++++++++++++++++---
>   1 file changed, 214 insertions(+), 19 deletions(-)


As I was asking Stephen about the fate of this patch series I could not 
stop my self from noticing that one of his comments ([1]) from v1 was 
ignored.
Let me quote it here:

 > The driver is already pretty hard to read because it combines so many
 > generations of spmi arbiter hardware from qcom into one file. It would
 > probably be better to start over and simplify the new version of the
 > driver, possibly sharing code between the two files if possible, but
 > otherwise dropping lots of cruft along the way and simplifying review
 > burden.

After taking a glance, I thought maybe we should really follow this 
approach. And it also allows us to start with the new bindings:

spmi@c400000 {
    compatible = "qcom,spmi-pmic-arb-v7";

    reg = <..... both arb registers as following....>;
    reg-names = "core", "chnls", "observer", "cnfg0", "intr0", "cnfg1", 
"intr1";

    interrupts = <&pdc 1 HIGH>, <&pdc 3 HIGH>;
    interrupt-names = "arb0", "arb1"; /* are the names necessary at all? */

    #address-cells = <1>;
    #size-cells = <0>;

    spmi_bus: bus@0 {
       reg = <0>;
       #address-cells = <2>;
       #size-cells = <0>;
       #interrupt-cells = <4>;
       interrupt-controller;

       pmic@.... {
           // etc.
       };

    };

    spmi1_bus: bus@1 {
       reg = <1>;
       #address-cells = <2>;
       #size-cells = <0>;
       #interrupt-cells = <4>;
       interrupt-controller;
    };
};

Note, this drops the qcom,ee (which is always 0 for all devices I see in 
mainline)) and qcom,channel (which if I understood correctly is used 
only for pmic-arb-v1, ugh). It uses common reg = <N> property instead of
cooked qcom,bus-id. And last, but not least, it save us from huuge 
comments in the source code telling why devm_platform_ioremap_resource 
can not be used.

[1] 
https://lore.kernel.org/linux-arm-msm/20211210020148.B2EA6C004DD@smtp.kernel.org/


-- 
With best wishes
Dmitry


  parent reply	other threads:[~2022-08-29 22:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 13:41 [PATCH v3 0/2] spmi: pmic-arb: Add support for PMIC v7 Vinod Koul
2022-02-01 13:41 ` [PATCH v3 1/2] dt-bindings: spmi: Add qcom,bus-id Vinod Koul
2022-02-07 21:45   ` Rob Herring
2022-02-01 13:41 ` [PATCH v3 2/2] spmi: pmic-arb: Add support for PMIC v7 Vinod Koul
2022-06-20 19:30   ` Dmitry Baryshkov
2022-08-29 22:45   ` Dmitry Baryshkov [this message]
2022-02-22 16:53 ` [PATCH v3 0/2] " Vinod Koul
2022-05-01 19:41   ` Dmitry Baryshkov
2022-06-18 15:29     ` Dmitry Baryshkov
2022-06-28 12:46       ` Linus Walleij
2022-08-29 22:25       ` Stephen Boyd
2022-08-30  4:36         ` Vinod Koul
2022-08-30 21:11           ` Stephen Boyd
2022-09-14 11:23             ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ac86ecb-bff4-6f13-1109-0410c8050cab@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=collinsd@codeaurora.org \
    --cc=daidavid1@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_collinsd@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).