Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arkadiusz Kubalewski and committed by
Jakub Kicinski
7f15ee35 8c72b2a2

+54 -2
+25
Documentation/driver-api/dpll.rst
··· 253 253 ``DPLL_A_PIN_ESYNC_PULSE`` pulse type of Embedded SYNC 254 254 ========================================= ================================= 255 255 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 + 256 281 Configuration commands group 257 282 ============================ 258 283
+19
Documentation/netlink/specs/dpll.yaml
··· 428 428 doc: | 429 429 A ratio of high to low state of a SYNC signal pulse embedded 430 430 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 + 431 440 - 432 441 name: pin-parent-device 433 442 subset-of: pin ··· 467 458 name: frequency-min 468 459 - 469 460 name: frequency-max 461 + - 462 + name: reference-sync 463 + subset-of: pin 464 + attributes: 465 + - 466 + name: id 467 + - 468 + name: state 470 469 471 470 operations: 472 471 enum-name: dpll_cmd ··· 615 598 - esync-frequency 616 599 - esync-frequency-supported 617 600 - esync-pulse 601 + - reference-sync 618 602 619 603 dump: 620 604 request: ··· 643 625 - parent-pin 644 626 - phase-adjust 645 627 - esync-frequency 628 + - reference-sync 646 629 - 647 630 name: pin-create-ntf 648 631 doc: Notification about pin appearing
+8 -2
drivers/dpll/dpll_nl.c
··· 24 24 [DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3), 25 25 }; 26 26 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 + 27 32 /* DPLL_CMD_DEVICE_ID_GET - do */ 28 33 static const struct nla_policy dpll_device_id_get_nl_policy[DPLL_A_TYPE + 1] = { 29 34 [DPLL_A_MODULE_NAME] = { .type = NLA_NUL_STRING, }, ··· 68 63 }; 69 64 70 65 /* DPLL_CMD_PIN_SET - do */ 71 - static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_ESYNC_FREQUENCY + 1] = { 66 + static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_REFERENCE_SYNC + 1] = { 72 67 [DPLL_A_PIN_ID] = { .type = NLA_U32, }, 73 68 [DPLL_A_PIN_FREQUENCY] = { .type = NLA_U64, }, 74 69 [DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2), ··· 78 73 [DPLL_A_PIN_PARENT_PIN] = NLA_POLICY_NESTED(dpll_pin_parent_pin_nl_policy), 79 74 [DPLL_A_PIN_PHASE_ADJUST] = { .type = NLA_S32, }, 80 75 [DPLL_A_PIN_ESYNC_FREQUENCY] = { .type = NLA_U64, }, 76 + [DPLL_A_PIN_REFERENCE_SYNC] = NLA_POLICY_NESTED(dpll_reference_sync_nl_policy), 81 77 }; 82 78 83 79 /* Ops table for dpll */ ··· 146 140 .doit = dpll_nl_pin_set_doit, 147 141 .post_doit = dpll_pin_post_doit, 148 142 .policy = dpll_pin_set_nl_policy, 149 - .maxattr = DPLL_A_PIN_ESYNC_FREQUENCY, 143 + .maxattr = DPLL_A_PIN_REFERENCE_SYNC, 150 144 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 151 145 }, 152 146 };
+1
drivers/dpll/dpll_nl.h
··· 14 14 /* Common nested types */ 15 15 extern const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_PHASE_OFFSET + 1]; 16 16 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]; 17 18 18 19 int dpll_lock_doit(const struct genl_split_ops *ops, struct sk_buff *skb, 19 20 struct genl_info *info);
+1
include/uapi/linux/dpll.h
··· 249 249 DPLL_A_PIN_ESYNC_FREQUENCY, 250 250 DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED, 251 251 DPLL_A_PIN_ESYNC_PULSE, 252 + DPLL_A_PIN_REFERENCE_SYNC, 252 253 253 254 __DPLL_A_PIN_MAX, 254 255 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)