public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Sperling, Tobias" <Tobias.Sperling@Softing.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Conor Dooley <conor@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"jdelvare@suse.com" <jdelvare@suse.com>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: hwmon: Introduce ADS71x8
Date: Mon, 2 Sep 2024 15:17:06 +0100	[thread overview]
Message-ID: <20240902151706.0000334f@Huawei.com> (raw)
In-Reply-To: <BE1P281MB2420D75334A568E60823BE48EF922@BE1P281MB2420.DEUP281.PROD.OUTLOOK.COM>

On Mon, 2 Sep 2024 13:24:59 +0000
"Sperling, Tobias" <Tobias.Sperling@Softing.com> wrote:

> > > > +  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?
No, this is not a build time of firmware config question. It is a question of
what the user is 'doing' with the device. Configure the mode according to what
userspace has enabled.

If it enables threshold detection, then turn on continuous mode.
If it enables capture of data via a chardev (so fast path) then turn on continuous
mode.  If neither of those, then run in manual mode.

Jonathan

> 
> Thanks and regards
> Tobias
> 


  reply	other threads:[~2024-09-02 14:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30 11:49 [PATCH 1/2] dt-bindings: hwmon: Introduce ADS71x8 Sperling, Tobias
2024-08-30 13:14 ` Conor Dooley
2024-08-30 14:30   ` Guenter Roeck
2024-08-31 12:18     ` Jonathan Cameron
2024-09-02 13:04       ` AW: " Sperling, Tobias
2024-09-03 19:40         ` Jonathan Cameron
2024-08-31 12:21   ` Jonathan Cameron
2024-09-02 13:24     ` AW: " Sperling, Tobias
2024-09-02 14:17       ` Jonathan Cameron [this message]
2024-09-02 12:58   ` Sperling, Tobias
2024-09-02 13:49     ` Guenter Roeck
2024-08-31  6:42 ` Krzysztof Kozlowski
2024-09-02 13:48   ` AW: " Sperling, Tobias
2024-09-02 16:02     ` Krzysztof Kozlowski
2024-09-02 17:01       ` Guenter Roeck

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=20240902151706.0000334f@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Tobias.Sperling@Softing.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    /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