]> git.ipfire.org Git - thirdparty/linux.git/commit
dpll: zl3073x: introduce zl3073x_chan for DPLL channel state
authorIvan Vecera <ivecera@redhat.com>
Sun, 15 Mar 2026 17:42:21 +0000 (18:42 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Mar 2026 02:05:12 +0000 (19:05 -0700)
commit3032e95987fa0da656ce3a5eb454674e7cc60a12
treeda415bd65d9df2c5e3a9939d89bde31e6794a923
parent05ea2ab3b10075e8fcfcd5e283e486df7055de5e
dpll: zl3073x: introduce zl3073x_chan for DPLL channel state

Extract DPLL channel state management into a dedicated zl3073x_chan
module, following the pattern already established by zl3073x_ref,
zl3073x_out and zl3073x_synth.

The new struct zl3073x_chan caches the raw mode_refsel register value
in a cfg group with inline getters and setters to extract and update
the bitfields. Three standard state management functions are provided:

 - zl3073x_chan_state_fetch: read the mode_refsel register from HW
 - zl3073x_chan_state_get: return cached channel state
 - zl3073x_chan_state_set: write changed state to HW, skip if unchanged

The channel state array chan[ZL3073X_MAX_CHANNELS] is added to struct
zl3073x_dev. Channel state is fetched as part of
zl3073x_dev_state_fetch, using the chip-specific channel count.

The refsel_mode and forced_ref fields are removed from struct
zl3073x_dpll and all direct register accesses in dpll.c are replaced
with the new chan state operations.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260315174224.399074-4-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/zl3073x/Makefile
drivers/dpll/zl3073x/chan.c [new file with mode: 0644]
drivers/dpll/zl3073x/chan.h [new file with mode: 0644]
drivers/dpll/zl3073x/core.c
drivers/dpll/zl3073x/core.h
drivers/dpll/zl3073x/dpll.c
drivers/dpll/zl3073x/dpll.h