@@ -246,6 +246,9 @@ static std::array<ynl_policy_attr,DPLL_A_PIN_MAX + 1> dpll_pin_policy = []() {
246246 arr[DPLL_A_PIN_PHASE_ADJUST] = { .name = " phase-adjust" , .type = YNL_PT_U32, };
247247 arr[DPLL_A_PIN_PHASE_OFFSET] = { .name = " phase-offset" , .type = YNL_PT_U64, };
248248 arr[DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET] = { .name = " fractional-frequency-offset" , .type = YNL_PT_UINT, };
249+ arr[DPLL_A_PIN_ESYNC_FREQUENCY] = { .name = " esync-frequency" , .type = YNL_PT_U64, };
250+ arr[DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED] = { .name = " esync-frequency-supported" , .type = YNL_PT_NEST, .nest = &dpll_frequency_range_nest, };
251+ arr[DPLL_A_PIN_ESYNC_PULSE] = { .name = " esync-pulse" , .type = YNL_PT_U32, };
249252 return arr;
250253} ();
251254
@@ -634,6 +637,7 @@ dpll_pin_id_get(ynl_cpp::ynl_socket& ys, dpll_pin_id_get_req& req)
634637int dpll_pin_get_rsp_parse (const struct nlmsghdr *nlh,
635638 struct ynl_parse_arg *yarg)
636639{
640+ unsigned int n_esync_frequency_supported = 0 ;
637641 unsigned int n_frequency_supported = 0 ;
638642 unsigned int n_parent_device = 0 ;
639643 unsigned int n_parent_pin = 0 ;
@@ -645,6 +649,8 @@ int dpll_pin_get_rsp_parse(const struct nlmsghdr *nlh,
645649 dst = (dpll_pin_get_rsp*)yarg->data ;
646650 parg.ys = yarg->ys ;
647651
652+ if (dst->esync_frequency_supported .size () > 0 )
653+ return ynl_error_parse (yarg, " attribute already present (pin.esync-frequency-supported)" );
648654 if (dst->frequency_supported .size () > 0 )
649655 return ynl_error_parse (yarg, " attribute already present (pin.frequency-supported)" );
650656 if (dst->parent_device .size () > 0 )
@@ -705,9 +711,32 @@ int dpll_pin_get_rsp_parse(const struct nlmsghdr *nlh,
705711 if (ynl_attr_validate (yarg, attr))
706712 return YNL_PARSE_CB_ERROR;
707713 dst->fractional_frequency_offset = (__s64)ynl_attr_get_sint (attr);
714+ } else if (type == DPLL_A_PIN_ESYNC_FREQUENCY) {
715+ if (ynl_attr_validate (yarg, attr))
716+ return YNL_PARSE_CB_ERROR;
717+ dst->esync_frequency = (__u64)ynl_attr_get_u64 (attr);
718+ } else if (type == DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED) {
719+ n_esync_frequency_supported++;
720+ } else if (type == DPLL_A_PIN_ESYNC_PULSE) {
721+ if (ynl_attr_validate (yarg, attr))
722+ return YNL_PARSE_CB_ERROR;
723+ dst->esync_pulse = (__u32)ynl_attr_get_u32 (attr);
708724 }
709725 }
710726
727+ if (n_esync_frequency_supported) {
728+ dst->esync_frequency_supported .resize (n_esync_frequency_supported);
729+ i = 0 ;
730+ parg.rsp_policy = &dpll_frequency_range_nest;
731+ ynl_attr_for_each (attr, nlh, yarg->ys ->family ->hdr_len ) {
732+ if (ynl_attr_type (attr) == DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED) {
733+ parg.data = &dst->esync_frequency_supported [i];
734+ if (dpll_frequency_range_parse (&parg, attr))
735+ return YNL_PARSE_CB_ERROR;
736+ i++;
737+ }
738+ }
739+ }
711740 if (n_frequency_supported) {
712741 dst->frequency_supported .resize (n_frequency_supported);
713742 i = 0 ;
@@ -835,6 +864,8 @@ int dpll_pin_set(ynl_cpp::ynl_socket& ys, dpll_pin_set_req& req)
835864 dpll_pin_parent_pin_put (nlh, DPLL_A_PIN_PARENT_PIN, req.parent_pin [i]);
836865 if (req.phase_adjust .has_value ())
837866 ynl_attr_put_s32 (nlh, DPLL_A_PIN_PHASE_ADJUST, req.phase_adjust .value ());
867+ if (req.esync_frequency .has_value ())
868+ ynl_attr_put_u64 (nlh, DPLL_A_PIN_ESYNC_FREQUENCY, req.esync_frequency .value ());
838869
839870 err = ynl_exec (ys, nlh, &yrs);
840871 if (err < 0 )
0 commit comments