Linux IIO development
 help / color / mirror / Atom feed
From: "Rafael V. Volkmer" <rafael.v.volkmer@gmail.com>
To: wbg@kernel.org
Cc: david@lechnology.com, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org,
	"Rafael V. Volkmer" <rafael.v.volkmer@gmail.com>
Subject: [PATCH] counter: add COUNTER_FUNCTION_DISABLE for energy saving
Date: Mon, 25 Nov 2024 20:02:20 -0300	[thread overview]
Message-ID: <20241125230220.9994-1-rafael.v.volkmer@gmail.com> (raw)

Add `COUNTER_FUNCTION_DISABLE` to the `counter_function` enum in the
counter API. This allows file operations to signal other drivers to
disable hardware resources, reducing energy consumption in
power-sensitive scenarios.

Previously, tests with Texas Instruments' eQEP modules revealed that
hardware resources remained active unless the driver was removed,
offering no user command to stop the count. This approach exposed the
fragility of these resources.

To address this, introduce a new enum option in the counter API to
receive commands for disabling the hardware. This ensures the hardware
enters an idle, power-saving state when not in use.

Signed-off-by: Rafael V. Volkmer <rafael.v.volkmer@gmail.com>
---
 include/uapi/linux/counter.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/counter.h b/include/uapi/linux/counter.h
index 008a691c254b..6f9a6ef878cf 100644
--- a/include/uapi/linux/counter.h
+++ b/include/uapi/linux/counter.h
@@ -145,6 +145,7 @@ enum counter_function {
 	COUNTER_FUNCTION_QUADRATURE_X2_A,
 	COUNTER_FUNCTION_QUADRATURE_X2_B,
 	COUNTER_FUNCTION_QUADRATURE_X4,
+	COUNTER_FUNCTION_DISABLE,
 };
 
 /* Signal values */
-- 
2.25.1


             reply	other threads:[~2024-11-25 23:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 23:02 Rafael V. Volkmer [this message]
2024-11-27 14:36 ` [PATCH] counter: add COUNTER_FUNCTION_DISABLE for energy saving David Lechner
2024-11-27 21:54   ` [PATCH] Add COUNTER_FUNCTION_DISABLE to the counter API Rafael V. Volkmer
2024-11-27 22:49     ` David Lechner
2024-11-27 20:26 ` [PATCH] counter: add COUNTER_FUNCTION_DISABLE for energy saving William Breathitt Gray
2024-11-27 21:46   ` [PATCH] Add COUNTER_FUNCTION_DISABLE to the counter API Rafael V. Volkmer
2024-11-27 21:48   ` Rafael V. Volkmer

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=20241125230220.9994-1-rafael.v.volkmer@gmail.com \
    --to=rafael.v.volkmer@gmail.com \
    --cc=david@lechnology.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wbg@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