devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Gwendal Grignou <gwendal@chromium.org>,
	jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org
Cc: 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: Wed, 15 Dec 2021 02:13:25 +0100	[thread overview]
Message-ID: <CAE-0n51VSmRNiNeU09ygGmWfyg2F8DN4ujf9gUv4c3QRsmdLHA@mail.gmail.com> (raw)
In-Reply-To: <20211210192328.2844060-6-gwendal@chromium.org>

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/

Is there a plan to resolve these todos? Or should they simply be
removed and then we can deal with the defaults?

> +       { SX9324_REG_ADV_CTRL13, 0x00 },
> +       { SX9324_REG_ADV_CTRL14, 0x00 },

  reply	other threads:[~2021-12-15  1:13 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 [this message]
2021-12-18  0:18     ` Gwendal Grignou
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=CAE-0n51VSmRNiNeU09ygGmWfyg2F8DN4ujf9gUv4c3QRsmdLHA@mail.gmail.com \
    --to=swboyd@chromium.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@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).