summaryrefslogtreecommitdiff
path: root/include/linux/counter.h
diff options
context:
space:
mode:
authorWilliam Breathitt Gray <william.gray@linaro.org>2022-09-28 01:53:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-30 15:32:35 +0300
commit650ae67bbf7ba5ac193f053969612fbb93247b64 (patch)
treebf80c0c98c877ded950722bbb4001d9d264ebb54 /include/linux/counter.h
parent7bbf842cdcff30ddd1da4ab9059cf92f9d1a4326 (diff)
downloadlinux-650ae67bbf7ba5ac193f053969612fbb93247b64.tar.xz
counter: Introduce the Signal polarity component
The Signal polarity component represents the active level of a respective Signal. There are two possible states: positive (rising edge) and negative (falling edge); enum counter_signal_polarity represents these states. A convenience macro COUNTER_COMP_POLARITY() is provided for driver authors to declare a Signal polarity component. Cc: Julien Panis <jpanis@baylibre.com> Link: https://lore.kernel.org/r/8f47d6e1db71a11bb1e2666f8e2a6e9d256d4131.1664204990.git.william.gray@linaro.org/ Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Link: https://lore.kernel.org/r/b6e53438badcb6318997d13dd2fc052f97d808ac.1664318353.git.william.gray@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/counter.h')
-rw-r--r--include/linux/counter.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/counter.h b/include/linux/counter.h
index a81234bc8ea8..b3fb6b68881a 100644
--- a/include/linux/counter.h
+++ b/include/linux/counter.h
@@ -31,6 +31,7 @@ enum counter_comp_type {
COUNTER_COMP_ENUM,
COUNTER_COMP_COUNT_DIRECTION,
COUNTER_COMP_COUNT_MODE,
+ COUNTER_COMP_SIGNAL_POLARITY,
};
/**
@@ -477,6 +478,15 @@ struct counter_available {
#define COUNTER_COMP_FLOOR(_read, _write) \
COUNTER_COMP_COUNT_U64("floor", _read, _write)
+#define COUNTER_COMP_POLARITY(_read, _write, _available) \
+{ \
+ .type = COUNTER_COMP_SIGNAL_POLARITY, \
+ .name = "polarity", \
+ .signal_u32_read = (_read), \
+ .signal_u32_write = (_write), \
+ .priv = &(_available), \
+}
+
#define COUNTER_COMP_PRESET(_read, _write) \
COUNTER_COMP_COUNT_U64("preset", _read, _write)