Linux IIO development
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Philipp Jungkamp <p.jungkamp@gmx.net>,
	Jiri Kosina <jikos@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] IIO: hid-sensor-prox: add missing scale attribute
Date: Tue, 17 Oct 2023 18:56:38 -0700	[thread overview]
Message-ID: <861ee3a58a52afb9e3f4001e4f25a2fd5c318618.camel@linux.intel.com> (raw)
In-Reply-To: <20231017201116.63d54c60@jic23-huawei>

On Tue, 2023-10-17 at 20:11 +0100, Jonathan Cameron wrote:
> On Mon, 16 Oct 2023 07:28:36 -0700
> srinivas pandruvada <srinivas.pandruvada@linux.intel.com> wrote:
> 
> > On Mon, 2023-10-16 at 08:44 +0100, Jonathan Cameron wrote:
> > > On Sun, 15 Oct 2023 12:04:48 +0100
> > > Jonathan Cameron <jic23@kernel.org> wrote:
> > >   
> > > > On Sat, 14 Oct 2023 19:56:26 -0700
> > > > srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
> > > > wrote:
> > > >   
> > > > > On Sat, 2023-10-14 at 17:52 +0100, Jonathan Cameron wrote:  
> > > > >   
> > > >   
> > 
> > [...]
> > 
> > > > Phillipp, if a backport makes sense you can request that after
> > > > this
> > > > goes upstream.  
> > > Whilst typing up a pull request I saw this again and thought a
> > > bit
> > > more on it.
> > > 
> > > This fix is probably wrong approach.  Proximity sensors are often
> > > scale free
> > > because they depend on reflectance off something or a capacitance
> > > changing etc
> > > so we don't know the scaling.  So the right response then is not
> > > to
> > > return a scale
> > > value of 1.0 but to not provide the attribute at all.  Is that
> > > something that
> > > could be easily done here?  
> > 
> > I think so. But hope that iio-sensor-proxy can handle absence of
> > scale
> > attribute.
> > 
> > git diff drivers/iio/light/hid-sensor-prox.c
> > diff --git a/drivers/iio/light/hid-sensor-prox.c
> > b/drivers/iio/light/hid-sensor-prox.c
> > index a47591e1bad9..e4b81fa948f5 100644
> > --- a/drivers/iio/light/hid-sensor-prox.c
> > +++ b/drivers/iio/light/hid-sensor-prox.c
> > @@ -36,7 +36,6 @@ static const struct iio_chan_spec prox_channels[]
> > = {
> >                 .type = IIO_PROXIMITY,
> >                 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
> >                 .info_mask_shared_by_type =
> > BIT(IIO_CHAN_INFO_OFFSET) |
> > -               BIT(IIO_CHAN_INFO_SCALE) |
> >                 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
> >                 BIT(IIO_CHAN_INFO_HYSTERESIS),
> >                 .scan_index = CHANNEL_SCAN_INDEX_PRESENCE,
> > 
> > Thanks,
> > Srinivas
> 
> Just to check. Are we guaranteed that there is never a scale
> parameter?
> Some proximity sensors do have absolute units (time of flight sensors
> for example).
> 
This driver is implementing:
Biometric: Human Presence (Usage ID 0x11) from HID sensor hub
specification.

"Biometric: Human
PresenceCA,CP – An application-level or physical collection that
identifies
a device that detects human presence (Boolean yes or no)."


It is not implementing Biometric: Human Proximity (Usage ID 0x12).
This has range of values, then unit will be applicable.

Thanks,
Srinivas

> Jonathan
> 
> > 
> > > 
> > > For now I'm dropping the patch. Sorry I wasn't paying enough
> > > attention to notice
> > > this was a proximity sensor.
> > > 
> > > Jonathan
> > >   
> > > > 
> > > > Thanks,
> > > > 
> > > > Jonathan
> > > >   
> > > > > > 
> > > > > > Phillipp - this sounds like a fix to me.  Fixes tag?
> > > > > > 
> > > > > > Thanks,
> > > > > > 
> > > > > > Jonathan      
> > > > >     
> > > >   
> > >   
> > 
> 


  reply	other threads:[~2023-10-18  1:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06 12:59 [PATCH] IIO: hid-sensor-prox: add missing scale attribute Philipp Jungkamp
2023-08-07 23:02 ` srinivas pandruvada
2023-08-08 12:22   ` Aw: " Philipp Jungkamp
2023-10-14 16:52     ` Jonathan Cameron
2023-10-15  2:56       ` srinivas pandruvada
2023-10-15 11:04         ` Jonathan Cameron
2023-10-16  7:44           ` Jonathan Cameron
2023-10-16 14:28             ` srinivas pandruvada
2023-10-17 19:11               ` Jonathan Cameron
2023-10-18  1:56                 ` srinivas pandruvada [this message]
2023-10-28 16:30                   ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2022-12-22 12:07 Philipp Jungkamp
2022-12-23 14:07 ` Jonathan Cameron
2023-01-02 16:43 ` srinivas pandruvada

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=861ee3a58a52afb9e3f4001e4f25a2fd5c318618.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=p.jungkamp@gmx.net \
    /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