Re: [PATCH 3/5] iio: proximity: Add SX9324 support

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

 



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



[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