From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: Antoniu Miclaus <antoniu.miclaus@analog.com>,
robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: add power and energy measurement modifiers
Date: Thu, 24 Jul 2025 14:09:40 +0100 [thread overview]
Message-ID: <20250724140940.2d9b4a1f@jic23-huawei> (raw)
In-Reply-To: <1ead013c-56ef-4f11-afb9-2b11e0de7eb2@baylibre.com>
On Fri, 11 Jul 2025 14:23:14 -0500
David Lechner <dlechner@baylibre.com> wrote:
> On 7/11/25 8:02 AM, Antoniu Miclaus wrote:
> > Add new IIO modifiers to support power and energy measurement devices:
> >
Sorry I'm late to the game. Busy few weeks :(
> > Power modifiers:
> > - IIO_MOD_ACTIVE: Real power consumed by the load
> > - IIO_MOD_REACTIVE: Power that oscillates between source and load
> > - IIO_MOD_APPARENT: Magnitude of complex power
>
> These make sense a modifiers since they are components of a single
> measured value.
Agreed. Oddly I thought we already had these. Maybe there was a proposal
at some point that never got adopted. Maybe I just had a nightmare
>
> > - IIO_MOD_FUND_REACTIVE: Reactive power at fundamental frequency
>
> This one seems like there should just be a separate channel
> with IIO_POWER + IIO_MOD_REACTIVE since it is measuring a different
> value.
Hmm. This one is new to me. A separate channels sounds fine to me
with a label to provide the info on what it is.
>
> > - IIO_MOD_FACTOR: Power factor (ratio of active to apparent power)
>
> Power factor seems like it should be a IIO_CHAN_INFO_ rather than
> IIO_MOD_. It is also unitless, so doesn't make sense to be part
> of power_raw which would imply that it shuold be converted to Watts.
Agreed.
>
> >
> > Energy modifiers:
> > - IIO_MOD_ACTIVE_ACCUM: Accumulated active energy
> > - IIO_MOD_APPARENT_ACCUM: Accumulated apparent energy
> > - IIO_MOD_REACTIVE_ACCUM: Accumulated reactive energy
>
> As below, this one seems like there should be a separate
> energy channel for accumulated energy.
What sort of energy measurement isn't accumulated? If it's
divided by time then it's power anyway.
>
> >
> > Signal quality modifiers:
> > - IIO_MOD_RMS: Root Mean Square value
>
> Suprised we don't have something like this already. altvoltageY isn't
> clear about if the value is peak-to-peak or RMS.
Hohum.. My vague recollection is peak to peak, but oops we should
have documented that better. Someone want to audit existing drivers?
>
> > - IIO_MOD_SWELL: Voltage swell detection
> > - IIO_MOD_DIP: Voltage dip (sag) detection
>
> These sound like events, not modifiers.
Agreed. Those look fun.
> > What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
> > KernelVersion: 3.2
> > Contact: linux-iio@vger.kernel.org
> > @@ -1593,6 +1603,12 @@ Description:
> >
> > What: /sys/.../iio:deviceX/in_energy_input
> > What: /sys/.../iio:deviceX/in_energy_raw
> > +What: /sys/.../iio:deviceX/in_energyY_active_raw
> > +What: /sys/.../iio:deviceX/in_energyY_reactive_raw
> > +What: /sys/.../iio:deviceX/in_energyY_apparent_raw
> > +What: /sys/.../iio:deviceX/in_energyY_active_accum_raw
> > +What: /sys/.../iio:deviceX/in_energyY_reactive_accum_raw
> > +What: /sys/.../iio:deviceX/in_energyY_apparent_accum_raw
>
> I think the accumulated would just be a separate channel, not a modifier.
I'm confused what energy is vs accumulated energy.
next prev parent reply other threads:[~2025-07-24 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 13:02 [PATCH 0/3] iio: adc: add support for ADE9000 Energy Monitoring IC Antoniu Miclaus
2025-07-11 13:02 ` [PATCH 1/3] iio: add power and energy measurement modifiers Antoniu Miclaus
2025-07-11 19:23 ` David Lechner
2025-07-24 13:09 ` Jonathan Cameron [this message]
2025-07-24 13:58 ` David Lechner
2025-07-27 13:17 ` Jonathan Cameron
2025-07-11 13:02 ` [PATCH 2/3] dt-bindings: iio: adc: add ade9000 Antoniu Miclaus
2025-07-11 17:43 ` David Lechner
2025-07-11 13:02 ` [PATCH 3/3] iio: adc: add ade9000 support Antoniu Miclaus
2025-07-12 17:56 ` kernel test robot
2025-07-12 22:16 ` kernel test robot
2025-07-11 17:09 ` [PATCH 0/3] iio: adc: add support for ADE9000 Energy Monitoring IC David Lechner
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=20250724140940.2d9b4a1f@jic23-huawei \
--to=jic23@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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