From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: jic23@kernel.org
Cc: benjamin.gaignard@st.com, fabrice.gasnier@st.com,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: [PATCH v6 0/9] Introduce the Counter subsystem
Date: Wed, 16 May 2018 13:50:10 -0400 [thread overview]
Message-ID: <cover.1526487615.git.vilhelm.gray@gmail.com> (raw)
This revision is primarily a code refactor and formatting cleanup -- the
interface has remained essentially the same as revision 5, with some
minor additions.
Here's a brief summary of the Generic Counter interface and related code
changes in this revision:
* checkpatch.pl formatting suggestions implemented (parameters line
up with opening round bracket, etc.)
* Implement struct counter_ops to enable const structure for
driver callbacks
* Provide const string array for count_direction and count_mode
options to help maintain a consistent interface
* Reduce local variables by inlining where appropriate
* Bring memory cleanup code closer to respective allocations for
clarity and easier debugging
* Implement counter_name_attribute_create function to reduce
repeated code for various "name" attributes
* Implement counter_global_attr_register function to organize global
counter attribute registration together
* Implement prepare_counter_device_groups_list and
prepare_counter_device_groups functions to organize sysfs
attribute configuration into logical groups (this makes the
counter_register function logic much easier to follow)
Furthermore, the following additions have been made:
* The "ceiling" and "floor" attributes are defined to represent the
upper limit and lower limit respectively for a Count
* The following attributes are now part of the main Generic Counter
interface: count_mode, direction, enable, preset, preset_enable,
and error_noise
* The "Quadrature x1" and "Quadrature x2" function modes are now
known as "Quadrature x1 A" and "Quadrature x2 A" respectively
* The following new function modes are defined in order to support
the STM32 LP Timer quadrature modes: Quadrature x1 B, Quadrature
x2 B, Quadrature x2 Rising, and Quadrature x2 Falling
* The "num_counts" and "num_signals" attributes are defined to
represent the total number of Counts and total number of Signals
respectively
The 104-QUAD-8 counter driver has been updated to make use of the
Generic Counter API changes ("ceiling" and "floor" attributes, constant
counter_ops structure, count_mode and direction string arrays, etc.).
The STM32 Timer counter driver has been updated to make use of the
Generic Counter API changes ("ceiling" attribute, constant counter_ops
structure, etc.). In addition, Fabrice Gasnier added support for a
missing encoder mode (see STM32_COUNT_ENCODER_MODE_2).
Proper Generic Counter interface support for the STM32 LP Timer has been
added to its respective counter driver. This is the last in-tree Linux
kernel driver using the deprecated IIO Counter interface, so we can
safely remove that interface in the future now.
I've added deprecation notices to the IIO Counter attributes to
encourage the switch to the Generic Counter interface. I didn't mention
a removal date for the relevant code, but perhaps before the next
longterm kernel release would be a good idea -- this should prevent the
IIO Counter API from persisting longer than necessary.
William Breathitt Gray
Benjamin Gaignard (2):
dt-bindings: counter: Document stm32 quadrature encoder
counter: Add STM32 Timer quadrature encoder
Fabrice Gasnier (1):
counter: stm32-lptimer: add counter device
William Breathitt Gray (6):
counter: Introduce the Generic Counter interface
counter: Documentation: Add Generic Counter sysfs documentation
docs: Add Generic Counter interface documentation
counter: 104-quad-8: Add Generic Counter interface support
counter: 104-quad-8: Documentation: Add Generic Counter sysfs
documentation
iio: counter: Remove IIO counter subdirectory
Documentation/ABI/testing/sysfs-bus-counter | 241 +++
.../ABI/testing/sysfs-bus-counter-104-quad-8 | 36 +
Documentation/ABI/testing/sysfs-bus-iio | 8 +
.../testing/sysfs-bus-iio-counter-104-quad-8 | 16 +
.../{iio => }/counter/stm32-lptimer-cnt.txt | 0
.../bindings/counter/stm32-timer-cnt.txt | 26 +
.../devicetree/bindings/mfd/stm32-lptimer.txt | 2 +-
.../devicetree/bindings/mfd/stm32-timers.txt | 7 +
Documentation/driver-api/generic-counter.rst | 336 ++++
Documentation/driver-api/index.rst | 1 +
MAINTAINERS | 14 +-
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/counter/104-quad-8.c | 1335 ++++++++++++++
drivers/counter/Kconfig | 59 +
drivers/{iio => }/counter/Makefile | 6 +-
drivers/counter/generic-counter.c | 1541 +++++++++++++++++
drivers/counter/stm32-lptimer-cnt.c | 722 ++++++++
drivers/counter/stm32-timer-cnt.c | 390 +++++
drivers/iio/Kconfig | 1 -
drivers/iio/Makefile | 1 -
drivers/iio/counter/104-quad-8.c | 596 -------
drivers/iio/counter/Kconfig | 34 -
drivers/iio/counter/stm32-lptimer-cnt.c | 382 ----
include/linux/counter.h | 554 ++++++
25 files changed, 5293 insertions(+), 1018 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-counter
create mode 100644 Documentation/ABI/testing/sysfs-bus-counter-104-quad-8
rename Documentation/devicetree/bindings/{iio => }/counter/stm32-lptimer-cnt.txt (100%)
create mode 100644 Documentation/devicetree/bindings/counter/stm32-timer-cnt.txt
create mode 100644 Documentation/driver-api/generic-counter.rst
create mode 100644 drivers/counter/104-quad-8.c
create mode 100644 drivers/counter/Kconfig
rename drivers/{iio => }/counter/Makefile (52%)
create mode 100644 drivers/counter/generic-counter.c
create mode 100644 drivers/counter/stm32-lptimer-cnt.c
create mode 100644 drivers/counter/stm32-timer-cnt.c
delete mode 100644 drivers/iio/counter/104-quad-8.c
delete mode 100644 drivers/iio/counter/Kconfig
delete mode 100644 drivers/iio/counter/stm32-lptimer-cnt.c
create mode 100644 include/linux/counter.h
--
2.17.0
next reply other threads:[~2018-05-16 17:50 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 17:50 William Breathitt Gray [this message]
2018-05-16 17:50 ` [PATCH v6 1/9] counter: Introduce the Generic Counter interface William Breathitt Gray
2018-05-20 15:06 ` Jonathan Cameron
2018-05-21 13:06 ` William Breathitt Gray
2018-05-16 17:50 ` [PATCH v6 2/9] counter: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-05-20 15:12 ` Jonathan Cameron
2018-05-16 17:51 ` [PATCH v6 3/9] docs: Add Generic Counter interface documentation William Breathitt Gray
2018-05-19 15:30 ` kbuild test robot
2018-05-20 15:31 ` Jonathan Cameron
2018-05-21 13:47 ` William Breathitt Gray
2018-05-22 17:08 ` Jonathan Cameron
2018-05-25 9:26 ` Fabrice Gasnier
2018-05-25 13:00 ` William Breathitt Gray
2018-05-16 17:51 ` [PATCH v6 4/9] counter: 104-quad-8: Add Generic Counter interface support William Breathitt Gray
2018-05-19 13:16 ` kbuild test robot
2018-05-19 13:55 ` William Breathitt Gray
2018-05-19 13:16 ` [RFC PATCH] counter: 104-quad-8: quad8_ops can be static kbuild test robot
2018-05-20 15:42 ` [PATCH v6 4/9] counter: 104-quad-8: Add Generic Counter interface support Jonathan Cameron
2018-05-21 13:51 ` William Breathitt Gray
2018-05-16 17:51 ` [PATCH v6 5/9] counter: 104-quad-8: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-05-16 17:51 ` [PATCH v6 6/9] dt-bindings: counter: Document stm32 quadrature encoder William Breathitt Gray
2018-05-17 16:23 ` Rob Herring
2018-05-17 18:07 ` William Breathitt Gray
2018-05-17 18:59 ` Benjamin Gaignard
2018-05-18 16:28 ` Rob Herring
2018-05-20 15:47 ` Jonathan Cameron
2018-06-04 13:03 ` Benjamin Gaignard
2018-05-16 17:52 ` [PATCH v6 7/9] counter: Add STM32 Timer " William Breathitt Gray
2018-05-16 17:52 ` [PATCH v6 8/9] counter: stm32-lptimer: add counter device William Breathitt Gray
2018-05-18 16:34 ` Rob Herring
2018-05-16 17:52 ` [PATCH v6 9/9] iio: counter: Remove IIO counter subdirectory William Breathitt Gray
2018-05-20 15:53 ` Jonathan Cameron
2018-05-21 13:58 ` William Breathitt Gray
2018-05-22 10:44 ` Jonathan Cameron
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.1526487615.git.vilhelm.gray@gmail.com \
--to=vilhelm.gray@gmail.com \
--cc=benjamin.gaignard@st.com \
--cc=devicetree@vger.kernel.org \
--cc=fabrice.gasnier@st.com \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@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).