From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: jic23@kernel.org
Cc: kamel.bouhara@bootlin.com, gwendal@chromium.org,
a.fatoum@pengutronix.de, david@lechnology.com,
linux-iio@vger.kernel.org, patrick.havelange@essensium.com,
alexandre.belloni@bootlin.com, mcoquelin.stm32@gmail.com,
linux-kernel@vger.kernel.org, kernel@pengutronix.de,
William Breathitt Gray <vilhelm.gray@gmail.com>,
fabrice.gasnier@st.com, syednwaris@gmail.com,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, alexandre.torgue@st.com
Subject: [PATCH v7 0/5] Introduce the Counter character device interface
Date: Fri, 25 Dec 2020 19:15:33 -0500 [thread overview]
Message-ID: <cover.1608935587.git.vilhelm.gray@gmail.com> (raw)
Changes in v7:
- Implemented u32 enums; enum types can now be used directly for
callbacks and values
- Fixed refcount underflow bug
- Refactored all err check to check for err < 0; this should help
prevent future oversights on valid positive return valids
- Use mutex instead of raw_spin_lock in counter_chrdev_read();
kifo_to_user() can now safely sleep
- Renamed COUNTER_COMPONENT_DUMMY to COUNTER_COMPONENT_NONE to make
purpose more obvious
- Introduced a watch_validate() callback
- Consolidated the functionality to clear the watches to the
counter_clear_watches() function
- Reimplemented counter_push_event() as a void function; on error,
errno is returned via struct counter_event so that it can be handled
by userspace (because interrupt handlers can't do much for this)
- Renamed the events_config() callback to events_configure();
"events_config" could be confused as a read callback when this is
actually intended to configure the device for the requested events
- Reimplemented 104-QUAD-8 driver to use events_configure() and
watch_validate() callbacks; irq_trigger_enable sysfs attribute
removed because events_configure() now serves this purpose
The changes for this revision were much simpler compared to the previous
revisions. I don't have any further questions for this patchset, so it's
really just a search for possible bugs or regressions now. Please test
and verify this patchset on your systems, and ACK appropriately.
To summarize the main points: there are no changes to the existing
Counter sysfs userspace interface; a Counter character device interface
is introduced that allows Counter events and associated data to be
read() by userspace; the events_configure() and watch_validate() driver
callbacks are introduced to support Counter events; and IRQ support is
added to the 104-QUAD-8 driver, serving as an example of how to support
the new Counter events functionality.
William Breathitt Gray (5):
counter: Internalize sysfs interface code
docs: counter: Update to reflect sysfs internalization
counter: Add character device interface
docs: counter: Document character device interface
counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8
Documentation/ABI/testing/sysfs-bus-counter | 18 +-
.../ABI/testing/sysfs-bus-counter-104-quad-8 | 25 +
Documentation/driver-api/generic-counter.rst | 416 ++++-
.../userspace-api/ioctl/ioctl-number.rst | 1 +
MAINTAINERS | 2 +-
drivers/counter/104-quad-8.c | 799 +++++----
drivers/counter/Kconfig | 6 +-
drivers/counter/Makefile | 1 +
drivers/counter/counter-chrdev.c | 490 ++++++
drivers/counter/counter-chrdev.h | 16 +
drivers/counter/counter-core.c | 182 ++
drivers/counter/counter-sysfs.c | 868 ++++++++++
drivers/counter/counter-sysfs.h | 13 +
drivers/counter/counter.c | 1496 -----------------
drivers/counter/ftm-quaddec.c | 61 +-
drivers/counter/microchip-tcb-capture.c | 103 +-
drivers/counter/stm32-lptimer-cnt.c | 181 +-
drivers/counter/stm32-timer-cnt.c | 149 +-
drivers/counter/ti-eqep.c | 224 +--
include/linux/counter.h | 716 ++++----
include/linux/counter_enum.h | 45 -
include/uapi/linux/counter.h | 123 ++
22 files changed, 3259 insertions(+), 2676 deletions(-)
create mode 100644 drivers/counter/counter-chrdev.c
create mode 100644 drivers/counter/counter-chrdev.h
create mode 100644 drivers/counter/counter-core.c
create mode 100644 drivers/counter/counter-sysfs.c
create mode 100644 drivers/counter/counter-sysfs.h
delete mode 100644 drivers/counter/counter.c
delete mode 100644 include/linux/counter_enum.h
create mode 100644 include/uapi/linux/counter.h
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-12-26 0:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-26 0:15 William Breathitt Gray [this message]
2020-12-26 0:15 ` [PATCH v7 2/5] docs: counter: Update to reflect sysfs internalization William Breathitt Gray
2020-12-30 14:41 ` Jonathan Cameron
2020-12-26 0:15 ` [PATCH v7 3/5] counter: Add character device interface William Breathitt Gray
2020-12-30 15:04 ` Jonathan Cameron
2021-02-12 6:32 ` William Breathitt Gray
2020-12-30 21:36 ` David Lechner
2021-01-30 4:59 ` William Breathitt Gray
2021-01-28 9:01 ` Oleksij Rempel
2021-01-30 5:15 ` William Breathitt Gray
2020-12-26 0:15 ` [PATCH v7 4/5] docs: counter: Document " William Breathitt Gray
2020-12-30 14:47 ` Jonathan Cameron
2020-12-30 18:18 ` David Lechner
2020-12-26 0:15 ` [PATCH v7 5/5] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 William Breathitt Gray
2020-12-30 15:31 ` Jonathan Cameron
2021-02-12 6:04 ` William Breathitt Gray
2020-12-30 17:36 ` David Lechner
2021-02-11 23:56 ` William Breathitt Gray
2021-02-12 1:10 ` David Lechner
[not found] ` <fc40ab7f4a38e80d86715daa5eaf744dd645a75b.1608935587.git.vilhelm.gray@gmail.com>
2020-12-30 23:24 ` [PATCH v7 1/5] counter: Internalize sysfs interface code David Lechner
2021-01-06 5:30 ` William Breathitt Gray
[not found] ` <20201230143719.28a90914@archlinux>
2021-01-06 5:29 ` William Breathitt Gray
2020-12-30 23:34 ` [PATCH v7 0/5] Introduce the Counter character device interface David Lechner
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=cover.1608935587.git.vilhelm.gray@gmail.com \
--to=vilhelm.gray@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@st.com \
--cc=david@lechnology.com \
--cc=fabrice.gasnier@st.com \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=kamel.bouhara@bootlin.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=patrick.havelange@essensium.com \
--cc=syednwaris@gmail.com \
/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).