diff --git a/home/nipa/nipa_out/953682/ynl/old-code/dpll-user.c b/home/nipa/nipa_out/953682/ynl/new-code/dpll-user.c index cdc58aad33e4..43a154386740 100644 --- a/home/nipa/nipa_out/953682/ynl/old-code/dpll-user.c +++ b/home/nipa/nipa_out/953682/ynl/new-code/dpll-user.c @@ -158,6 +158,18 @@ const char *dpll_pin_capabilities_str(enum dpll_pin_capabilities value) return dpll_pin_capabilities_strmap[value]; } +static const char * const dpll_features_strmap[] = { + [0] = "all-inputs-phase-offset-monitor", +}; + +const char *dpll_features_str(enum dpll_features value) +{ + value = ffs(value) - 1; + if (value < 0 || value >= (int)YNL_ARRAY_SIZE(dpll_features_strmap)) + return NULL; + return dpll_features_strmap[value]; +} + /* Policies */ const struct ynl_policy_attr dpll_frequency_range_policy[DPLL_A_PIN_MAX + 1] = { [DPLL_A_PIN_FREQUENCY_MIN] = { .name = "frequency-min", .type = YNL_PT_U64, }, @@ -204,6 +216,8 @@ const struct ynl_policy_attr dpll_policy[DPLL_A_MAX + 1] = { [DPLL_A_TYPE] = { .name = "type", .type = YNL_PT_U32, }, [DPLL_A_LOCK_STATUS_ERROR] = { .name = "lock-status-error", .type = YNL_PT_U32, }, [DPLL_A_CLOCK_QUALITY_LEVEL] = { .name = "clock-quality-level", .type = YNL_PT_U32, }, + [DPLL_A_CAPABILITIES] = { .name = "capabilities", .type = YNL_PT_U32, }, + [DPLL_A_FEATURES] = { .name = "features", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest dpll_nest = { @@ -533,6 +547,16 @@ int dpll_device_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.type = 1; dst->type = ynl_attr_get_u32(attr); + } else if (type == DPLL_A_CAPABILITIES) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.capabilities = 1; + dst->capabilities = ynl_attr_get_u32(attr); + } else if (type == DPLL_A_FEATURES) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.features = 1; + dst->features = ynl_attr_get_u32(attr); } } @@ -649,6 +673,8 @@ int dpll_device_set(struct ynl_sock *ys, struct dpll_device_set_req *req) if (req->_present.id) ynl_attr_put_u32(nlh, DPLL_A_ID, req->id); + if (req->_present.features) + ynl_attr_put_u32(nlh, DPLL_A_FEATURES, req->features); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/home/nipa/nipa_out/953682/ynl/old-code/dpll-user.h b/home/nipa/nipa_out/953682/ynl/new-code/dpll-user.h index e94cc10f41a4..8d617ad32a75 100644 --- a/home/nipa/nipa_out/953682/ynl/old-code/dpll-user.h +++ b/home/nipa/nipa_out/953682/ynl/new-code/dpll-user.h @@ -26,6 +26,7 @@ const char *dpll_pin_type_str(enum dpll_pin_type value); const char *dpll_pin_direction_str(enum dpll_pin_direction value); const char *dpll_pin_state_str(enum dpll_pin_state value); const char *dpll_pin_capabilities_str(enum dpll_pin_capabilities value); +const char *dpll_features_str(enum dpll_features value); /* Common nested types */ struct dpll_frequency_range { @@ -159,6 +160,8 @@ struct dpll_device_get_rsp { __u32 temp:1; __u32 clock_id:1; __u32 type:1; + __u32 capabilities:1; + __u32 features:1; } _present; __u32 id; @@ -171,6 +174,8 @@ struct dpll_device_get_rsp { __s32 temp; __u64 clock_id; enum dpll_type type; + __u32 capabilities; + __u32 features; }; void dpll_device_get_rsp_free(struct dpll_device_get_rsp *rsp); @@ -208,9 +213,11 @@ void dpll_device_get_ntf_free(struct dpll_device_get_ntf *rsp); struct dpll_device_set_req { struct { __u32 id:1; + __u32 features:1; } _present; __u32 id; + __u32 features; }; static inline struct dpll_device_set_req *dpll_device_set_req_alloc(void) @@ -225,6 +232,13 @@ dpll_device_set_req_set_id(struct dpll_device_set_req *req, __u32 id) req->_present.id = 1; req->id = id; } +static inline void +dpll_device_set_req_set_features(struct dpll_device_set_req *req, + __u32 features) +{ + req->_present.features = 1; + req->features = features; +} /* * Set attributes for a DPLL device