Re: [PATCH] IIO: hid-sensor-prox: add missing scale attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 15 Oct 2023 12:04:48 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> On Sat, 14 Oct 2023 19:56:26 -0700
> srinivas pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx> wrote:
> 
> > On Sat, 2023-10-14 at 17:52 +0100, Jonathan Cameron wrote:  
> > > On Tue, 8 Aug 2023 14:22:10 +0200
> > > Philipp Jungkamp <p.jungkamp@xxxxxxx> wrote:
> > >     
> > > > > > The hid-sensor-prox returned an empty string on sysfs
> > > > > > in_proximity_scale
> > > > > > read. This is due to the the driver's scale never being
> > > > > > initialized.      
> > > > > 
> > > > > What is scale value reporting here? Is it 1.
> > > > > 
> > > > > Thanks,
> > > > > Srinivas      
> > > > 
> > > > Calling `read` on the sysfs file `in_proximity_scale` returns 0,
> > > > thus an empty string.
> > > > Adding the hid_format_scale call makes that a '1.000000'.
> > > > 
> > > > Regards,
> > > > Philipp    
> > > 
> > > Srinivas - I was kind of waiting for a reply to say if you are happy
> > > with the explanation.
> > > All good?    
> > All good.
> > 
> > Acked-by: Srinivas Pandruvada<srinivas.pandruvada@xxxxxxxxxxxxxxx>
> >   
> Given we are late in the cycle and my next fixes pull will probably end up
> going in during the merge window anyway, I've applied this to the togreg
> branch of iio.git (so the slow path).
> 
> 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?

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    
> >   
> 





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux