summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-04-04 02:48:03 +0300
committerJakub Kicinski <kuba@kernel.org>2026-04-04 02:48:04 +0300
commit3741f8fa004bf598cd5032b0ff240984332d6f05 (patch)
treecf74817bde2ccab3f4a243156ce7ba01a82294f6 /include
parent353d8e7989b6babe8fe4ae06272230c7941c3f73 (diff)
parentbfc923b642874ea6f94763d6060782072944ebd5 (diff)
downloadlinux-3741f8fa004bf598cd5032b0ff240984332d6f05.tar.xz
Merge branch 'dpll-add-frequency-monitoring-feature'
Ivan Vecera says: ==================== dpll: add frequency monitoring feature This series adds support for monitoring the measured input frequency of DPLL input pins via the DPLL netlink interface. Some DPLL devices can measure the actual frequency being received on input pins. The approach mirrors the existing phase-offset-monitor feature: a device-level attribute (DPLL_A_FREQUENCY_MONITOR) enables or disables monitoring, and a per-pin attribute (DPLL_A_PIN_MEASURED_FREQUENCY) exposes the measured frequency in millihertz (mHz) when monitoring is enabled. Patch 1 adds the new attributes to the DPLL netlink spec (dpll.yaml), the DPLL_PIN_MEASURED_FREQUENCY_DIVIDER constant, regenerates the auto-generated UAPI header and netlink policy, and updates Documentation/driver-api/dpll.rst. Patch 2 adds the callback operations (freq_monitor_get/set for devices, measured_freq_get for pins) and the corresponding netlink GET/SET handlers in the DPLL core. The core only invokes measured_freq_get when the frequency monitor is enabled on the parent device. The freq_monitor_get callback is required when measured_freq_get is provided. Patch 3 implements the feature in the ZL3073x driver by extracting a common measurement latch helper from the existing FFO update path, adding a frequency measurement function, and wiring up the new callbacks. ==================== Link: https://patch.msgid.link/20260402184057.1890514-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dpll.h10
-rw-r--r--include/uapi/linux/dpll.h5
2 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/dpll.h b/include/linux/dpll.h
index 2ce295b46b8c..b7277a8b484d 100644
--- a/include/linux/dpll.h
+++ b/include/linux/dpll.h
@@ -52,6 +52,12 @@ struct dpll_device_ops {
int (*phase_offset_avg_factor_get)(const struct dpll_device *dpll,
void *dpll_priv, u32 *factor,
struct netlink_ext_ack *extack);
+ int (*freq_monitor_set)(const struct dpll_device *dpll, void *dpll_priv,
+ enum dpll_feature_state state,
+ struct netlink_ext_ack *extack);
+ int (*freq_monitor_get)(const struct dpll_device *dpll, void *dpll_priv,
+ enum dpll_feature_state *state,
+ struct netlink_ext_ack *extack);
};
struct dpll_pin_ops {
@@ -110,6 +116,10 @@ struct dpll_pin_ops {
int (*ffo_get)(const struct dpll_pin *pin, void *pin_priv,
const struct dpll_device *dpll, void *dpll_priv,
s64 *ffo, struct netlink_ext_ack *extack);
+ int (*measured_freq_get)(const struct dpll_pin *pin, void *pin_priv,
+ const struct dpll_device *dpll,
+ void *dpll_priv, u64 *measured_freq,
+ struct netlink_ext_ack *extack);
int (*esync_set)(const struct dpll_pin *pin, void *pin_priv,
const struct dpll_device *dpll, void *dpll_priv,
u64 freq, struct netlink_ext_ack *extack);
diff --git a/include/uapi/linux/dpll.h b/include/uapi/linux/dpll.h
index de0005f28e5c..871685f7c353 100644
--- a/include/uapi/linux/dpll.h
+++ b/include/uapi/linux/dpll.h
@@ -191,7 +191,8 @@ enum dpll_pin_capabilities {
DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE = 4,
};
-#define DPLL_PHASE_OFFSET_DIVIDER 1000
+#define DPLL_PHASE_OFFSET_DIVIDER 1000
+#define DPLL_PIN_MEASURED_FREQUENCY_DIVIDER 1000
/**
* enum dpll_feature_state - Allow control (enable/disable) and status checking
@@ -218,6 +219,7 @@ enum dpll_a {
DPLL_A_CLOCK_QUALITY_LEVEL,
DPLL_A_PHASE_OFFSET_MONITOR,
DPLL_A_PHASE_OFFSET_AVG_FACTOR,
+ DPLL_A_FREQUENCY_MONITOR,
__DPLL_A_MAX,
DPLL_A_MAX = (__DPLL_A_MAX - 1)
@@ -254,6 +256,7 @@ enum dpll_a_pin {
DPLL_A_PIN_REFERENCE_SYNC,
DPLL_A_PIN_PHASE_ADJUST_GRAN,
DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT,
+ DPLL_A_PIN_MEASURED_FREQUENCY,
__DPLL_A_PIN_MAX,
DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)