AW: [PATCH 1/2] dt-bindings: hwmon: Introduce ADS71x8

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

 



> > > +  ti,mode:
> > > +    $ref: /schemas/types.yaml#/definitions/uint8
> > > +    description: |
> > > +      Operation mode
> > > +      Mode 0 - Manual mode. A channel is only sampled when the according
> input
> > > +        in the sysfs is read.
> > > +      Mode 1 - Auto mode. All channels are automatically sampled
> sequentially.
> > > +        Reading an input returns the last valid sample. In this mode further
> > > +        features like statistics and interrupts are available.
> > > +    default: 0
> >
> > I don't think this ti,mode property is suitable for bindings. sysfs is a
> > linux implementation detail, when to do sampling is an implementation
> > detail of your driver. Bindings are only supposed to describe properties
> > of the hardware, not set software policy.
> 
> Agreed. With an IIO driver this will become a switch based on what usespace
> interfaces are enabled.
> So if events are on or buffered data capture, enable automode.
> If just sysfs reads, then manual mode is fine.

Not quite sure if I understood you correctly. With the mode I intended to give
control about the sampling behavior.
In manual mode channels are only sampled if they are accessed/read.
In auto mode they are sampled all the time sequentially. This also offers to use
some extended features, like triggering an interrupt if a measurement crosses a
defined limit.
So the mode mainly affects the hardware behavior and just offers the possibility
to catch that in userspace, if configured accordingly, but that's not a must-have.

Anyway, did I understood it correctly, that you suggest to configure the mode
according some symbols in the kconfig and check that with #ifdef? Do you have
the specific symbol names for me or a driver as example, so I can have a look?

Thanks and regards
Tobias





[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