diff mbox series

counter: add COUNTER_FUNCTION_DISABLE for energy saving

Message ID 20241125230220.9994-1-rafael.v.volkmer@gmail.com (mailing list archive)
State New
Headers show
Series counter: add COUNTER_FUNCTION_DISABLE for energy saving | expand

Commit Message

Rafael V. Volkmer Nov. 25, 2024, 11:02 p.m. UTC
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 mbox series

Patch

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 */