Lines Matching full:dpll
3 * Generic netlink for DPLL management framework
16 #include <uapi/linux/dpll.h>
34 dpll_msg_add_dev_handle(struct sk_buff *msg, struct dpll_device *dpll) in dpll_msg_add_dev_handle() argument
36 if (nla_put_u32(msg, DPLL_A_ID, dpll->id)) in dpll_msg_add_dev_handle()
92 dpll_msg_add_mode(struct sk_buff *msg, struct dpll_device *dpll, in dpll_msg_add_mode() argument
95 const struct dpll_device_ops *ops = dpll_device_ops(dpll); in dpll_msg_add_mode()
99 ret = ops->mode_get(dpll, dpll_priv(dpll), &mode, extack); in dpll_msg_add_mode()
109 dpll_msg_add_mode_supported(struct sk_buff *msg, struct dpll_device *dpll, in dpll_msg_add_mode_supported() argument
112 const struct dpll_device_ops *ops = dpll_device_ops(dpll); in dpll_msg_add_mode_supported()
120 ret = ops->mode_get(dpll, dpll_priv(dpll), &mode, extack); in dpll_msg_add_mode_supported()
130 dpll_msg_add_lock_status(struct sk_buff *msg, struct dpll_device *dpll, in dpll_msg_add_lock_status() argument
133 const struct dpll_device_ops *ops = dpll_device_ops(dpll); in dpll_msg_add_lock_status()
138 ret = ops->lock_status_get(dpll, dpll_priv(dpll), &status, in dpll_msg_add_lock_status()
154 dpll_msg_add_temp(struct sk_buff *msg, struct dpll_device *dpll, in dpll_msg_add_temp() argument
157 const struct dpll_device_ops *ops = dpll_device_ops(dpll); in dpll_msg_add_temp()
163 ret = ops->temp_get(dpll, dpll_priv(dpll), &temp, extack); in dpll_msg_add_temp()
178 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_prio() local
184 ret = ops->prio_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_msg_add_pin_prio()
185 dpll_priv(dpll), &prio, extack); in dpll_msg_add_pin_prio()
200 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_on_dpll_state() local
206 ret = ops->state_on_dpll_get(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_msg_add_pin_on_dpll_state()
207 dpll, dpll_priv(dpll), &state, extack); in dpll_msg_add_pin_on_dpll_state()
222 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_direction() local
226 ret = ops->direction_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_msg_add_pin_direction()
227 dpll_priv(dpll), &direction, extack); in dpll_msg_add_pin_direction()
242 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_phase_adjust() local
248 ret = ops->phase_adjust_get(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_msg_add_pin_phase_adjust()
249 dpll, dpll_priv(dpll), in dpll_msg_add_pin_phase_adjust()
265 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_phase_offset() local
271 ret = ops->phase_offset_get(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_msg_add_phase_offset()
272 dpll, dpll_priv(dpll), &phase_offset, in dpll_msg_add_phase_offset()
288 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_ffo() local
294 ret = ops->ffo_get(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_msg_add_ffo()
295 dpll, dpll_priv(dpll), &ffo, extack); in dpll_msg_add_ffo()
309 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_freq() local
316 ret = ops->frequency_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_msg_add_pin_freq()
317 dpll_priv(dpll), &freq, extack); in dpll_msg_add_pin_freq()
350 struct dpll_device *dpll = ref->dpll; in dpll_msg_add_pin_esync() local
357 ret = ops->esync_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_msg_add_pin_esync()
358 dpll_priv(dpll), &esync, extack); in dpll_msg_add_pin_esync()
418 parent_priv = dpll_pin_on_dpll_priv(dpll_ref->dpll, ppin); in dpll_msg_add_pin_parents()
457 ret = dpll_msg_add_dev_parent_handle(msg, ref->dpll->id); in dpll_msg_add_pin_dplls()
543 dpll_device_get_one(struct dpll_device *dpll, struct sk_buff *msg, in dpll_device_get_one() argument
548 ret = dpll_msg_add_dev_handle(msg, dpll); in dpll_device_get_one()
551 if (nla_put_string(msg, DPLL_A_MODULE_NAME, module_name(dpll->module))) in dpll_device_get_one()
553 if (nla_put_64bit(msg, DPLL_A_CLOCK_ID, sizeof(dpll->clock_id), in dpll_device_get_one()
554 &dpll->clock_id, DPLL_A_PAD)) in dpll_device_get_one()
556 ret = dpll_msg_add_temp(msg, dpll, extack); in dpll_device_get_one()
559 ret = dpll_msg_add_lock_status(msg, dpll, extack); in dpll_device_get_one()
562 ret = dpll_msg_add_mode(msg, dpll, extack); in dpll_device_get_one()
565 ret = dpll_msg_add_mode_supported(msg, dpll, extack); in dpll_device_get_one()
568 if (nla_put_u32(msg, DPLL_A_TYPE, dpll->type)) in dpll_device_get_one()
575 dpll_device_event_send(enum dpll_cmd event, struct dpll_device *dpll) in dpll_device_event_send() argument
581 if (WARN_ON(!xa_get_mark(&dpll_device_xa, dpll->id, DPLL_REGISTERED))) in dpll_device_event_send()
589 ret = dpll_device_get_one(dpll, msg, NULL); in dpll_device_event_send()
605 int dpll_device_create_ntf(struct dpll_device *dpll) in dpll_device_create_ntf() argument
607 return dpll_device_event_send(DPLL_CMD_DEVICE_CREATE_NTF, dpll); in dpll_device_create_ntf()
610 int dpll_device_delete_ntf(struct dpll_device *dpll) in dpll_device_delete_ntf() argument
612 return dpll_device_event_send(DPLL_CMD_DEVICE_DELETE_NTF, dpll); in dpll_device_delete_ntf()
616 __dpll_device_change_ntf(struct dpll_device *dpll) in __dpll_device_change_ntf() argument
618 return dpll_device_event_send(DPLL_CMD_DEVICE_CHANGE_NTF, dpll); in __dpll_device_change_ntf()
633 if (xa_get_mark(&dpll_device_xa, par_ref->dpll->id, in dpll_pin_available()
640 * dpll_device_change_ntf - notify that the dpll device has been changed
641 * @dpll: registered dpll pointer
646 int dpll_device_change_ntf(struct dpll_device *dpll) in dpll_device_change_ntf() argument
651 ret = __dpll_device_change_ntf(dpll); in dpll_device_change_ntf()
732 struct dpll_device *dpll; in dpll_pin_freq_set() local
750 dpll = ref->dpll; in dpll_pin_freq_set()
751 ret = ops->frequency_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_pin_freq_set()
752 dpll_priv(dpll), &old_freq, extack); in dpll_pin_freq_set()
762 dpll = ref->dpll; in dpll_pin_freq_set()
763 ret = ops->frequency_set(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_freq_set()
764 dpll, dpll_priv(dpll), freq, extack); in dpll_pin_freq_set()
768 dpll->id); in dpll_pin_freq_set()
781 dpll = ref->dpll; in dpll_pin_freq_set()
782 if (ops->frequency_set(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_freq_set()
783 dpll, dpll_priv(dpll), old_freq, extack)) in dpll_pin_freq_set()
797 struct dpll_device *dpll; in dpll_pin_esync_set() local
812 dpll = ref->dpll; in dpll_pin_esync_set()
813 ret = ops->esync_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_pin_esync_set()
814 dpll_priv(dpll), &esync, extack); in dpll_pin_esync_set()
834 dpll = ref->dpll; in dpll_pin_esync_set()
835 pin_dpll_priv = dpll_pin_on_dpll_priv(dpll, pin); in dpll_pin_esync_set()
836 ret = ops->esync_set(pin, pin_dpll_priv, dpll, dpll_priv(dpll), in dpll_pin_esync_set()
842 dpll->id); in dpll_pin_esync_set()
857 dpll = ref->dpll; in dpll_pin_esync_set()
858 pin_dpll_priv = dpll_pin_on_dpll_priv(dpll, pin); in dpll_pin_esync_set()
859 if (ops->esync_set(pin, pin_dpll_priv, dpll, dpll_priv(dpll), in dpll_pin_esync_set()
895 parent_priv = dpll_pin_on_dpll_priv(dpll_ref->dpll, parent); in dpll_pin_on_pin_state_set()
907 dpll_pin_state_set(struct dpll_device *dpll, struct dpll_pin *pin, in dpll_pin_state_set() argument
920 ref = xa_load(&pin->dpll_refs, dpll->id); in dpll_pin_state_set()
925 ret = ops->state_on_dpll_set(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_state_set()
926 dpll, dpll_priv(dpll), state, extack); in dpll_pin_state_set()
935 dpll_pin_prio_set(struct dpll_device *dpll, struct dpll_pin *pin, in dpll_pin_prio_set() argument
947 ref = xa_load(&pin->dpll_refs, dpll->id); in dpll_pin_prio_set()
952 ret = ops->prio_set(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll, in dpll_pin_prio_set()
953 dpll_priv(dpll), prio, extack); in dpll_pin_prio_set()
962 dpll_pin_direction_set(struct dpll_pin *pin, struct dpll_device *dpll, in dpll_pin_direction_set() argument
975 ref = xa_load(&pin->dpll_refs, dpll->id); in dpll_pin_direction_set()
980 ret = ops->direction_set(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_direction_set()
981 dpll, dpll_priv(dpll), direction, extack); in dpll_pin_direction_set()
996 struct dpll_device *dpll; in dpll_pin_phase_adj_set() local
1017 dpll = ref->dpll; in dpll_pin_phase_adj_set()
1018 ret = ops->phase_adjust_get(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_phase_adj_set()
1019 dpll, dpll_priv(dpll), &old_phase_adj, in dpll_pin_phase_adj_set()
1030 dpll = ref->dpll; in dpll_pin_phase_adj_set()
1032 dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_phase_adj_set()
1033 dpll, dpll_priv(dpll), phase_adj, in dpll_pin_phase_adj_set()
1039 dpll->id); in dpll_pin_phase_adj_set()
1052 dpll = ref->dpll; in dpll_pin_phase_adj_set()
1053 if (ops->phase_adjust_set(pin, dpll_pin_on_dpll_priv(dpll, pin), in dpll_pin_phase_adj_set()
1054 dpll, dpll_priv(dpll), old_phase_adj, in dpll_pin_phase_adj_set()
1069 struct dpll_device *dpll; in dpll_pin_parent_device_set() local
1080 dpll = xa_load(&dpll_device_xa, pdpll_idx); in dpll_pin_parent_device_set()
1081 if (!dpll) { in dpll_pin_parent_device_set()
1085 ref = xa_load(&pin->dpll_refs, dpll->id); in dpll_pin_parent_device_set()
1092 ret = dpll_pin_state_set(dpll, pin, state, extack); in dpll_pin_parent_device_set()
1098 ret = dpll_pin_prio_set(dpll, pin, prio, extack); in dpll_pin_parent_device_set()
1104 ret = dpll_pin_direction_set(pin, dpll, direction, extack); in dpll_pin_parent_device_set()
1389 struct dpll_device *dpll_match = NULL, *dpll; in dpll_device_find() local
1393 xa_for_each_marked(&dpll_device_xa, i, dpll, DPLL_REGISTERED) { in dpll_device_find()
1394 cid_match = clock_id ? dpll->clock_id == clock_id : true; in dpll_device_find()
1395 mod_match = mod_name_attr ? (module_name(dpll->module) ? in dpll_device_find()
1397 module_name(dpll->module)) : false) : true; in dpll_device_find()
1398 type_match = type ? dpll->type == type : true; in dpll_device_find()
1404 dpll_match = dpll; in dpll_device_find()
1457 struct dpll_device *dpll; in dpll_nl_device_id_get_doit() local
1472 dpll = dpll_device_find_from_nlattr(info); in dpll_nl_device_id_get_doit()
1473 if (!IS_ERR(dpll)) { in dpll_nl_device_id_get_doit()
1474 ret = dpll_msg_add_dev_handle(msg, dpll); in dpll_nl_device_id_get_doit()
1487 struct dpll_device *dpll = info->user_ptr[0]; in dpll_nl_device_get_doit() local
1502 ret = dpll_device_get_one(dpll, msg, info->extack); in dpll_nl_device_get_doit()
1521 struct dpll_device *dpll; in dpll_nl_device_get_dumpit() local
1527 xa_for_each_marked_start(&dpll_device_xa, i, dpll, DPLL_REGISTERED, in dpll_nl_device_get_dumpit()
1536 ret = dpll_device_get_one(dpll, skb, cb->extack); in dpll_nl_device_get_dumpit()