From: Jonathan Cameron <jic23@kernel.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>,
robh+dt@kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 6/8] iio: sx9324: Add Setting for internal compensation resistor
Date: Sun, 27 Mar 2022 14:43:05 +0100 [thread overview]
Message-ID: <20220327144305.0aefad4b@jic23-huawei> (raw)
In-Reply-To: <CAE-0n50a+d+MV9MQ4phppBhkvdgGU4cqC-9ZN9GjbhbRi+pUnQ@mail.gmail.com>
On Fri, 25 Mar 2022 19:04:32 -0500
Stephen Boyd <swboyd@chromium.org> wrote:
> Quoting Gwendal Grignou (2022-03-25 15:08:25)
> > diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c
> > index 3f229dffd5380..38dfdc6dc86ad 100644
> > --- a/drivers/iio/proximity/sx9324.c
> > +++ b/drivers/iio/proximity/sx9324.c
> > @@ -875,6 +881,22 @@ sx9324_get_default_reg(struct device *dev, int idx,
> > SX9324_REG_AFE_PH0_PIN_MASK(pin);
> > reg_def->def = raw;
> > break;
> > + case SX9324_REG_AFE_CTRL0:
> > + ret = device_property_read_string(dev,
> > + "semtech,int-comp-resistor", &res);
> > + if (ret)
> > + break;
> > + reg_def->def &= ~SX9324_REG_AFE_CTRL0_RINT_MASK;
> > + if (!strcmp(res, "lowest"))
> > + reg_def->def |= SX9324_REG_AFE_CTRL0_RINT_LOWEST;
> > + else if (!strcmp(res, "low"))
> > + reg_def->def |= SX9324_REG_AFE_CTRL0_RINT_LOW;
> > + else if (!strcmp(res, "high"))
>
> Should the order of arguments be swapped? I'm wondering if I can have
> 'hig' in the DT property and then it will match 'high' here? I suppose
> the schema validator will find that and complain first.
Wouldn't that result in a failed match between the null terminator of the first
string and the 'h'? Hence I don't think it matters but maybe I'm missing something..
>
> > + reg_def->def |= SX9324_REG_AFE_CTRL0_RINT_HIGH;
> > + else if (!strcmp(res, "highest"))
> > + reg_def->def |= SX9324_REG_AFE_CTRL0_RINT_HIGHEST;
> > +
> > + break;
next prev parent reply other threads:[~2022-03-27 13:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 22:08 [PATCH v3 0/8] Add settings for precharge and internal resistor Gwendal Grignou
2022-03-25 22:08 ` [PATCH v3 1/8] iio: sx9324: Fix default precharge internal resistance register Gwendal Grignou
2022-03-25 23:57 ` Stephen Boyd
2022-03-27 19:01 ` Andy Shevchenko
2022-03-25 22:08 ` [PATCH v3 2/8] iio: sx9324: Fix register field spelling Gwendal Grignou
2022-03-25 23:57 ` Stephen Boyd
2022-03-25 22:08 ` [PATCH v3 3/8] dt-bindings: iio: sx9324: Add precharge resistor setting Gwendal Grignou
2022-03-25 23:58 ` Stephen Boyd
2022-03-29 23:33 ` Rob Herring
2022-03-25 22:08 ` [PATCH v3 4/8] iio: sx9324: Add precharge internal resistance setting Gwendal Grignou
2022-03-25 23:59 ` Stephen Boyd
2022-03-25 22:08 ` [PATCH v3 5/8] dt-bindings: iio: sx9324: Add internal compensation resistor setting Gwendal Grignou
2022-03-26 0:00 ` Stephen Boyd
2022-03-29 23:34 ` Rob Herring
2022-03-25 22:08 ` [PATCH v3 6/8] iio: sx9324: Add Setting for internal compensation resistor Gwendal Grignou
2022-03-26 0:04 ` Stephen Boyd
2022-03-27 13:43 ` Jonathan Cameron [this message]
2022-03-27 19:08 ` Andy Shevchenko
2022-03-25 22:08 ` [PATCH v3 7/8] dt-bindings: iio: sx9360: Add precharge resistor setting Gwendal Grignou
2022-03-26 0:04 ` Stephen Boyd
2022-03-29 23:36 ` Rob Herring
2022-03-25 22:08 ` [PATCH v3 8/8] iio: sx9360: Add pre-charge " Gwendal Grignou
2022-03-26 0:05 ` Stephen Boyd
2022-03-27 13:47 ` [PATCH v3 0/8] Add settings for precharge and internal resistor Jonathan Cameron
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=20220327144305.0aefad4b@jic23-huawei \
--to=jic23@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gwendal@chromium.org \
--cc=linux-iio@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=swboyd@chromium.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).