From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <robh@kernel.org>, <conor+dt@kernel.org>,
<devicetree@vger.kernel.org>, <linux-iio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/5] iio: add power and energy measurement modifiers
Date: Sun, 27 Jul 2025 14:18:44 +0100 [thread overview]
Message-ID: <20250727141844.500c7416@jic23-huawei> (raw)
In-Reply-To: <20250721112455.23948-1-antoniu.miclaus@analog.com>
On Mon, 21 Jul 2025 14:24:41 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> Add new IIO modifiers to support power and energy measurement devices:
>
> 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
> - IIO_MOD_FUND_REACTIVE: Reactive power at fundamental frequency
> - IIO_MOD_FACTOR: Power factor (ratio of active to apparent power)
>
> Signal quality modifiers:
> - IIO_MOD_RMS: Root Mean Square value
>
> These modifiers enable proper representation of power measurement
> devices like energy meters and power analyzers.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
This series seems to have dropped it's cover letter between v1 and v2.
Make sure it's there for v3.
> ---
> changes in v2:
> - drop _accum modifiers
> - drop dip/swell modifiers
> - change power factor to be a chan_info
Do we ever need to getting for an IIO buffer?
> - voltage -> altvoltage for rms
> Documentation/ABI/testing/sysfs-bus-iio | 14 ++++++++++++++
> drivers/iio/industrialio-core.c | 5 +++++
> include/linux/iio/types.h | 1 +
> include/uapi/linux/iio/types.h | 4 ++++
> 4 files changed, 24 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 3bc386995fb6..0948611227a8 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -169,7 +169,12 @@ Description:
> is required is a consistent labeling. Units after application
> of scale and offset are millivolts.
>
> +What: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_rms_raw
> +
> What: /sys/bus/iio/devices/iio:deviceX/in_powerY_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_powerY_active_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_powerY_reactive_raw
> +What: /sys/bus/iio/devices/iio:deviceX/in_powerY_apparent_raw
> KernelVersion: 4.5
> Contact: linux-iio@vger.kernel.org
> Description:
> @@ -178,6 +183,8 @@ Description:
> unique to allow association with event codes. Units after
> application of scale and offset are milliwatts.
>
> +What: /sys/bus/iio/devices/iio:deviceX/in_powerY_power_factor
> +
> What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
> KernelVersion: 3.2
> Contact: linux-iio@vger.kernel.org
> @@ -1593,6 +1600,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
Seems the docs are still here from v1 for accum versions.
> /* relies on pairs of these shared then separate */
> @@ -189,6 +193,7 @@ static const char * const iio_chan_info_postfix[] = {
> [IIO_CHAN_INFO_ZEROPOINT] = "zeropoint",
> [IIO_CHAN_INFO_TROUGH] = "trough_raw",
> [IIO_CHAN_INFO_CONVDELAY] = "convdelay",
> + [IIO_CHAN_INFO_POWER_FACTOR] = "power_factor",
I thought David comment on this in v1. No _ in new info elements because
of the complexity it makes for userspace. We sometimes do accept them still
if they are related to an existing element - hence trough_raw a few lines up.
> };
> /**
> * iio_device_id() - query the unique ID for the device
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index ad2761efcc83..f26a0fbd6ab4 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -70,6 +70,7 @@ enum iio_chan_info_enum {
> IIO_CHAN_INFO_ZEROPOINT,
> IIO_CHAN_INFO_TROUGH,
> IIO_CHAN_INFO_CONVDELAY,
> + IIO_CHAN_INFO_POWER_FACTOR,
> };
> enum iio_event_type {
prev parent reply other threads:[~2025-07-27 13:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 11:24 [PATCH v2 1/5] iio: add power and energy measurement modifiers Antoniu Miclaus
2025-07-21 11:24 ` [PATCH v2 2/5] dt-bindings: iio: adc: add ade9000 Antoniu Miclaus
2025-07-21 14:23 ` Rob Herring (Arm)
2025-07-26 20:46 ` David Lechner
2025-07-27 13:24 ` Jonathan Cameron
2025-07-21 11:24 ` [PATCH v2 3/5] iio: adc: add ade9000 support Antoniu Miclaus
2025-07-27 14:10 ` Jonathan Cameron
2025-07-21 11:24 ` [PATCH v2 4/5] Documentation: ABI: iio: add sinc4+iir and dsp types Antoniu Miclaus
2025-07-27 13:27 ` Jonathan Cameron
2025-07-21 11:24 ` [PATCH v2 5/5] Documentation: ABI: iio: adc: add ade9000 ABI Antoniu Miclaus
2025-07-27 13:38 ` Jonathan Cameron
2025-07-27 13:18 ` Jonathan Cameron [this message]
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=20250727141844.500c7416@jic23-huawei \
--to=jic23@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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