Re: [PATCH] dt-bindings: iio: sx9310: Add various settings as DT properties
From: Jonathan Cameron
Date: Fri Sep 25 2020 - 08:47:36 EST
On Thu, 24 Sep 2020 00:57:13 -0700
Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
> Quoting Stephen Boyd (2020-09-23 16:25:43)
> > > > > > +
> > > > > > + semtech,close-debounce-samples:
> > > > > > + allOf:
> > > > > > + - $ref: /schemas/types.yaml#definitions/uint32
> > > > > > + - enum: [0, 2, 4, 8]
> > > > > > + default: 0
> > > > > > + description:
> > > > > > + The number of close samples debounced for proximity/body thresholds.
> > > > >
> > > > > This feels like something that has more to do with the object motion than
> > > > > the sensor setup, so perhaps should be controlled from userspace?
> > > >
> > > > Sure. Is there an IIO sample property? Or I should make a custom
> > > > knob for this?
> > >
> > > It's kind of close to in_proximity0_thresh_period and that may be how they
> > > have implemented it.
> > >
> > > That control specifies a number of samples for which a condition should be true
> > > before it is reported.
> >
> > Sounds good. I can do that. It looks like the driver reports close/far
> > via an event and these debounce values are the same for me so I can
> > write both fields (close and far) with the same thresh_period value from
> > userspace. If they need to be different between the two then this can be
> > reevaluated?
> >
>
> Or I can assign thresh_period to falling and rising corresponding to
> close/far debounce. Seems that the direction is the same, but that can
> be split apart and each direction gets a different sysfs file?
Ah I should have read on. Yes,
thresh_falling_period and thresh_rising_period is fine.
Jonathan