devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gwendal Grignou <gwendal@chromium.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org,
	andy.shevchenko@gmail.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v7 5/5] iio: sx9324: Add dt_binding support
Date: Fri, 17 Dec 2021 16:18:01 -0800	[thread overview]
Message-ID: <CAPUE2utnWKtZT=mvJ7TeNzDsQEEOL4tzCaaQdpR65B2=F91oog@mail.gmail.com> (raw)
In-Reply-To: <CAE-0n51VSmRNiNeU09ygGmWfyg2F8DN4ujf9gUv4c3QRsmdLHA@mail.gmail.com>

On Tue, Dec 14, 2021 at 5:13 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Gwendal Grignou (2021-12-10 11:23:28)
> > Based on bindings/iio/proximity/semtech,sx9324.yaml, implement
> > retrieving sensor hardware property and alter default values.
> >
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
>
> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>
> > diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c
> > index ed7ac30e1915d5..78a173aeccf5ac 100644
> > --- a/drivers/iio/proximity/sx9324.c
> > +++ b/drivers/iio/proximity/sx9324.c
> > @@ -77,6 +77,7 @@
> >  #define SX9324_REG_PROX_CTRL0          0x30
> >  #define SX9324_REG_PROX_CTRL0_GAIN_MASK        GENMASK(5, 3)
> >  #define SX9324_REG_PROX_CTRL0_GAIN_1           0x80
> > +#define SX9324_REG_PROX_CTRL0_RAWFILT_MASK     GENMASK(2, 0)
> >  #define SX9324_REG_PROX_CTRL0_RAWFILT_1P50     0x01
> >  #define SX9324_REG_PROX_CTRL1          0x31
> >  #define SX9324_REG_PROX_CTRL2          0x32
> > @@ -753,6 +754,74 @@ static int sx9324_write_raw(struct iio_dev *indio_dev,
> >         return -EINVAL;
> >  }
> >
> > +static const struct sx_common_reg_default sx9324_default_regs[] = {
> > +       { SX9324_REG_IRQ_MSK, 0x00 },
> > +       { SX9324_REG_IRQ_CFG0, 0x00 },
> > +       { SX9324_REG_IRQ_CFG1, SX9324_REG_IRQ_CFG1_FAILCOND },
> > +       { SX9324_REG_IRQ_CFG2, 0x00 },
> > +       { SX9324_REG_GNRL_CTRL0, SX9324_REG_GNRL_CTRL0_SCANPERIOD_100MS },
> > +       /*
> > +        * The lower 4 bits should not be set as it enable sensors measurements.
> > +        * Turning the detection on before the configuration values are set to
> > +        * good values can cause the device to return erroneous readings.
> > +        */
> > +       { SX9324_REG_GNRL_CTRL1, SX9324_REG_GNRL_CTRL1_PAUSECTRL },
> > +
> > +       { SX9324_REG_AFE_CTRL0, 0x00 },
> > +       { SX9324_REG_AFE_CTRL3, 0x00 },
> > +       { SX9324_REG_AFE_CTRL4, SX9324_REG_AFE_CTRL4_FREQ_83_33HZ |
> > +               SX9324_REG_AFE_CTRL4_RES_100 },
> > +       { SX9324_REG_AFE_CTRL6, 0x00 },
> > +       { SX9324_REG_AFE_CTRL7, SX9324_REG_AFE_CTRL4_FREQ_83_33HZ |
> > +               SX9324_REG_AFE_CTRL4_RES_100 },
> > +
> > +       /* TODO(gwendal): PHx use chip default or all grounded? */
> > +       { SX9324_REG_AFE_PH0, 0x29 },
> [...]
> > +       { SX9324_REG_ADV_CTRL11, 0x00 },
> > +       { SX9324_REG_ADV_CTRL12, 0x00 },
> > +       /* TODO(gwendal): SAR currenly disabled */
>
> s/currenly/currently/
Done
>
> Is there a plan to resolve these todos? Or should they simply be
> removed and then we can deal with the defaults?
It would be nice to enable the Smart SAR engine, but it requires some
coding (how to integrate nicely with iio subsystem) and coding (how to
enable it right).
>
> > +       { SX9324_REG_ADV_CTRL13, 0x00 },
> > +       { SX9324_REG_ADV_CTRL14, 0x00 },

  reply	other threads:[~2021-12-18  0:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 19:23 [PATCH v7 0/5] Expand Semtech SAR Sensors support Gwendal Grignou
2021-12-10 19:23 ` [PATCH v7 1/5] iio: sx9310: Add frequency in read_avail Gwendal Grignou
2021-12-15  1:06   ` Stephen Boyd
2021-12-10 19:23 ` [PATCH v7 2/5] iio: sx9310: Extract common Semtech sensor logic Gwendal Grignou
2021-12-15  1:11   ` Stephen Boyd
2021-12-10 19:23 ` [PATCH v7 3/5] iio: proximity: Add SX9324 support Gwendal Grignou
2021-12-15  1:11   ` Stephen Boyd
2021-12-16 16:04   ` Jonathan Cameron
2021-12-10 19:23 ` [PATCH v7 4/5] dt-bindings: iio: Add sx9324 binding Gwendal Grignou
2021-12-14 16:08   ` Rob Herring
2021-12-15  1:03   ` Stephen Boyd
2021-12-10 19:23 ` [PATCH v7 5/5] iio: sx9324: Add dt_binding support Gwendal Grignou
2021-12-15  1:13   ` Stephen Boyd
2021-12-18  0:18     ` Gwendal Grignou [this message]
2021-12-16 15:50 ` [PATCH v7 0/5] Expand Semtech SAR Sensors support Jonathan Cameron
2021-12-16 16:02   ` 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='CAPUE2utnWKtZT=mvJ7TeNzDsQEEOL4tzCaaQdpR65B2=F91oog@mail.gmail.com' \
    --to=gwendal@chromium.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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).