Skip to content

Commit de9ccf2

Browse files
ivecerakuba-moo
authored andcommitted
devlink: Add new "clock_id" generic device param
Add a new device generic parameter to specify clock ID that should be used by the device for registering DPLL devices and pins. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20250704182202.1641943-5-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c0ef144 commit de9ccf2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Documentation/networking/devlink/devlink-params.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@ own name.
140140
* - ``enable_phc``
141141
- Boolean
142142
- Enable PHC (PTP Hardware Clock) functionality in the device.
143+
* - ``clock_id``
144+
- u64
145+
- Clock ID used by the device for registering DPLL devices and pins.

include/net/devlink.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ enum devlink_param_generic_id {
525525
DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE,
526526
DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE,
527527
DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC,
528+
DEVLINK_PARAM_GENERIC_ID_CLOCK_ID,
528529

529530
/* add new param generic ids above here*/
530531
__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -586,6 +587,9 @@ enum devlink_param_generic_id {
586587
#define DEVLINK_PARAM_GENERIC_ENABLE_PHC_NAME "enable_phc"
587588
#define DEVLINK_PARAM_GENERIC_ENABLE_PHC_TYPE DEVLINK_PARAM_TYPE_BOOL
588589

590+
#define DEVLINK_PARAM_GENERIC_CLOCK_ID_NAME "clock_id"
591+
#define DEVLINK_PARAM_GENERIC_CLOCK_ID_TYPE DEVLINK_PARAM_TYPE_U64
592+
589593
#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \
590594
{ \
591595
.id = DEVLINK_PARAM_GENERIC_ID_##_id, \

net/devlink/param.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ static const struct devlink_param devlink_param_generic[] = {
9797
.name = DEVLINK_PARAM_GENERIC_ENABLE_PHC_NAME,
9898
.type = DEVLINK_PARAM_GENERIC_ENABLE_PHC_TYPE,
9999
},
100+
{
101+
.id = DEVLINK_PARAM_GENERIC_ID_CLOCK_ID,
102+
.name = DEVLINK_PARAM_GENERIC_CLOCK_ID_NAME,
103+
.type = DEVLINK_PARAM_GENERIC_CLOCK_ID_TYPE,
104+
},
100105
};
101106

102107
static int devlink_param_generic_verify(const struct devlink_param *param)

0 commit comments

Comments
 (0)