From: William Breathitt Gray <william.gray@linaro.org>
To: gregkh@linuxfoundation.org
Cc: linux-iio@vger.kernel.org,
William Breathitt Gray <william.gray@linaro.org>,
Julien Panis <jpanis@baylibre.com>
Subject: [PATCH 06/12] counter: Introduce the Count capture component
Date: Tue, 27 Sep 2022 18:53:40 -0400 [thread overview]
Message-ID: <3cebaa0b807a225eb277d771504fe6dba7269ffd.1664318353.git.william.gray@linaro.org> (raw)
In-Reply-To: <cover.1664318353.git.william.gray@linaro.org>
Some devices provide a latch function to save historic Count values.
This patch standardizes exposure of such functionality as Count capture
components. A COUNTER_COMP_CAPTURE macro is provided for driver authors
to define a capture component. A new event COUNTER_EVENT_CAPTURE is
introduced to represent Count value capture events.
Cc: Julien Panis <jpanis@baylibre.com>
Link: https://lore.kernel.org/r/c239572ab4208d0d6728136e82a88ad464369a7a.1664204990.git.william.gray@linaro.org/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
Documentation/ABI/testing/sysfs-bus-counter | 7 +++++++
include/linux/counter.h | 3 +++
include/uapi/linux/counter.h | 2 ++
3 files changed, 12 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter
index 2a996deabe9e..3eb6b063970a 100644
--- a/Documentation/ABI/testing/sysfs-bus-counter
+++ b/Documentation/ABI/testing/sysfs-bus-counter
@@ -4,6 +4,12 @@ Contact: linux-iio@vger.kernel.org
Description:
Count data of Count Y represented as a string.
+What: /sys/bus/counter/devices/counterX/countY/capture
+KernelVersion: 6.1
+Contact: linux-iio@vger.kernel.org
+Description:
+ Historical capture of the Count Y count data.
+
What: /sys/bus/counter/devices/counterX/countY/ceiling
KernelVersion: 5.2
Contact: linux-iio@vger.kernel.org
@@ -203,6 +209,7 @@ Description:
both edges:
Any state transition.
+What: /sys/bus/counter/devices/counterX/countY/capture_component_id
What: /sys/bus/counter/devices/counterX/countY/ceiling_component_id
What: /sys/bus/counter/devices/counterX/countY/floor_component_id
What: /sys/bus/counter/devices/counterX/countY/count_mode_component_id
diff --git a/include/linux/counter.h b/include/linux/counter.h
index b3fb6b68881a..e160197971dd 100644
--- a/include/linux/counter.h
+++ b/include/linux/counter.h
@@ -453,6 +453,9 @@ struct counter_available {
.priv = &(_available), \
}
+#define COUNTER_COMP_CAPTURE(_read, _write) \
+ COUNTER_COMP_COUNT_U64("capture", _read, _write)
+
#define COUNTER_COMP_CEILING(_read, _write) \
COUNTER_COMP_COUNT_U64("ceiling", _read, _write)
diff --git a/include/uapi/linux/counter.h b/include/uapi/linux/counter.h
index e9610e1944dc..8ab12d731e3b 100644
--- a/include/uapi/linux/counter.h
+++ b/include/uapi/linux/counter.h
@@ -63,6 +63,8 @@ enum counter_event_type {
COUNTER_EVENT_INDEX,
/* State of counter is changed */
COUNTER_EVENT_CHANGE_OF_STATE,
+ /* Count value captured */
+ COUNTER_EVENT_CAPTURE,
};
/**
--
2.37.3
next prev parent reply other threads:[~2022-09-27 22:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 22:53 [PATCH 00/12] First set of Counter updates for the 6.1 cycle William Breathitt Gray
2022-09-27 22:53 ` [PATCH 01/12] MAINTAINERS: Update Counter subsystem git tree repo link William Breathitt Gray
2022-09-27 22:53 ` [PATCH 02/12] counter: Move symbols into COUNTER namespace William Breathitt Gray
2022-09-27 22:53 ` [PATCH 03/12] counter: interrupt-cnt: Implement watch_validate callback William Breathitt Gray
2022-09-27 22:53 ` [PATCH 04/12] counter: Introduce the Signal polarity component William Breathitt Gray
2022-09-27 22:53 ` [PATCH 05/12] counter: 104-quad-8: Add " William Breathitt Gray
2022-09-27 22:53 ` William Breathitt Gray [this message]
2022-09-27 22:53 ` [PATCH 07/12] counter: Consolidate Counter extension sysfs attribute creation William Breathitt Gray
2022-09-27 22:53 ` [PATCH 08/12] counter: Introduce the COUNTER_COMP_ARRAY component type William Breathitt Gray
2022-09-27 22:53 ` [PATCH 09/12] dt-bindings: counter: add ti,am62-ecap-capture.yaml William Breathitt Gray
2022-09-27 22:53 ` [PATCH 10/12] Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows items William Breathitt Gray
2022-09-27 22:53 ` [PATCH 11/12] counter: ti-ecap-capture: capture driver support for ECAP William Breathitt Gray
2022-09-27 22:53 ` [PATCH 12/12] MAINTAINERS: add TI ECAP driver info William Breathitt Gray
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=3cebaa0b807a225eb277d771504fe6dba7269ffd.1664318353.git.william.gray@linaro.org \
--to=william.gray@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jpanis@baylibre.com \
--cc=linux-iio@vger.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;
as well as URLs for NNTP newsgroup(s).