Lines Matching full:pin

16  * enum ice_dpll_pin_type - enumerate ice pin types:
17 * @ICE_DPLL_PIN_INVALID: invalid pin type
18 * @ICE_DPLL_PIN_TYPE_INPUT: input pin
19 * @ICE_DPLL_PIN_TYPE_OUTPUT: output pin
20 * @ICE_DPLL_PIN_TYPE_RCLK_INPUT: recovery clock input pin
60 * ice_dpll_pin_freq_set - set pin's frequency
62 * @pin: pointer to a pin
63 * @pin_type: type of pin being configured
67 * Set requested frequency on a pin.
72 * * negative - error on AQ or wrong pin type given
75 ice_dpll_pin_freq_set(struct ice_pf *pf, struct ice_dpll_pin *pin, in ice_dpll_pin_freq_set() argument
85 ret = ice_aq_set_input_pin_cfg(&pf->hw, pin->idx, flags, in ice_dpll_pin_freq_set()
86 pin->flags[0], freq, 0); in ice_dpll_pin_freq_set()
90 ret = ice_aq_set_output_pin_cfg(&pf->hw, pin->idx, flags, in ice_dpll_pin_freq_set()
98 "err:%d %s failed to set pin freq:%u on pin:%u\n", in ice_dpll_pin_freq_set()
101 freq, pin->idx); in ice_dpll_pin_freq_set()
104 pin->freq = freq; in ice_dpll_pin_freq_set()
110 * ice_dpll_frequency_set - wrapper for pin callback for set frequency
111 * @pin: pointer to a pin
112 * @pin_priv: private data pointer passed on pin registration
117 * @pin_type: type of pin being configured
119 * Wraps internal set frequency command on a pin.
124 * * negative - error pin not found or couldn't set in hw
127 ice_dpll_frequency_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_frequency_set() argument
149 * ice_dpll_input_frequency_set - input pin callback for set frequency
150 * @pin: pointer to a pin
151 * @pin_priv: private data pointer passed on pin registration
157 * Wraps internal set frequency command on a pin.
162 * * negative - error pin not found or couldn't set in hw
165 ice_dpll_input_frequency_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_frequency_set() argument
169 return ice_dpll_frequency_set(pin, pin_priv, dpll, dpll_priv, frequency, in ice_dpll_input_frequency_set()
174 * ice_dpll_output_frequency_set - output pin callback for set frequency
175 * @pin: pointer to a pin
176 * @pin_priv: private data pointer passed on pin registration
182 * Wraps internal set frequency command on a pin.
187 * * negative - error pin not found or couldn't set in hw
190 ice_dpll_output_frequency_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_frequency_set() argument
194 return ice_dpll_frequency_set(pin, pin_priv, dpll, dpll_priv, frequency, in ice_dpll_output_frequency_set()
199 * ice_dpll_frequency_get - wrapper for pin callback for get frequency
200 * @pin: pointer to a pin
201 * @pin_priv: private data pointer passed on pin registration
204 * @frequency: on success holds pin's frequency
206 * @pin_type: type of pin being configured
208 * Wraps internal get frequency command of a pin.
213 * * negative - error pin not found or couldn't get from hw
216 ice_dpll_frequency_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_frequency_get() argument
233 * ice_dpll_input_frequency_get - input pin callback for get frequency
234 * @pin: pointer to a pin
235 * @pin_priv: private data pointer passed on pin registration
238 * @frequency: on success holds pin's frequency
241 * Wraps internal get frequency command of a input pin.
246 * * negative - error pin not found or couldn't get from hw
249 ice_dpll_input_frequency_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_frequency_get() argument
253 return ice_dpll_frequency_get(pin, pin_priv, dpll, dpll_priv, frequency, in ice_dpll_input_frequency_get()
258 * ice_dpll_output_frequency_get - output pin callback for get frequency
259 * @pin: pointer to a pin
260 * @pin_priv: private data pointer passed on pin registration
263 * @frequency: on success holds pin's frequency
266 * Wraps internal get frequency command of a pin.
271 * * negative - error pin not found or couldn't get from hw
274 ice_dpll_output_frequency_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_frequency_get() argument
278 return ice_dpll_frequency_get(pin, pin_priv, dpll, dpll_priv, frequency, in ice_dpll_output_frequency_get()
283 * ice_dpll_pin_enable - enable a pin on dplls
285 * @pin: pointer to a pin
286 * @dpll_idx: dpll index to connect to output pin
287 * @pin_type: type of pin being enabled
290 * Enable a pin on both dplls. Store current state in pin->flags.
298 ice_dpll_pin_enable(struct ice_hw *hw, struct ice_dpll_pin *pin, in ice_dpll_pin_enable() argument
307 if (pin->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN) in ice_dpll_pin_enable()
310 ret = ice_aq_set_input_pin_cfg(hw, pin->idx, 0, flags, 0, 0); in ice_dpll_pin_enable()
314 if (pin->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN) in ice_dpll_pin_enable()
317 ret = ice_aq_set_output_pin_cfg(hw, pin->idx, flags, dpll_idx, in ice_dpll_pin_enable()
325 "err:%d %s failed to enable %s pin:%u\n", in ice_dpll_pin_enable()
327 pin_type_name[pin_type], pin->idx); in ice_dpll_pin_enable()
333 * ice_dpll_pin_disable - disable a pin on dplls
335 * @pin: pointer to a pin
336 * @pin_type: type of pin being disabled
339 * Disable a pin on both dplls. Store current state in pin->flags.
347 ice_dpll_pin_disable(struct ice_hw *hw, struct ice_dpll_pin *pin, in ice_dpll_pin_disable() argument
356 if (pin->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN) in ice_dpll_pin_disable()
358 ret = ice_aq_set_input_pin_cfg(hw, pin->idx, 0, flags, 0, 0); in ice_dpll_pin_disable()
361 if (pin->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN) in ice_dpll_pin_disable()
363 ret = ice_aq_set_output_pin_cfg(hw, pin->idx, flags, 0, 0, 0); in ice_dpll_pin_disable()
370 "err:%d %s failed to disable %s pin:%u\n", in ice_dpll_pin_disable()
372 pin_type_name[pin_type], pin->idx); in ice_dpll_pin_disable()
378 * ice_dpll_pin_state_update - update pin's state
380 * @pin: structure with pin attributes to be updated
381 * @pin_type: type of pin being updated
384 * Determine pin current state and frequency, then update struct
385 * holding the pin info. For input pin states are separated for each
394 ice_dpll_pin_state_update(struct ice_pf *pf, struct ice_dpll_pin *pin, in ice_dpll_pin_state_update() argument
403 ret = ice_aq_get_input_pin_cfg(&pf->hw, pin->idx, &pin->status, in ice_dpll_pin_state_update()
404 NULL, NULL, &pin->flags[0], in ice_dpll_pin_state_update()
405 &pin->freq, &pin->phase_adjust); in ice_dpll_pin_state_update()
408 if (ICE_AQC_GET_CGU_IN_CFG_FLG2_INPUT_EN & pin->flags[0]) { in ice_dpll_pin_state_update()
409 if (pin->pin) { in ice_dpll_pin_state_update()
410 pin->state[pf->dplls.eec.dpll_idx] = in ice_dpll_pin_state_update()
411 pin->pin == pf->dplls.eec.active_input ? in ice_dpll_pin_state_update()
414 pin->state[pf->dplls.pps.dpll_idx] = in ice_dpll_pin_state_update()
415 pin->pin == pf->dplls.pps.active_input ? in ice_dpll_pin_state_update()
419 pin->state[pf->dplls.eec.dpll_idx] = in ice_dpll_pin_state_update()
421 pin->state[pf->dplls.pps.dpll_idx] = in ice_dpll_pin_state_update()
425 pin->state[pf->dplls.eec.dpll_idx] = in ice_dpll_pin_state_update()
427 pin->state[pf->dplls.pps.dpll_idx] = in ice_dpll_pin_state_update()
432 ret = ice_aq_get_output_pin_cfg(&pf->hw, pin->idx, in ice_dpll_pin_state_update()
433 &pin->flags[0], &parent, in ice_dpll_pin_state_update()
434 &pin->freq, NULL); in ice_dpll_pin_state_update()
439 if (ICE_AQC_GET_CGU_OUT_CFG_OUT_EN & pin->flags[0]) { in ice_dpll_pin_state_update()
440 pin->state[pf->dplls.eec.dpll_idx] = in ice_dpll_pin_state_update()
444 pin->state[pf->dplls.pps.dpll_idx] = in ice_dpll_pin_state_update()
449 pin->state[pf->dplls.eec.dpll_idx] = in ice_dpll_pin_state_update()
451 pin->state[pf->dplls.pps.dpll_idx] = in ice_dpll_pin_state_update()
462 &pin->flags[parent], in ice_dpll_pin_state_update()
467 pin->flags[parent]) in ice_dpll_pin_state_update()
468 pin->state[parent] = DPLL_PIN_STATE_CONNECTED; in ice_dpll_pin_state_update()
470 pin->state[parent] = in ice_dpll_pin_state_update()
482 "err:%d %s failed to update %s pin:%u\n", in ice_dpll_pin_state_update()
485 pin_type_name[pin_type], pin->idx); in ice_dpll_pin_state_update()
488 "err:%d %s failed to update %s pin:%u\n", in ice_dpll_pin_state_update()
491 pin_type_name[pin_type], pin->idx); in ice_dpll_pin_state_update()
499 * @pin: ice pin pointer
512 struct ice_dpll_pin *pin, const u32 prio, in ice_dpll_hw_input_prio_set() argument
517 ret = ice_aq_set_cgu_ref_prio(&pf->hw, dpll->dpll_idx, pin->idx, in ice_dpll_hw_input_prio_set()
521 "err:%d %s failed to set pin prio:%u on pin:%u\n", in ice_dpll_hw_input_prio_set()
524 prio, pin->idx); in ice_dpll_hw_input_prio_set()
526 dpll->input_prio[pin->idx] = prio; in ice_dpll_hw_input_prio_set()
591 * ice_dpll_pin_state_set - set pin's state on dpll
592 * @pin: pointer to a pin
593 * @pin_priv: private data pointer passed on pin registration
596 * @enable: if pin shalll be enabled
598 * @pin_type: type of a pin
600 * Set pin state on a pin.
608 ice_dpll_pin_state_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_pin_state_set() argument
635 * ice_dpll_output_state_set - enable/disable output pin on dpll device
636 * @pin: pointer to a pin
637 * @pin_priv: private data pointer passed on pin registration
640 * @state: state of pin to be set
643 * Dpll subsystem callback. Set given state on output type pin.
651 ice_dpll_output_state_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_state_set() argument
665 return ice_dpll_pin_state_set(pin, pin_priv, dpll, dpll_priv, enable, in ice_dpll_output_state_set()
670 * ice_dpll_input_state_set - enable/disable input pin on dpll levice
671 * @pin: pointer to a pin
672 * @pin_priv: private data pointer passed on pin registration
675 * @state: state of pin to be set
678 * Dpll subsystem callback. Enables given mode on input type pin.
686 ice_dpll_input_state_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_state_set() argument
693 return ice_dpll_pin_state_set(pin, pin_priv, dpll, dpll_priv, enable, in ice_dpll_input_state_set()
698 * ice_dpll_pin_state_get - set pin's state on dpll
699 * @pin: pointer to a pin
700 * @pin_priv: private data pointer passed on pin registration
703 * @state: on success holds state of the pin
705 * @pin_type: type of questioned pin
707 * Determine pin state set it on a pin.
715 ice_dpll_pin_state_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_pin_state_get() argument
744 * ice_dpll_output_state_get - get output pin state on dpll device
745 * @pin: pointer to a pin
746 * @pin_priv: private data pointer passed on pin registration
749 * @state: on success holds state of the pin
752 * Dpll subsystem callback. Check state of a pin.
760 ice_dpll_output_state_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_state_get() argument
765 return ice_dpll_pin_state_get(pin, pin_priv, dpll, dpll_priv, state, in ice_dpll_output_state_get()
770 * ice_dpll_input_state_get - get input pin state on dpll device
771 * @pin: pointer to a pin
772 * @pin_priv: private data pointer passed on pin registration
775 * @state: on success holds state of the pin
778 * Dpll subsystem callback. Check state of a input pin.
786 ice_dpll_input_state_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_state_get() argument
791 return ice_dpll_pin_state_get(pin, pin_priv, dpll, dpll_priv, state, in ice_dpll_input_state_get()
797 * @pin: pointer to a pin
798 * @pin_priv: private data pointer passed on pin registration
804 * Dpll subsystem callback. Handler for getting priority of a input pin.
812 ice_dpll_input_prio_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_prio_get() argument
829 * @pin: pointer to a pin
830 * @pin_priv: private data pointer passed on pin registration
836 * Dpll subsystem callback. Handler for setting priority of a input pin.
844 ice_dpll_input_prio_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_prio_set() argument
864 * ice_dpll_input_direction - callback for get input pin direction
865 * @pin: pointer to a pin
866 * @pin_priv: private data pointer passed on pin registration
869 * @direction: holds input pin direction
872 * Dpll subsystem callback. Handler for getting direction of a input pin.
878 ice_dpll_input_direction(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_direction() argument
889 * ice_dpll_output_direction - callback for get output pin direction
890 * @pin: pointer to a pin
891 * @pin_priv: private data pointer passed on pin registration
894 * @direction: holds output pin direction
897 * Dpll subsystem callback. Handler for getting direction of an output pin.
903 ice_dpll_output_direction(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_direction() argument
914 * ice_dpll_pin_phase_adjust_get - callback for get pin phase adjust value
915 * @pin: pointer to a pin
916 * @pin_priv: private data pointer passed on pin registration
919 * @phase_adjust: on success holds pin phase_adjust value
922 * Dpll subsystem callback. Handler for getting phase adjust value of a pin.
930 ice_dpll_pin_phase_adjust_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_pin_phase_adjust_get() argument
946 * ice_dpll_pin_phase_adjust_set - helper for setting a pin phase adjust value
947 * @pin: pointer to a pin
948 * @pin_priv: private data pointer passed on pin registration
953 * @type: type of a pin
956 * of a pin.
964 ice_dpll_pin_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_pin_phase_adjust_set() argument
1007 "err:%d %s failed to set pin phase_adjust:%d for pin:%u on dpll:%u\n", in ice_dpll_pin_phase_adjust_set()
1016 * ice_dpll_input_phase_adjust_set - callback for set input pin phase adjust
1017 * @pin: pointer to a pin
1018 * @pin_priv: private data pointer passed on pin registration
1025 * pin.
1033 ice_dpll_input_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_phase_adjust_set() argument
1038 return ice_dpll_pin_phase_adjust_set(pin, pin_priv, dpll, dpll_priv, in ice_dpll_input_phase_adjust_set()
1044 * ice_dpll_output_phase_adjust_set - callback for set output pin phase adjust
1045 * @pin: pointer to a pin
1046 * @pin_priv: private data pointer passed on pin registration
1053 * pin.
1061 ice_dpll_output_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_phase_adjust_set() argument
1066 return ice_dpll_pin_phase_adjust_set(pin, pin_priv, dpll, dpll_priv, in ice_dpll_output_phase_adjust_set()
1076 * @pin: pointer to a pin
1077 * @pin_priv: private data pointer passed on pin registration
1080 * @phase_offset: on success holds pin phase_offset value
1092 ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_phase_offset_get() argument
1100 if (d->active_input == pin) in ice_dpll_phase_offset_get()
1111 * @pin: pointer to a pin
1112 * @pin_priv: private data pointer passed on pin registration
1119 * on output pin.
1127 ice_dpll_output_esync_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_esync_set() argument
1166 * @pin: pointer to a pin
1167 * @pin_priv: private data pointer passed on pin registration
1170 * @esync: on success holds embedded sync pin properties
1174 * and capabilities on output pin.
1182 ice_dpll_output_esync_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_output_esync_get() argument
1215 * @pin: pointer to a pin
1216 * @pin_priv: private data pointer passed on pin registration
1223 * on input pin.
1231 ice_dpll_input_esync_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_esync_set() argument
1270 * @pin: pointer to a pin
1271 * @pin_priv: private data pointer passed on pin registration
1274 * @esync: on success holds embedded sync pin properties
1278 * and capabilities on input pin.
1286 ice_dpll_input_esync_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_input_esync_get() argument
1318 * ice_dpll_rclk_state_on_pin_set - set a state on rclk pin
1319 * @pin: pointer to a pin
1320 * @pin_priv: private data pointer passed on pin registration
1321 * @parent_pin: pin parent pointer
1322 * @parent_pin_priv: parent private data pointer passed on pin registration
1323 * @state: state to be set on pin
1326 * Dpll subsystem callback, set a state of a rclk pin on a parent pin
1334 ice_dpll_rclk_state_on_pin_set(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_rclk_state_on_pin_set() argument
1357 "pin:%u state:%u on parent:%u already set", in ice_dpll_rclk_state_on_pin_set()
1365 "err:%d %s failed to set pin state:%u for pin:%u on parent:%u\n", in ice_dpll_rclk_state_on_pin_set()
1376 * ice_dpll_rclk_state_on_pin_get - get a state of rclk pin
1377 * @pin: pointer to a pin
1378 * @pin_priv: private data pointer passed on pin registration
1379 * @parent_pin: pin parent pointer
1380 * @parent_pin_priv: pin parent priv data pointer passed on pin registration
1381 * @state: on success holds pin state on parent pin
1384 * dpll subsystem callback, get a state of a recovered clock pin.
1392 ice_dpll_rclk_state_on_pin_get(const struct dpll_pin *pin, void *pin_priv, in ice_dpll_rclk_state_on_pin_get() argument
1543 d->active_input = pf->dplls.inputs[d->input_idx].pin; in ice_dpll_update_state()
1568 d->active_input = p->pin; in ice_dpll_update_state()
1634 dpll_pin_put(pins[i].pin); in ice_dpll_release_pins()
1641 * @start_idx: get starts from this pin idx value
1645 * Get pins - allocate - in dpll subsystem, store them in pin field of given
1659 pins[i].pin = dpll_pin_get(clock_id, i + start_idx, THIS_MODULE, in ice_dpll_get_pins()
1661 if (IS_ERR(pins[i].pin)) { in ice_dpll_get_pins()
1662 ret = PTR_ERR(pins[i].pin); in ice_dpll_get_pins()
1671 dpll_pin_put(pins[i].pin); in ice_dpll_get_pins()
1692 dpll_pin_unregister(dpll, pins[i].pin, ops, &pins[i]); in ice_dpll_unregister_pins()
1715 ret = dpll_pin_register(dpll, pins[i].pin, ops, &pins[i]); in ice_dpll_register_pins()
1724 dpll_pin_unregister(dpll, pins[i].pin, ops, &pins[i]); in ice_dpll_register_pins()
1801 * ice_dpll_deinit_rclk_pin - release rclk pin resources
1804 * Deregister rclk pin from parent pins and release resources in dpll subsystem.
1814 parent = pf->dplls.inputs[rclk->parent_idx[i]].pin; in ice_dpll_deinit_rclk_pin()
1817 dpll_pin_on_pin_unregister(parent, rclk->pin, in ice_dpll_deinit_rclk_pin()
1823 dpll_pin_put(rclk->pin); in ice_dpll_deinit_rclk_pin()
1827 * ice_dpll_init_rclk_pins - initialize recovered clock pin
1829 * @pin: pin to register
1833 * Allocate resource for recovered clock pin in dpll subsystem. Register the
1834 * pin with the parents it has in the info. Register pin with the pf's main vsi
1842 ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin, in ice_dpll_init_rclk_pins() argument
1851 ret = ice_dpll_get_pins(pf, pin, start_idx, ICE_DPLL_RCLK_NUM_PER_PF, in ice_dpll_init_rclk_pins()
1856 parent = pf->dplls.inputs[pf->dplls.rclk.parent_idx[i]].pin; in ice_dpll_init_rclk_pins()
1861 ret = dpll_pin_on_pin_register(parent, pf->dplls.rclk.pin, in ice_dpll_init_rclk_pins()
1866 dpll_netdev_pin_set(vsi->netdev, pf->dplls.rclk.pin); in ice_dpll_init_rclk_pins()
1872 parent = pf->dplls.inputs[pf->dplls.rclk.parent_idx[--i]].pin; in ice_dpll_init_rclk_pins()
1873 dpll_pin_on_pin_unregister(parent, pf->dplls.rclk.pin, in ice_dpll_init_rclk_pins()
1876 ice_dpll_release_pins(pin, ICE_DPLL_RCLK_NUM_PER_PF); in ice_dpll_init_rclk_pins()
2218 * ice_dpll_init_info_rclk_pin - initializes rclk pin information
2221 * Init information for rclk pin, cache them in pf->dplls.rclk.
2229 struct ice_dpll_pin *pin = &pf->dplls.rclk; in ice_dpll_init_info_rclk_pin() local
2231 pin->prop.type = DPLL_PIN_TYPE_SYNCE_ETH_PORT; in ice_dpll_init_info_rclk_pin()
2232 pin->prop.capabilities |= DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE; in ice_dpll_init_info_rclk_pin()
2233 pin->pf = pf; in ice_dpll_init_info_rclk_pin()
2235 return ice_dpll_pin_state_update(pf, pin, in ice_dpll_init_info_rclk_pin()
2244 * Wraps functions for pin initialization.
2378 * resources and unregistering the dpll, pin and all resources used for