From: Jonathan Cameron <jic23@kernel.org>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: lars@metafoo.de, swboyd@chromium.org, andy.shevchenko@gmail.com,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 3/5] iio: proximity: Add SX9324 support
Date: Thu, 4 Nov 2021 18:15:10 +0000 [thread overview]
Message-ID: <20211104181510.2a4f31ed@jic23-huawei> (raw)
In-Reply-To: <CAPUE2utpxe098AZEkAKnJDte7Kv8v3R44w71b0Tdba+vXskv2w@mail.gmail.com>
> > > +static ssize_t sx9324_phase_configuration_store(struct device *dev,
> > > + struct device_attribute *attr,
> > > + const char *buf,
> > > + size_t len)
> > > +{
> > > + return -EINVAL;
> >
> > Don't do this. If they are read only treat them correctly as such
> > with appropriate permissions etc.
> used channel .ext_info instead.
Even better.
> >
> > > +}
> > > +
> > > +#define IIO_DEV_ATTR_PHASE_CONFIG(_idx) \
> > > +IIO_DEVICE_ATTR(in_proximity_configuration##_idx, 0644, \
> > > + sx9324_phase_configuration_show, \
> > > + sx9324_phase_configuration_store, _idx)
> > > +
> > > +static IIO_DEV_ATTR_PHASE_CONFIG(0);
> > > +static IIO_DEV_ATTR_PHASE_CONFIG(1);
> > > +static IIO_DEV_ATTR_PHASE_CONFIG(2);
> > > +static IIO_DEV_ATTR_PHASE_CONFIG(3);
> >
> > Documentation of these? I'm not going to comment on them without appropriate
> > docs in
> >
> > Documentation/ABI/testing/
> >
> > Just wastes time figuring out what they are.
> It is not easy to explain without the doc (not released by semtech but
> available at https://edit.wpgdadawant.com/uploads/news_file/program/2019/30184/tech_files/program_30184_suggest_other_file.pdf),
> but let me try:
>
> Each sensor has 3 inputs, CS0, CS1 and CS2. Hardware engineers decide
> if the input is not connected (HZ), grounded (GD), connected to an
> antenna where it can act as a base (DS - data shield), or measured
> input (MI).
> The sensor rotates measurement across 4 phases (PH0, PH1, PH2, PH3),
> where the inputs are configured and then measured.
> By default, during the first phase, [PH0], CS0 is measured, while CS1
> and CS2 are used as shields. `cat in_proximity0_mode` returns
> "MI,DS,DS".
> I did not make this change configurable: if the hardware designer
> decided to ground or leave an input dangling, it does not make sense
> to set it as a shield. [it can be changed if the need arises].
> Having 4 phases allows different treatment of the input. For instance,
> one phase could be used for object detection,the other for body
> detection. Configuring each phase is not implemented yet.
Ah. I read the emails backwards, this explanation is good - it's a
combination of 'what is wired' and what you are trying to measure.
>
> Add missing documentation in ABI/testing/sysfs-bus-iio-sx9324.
next prev parent reply other threads:[~2021-11-04 18:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 11:18 [PATCH 0/5] Expand Semtech SAR Sensors support Gwendal Grignou
2021-10-30 11:18 ` [PATCH 1/5] iio: Use .realbits to extend a small signed integer Gwendal Grignou
2021-10-30 11:35 ` Lars-Peter Clausen
2021-10-30 16:09 ` Jonathan Cameron
2021-11-01 7:30 ` Gwendal Grignou
2021-10-30 11:18 ` [PATCH 2/5] iio: sx9310: Extract common Semtech sensor logic Gwendal Grignou
2021-10-30 11:40 ` Lars-Peter Clausen
2021-10-30 16:42 ` Jonathan Cameron
2021-10-30 11:18 ` [PATCH 3/5] iio: proximity: Add SX9324 support Gwendal Grignou
2021-10-30 11:56 ` Lars-Peter Clausen
2021-10-30 17:04 ` Jonathan Cameron
2021-11-04 7:15 ` Gwendal Grignou
2021-11-04 18:15 ` Jonathan Cameron [this message]
2021-10-30 11:18 ` [PATCH 4/5] dt-bindings: iio: Add sx9324 binding Gwendal Grignou
2021-10-30 17:24 ` Jonathan Cameron
2021-11-04 7:16 ` Gwendal Grignou
2021-11-04 18:13 ` Jonathan Cameron
2021-10-30 11:18 ` [PATCH 5/5] iio: sx9324: Add dt_bidding support Gwendal Grignou
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=20211104181510.2a4f31ed@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=gwendal@chromium.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.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