Skip to content

Commit abbfd03

Browse files
committed
dpll: add reference-sync netlink attribute
JIRA: https://issues.redhat.com/browse/RHEL-126529 Upstream commit(s): commit 7f15ee3 Author: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Date: Thu Jun 26 15:52:17 2025 +0200 dpll: add reference-sync netlink attribute Add new netlink attribute to allow user space configuration of reference sync pin pairs, where both pins are used to provide one clock signal consisting of both: base frequency and sync signal. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Milena Olech <milena.olech@intel.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Link: https://patch.msgid.link/20250626135219.1769350-2-arkadiusz.kubalewski@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent 2331702 commit abbfd03

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

Documentation/driver-api/dpll.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,31 @@ the pin.
253253
``DPLL_A_PIN_ESYNC_PULSE`` pulse type of Embedded SYNC
254254
========================================= =================================
255255

256+
Reference SYNC
257+
==============
258+
259+
The device may support the Reference SYNC feature, which allows the combination
260+
of two inputs into a input pair. In this configuration, clock signals
261+
from both inputs are used to synchronize the DPLL device. The higher frequency
262+
signal is utilized for the loop bandwidth of the DPLL, while the lower frequency
263+
signal is used to syntonize the output signal of the DPLL device. This feature
264+
enables the provision of a high-quality loop bandwidth signal from an external
265+
source.
266+
267+
A capable input provides a list of inputs that can be bound with to create
268+
Reference SYNC. To control this feature, the user must request a desired
269+
state for a target pin: use ``DPLL_PIN_STATE_CONNECTED`` to enable or
270+
``DPLL_PIN_STATE_DISCONNECTED`` to disable the feature. An input pin can be
271+
bound to only one other pin at any given time.
272+
273+
============================== ==========================================
274+
``DPLL_A_PIN_REFERENCE_SYNC`` nested attribute for providing info or
275+
requesting configuration of the Reference
276+
SYNC feature
277+
``DPLL_A_PIN_ID`` target pin id for Reference SYNC feature
278+
``DPLL_A_PIN_STATE`` state of Reference SYNC connection
279+
============================== ==========================================
280+
256281
Configuration commands group
257282
============================
258283

Documentation/netlink/specs/dpll.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,15 @@ attribute-sets:
428428
doc: |
429429
A ratio of high to low state of a SYNC signal pulse embedded
430430
into base clock frequency. Value is in percents.
431+
-
432+
name: reference-sync
433+
type: nest
434+
multi-attr: true
435+
nested-attributes: reference-sync
436+
doc: |
437+
Capable pin provides list of pins that can be bound to create a
438+
reference-sync pin pair.
439+
431440
-
432441
name: pin-parent-device
433442
subset-of: pin
@@ -458,6 +467,14 @@ attribute-sets:
458467
name: frequency-min
459468
-
460469
name: frequency-max
470+
-
471+
name: reference-sync
472+
subset-of: pin
473+
attributes:
474+
-
475+
name: id
476+
-
477+
name: state
461478

462479
operations:
463480
enum-name: dpll_cmd
@@ -598,6 +615,7 @@ operations:
598615
- esync-frequency
599616
- esync-frequency-supported
600617
- esync-pulse
618+
- reference-sync
601619

602620
dump:
603621
request:
@@ -625,6 +643,7 @@ operations:
625643
- parent-pin
626644
- phase-adjust
627645
- esync-frequency
646+
- reference-sync
628647
-
629648
name: pin-create-ntf
630649
doc: Notification about pin appearing

drivers/dpll/dpll_nl.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const struct nla_policy dpll_pin_parent_pin_nl_policy[DPLL_A_PIN_STATE + 1] = {
2424
[DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3),
2525
};
2626

27+
const struct nla_policy dpll_reference_sync_nl_policy[DPLL_A_PIN_STATE + 1] = {
28+
[DPLL_A_PIN_ID] = { .type = NLA_U32, },
29+
[DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3),
30+
};
31+
2732
/* DPLL_CMD_DEVICE_ID_GET - do */
2833
static const struct nla_policy dpll_device_id_get_nl_policy[DPLL_A_TYPE + 1] = {
2934
[DPLL_A_MODULE_NAME] = { .type = NLA_NUL_STRING, },
@@ -63,7 +68,7 @@ static const struct nla_policy dpll_pin_get_dump_nl_policy[DPLL_A_PIN_ID + 1] =
6368
};
6469

6570
/* DPLL_CMD_PIN_SET - do */
66-
static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_ESYNC_FREQUENCY + 1] = {
71+
static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_REFERENCE_SYNC + 1] = {
6772
[DPLL_A_PIN_ID] = { .type = NLA_U32, },
6873
[DPLL_A_PIN_FREQUENCY] = { .type = NLA_U64, },
6974
[DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2),
@@ -73,6 +78,7 @@ static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_ESYNC_FREQUENCY
7378
[DPLL_A_PIN_PARENT_PIN] = NLA_POLICY_NESTED(dpll_pin_parent_pin_nl_policy),
7479
[DPLL_A_PIN_PHASE_ADJUST] = { .type = NLA_S32, },
7580
[DPLL_A_PIN_ESYNC_FREQUENCY] = { .type = NLA_U64, },
81+
[DPLL_A_PIN_REFERENCE_SYNC] = NLA_POLICY_NESTED(dpll_reference_sync_nl_policy),
7682
};
7783

7884
/* Ops table for dpll */
@@ -140,7 +146,7 @@ static const struct genl_split_ops dpll_nl_ops[] = {
140146
.doit = dpll_nl_pin_set_doit,
141147
.post_doit = dpll_pin_post_doit,
142148
.policy = dpll_pin_set_nl_policy,
143-
.maxattr = DPLL_A_PIN_ESYNC_FREQUENCY,
149+
.maxattr = DPLL_A_PIN_REFERENCE_SYNC,
144150
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
145151
},
146152
};

drivers/dpll/dpll_nl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/* Common nested types */
1515
extern const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_PHASE_OFFSET + 1];
1616
extern const struct nla_policy dpll_pin_parent_pin_nl_policy[DPLL_A_PIN_STATE + 1];
17+
extern const struct nla_policy dpll_reference_sync_nl_policy[DPLL_A_PIN_STATE + 1];
1718

1819
int dpll_lock_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
1920
struct genl_info *info);

include/uapi/linux/dpll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ enum dpll_a_pin {
249249
DPLL_A_PIN_ESYNC_FREQUENCY,
250250
DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED,
251251
DPLL_A_PIN_ESYNC_PULSE,
252+
DPLL_A_PIN_REFERENCE_SYNC,
252253

253254
__DPLL_A_PIN_MAX,
254255
DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)

0 commit comments

Comments
 (0)