From: William Breathitt Gray <william.gray@linaro.org>
To: linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Johannes Berg <johannes.berg@intel.com>,
Jonathan Cameron <jic23@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH v4 0/4] Refactor 104-quad-8 to match device operations
Date: Thu, 18 May 2023 21:19:17 -0400 [thread overview]
Message-ID: <ZGbOlXhXgcmZMCXv@fedora> (raw)
In-Reply-To: <cover.1681753140.git.william.gray@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 3156 bytes --]
On Mon, Apr 17, 2023 at 03:50:46PM -0400, William Breathitt Gray wrote:
> Changes in v4:
> - Fix endianness errors by utilizing get_unaligned_le24() and
> put_unaligned_le24()
> - Mention benefits of using regmap in the commit description
> - Use "int ret" for regmap_* return values throughout for consistency
> - Reorganize declaration lists to prioritize longer lines first
> Changes in v3:
> - Add __always_inline attribute for quad8_control_register_update()
> Changes in v2:
> - Drop FIELD_MODIFY() macro introduction; u8p_replace_bits() is
> utilized instead for the same purpose
> - Replace FIELD_PREP() and FIELD_GET() with u8_encode_bits() and
> u8_get_bits()
> - Replace FIELD_MODIFY() with u8p_replace_bits()
> - Wrap up control register update in quad8_control_register_update()
> - Utilize ioread8_rep() and iowrite8_rep() to read and write counter
> data
>
> The 104-quad-8 driver was initially introduced to the IIO subsystem
> where it didn't quite fit with the existing paradigm [0]; these
> differences eventually led to the creation of the Counter subsystem[1].
> As a result of its awkward beginnings, the design of the 104-quad-8
> driver was structured around maintaining abstract state buffers that
> would eventually be converted to match the actual device registers
> states on-the-fly as needed.
>
> The original design approach for the 104-quad-8 driver was neither
> efficient nor easy to troubleshoot, but it did allow us to focus on
> implementing and supporting necessary APIs for the nascent Counter
> subsystem. Now that development for the 104-quad-8 driver has shifted
> to maintenance, it is a good time to refactor and clean up the code to
> match closer to what is actually happening on the device. This patchset
> is an attempt to rectify the situation as such.
>
> The primary change is a transition from maintaining individual
> configuration states independently, to storing buffers of the device
> register configurations. To that end, the bitfield API is leveraged to
> access and retrieve field states. Some helper functions are introduced
> as well to abstract the handling of the PR, FLAG, PSC, and control
> registers. A migration to the regmap API is added as a follow-up patch
> due to its dependence on this patch series.
>
> [0] https://lore.kernel.org/r/b43e2942b763b87afc85bfa9fe36e5695cba4c44.1475079578.git.vilhelm.gray@gmail.com/
> [1] https://lore.kernel.org/r/cover.1554184734.git.vilhelm.gray@gmail.com/
>
> William Breathitt Gray (4):
> counter: 104-quad-8: Utilize bitfield access macros
> counter: 104-quad-8: Refactor to buffer states for CMR, IOR, and IDR
> counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and
> PSC
> counter: 104-quad-8: Migrate to the regmap API
>
> drivers/counter/104-quad-8.c | 802 +++++++++++++++++++----------------
> drivers/counter/Kconfig | 1 +
> 2 files changed, 440 insertions(+), 363 deletions(-)
>
>
> base-commit: 09a9639e56c01c7a00d6c0ca63f4c7c41abe075d
> --
> 2.39.2
>
Queued for counter-next.
William Breathitt Gray
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-05-19 1:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 19:50 [PATCH v4 0/4] Refactor 104-quad-8 to match device operations William Breathitt Gray
2023-04-17 19:50 ` [PATCH v4 1/4] counter: 104-quad-8: Utilize bitfield access macros William Breathitt Gray
2023-04-17 19:50 ` [PATCH v4 2/4] counter: 104-quad-8: Refactor to buffer states for CMR, IOR, and IDR William Breathitt Gray
2023-04-17 19:50 ` [PATCH v4 3/4] counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC William Breathitt Gray
2023-04-17 19:50 ` [PATCH v4 4/4] counter: 104-quad-8: Migrate to the regmap API William Breathitt Gray
2023-04-18 7:44 ` Andy Shevchenko
2023-04-19 11:27 ` William Breathitt Gray
2023-05-19 1:19 ` William Breathitt Gray [this message]
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=ZGbOlXhXgcmZMCXv@fedora \
--to=william.gray@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=johannes.berg@intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.