linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guido Günther" <agx@sigxcpu.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org
Subject: Exposing device properties for priximity sensors
Date: Mon, 10 Feb 2020 16:41:54 +0100	[thread overview]
Message-ID: <20200210154153.GA26903@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <20200208141713.469fb174@archlinux>

Hi Jonathan,
I've been extending iio-sensor-proxy to handle iio based proximity
sensors:

    https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/merge_requests/298

The API to applications shall not export the raw value but rather tell
if an object is near by:

   https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/merge_requests/298/diffs#67dff3849420abc19453e1998b8904bbaee6f13c_67_79

So in the simplest case we'd have to set a level above which an object
is considered close:

My intitial intent was to expose that via DT but looking around in iio
drivers i couldn't see any driver doing that (i missed
iio_read_mount_matrix) and noticed that the mount matrix is given via
systemd/udev's hwdb:

    https://github.com/systemd/systemd/pull/14845

Since matching on hwdb is done via modalias we wouldn't be able to have
different values on different boards without DMI/smbios:

   https://github.com/systemd/systemd/pull/14845/files#diff-37fdc5406b715a9996bdcd3d8e439e16R539

The matching rule is explained here:

     https://github.com/systemd/systemd/blob/master/hwdb.d/60-sensor.hwdb#L12

So would specifying this via DT and then exporting via sysfs be an
acceptable solution? That is inventing something like
iio_read_close_level. The value would not be used by the driver itself
but only exposed to userspace.
Cheers,
 -- Guido


      reply	other threads:[~2020-02-10 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07  9:12 [PATCH] iio: vncl4000: Fix early return in vcnl4200_set_power_state Guido Günther
2020-02-07 19:45 ` Matt Ranostay
2020-02-08 14:17 ` Jonathan Cameron
2020-02-10 15:41   ` Guido Günther [this message]

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=20200210154153.GA26903@bogon.m.sigxcpu.org \
    --to=agx@sigxcpu.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.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).