devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Caleb Connolly <caleb.connolly@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, sumit.semwal@linaro.org,
	amit.pundir@linaro.org, john.stultz@linaro.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: Re: [PATCH v13 2/9] mfd: qcom-spmi-pmic: expose the PMIC revid information to clients
Date: Fri, 29 Apr 2022 11:06:05 +0100	[thread overview]
Message-ID: <Ymu4jUup3YiX6p3X@google.com> (raw)
In-Reply-To: <cce2f4b7-3620-7a33-ef21-579eff9a7dac@linaro.org>

On Thu, 28 Apr 2022, Caleb Connolly wrote:
> On 28/04/2022 17:14, Lee Jones wrote:
> > On Wed, 27 Apr 2022, Caleb Connolly wrote:
> > > On 25/04/2022 16:03, Lee Jones wrote:
> > > > 
> > > > On Wed, 23 Mar 2022, Caleb Connolly wrote:
> > > > > From: Caleb Connolly <caleb.connolly@linaro.org>
> > > > > 
> > > > > Some PMIC functions such as the RRADC need to be aware of the PMIC
> > > > > chip revision information to implement errata or otherwise adjust
> > > > > behaviour, export the PMIC information to enable this.
> > > > > 
> > > > > This is specifically required to enable the RRADC to adjust
> > > > > coefficients based on which chip fab the PMIC was produced in,
> > > > > this can vary per unique device and therefore has to be read at
> > > > > runtime.
> > > > > 
> > > > > Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> > > > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > > > > Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > > > > ---
> > > > >    drivers/mfd/qcom-spmi-pmic.c      | 261 +++++++++++++++++++-----------
> > > > >    include/soc/qcom/qcom-spmi-pmic.h |  60 +++++++
> > > > >    2 files changed, 231 insertions(+), 90 deletions(-)
> > > > >    create mode 100644 include/soc/qcom/qcom-spmi-pmic.h
> > 
> > [...]
> > 
> > > > > +			/*
> > > > > +			 * If the base USID for this PMIC hasn't probed yet
> > > > > +			 * but the secondary USID has, then we need to defer
> > > > > +			 * the function driver so that it will attempt to
> > > > > +			 * probe again when the base USID is ready.
> > > > > +			 */
> > > > > +			if (pmic_addr == function_parent_usid  - (ctx->num_usids - 1))
> > > > 
> > > > Double "  ".
> > > Ack
> > > > 
> > > > Over-bracketing of statements with matching operands.
> > > I don't think x - (y - 1) is equal to x - y - 1? Or am I misunderstanding you here?
> > 
> > Can you give me an example when this would be the case?
> According to the Python interpreter:
> >>> x=7
> >>> y=4
> >>> x - y - 1
> 2
> >>> x - (y - 1)
> 4
> 
> C does also respect the first rule of BODMAS - parenthesis are always
> evaluated first.

Fair point, well presented.

Thanks for this - I understand the problem now.

-- 
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2022-04-29 10:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 16:28 [PATCH v13 0/9] iio: adc: introduce Qualcomm SPMI Round Robin ADC Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 1/9] spmi: add a helper to look up an SPMI device from a device node Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 2/9] mfd: qcom-spmi-pmic: expose the PMIC revid information to clients Caleb Connolly
2022-04-25 15:03   ` Lee Jones
2022-04-27 22:27     ` Caleb Connolly
2022-04-28 16:14       ` Lee Jones
2022-04-28 16:30         ` Caleb Connolly
2022-04-29 10:06           ` Lee Jones [this message]
2022-04-29 12:36             ` Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 3/9] mfd: qcom-spmi-pmic: read fab id on supported PMICs Caleb Connolly
2022-04-25 15:05   ` Lee Jones
2022-04-26 17:41     ` Caleb Connolly
2022-04-26 18:24       ` Lee Jones
2022-04-27 18:45         ` Caleb Connolly
2022-04-28 16:15           ` Lee Jones
2022-03-23 16:28 ` [PATCH v13 4/9] dt-bindings: iio: adc: document qcom-spmi-rradc Caleb Connolly
2022-03-23 16:36   ` Krzysztof Kozlowski
2022-03-27 15:02   ` Jonathan Cameron
2022-03-23 16:28 ` [PATCH v13 5/9] iio: adc: qcom-spmi-rradc: introduce round robin adc Caleb Connolly
2022-03-27 15:03   ` Jonathan Cameron
2022-04-13  3:08     ` Bjorn Andersson
2022-04-13 13:13       ` Jonathan Cameron
2022-03-23 16:28 ` [PATCH v13 6/9] arm64: dts: qcom: pmi8998: add rradc node Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 7/9] arm64: dts: qcom: sdm845-oneplus: enable rradc Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 8/9] arm64: dts: qcom: sdm845-db845c: " Caleb Connolly
2022-03-23 16:28 ` [PATCH v13 9/9] arm64: dts: qcom: sdm845-xiaomi-beryllium: " Caleb Connolly

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=Ymu4jUup3YiX6p3X@google.com \
    --to=lee.jones@linaro.org \
    --cc=agross@kernel.org \
    --cc=amit.pundir@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=caleb.connolly@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=jic23@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sumit.semwal@linaro.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).