From: Ivan Vecera <ivecera@redhat.com>
To: netdev@vger.kernel.org
Cc: Prathosh Satish <Prathosh.Satish@microchip.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Petr Oros <poros@redhat.com>,
Michal Schmidt <mschmidt@redhat.com>,
Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 0/6] dpll: zl3073x: refactor state management
Date: Wed, 11 Mar 2026 20:00:49 +0100 [thread overview]
Message-ID: <20260311190055.139006-1-ivecera@redhat.com> (raw)
This series refactors the zl3073x DPLL driver to centralize hardware
state management behind dedicated per-module state interfaces, replacing
scattered direct register accesses in dpll.c with cached state and
proper accessor functions.
The driver already uses a fetch/get/set pattern for ref, out, and synth
modules. This series extends and refines that pattern:
First, struct_group() is applied to the existing ref, out, and synth
structures to partition fields into cfg (mutable configuration), inv
(invariants set at init), and stat (read-only status) groups. This
enables group-level memcmp for short-circuit checks and bulk copies in
state_set, and adds invariant validation guards.
A ref_state_update() helper is extracted to encapsulate the per-reference
monitor status register read, keeping direct register access behind the
ref module interface.
A new zl3073x_chan module is introduced following the same pattern,
caching the DPLL channel mode_refsel register with inline getters and
setters. The refsel_mode and forced_ref fields are removed from struct
zl3073x_dpll in favor of the cached channel state.
The chan module is then extended with cached mon_status and refsel_status
registers, converting lock_status_get and selected_ref_get from direct
HW reads to cached state lookups refreshed by the periodic worker.
Reference priority registers are cached in the chan cfg group, removing
the ad-hoc ref_prio_get/set functions and the redundant pin->selectable
flag, which is now derived from the cached priority. The
selected_ref_set function is inlined into input_pin_state_on_dpll_set,
unifying all mode paths through a single chan_state_set commit point.
Finally, selected_ref_get is dropped entirely since the refsel_status
register provides the selected reference regardless of mode, and
connected_ref_get is simplified to a direct refsel_state check.
Ivan Vecera (6):
dpll: zl3073x: use struct_group to partition states
dpll: zl3073x: add zl3073x_ref_state_update helper
dpll: zl3073x: introduce zl3073x_chan for DPLL channel state
dpll: zl3073x: add DPLL channel status fields to zl3073x_chan
dpll: zl3073x: add reference priority to zl3073x_chan
dpll: zl3073x: drop selected and simplify connected ref getter
drivers/dpll/zl3073x/Makefile | 4 +-
drivers/dpll/zl3073x/chan.c | 164 ++++++++++++
drivers/dpll/zl3073x/chan.h | 179 +++++++++++++
drivers/dpll/zl3073x/core.c | 36 ++-
drivers/dpll/zl3073x/core.h | 14 +-
drivers/dpll/zl3073x/dpll.c | 490 +++++++++-------------------------
drivers/dpll/zl3073x/dpll.h | 4 -
drivers/dpll/zl3073x/out.c | 27 +-
drivers/dpll/zl3073x/out.h | 21 +-
drivers/dpll/zl3073x/ref.c | 58 ++--
drivers/dpll/zl3073x/ref.h | 33 ++-
drivers/dpll/zl3073x/regs.h | 12 +
drivers/dpll/zl3073x/synth.h | 16 +-
13 files changed, 626 insertions(+), 432 deletions(-)
create mode 100644 drivers/dpll/zl3073x/chan.c
create mode 100644 drivers/dpll/zl3073x/chan.h
--
2.52.0
next reply other threads:[~2026-03-11 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 19:00 Ivan Vecera [this message]
2026-03-11 19:00 ` [PATCH net-next 1/6] dpll: zl3073x: use struct_group to partition states Ivan Vecera
2026-03-11 19:00 ` [PATCH net-next 2/6] dpll: zl3073x: add zl3073x_ref_state_update helper Ivan Vecera
2026-03-11 19:00 ` [PATCH net-next 3/6] dpll: zl3073x: introduce zl3073x_chan for DPLL channel state Ivan Vecera
2026-03-11 19:00 ` [PATCH net-next 4/6] dpll: zl3073x: add DPLL channel status fields to zl3073x_chan Ivan Vecera
2026-03-11 19:00 ` [PATCH net-next 5/6] dpll: zl3073x: add reference priority " Ivan Vecera
2026-03-14 19:53 ` [net-next,5/6] " Jakub Kicinski
2026-03-15 17:38 ` Ivan Vecera
2026-03-11 19:00 ` [PATCH net-next 6/6] dpll: zl3073x: drop selected and simplify connected ref getter Ivan Vecera
-- strict thread matches above, loose matches on Subject: below --
2025-11-10 17:58 [PATCH net-next 0/6] dpll: zl3073x: Refactor state management Ivan Vecera
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=20260311190055.139006-1-ivecera@redhat.com \
--to=ivecera@redhat.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=poros@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/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