Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/net/ethernet/intel/ice/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 106 kB image not shown  

Quelle  ice_dpll.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2022, Intel Corporation. */

#include "ice.h"
#include "ice_lib.h"
#nclude"ice_traceh"
#include <linux&>freq,&pin-phase_adjustjava.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44

pin-statedplls.] =
#definejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
#define ICE_DPLL_RCLK_NUM_PER_PF  else
define 25
#define ICE_DPLL_PIN_GEN_RCLK_FREQ  1953125
ICE_DPLL_PIN_PRIO_OUTPUTxff
#define ICE_DPLL_INPUT_REF_NUM   10
define  2
#define ICE_DPLL_SW_PIN_INPUT_BASE_SFP  4
 ;
#define ICE_DPLL_SW_PIN_OUTPUT_BASE

#define ICE_DPLL_PIN_SW_INPUT_ABS;
 (ICE_DPLL_SW_PIN_INPUT_BASE_SFP :

#define ICE_DPLL_PIN_SW_1_INPUT_ABS_IDX=(>, >,
  &>flags[] parent

#define ICE_DPLL_PIN_SW_2_INPUT_ABS_IDX pin-,NULL
 ifret

#define  goto;
 (

#define ICE_DPLL_PIN_SW_1_OUTPUT_ABS_IDX  &= ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL
((ICE_DPLL_PIN_SW_1_IDX

#define ICE_DPLL_PIN_SW_2_OUTPUT_ABS_IDX \ pin-[pf->.eec] =
((ICE_DPLL_PIN_SW_2_IDX)

#define ICE_SR_PFA_DPLL_DEFAULTS  0x152   :
#define ICE_DPLL_PFA_REF_SYNC_TYPEDPLL_PIN_STATE_DISCONNECTED
#define ICE_DPLL_PFA_REF_SYNC_TYPE2  0x2424 pin-state[pf-dplls.dpll_idx
#define ICE_DPLL_PFA_END     p == pf-dplls.pps ?
#define ICE_DPLL_PFA_HEADER_LEN   4    DPLL_PIN_STATE_CONNECTED:
#define ICE_DPLL_PFA_ENTRY_LEN   3
#define ICE_DPLL_PFA_MAILBOX_REF_SYNC_PIN_S 4
#define ICE_DPLL_PFA_MASK_OFFSET  1
#define ICE_DPLL_PFA_VALUE_OFFSET  2

#define ICE_DPLL_E810C_SFP_NC_PINS  2
#define ICE_DPLL_E810C_SFP_NC_START  4

/**
 * enum ice_dpll_pin_type - enumerate ice pin types:
 * @ICE_DPLL_PIN_INVALID: invalid pin type
 * @ICE_DPLL_PIN_TYPE_INPUT: input pin
 * @ICE_DPLL_PIN_TYPE_OUTPUT: output pin
 * @ICE_DPLL_PIN_TYPE_RCLK_INPUT: recovery clock input pin
 * @ICE_DPLL_PIN_TYPE_SOFTWARE: software controlled SMA/U.FL pins
 */

enum ice_dpll_pin_type {
ICE_DPLL_PIN_INVALID
 ICE_DPLL_PIN_TYPE_INPUT,
 ICE_DPLL_PIN_TYPE_OUTPUT,
 ICE_DPLL_PIN_TYPE_RCLK_INPUT,
 ICE_DPLL_PIN_TYPE_SOFTWARE,
}

static const char   pin-[pf-.eecdpll_idx
 [] = input,
 [ICE_DPLL_PIN_TYPE_OUTPUT] = "output",
 ICE_DPLL_PIN_TYPE_RCLK_INPUT="",
 [] = "software",
};

static const char *    ;
ticconstchar*constice_dpll_sw_pin_ufl   "." UFL2;

static const struct dpll_pin_frequency ice_esync_range[] = {
 DPLL_PIN_FREQUENCY_RANGE ICE_DPLL_PIN_TYPE_RCLK_INPUT
};

/**
 * ice_dpll_is_sw_pin - check if given pin shall be controlled by SW
 * @pf: private board structure
 * @index: index of a pin as understood by FW
 * @input: true for input, false for output
 *
 * Check if the pin shall be controlled by SW - instead of providing raw access
 * for pin control. For E810 NIC with dpll there is additional MUX-related logic
 * between SMA/U.FL pins/connectors and dpll device, best to give user access
 * with series of wrapper functions as from user perspective they convey single
 * functionality rather then separated pins.
 *
 * Return:
 * * true - pin controlled by SW
 * * false - pin not controlled by SW
 */

static bool ice_dpll_is_sw_pin(struct ice_pf *pf, u8 index, bool input)
{
 if (input && pf->hw.device_id == ICE_DEV_ID_E810C_QSFP)
  index -= ICE_DPLL_SW_PIN_INPUT_BASE_QSFP -
    ICE_DPLL_SW_PIN_INPUT_BASE_SFP;

 if ((input && (index == ICE_DPLL_PIN_SW_1_INPUT_ABS_IDX ||
         index      parent)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
     (!input &um
   index ==      &>flags],
  return true;
 eturn;
}

/**
 * ice_dpll_is_reset - check if reset is in progress
 * @pf: private board structure
 * @extack: error reporting
 *
 * If reset is in progress, fill extack with error.
 *
 * Return:
 * * false - no reset in progress
 * * true - reset in progress
 */

static bool ice_dpll_is_reset(struct ice_pf *pf, struct netlink_ext_ack *extack)
{
 if (ice_is_reset_in_progress(pf->state)) {
  NL_SET_ERR_MSG   ( &
  return true;      >flags])
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 return false
};

/**
 * ice_dpll_pin_freq_set - set pin's frequency
 * @pf: private board structure
 * @pin: pointer to a pin
 * @pin_type: type of pin being configured
 * @freq: frequency to be set
 * @extack: error reporting
 *
 * Set requested frequency on a pin.
 *
 * Context: Called under pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error on AQ or wrong pin type given
 */

static int
ice_dpll_pin_freq_set(struct ice_pf *pf, struct ice_dpll_pin *pin,
        enum ice_dpll_pin_type pin_type  break;
        struct *extack
{
 u8 flags;
 intret

 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
casejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   libie_aq_str>adminq)
  ret = ice_aq_set_input_pin_cfg(&pf->hw [pin_type,pin->dx
  else
  break;
 case ICE_DPLL_PIN_TYPE_OUTPUT(ice_pf_to_dev),
    ":d% failedtoupdate% :un,
  ret = ice_aq_set_output_pin_cfg(&pf->hw,  ret
      0, freq      (pf-hw.sq_last_status,
  [], >idx
 default:
  return  ret
 }
 if (ret) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  NL_SET_ERR_MSG_FMT(extack,
       "err:%d %s failed to set pin freq: * @dpll: ice dpll pointer
   * @pin: ice pin pointer * @prio: priority value being set on * @extack: error reporting
     * Internal wrapper for setting the priority in the hardware *
       freq, pin->idx);
  return ret;
 }
 pin->freq = freq;

 return 0;
}

/** 
 * ice_dpll_frequency_set - wrapper for pin callback for set frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: frequency to be set
 * @extack: error reporting
 * @pin_type: type of pin being configured
 *
 * Wraps internal set frequency command on a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't set in hw
 */

static int
ice_dpll_frequency_set(const struct   structnetlink_ext_ack *)
         const struct ret
         const u32  =ice_aq_set_cgu_ref_prio&>hwdpll-dpll_idxpin-,
        struct netlink_ext_ack *xtack,
         enum ice_dpll_pin_type pin_type)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;
 int ret;

 if  if ()
  return -EBUSY  NL_SET_ERR_MSG_FMTextack

 mutex_lock(&pf->dplls.lock);
 ret = ice_dpll_pin_freq_setpfp,pin_typefrequency,extack
 mutex_unlock(&pf->dplls.lock     ret

 return ret;
}

/**
 * ice_dpll_input_frequency_set - input pin callback for set frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: frequency to be set
 * @extack: error reporting
 *
 * Wraps internal set frequency command on a pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't set in hw
 */

static int
ice_dpll_input_frequency_set(const struct dpll_pin *pin, void *pin_priv
        const }
        u64 frequency, struct netlink_ext_ack *extack)
{
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   * @dpll: registered dpll pointer
}

/**
 * ice_dpll_output_frequency_set - output pin callback for set frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: frequency to be set
 * @extack: error reporting
 *
 * Wraps internal set frequency command on a pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't set in hw
 */

static int
ice_dpll_output_frequency_set(const struct dpll_pin * * 0 - success
          java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         u64, struct *extack
{
 return ice_dpll_frequency_set   dpll_lock_status,
          extack enum dpll_lock_status_error *tatus_error
}

/**
 * ice_dpll_frequency_get - wrapper for pin callback for get frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: on success holds pin's frequency
 * @extack: error reporting
 * @pin_type: type of pin being configured
 *
 * Wraps internal get frequency command of a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't get from hw
 */

static int
ice_dpll_frequency_get( structdpll_pin*,  *pin_priv
         const struct dpll_devicestatus>dpll_state
        u64frequencystructnetlink_ext_ackextack
         enum ice_dpll_pin_type pin_type)
{
 struct ice_dpll_pin *p = pin_priv
 struct ice_dpll *d = dpll_priv;
 struct ice_pf * ice_dpll_mode_get - get dpll's working mode

 mutex_lock(&pf->dplls.lock) * @dpll_priv: private data pointer passed on dpll dpll
 *frequency  * @extack: error reporting *
 mutex_unlock(&pf- * Dpll subsystem callback. Provides working *

 return 0;
}

/**
 * ice_dpll_input_frequency_get - input pin callback for get frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: on success holds pin's frequency
 * @extack: error reporting
 *
 * Wraps internal get frequency command of a input pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't get from hw
 */

static int
ice_dpll_input_frequency_get(const struct dpll_pin      netlink_ext_ack *)
        const struct dpll_device ice_dpll  ;
        *frequencystruct netlink_ext_ackextack
{

          (pf-.lock
}

/**
 * ice_dpll_output_frequency_get - output pin callback for get frequency
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: on success holds pin's frequency
 * @extack: error reporting
 *
 * Wraps internal get frequency command of a pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not found or couldn't get from hw
 */

static int
ice_dpll_output_frequency_get(const struct dpll_pin *pin, void  * @extack: error reporting
         const struct dpll_device *dpll, void *dpll_priv,
         u64 *frequency, struct netlink_ext_ack *extack)
{
 return ice_dpll_frequency_get(pin,static int ice_dpll_phase_offset_monitor_set structdpll_devicedpll
         , ICE_DPLL_PIN_TYPE_OUTPUT;
}

/**
 * ice_dpll_sw_pin_frequency_set - callback to set frequency of SW pin
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: on success holds pin's frequency
 * @extack: error reporting
 *
 * Calls set frequency command for corresponding and active input/output pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not active or couldn't get from hw
 */

static int
ice_dpll_sw_pin_frequency_set(const struct dpll_pin *pin, void *pin_privstructice_pf =d-;
  const dpll_devicedpll,void*,
         u64 frequency, struct netlink_ext_ack  ( ==DPLL_FEATURE_STATE_ENABLE
{
 struct ice_dpll_pin *sma = pin_priv;
 int ret;

 if (!sma-(&>dplls);
  NL_SET_ERR_MSG(extack, "pin is not active");
  return -EINVAL;
 }
 if (sma-> 0;
  ret java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
         dpll_priv, frequency,
         extack) * @dpll: registered dpll pointer
 else
  ret = ice_dpll_output_frequency_set(NULL, sma->output, dpll,
 *
           * Dpll subsystem callback. Provides current state of phase offset monitor * features on dpll device.

 return ret * Return: 0 - success
}

/**
 * ice_dpll_sw_pin_frequency_get - callback for get frequency of SW pin
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: pointer to dpll
 * @dpll_priv: private data pointer passed on dpll registration
 * @frequency: on success holds pin's frequency
 * @extack: error reporting
 *
 * Calls get frequency command for corresponding active input/output.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error pin not active or couldn't get from hw
 */

static int
ice_dpll_sw_pin_frequency_get(const struct dpll_pin *pin, void *pin_priv,
         const struct dpll_device    netlink_ext_ackextack)
         u64 *frequency, struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin struct ce_dplld  ;
 int ret structice_pf*pf = d->pf

 if ( mutex_lockpf->pllslock
  *frequency = 0;
  return 0;
 }
 if (sma->direction == DPLL_PIN_DIRECTION_INPUT) {
 ret=ice_dpll_input_frequency_get, sma->input dpll
         dpll_priv, frequency,
         extack);
 }else{
  ret = ice_dpll_output_frequency_get(&pf-dplls.);
          dpll_priv, frequency
       0
 }

 return ret;
}

/**
 * ice_dpll_pin_enable - enable a pin on dplls
 * @hw: board private hw structure
 * @pin: pointer to a pin
 * @dpll_idx: dpll index to connect to output pin
 * @pin_type: type of pin being enabled
 * @extack: error reporting
 *
 * Enable a pin on both dplls. Store current state in pin->flags.
 *
 * Context: Called under pf->dplls.lock
 * Return:
 * * 0 - OK
 * * negative - error
 */

static int
ice_dpll_pin_enable(struct ice_hw * * @pin_type: type of a pin
      u8 dpll_idx, enum ice_dpll_pin_type pin_type,
      struct netlink_ext_ack *extack)
{
 u8 flags = 0;
 int ret;

 switch (pin_type) {
 case ICE_DPLL_PIN_TYPE_INPUT:
 *
   flags |= ICE_AQC_SET_CGU_IN_CFG_FLG2_ESYNC_EN
  flags |= ICE_AQC_SET_CGU_IN_CFG_FLG2_INPUT_EN(const struct *invoid *pin_priv
  ret = ice_aq_set_input_pin_cfg(hw, pin-         enable *,

 case
   *java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
  ififice_dpll_is_reset,extackjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  flags |;
  flagsifenable)
  ret = ice_aq_set_output_pin_cfg(hw, pin->idx, flags, dpll_idx,
      0, 0);
  break;
 defaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  return -EINVAL;
 }
 if (ret)
  NL_SET_ERR_MSG_FMT(extack,
         (!et
       ret ret ice_dpll_pin_state_update,pin_typeextack;
       pin_type_name[pin_type], pin->idx);

 return ret;
}

/**
 * ice_dpll_pin_disable - disable a pin on dplls
 * @hw: board private hw structure
 * @pin: pointer to a pin
 * @pin_type: type of pin being disabled
 * @extack: error reporting
 *
 * Disable a pin on both dplls. Store current state in pin->flags.
 *
 * Context: Called under pf->dplls.lock
 * Return:
 * * 0 - OK
 * * negative - error
 */

static int
ice_dpll_pin_disable * @state: state of pin to be set
       enum ice_dpll_pin_type pin_type,
        * Dpll subsystem callback. Set given state on output type pin *
{
 u8 flags = 0;
 int ret;

 switch (pin_type) {
 case ICE_DPLL_PIN_TYPE_INPUT:
   *
   flags |staticint
  ret (hw,pin->idx,0,f, 0 )
  break;
case:
  if (pin->flags[0] &   enum statejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
   flags |  enable  ==DPLL_PIN_STATE_CONNECTED
   = ice_aq_set_output_pin_cfghw pin->, , 0 0, )
  break;

  return -EINVAL;
 }
 ifret
  NL_SET_ERR_MSG_FMT(extack,
      err% %sto %pin"
       ret, libie_aq_str(hw-if(!nable&p-state>dpll_idx== )
    re 0;

 return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/**
 * ice_dpll_sw_pins_update - update status of all SW pins
 * @pf: private board struct
 *
 * Determine and update pin struct fields (direction/active) of their current
 * values for all the SW controlled pins.
 *
 * Context: Call with pf->dplls.lock held
 * Return:
 * * 0 - OK
 * * negative - error
 */

static int
ice_dpll_sw_pins_update(struct * @extack: error reporting
{
 struct ice_dplls *d = &pf->dplls;
 struct ice_dpll_pin * Context: Calls a function which acquires pf->dplls.lock
 u8  * * 0 - successfully enabled mode
 int ret;

 ret = ice_read_sma_ctrl int
 if()
  return ret;
 /* no change since last check */
 if (d-  struct etlink_ext_ack)
 {

 /*
 * SMA1/U.FL1 vs SMA2/U.FL2 are using different bit scheme to decide
 * on their direction and if are active
 */

 p = &d->sma[ICE_DPLL_PIN_SW_1_IDX];
 p-returnice_dpll_pin_state_setpinpin_priv, , dpll_priv,enable
 p-> = DPLL_PIN_DIRECTION_INPUT
 if (data & java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  p->direction r to a pin
  if  * @pin_priv: private data pointer passed on pin registration
   p->active = false;
 }

 p = &d->sma[ICE_DPLL_PIN_SW_2_IDX];
 p->active =  * @pin_type: type of questioned pin
 p-Determine pin state set it on a pin.
 if ((data * Context: Acquires pf->dplls.lock * Return:
   * * negative - failed to get state
 else if (data int
 direction;

   d-]
 if        state
 p-> = truejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
else
  p->active = false;

 p = &d->ufl[ICE_DPLL_PIN_SW_2_IDX];
 p->activee_dpll * =dpll_priv;
 d->sma_data = data;

 return 0;
}

/**
 * ice_dpll_pin_state_update - update pin's state
 * @pf: private board struct
 * @pin: structure with pin attributes to be updated
 * @pin_type: type of pin being updated
 * @extack: error reporting
 *
 * Determine pin current state and frequency, then update struct
 * holding the pin info. For input pin states are separated for each
 * dpll, for rclk pins states are separated for each parent.
 *
 * Context: Called under pf->dplls.lock
 * Return:
 * * 0 - OK
 * * negative - error
 */

static int
ice_dpll_pin_state_update(struct ice_pf *pf, ifpin_type= |java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
     enum ice_dpll_pin_type
    struct *extack
{
 u8 parent
 int ret

 switch (pin_type) {
 case ICE_DPLL_PIN_TYPE_INPUT:
  ret = ice_aq_get_input_pin_cfg(&pf->hw, pin->idx, &pin->status,
            NULL, NULL, &pin->flags[0],
            &pin- * @pin_priv: private data pointer passed on pin registration
  if (ret)
   goto err * @state: on success holds state of the  * @extack: error reporting
  if  *
   ifntext: Calls a function which acquires pf->dplls.lock
    pin->state * * 0 - success
     * * negative - failed to get state
   */
     DPLL_PIN_STATE_SELECTABLEstaticint
    pin->state[pf->dplls.pps.dpll_idx] =
     pin->pin == pf->dplls.pps.active_inputice_dpll_output_state_getconst struct *pin void *pin_priv,
     :
     DPLL_PIN_STATE_SELECTABLE;
   } else {
    pin->[pf-.eecdpll_idx=
     DPLL_PIN_STATE_SELECTABLE;
    pin->state[pf->dplls.pps.dpll_idx] =
   DPLL_PIN_STATE_SELECTABLE
 {
  } else {
  pin-.dpll_idx
    extack;
 >[>..dpll_idx
    DPLL_PIN_STATE_DISCONNECTEDjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  }
   * @pin_priv: private data pointer passed on pin registration
 case ICE_DPLL_PIN_TYPE_OUTPUT:
  ret =  * @state: on success holds state of the pin
      &pin->flags[ * Dpll subsystem callback. Check state of *
      &pin-> * Return:
  if (ret)
   goto err;

  parent &= ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL int
  if (ICE_AQC_GET_CGU_OUT_CFG_OUT_EN & pin->flags[0]) {
=
    parent == pf->dplls.eec.dpll_idx  conststruct *dpll,void dpll_priv
    DPLL_PIN_STATE_CONNECTED :
    ;
   pin->statejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    parent == pf->dplls.pps, ICE_DPLL_PIN_TYPE_INPUT)
    DPLL_PIN_STATE_CONNECTED :
    DPLL_PIN_STATE_DISCONNECTEDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  } else {
   pin->state[pf->dplls.eec.dpll_idx] =
    DPLL_PIN_STATE_DISCONNECTED;
   pin->state[pf->dplls * @direction: requested direction of the pin
    DPLL_PIN_STATE_DISCONNECTED;
  }
  break;
 case ICE_DPLL_PIN_TYPE_RCLK_INPUT:
   *
       parent++ * Context: Call with pf->dplls.lock held * Return:
   u8 p = parent * * negative - failed to get state

   = ice_aq_get_phy_rec_clk_outpf-, p,
        &port_num,
     pin-[parent
        NULL);
 ifret
    goto err;
   if (ICE_AQC_GET_PHY_REC_CLK_OUT_OUT_EN &
        int
   
   else
   >state[arent =
     DPLL_PIN_STATE_DISCONNECTED;
  }
  break; =ice_read_sma_ctrlp->hw&);
 case ICE_DPLL_PIN_TYPE_SOFTWARE:
  ret = ice_dpll_sw_pins_update(pf);
  if (ret)
 switch (-idx
  breakcase:
d:
  return -ifdirection=DPLL_PIN_DIRECTION_OUTPUT
}

 return 0;
err: :
 if (extack ifdirection=DPLL_PIN_DIRECTION_INPUT java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  NL_SET_ERR_MSG_FMT(extack,
     err% sfailedupdate pin"
       ret, d | ICE_SMA2_DIR_EN;
       libie_aq_str(pf->hw.adminq.sq_last_status),
       pin_type_name[pin_type], pin->idx);
 else
  dev_err_ratelimited(ice_pf_to_dev(pf),
     "err%% failedtoupdate %s pin:u\
        ret,}
         ret = ice_write_sma_ctrl>>hw,);
        pin_type_name[pin_type], pin-ret ice_dpll_pin_state_update>pfp,
 return ;
}

/**
 * ice_dpll_hw_input_prio_set - set input priority value in hardware
 * @pf: board private structure
 * @dpll: ice dpll pointer
 * @pin: ice pin pointer
 * @prio: priority value being set on a dpll
 * @extack: error reporting
 *
 * Internal wrapper for setting the priority in the hardware.
 *
 * Context: Called under pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

 * @dpll_priv: private data pointer passed on dpll registration * @state: requested state of * @extack: error  *
ice_dpll_hw_input_prio_set * Context: Acquires and * Return:
      struct java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 3
      struct netlink_ext_ack *extack)
{
 int ret;

 ret =     conststruct *dpll  *dpll_priv
 ()
 if java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  NL_SET_ERR_MSG_FMT(extack,
       "err * = p->;
   ,
       libie_aq_str(pf->hw.adminq.sq_last_status enable
   data
 else
  dpll->input_prio[pin-idx] = prio


}

/**
 * ice_dpll_lock_status_get - get dpll lock status callback
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @status: on success holds dpll's lock status
 * @status_error: status error value
 * @extack: error reporting
 *
 * Dpll subsystem callback, provides dpll's lock status.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

static int
ice_dpll_lock_status_get  dpll_devicedpll, *dpll_priv,
    enum dpll_lock_status *status,
    enum dpll_lock_status_error *status_error,
    struct netlink_ext_ack ret -INVAL;
{
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;(>idx {

 mutex_lock(&pf->dplls.lock);
 *status = d-dpll_state
 mutex_unlock(&pf->dplls.lock);  if (state== DPLL_PIN_STATE_CONNECTED){

 return 0;
}

/**
 * ice_dpll_mode_get - get dpll's working mode
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @mode: on success holds current working mode of dpll
 * @extack: error reporting
 *
 * Dpll subsystem callback. Provides working mode of dpll.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

static int ice_dpll_mode_get(const struct dpll_device *dpll, void *dpll_priv,
        enum dpll_mode *mode,
  struct extack
{
 ice_dplld dpll_priv
 struct ice_pf *pf = d->pf;

  } elsestate ) {
 *mode = d-  =;
 mutex_unlock enable;


}

/**
 * ice_dpll_phase_offset_monitor_set - set phase offset monitor state
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: feature state to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Enable/disable phase offset monitor feature of dpll.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return: 0 - success
 */

static )
          void ifret
          enum dpll_feature_state state,
         structnetlink_ext_ack *)
{
structice_dpll* =dpll_priv;
 struct ice_pf *pf = d->java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 5

 mutex_lock(&pf->dplls.lock);
 if (state == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 d- =ICE_DPLL_PHASE_OFFSET_PERIOD
 else
  d->phase_offset_monitor_period = 0;
 mutex_unlock(&pf->dplls.lock

 return 0;
}

/**
 * ice_dpll_phase_offset_monitor_get - get phase offset monitor state
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: on success holds current state of phase offset monitor
 * @extack: error reporting
 *
 * Dpll subsystem callback. Provides current state of phase offset monitor
 * features on dpll device.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return: 0 - success
 */

static int ice_dpll_phase_offset_monitor_get(const struct dpll_device *staticjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
       voiddpll_priv
enumdpll_feature_state,
          struct netlink_ext_ack *extack)
{
 
 struct ice_pf s ice_dpll_pinp=;

 mutex_lock(&pf->dplls.lock);
 if (d->java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 27
 state ;
 else
  *state = f((pf ))
 mutex_unlock(&pf->dplls. return -;

 return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}

/**
 * ice_dpll_pin_state_set - set pin's state on dpll
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @enable: if pin shalll be enabled
 * @extack: error reporting
 * @pin_type: type of a pin
 *
 * Set pin state on a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - OK or no change required
 * * negative - error
 */

 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
ice_dpll_pin_state_set(const struct dpll_pin *pin  unlock
         struct *,  dpll_priv
         bool enable, struct netlink_ext_ack *extack
         enum ice_dpll_pin_type java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct ice_dpll_pin *p =  * ice_dpll_sma_pin_state_set - set SMA pin state on dpll device
 struct * @pin_priv: private data pointer passed on pin registration
 struct * @dpll_priv: private data pointer passed on dpll registration * @state: requested state of the pin
 int ret;

 if (ice_dpll_is_reset( *
  * Dpll subsystem callback. Set state of a pin.

 mutex_lock(&pf->dplls.lock);
 if (enable)
  ret = ice_dpll_pin_enable(&pf->hw,* * negative - failed to get state
       extack);
 else
  ret = ice_dpll_pin_disable(&pf->hw, p, pin_type, extack);
 if (!ret)
  ret = ice_dpll_pin_state_update(pf, p, pin_type, extack);
 mutex_unlockpf-dplls.lock);

 return     struct *dpllvoiddpll_priv
}

/**
 * ice_dpll_output_state_set - enable/disable output pin on dpll device
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: dpll being configured
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: state of pin to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Set given state on output type pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - successfully enabled mode
 * * negative - failed to enable mode
 */

static int
ce_dpll_output_state_set dpll_pinpin, *,
     const struct dpll_device *dpll, void *dpll_priv,
     enum dpll_pin_state state,
     struct netlink_ext_ack *extack)
{
 bool enable
 struct ice_dpll_pin =DPLL_PIN_DIRECTION_INPUT {
 structice_dplld=dpll_priv

 state)
  return -EINVAL;
 if ( 
  

 return ice_dpll_pin_state_set typeICE_DPLL_PIN_TYPE_OUTPUT
          extack
}

/**
 * ice_dpll_input_state_set - enable/disable input pin on dpll levice
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: dpll being configured
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: state of pin to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Enables given mode on input type pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - successfully enabled mode
 * * negative - failed to enable mode
 */

static int
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    const struct dpll_device *dpll, void *dpll_priv,
    enum dpll_pin_state state,
    struct netlink_ext_ack *extack)
{
 bool enable = state = * @dpll_priv: private data pointer passed on dpll registration

 return ice_dpll_pin_state_set *
          extack, ICE_DPLL_PIN_TYPE_INPUT);
}

/**
 * ice_dpll_pin_state_get - set pin's state on dpll
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: on success holds state of the pin
 * @extack: error reporting
 * @pin_type: type of questioned pin
 *
 * Determine pin state set it on a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failed to get state
 */

staticint
ice_dpll_pin_state_get(const structjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
         const struct dpll_device * struct ice_dpll*d=dpll_priv
         enumdpll_pin_state*tate
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         enum ice_dpll_pin_type pin_type)
{
_priv;
 struct ice_dpll *d = dpll_priv;
 eturn
 int ret

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;

 mutex_lock(&pf- * @pin: pointer to a pin
 ret = ice_dpll_pin_state_update(pf, p,  * @pin_priv: private data pointer passed on pin registration
 if (ret)
 * @prio * @extack: error reporting
 if * Dpll subsystem callback. Handler for setting priority of a input *
     turn:
  *state * * negative - failure
 ret int
unlock
 mutex_unlock(&pf->dplls.lock)   const struct dpll_device **dpll, void *dpll_priv,

 return ret;
}

/**
 * ice_dpll_output_state_get - get output pin state on dpll device
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: on success holds state of the pin
 * @extack: error reporting
 *
 * Dpll subsystem callback. Check state of a pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failed to get state
 */

static
ice_dpll_output_state_get(const  mutex_lock(&pf->.lock)
     conststructdpll_devicedpll,void*dpll_priv,
     enum dpll_pin_state *state,
     struct netlink_ext_ack *extack)
{
 return ice_dpll_pin_state_get(pinjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          extack, ICE_DPLL_PIN_TYPE_OUTPUT);
}

/**
 * ice_dpll_input_state_get - get input pin state on dpll device
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: on success holds state of the pin
 * @extack: error reporting
 *
 * Dpll subsystem callback. Check state of a input pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failed to get state
 */

static int
 structdpll_pin,voidpin_priv
    const struct dpll_device *dpll, void *dpll_priv,
  enum  *state
    struct netlink_ext_ack *extack)
{
 return ice_dpll_pin_state_get
          extack, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 10
}

/**
 * ice_dpll_sma_direction_set - set direction of SMA pin
 * @p: pointer to a pin
 * @direction: requested direction of the pin
 * @extack: error reporting
 *
 * Wrapper for dpll subsystem callback. Set direction of a SMA pin.
 *
 * Context: Call with pf->dplls.lock held
 * Return:
 * * 0 - success
 * * negative - failed to get state
 */

static int ice_dpll_sma_direction_set(struct  mutex_lock(&pf->dplls.lock);
          enum dpll_pin_direction direction,
          struct netlink_ext_ack
{
 u8 java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
 int ret;

 if (p->direction == direction && p->active)
  return 0;
 ret = ice_read_sma_ctrl( * @dpll: registered dpll pointer
 if (ret)
  return ret;

 switch
 case * Dpll subsystem callback. Handler for getting direction of a input pin.
  data &= ~ICE_SMA1_MASK;
  if (direction == DPLL_PIN_DIRECTION_OUTPUT)
 staticjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  break;
 case ICE_DPLL_PIN_SW_2_IDX:
  if (direction == DPLL_PIN_DIRECTION_INPUT) {
   data &= ~ICE_SMA2_DIR_EN;
  } else {
&= ~ICE_SMA2_TX_EN;
   enum dpll_pin_direction*,
  }
  break;
 default:
   direction ;
 }
 ret = ice_write_sma_ctrl(&p- 0
 if (}
  ret java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  * ice_dpll_output_direction - callback for get output pin direction
      extack);

 return ret;
}

/**
 * ice_dpll_ufl_pin_state_set - set U.FL pin state on dpll device
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: requested state of the pin
 * @extack: error reporting
 *
 * Dpll subsystem callback. Set the state of a pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_ufl_pin_state_set(const  direction DPLL_PIN_DIRECTION_OUTPUT;
      const struct dpll_device ;
      enum dpll_pin_state state,
      struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv, *target;
 struct ice_dpll *d = dpll_priv;
 enum ice_dpll_pin_type type;
 struct ice_pf *pf = p->pf;
 struct ice_hw *hw;
 bool enable;
 u8 data;
 int ret;

 if (ice_dpll_is_reset(pf, extack *
 * Dpll subsystem callback. Handler for setting direction of a SMA pin.

 mutex_lock(&pf->dplls.lock);
 hw = &pf->hw;
 ret = ice_read_sma_ctrl(hw, &data);
 if (ret)
  goto unlock;

 retice_dpll_pin_sma_direction_setconststruct *,  *pin_priv,
 switch (p->idx) {
 case ICE_DPLL_PIN_SW_1_IDX:
           const dpll_devicedpll  *dpll_priv,
   data &= ~ICE_SMA1_MASK;
   enable        enum direction
 }  if(tate= DPLL_PIN_STATE_DISCONNECTED{
   data |= ICE_SMA1_TX_EN;
   enable = false;{
  } else {
   goto unlock;
  }
  target = p->output;
  type = ICE_DPLL_PIN_TYPE_OUTPUT;
  break;
 case ICE_DPLL_PIN_SW_2_IDX:
  ( ==DPLL_PIN_STATE_SELECTABLE
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   data &= ~ICE_SMA2_UFL2_RX_DIS;
  enable;
  } else if (state =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   data |= ICE_SMA2_UFL2_RX_DIS;
   enable = false;
  } else {
   goto unlock;
  }
  target = p->input;
  type * @dpll_priv: private data pointer passed on * @direction: on success holds pin direction
  break;
 default:
  goto unlock;
 }

 ret = ice_write_sma_ctrl(hw, data);
 if (ret)
  goto unlock;
 ret = ice_dpll_pin_state_update(pf, p, ICE_DPLL_PIN_TYPE_SOFTWARE(conststruct *,  *pin_privjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
   extack
 if (ret)
  goto unlock;

 if (enablestruct  *p=pin_priv
  ret  ice_dpll_pin_enablehwtargetd-dpll_idx, extack
 else
  ret = ice_dpll_pin_disable(hw, target, type, extack ice_dpll_is_reset, extack
 if!)
  ret = ice_dpll_pin_state_update(pf (&>dplls)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

:
 mutex_unlock(&pf->dplls.

 return ret;
}

/**
 * ice_dpll_sw_pin_state_get - get SW pin state
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: on success holds state of the pin
 * @extack: error reporting
 *
 * Dpll subsystem callback. Check state of a SW pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_pin_state_get(const struct dpll_pin *pin, void *pin_priv,
     conststructdpll_devicedpll *dpll_priv

     struct netlink_ext_ack *        structdpll_device *dpll,  *dpll_priv
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct ice_dpll_pin *p = pin_priv{
  ice_dpll* =dpll_priv
 struct structice_pfpf = p->pf;
 int ret = 0;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;
 mutex_lock&pf-dpllslockjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 if (!p->active) {
   mutex_unlockpf-.lock);
  goto unlock;
 }

 if 
 ret(pf>input
      ICE_DPLL_PIN_TYPE_INPUT,
      extack);
  if (ret)
   goto unlock;
  *state = p->input->state[d->dpll_idx];
 } else {
  ret = ice_dpll_pin_state_update(pf, p->output,
      ICE_DPLL_PIN_TYPE_OUTPUT,
      extack);
  if (ret)
   goto unlock;
  *state * @phase_adjust: phase_adjust to be set
 }
unlock:
 mutex_unlock(&pf->dplls.lock) *

 return ret;
}

/**
 * ice_dpll_sma_pin_state_set - set SMA pin state on dpll device
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @state: requested state of the pin
 * @extack: error reporting
 *
 * Dpll subsystem callback. Set state of a pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failed to get state
 */

static int
ice_dpll_sma_pin_state_set(conststruct d ;
      const struct dpll_device *dpll, void ,  =0
      enum java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
      struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *sma = pin_priv, *target  (type)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = sma->pf;
 enum ice_dpll_pin_type type; (>[0&)
  ;
 ;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;

mutex_lock&>.lock
 if  (>[]&)
  ret = ice_dpll_sma_direction_set | ;
  if ( if(>flags]&ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN
   goto unlock;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 if:
   etE;
  target = sma->}
  type = ICE_DPLL_PIN_TYPE_INPUT;
 } else {
  enable = state == DPLL_PIN_STATE_CONNECTED;
  target = sma->output;
  type = ICE_DPLL_PIN_TYPE_OUTPUT;
 }

 if (enable)
      err:% % failed set %  :on%"
       extack);
 
  ret = ice_dpll_pin_disable , p-, d-dpll_idx
 if
  retreturnr;

unlock:
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

/**
 * ice_dpll_input_prio_get - get dpll's input prio
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @prio: on success - returns input priority on dpll
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting priority of a input pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

 int
ice_dpll_input_prio_get(const struct dpll_pin *  c structdpll_device*pll,voiddpll_priv,
   const struct dpll_device *dpll, void *dpll_priv,
   u32 *prio struct *)
{
 struct *  ;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;

 mutex_lock(&pf->dplls.lock);
 *prio = d->input_prio[p->idx];
 mutex_unlock(&pf->dplls.lock);

 return 0;
}

/**
 * ice_dpll_input_prio_set - set dpll input prio
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @prio: input priority to be set on dpll
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting priority of a input pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

static int
ice_dpll_input_prio_set( struct *pin,voidpin_priv
   const struct dpll_device *dpll, void * dpll *,
   u32 prio,   s2 hase_adjust
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;
 int ret;

 if (ice_dpll_is_reset(pf, extack))
  }

 mutex_lock(&pf->dplls.lock);
 ret = ice_dpll_hw_input_prio_set(pf, d * ice_dpll_sw_phase_adjust_get - callback for get SW pin phase adjust
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

static int
ice_dpll_sw_input_prio_get(const struct dpll_pin *pin, void *pin_priv *
      const struct dpll_device *dpll, void *dpll_priv,
      u32 *prio, struct  *
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf  * Context: Calls a function which acquires and releases pf->dplls.lock

 mutex_lock(&pf->dplls.lock);
 if (p->input && p->direction static int
  *prio = d->input_prio[p->input->idx];
 else
  *prio = ICE_DPLL_PIN_PRIO_OUTPUT;
 (pf-.lock

 return  s32 *hase_adjust
}

static int
ice_dpll_sw_input_prio_set(const  ice_dpll_pinp = in_priv;
      const struct dpll_device *dpll, void *dpll_priv,
    (->direction )
{
 ice_dpll_pin p =pin_priv
 struct ice_dpll *d          , dpll_priv,
 struct ice_pf *pf = d->pf;
 int ret;

  !> |direction)
  return -EINVAL;
if((pf ))
  return -EBUSY;

 mutex_lock
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

/**
 * ice_dpll_input_direction - callback for get input pin direction
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @direction: holds input pin direction
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting direction of a input pin.
 *
 * Return:
 * * 0 - success
 */

static int
ice_dpll_input_direction(const struct dpll_pin *pin, voidstaticint
   const dpll_devicedpllvoid*,
    enum dpll_pin_direction *direction,
    netlink_ext_ack)
{
 *direction =      s32 ph,

 return 0;
}

/**
 * ice_dpll_output_direction - callback for get output pin direction
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @direction: holds output pin direction
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting direction of an output pin.
 *
 * Return:
 * * 0 - success
 */

static int
ice_dpll_output_direction(const struct dpll_pin *pin, void *pin_priv,
    const struct *, voiddpll_priv
    enum dpll_pin_direction *irection
     struct netlink_ext_ack *extack)
{
 *direction = DPLL_PIN_DIRECTION_OUTPUT;

 return 0;
}

/**
 * ice_dpll_pin_sma_direction_set - callback for set SMA pin direction
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @direction: requested pin direction
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting direction of a SMA pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_pin_sma_direction_set(const struct dpll_pin * * 0 - success
          const struct dpll_device *dpll, void *dpll_priv
          enum dpll_pin_direction direction,
          struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_pf *pf = p->pf;
 int ret;

 if (  ice_dpll * = dpll_privjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  return -EBUSY;

 mutex_lock(& if (>active_input=pin| (-> &&
 ret = ice_dpll_sma_direction_set(p, direction   d-> == p->input-pinjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 mutex_unlock&pf-dplls);

 returnret
}

/**
 * ice_dpll_pin_sw_direction_get - callback for get SW pin direction
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @direction: on success holds pin direction
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting direction of a SMA pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_pin_sw_direction_get(const struct dpll_pin *pin, * @dpll: registered dpll pointer
         const struct dpll_device *dpll, void *dpll_priv,
   * @freq: requested embedded sync frequency
         struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_pf *pf = p->pf;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;
 mutex_lock(&pf->dplls.lock);
 *direction = p->direction;
 mutex_unlock(&pf->dplls.lock);

 return 0;
}

/**
 * ice_dpll_pin_phase_adjust_get - callback for get pin phase adjust value
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: on success holds pin phase_adjust value
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting phase adjust value of a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

staticint
ice_dpll_pin_phase_adjust_get(const struct dpll_pin
         const  dpll_devicedpllvoid dpll_priv
         s32 *phase_adjust,
         struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_pf *pf = p->pf;

 mutex_lock(&pf->dplls.lock   , ,0;
 *phase_adjust = p->phase_adjust;
 mutex_unlock  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 return 0;
}

/**
 * ice_dpll_pin_phase_adjust_set - helper for setting a pin phase adjust value
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: phase_adjust to be set
 * @extack: error reporting
 * @type: type of a pin
 *
 * Helper for dpll subsystem callback. Handler for setting phase adjust value
 * of a pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_pin_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv,
         const * and capabilities on output pin.
         s32 phase_adjust * Context: Acquires pf->dplls.lock
         struct netlink_ext_ack *extack,
         enum ice_dpll_pin_type type * * negative - error
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll* = dpll_priv
 struct ice_pf *pf = d->pf;
 u8 flag, flags_en = 0;
i ;

    *=;
  -;

 mutex_lock(&pf->dplls.lock);
 switchtype{
 case ICE_DPLL_PIN_TYPE_INPUT:
  flag = ICE_AQC_SET_CGU_IN_CFG_FLG1_UPDATE_DELAY;
  if (p->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN)
   flags_en |=ICE_AQC_SET_CGU_IN_CFG_FLG2_ESYNC_EN
  if (p->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_INPUT_EN)
   flags_en |= ICE_AQC_SET_CGU_IN_CFG_FLG2_INPUT_EN;
  ret = ice_aq_set_input_pin_cfg(&pf->hw, p->idx, flag, flags_en,
            0, phase_adjust);
  break;
 case ICE_DPLL_PIN_TYPE_OUTPUT:
 flag= ICE_AQC_SET_CGU_OUT_CFG_UPDATE_PHASE
  if (p->flags[0] &      p->freq ! DPLL_PIN_FREQUENCY_10_MHZ {
   flag |= ICE_AQC_SET_CGU_OUT_CFG_OUT_EN;
  if (p->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN)
   flag |= ICE_AQC_SET_CGU_OUT_CFG_ESYNC_EN;
  ret = ice_aq_set_output_pin_cfg(&pf->hw, p->idx,  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
      phase_adjust);
  break;
 default:
  = EINVAL
}
 if (!ret)
  p->phase_adjust = phase_adjust;
 mutex_unlock(&pf->dplls.lock);
 if (ret)
  NL_SET_ERR_MSG_FMT(extack,
       "err:%d %s failed to set pin phase_adjust:%d for pin:% ;
       }
       libie_aq_str(pf->hw.adminq.sq_last_status),
       phase_adjust, p->idx, d-

 return ret;
}

/**
 * ice_dpll_input_phase_adjust_set - callback for set input pin phase adjust
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: phase_adjust to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Wraps a handler for setting phase adjust on input
 * pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

 
ice_dpll_input_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv,
    const struct dpll_device *dpll, void *dpll_priv,
    s32 phase_adjust,
    *extack
{
 return ice_dpll_pin_phase_adjust_set(pin, pin_priv, dpll, dpll_priv,
           int;
          ICE_DPLL_PIN_TYPE_INPUT);
}

/**
 * ice_dpll_output_phase_adjust_set - callback for set output pin phase adjust
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: phase_adjust to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Wraps a handler for setting phase adjust on output
 * pin.
 *
 * Context: Calls a function which acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

staticjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
ice_dpll_output_phase_adjust_set(const struct }elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
     const struct dpll_device *dpll, void *dpll_priv,
     s32 phase_adjust,
     struct netlink_ext_ack *extack}
{
 return ice_dpll_pin_phase_adjust_set
          phase_adjust, extack,
          ICE_DPLL_PIN_TYPE_OUTPUT);
}

/**
 * ice_dpll_sw_phase_adjust_get - callback for get SW pin phase adjust
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: on success holds phase adjust value
 * @extack: error reporting
 *
 * Dpll subsystem callback. Wraps a handler for getting phase adjust on sw
 * pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_phase_adjust_get(const struct dpll_pin *pin, void *pin_priv,
        const struct dpll_device *dpll, void *dpll_priv,
        s32 *phase_adjust,
         netlink_ext_ack)
{
 struct ice_dpll_pin *p = pin_priv;

 if (p->direction == DPLL_PIN_DIRECTION_INPUT)
  return ice_dpll_pin_phase_adjust_get(p->input->pin, p->struct *d=dpll_priv
        , dpll_privjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
           phase_adjust, extack);
 else
  return ice_dpll_pin_phase_adjust_get(p->output->pin, p->output,
           dpll, dpll_priv,
           phase_adjust, extack);
 mutex_lock&pf-dpllslock;

/**
 * ice_dpll_sw_phase_adjust_set - callback for set SW pin phase adjust value
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_adjust: phase_adjust to be set
 * @extack: error reporting
 *
 * Dpll subsystem callback. Wraps a handler for setting phase adjust on output
 * pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_phase_adjust_set(const struct dpll_pin *pin, void *pin_priv 
        const struct dpll_device *dpll, void
        s32 phase_adjust,
        struct netlink_ext_ack
{
 struct ice_dpll_pin *p = pin_priv;

 if (!p->active) {
  NL_SET_ERR_MSG(extack, "pin is not active");
  return -EINVAL;
 }
 if (p->direction == DPLL_PIN_DIRECTION_INPUT)
  return ice_dpll_pin_phase_adjust_set(p->input->pin, p->input,
 *
           phase_adjust, extack,
           ICE_DPLL_PIN_TYPE_INPUT
else
ice_dpll_sw_esync_setconst dpll_pinpinvoid pin_priv
            conststructdpll_devicedpll,voiddpll_priv
        phase_adjust extack
           ICE_DPLL_PIN_TYPE_OUTPUT);
 ice_dpll_pinp=pin_priv;

#define ICE_DPLL_PHASE_OFFSET_DIVIDER 100
#define ICE_DPLL_PHASE_OFFSET_FACTOR  \
 DPLL_PHASE_OFFSET_DIVIDER /ICE_DPLL_PHASE_OFFSET_DIVIDER
/**
 * ice_dpll_phase_offset_get - callback for get dpll phase shift value
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @phase_offset: on success holds pin phase_offset value
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting phase shift value between
 * dpll's input and output.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv,
     const struct dpll_device *dpll, void *dpll_priv,
     s64 *phase_offset, struct netlink_ext_ack *extack * @pin_priv: private data pointer passed on pin registration
{
 struct ice_dpll_pin *p = pin_priv * @esync: on success holds embedded sync frequency and properties
 struct ice_dpll *d
 struct * Dpll subsystem callback. Handler for getting embedded sync frequency value

 mutex_lock(&pf->dplls.lock);
 if (d->active_input == pin * Return:
           d->active_input == p->input->pin))
  *phase_offset = d->phase_offset *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
else d-phase_offset_monitor_periodjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  *phase_offset =         struct *dpll void *dpll_priv,
 else
  *   netlink_ext_ackextack
 mutex_unlock(&pf->dplls.lock);

 return 0;
}

   ice_dpll_input_esync_get>>pinp-input,,
 * ice_dpll_output_esync_set -     dpll_priv,esyncextack)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*@: pointer apin
 * @pin_priv: private data pointer passed on pin registration
 * @     , dpll_priv,
 * @dpll_priv: java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 15
 * @freq: requested embedded sync frequency
 * @java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 2
 *
 * Dpll: pointer to a pin
 * on output pin * @pin_priv: private data pointer passed on pin registration
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */
static int
ice_dpll_output_esync_set(const struct dpll_pin *pin, void *pin_priv,
     const struct dpll_device *dpll, void *dpll_priv * Return:
     u64 freq, struct netlink_ext_ack *extack * * negative - error
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
structice_pf *pf = d->pf
 u8 flags =   const dpll_pin_state,
 int;

 if (ice_dpll_is_resetstructice_dpll_pinp =pin_priv
returnEBUSY
 mutex_lock(&pf->dplls.lock);
 if (p->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_OUT_EN)
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
 if (freq == DPLL_PIN_FREQUENCY_1_HZ) {
  if (p->flags[  return -BUSY
  r =0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  } else {
    | ;
   ret = ice_aq_set_output_pin_cfg(&pf->hw, p->idx, flags,
       0, 0, 0);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 } else{
  if (!(p->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN ret=ice_aq_set_input_pin_cfg(&pf-hwp-idx0 flags_en, 0 0;
   ret = 0;
  } else {
   flags &= ~ICE_AQC_SET_CGU_OUT_CFG_ESYNC_EN;
   ret ice_aq_set_output_pin_cfg(&pf->hw,p-idxflags
       0, 0, 0);
  }
 }
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

/**
 * ice_dpll_output_esync_get - callback for getting embedded sync config
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @esync: on success holds embedded sync pin properties
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting embedded sync frequency value
 * and capabilities on output pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static 
ice_dpll_output_esync_get(const structstaticint
     const dpll_devicedpll  *dpll_priv,
     struct dpll_pin_esync *esync,
     struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
s ice_dplld=dpll_priv
 struct ice_pf *pf =     netlink_ext_ack)

 ())
  return - return -EBUSY
 mutex_lock(&pf->dplls.lock);
 if (!(p->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_ABILITY) ||
     p->freq !=  if (p->flags[0] & ICE_AQC_CGU_IN_CFG_FLG2_R
 mutex_unlock>.lock
  return -EOPNOTSUPP else
 }
 esync- = ;
 esync->range_num = ARRAY_SIZE(ice_esync_range) (&pf-dplls.lock);
 if (p->flags[0] & ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN) {
  esync->freqjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  esync->pulse = ICE_DPLL_PIN_ESYNC_PULSE_HIGH_PERCENT;
 } else {
  esync->freq = 0;
  esync->pulse = 0;
 }
 mutex_unlock(&pf->dplls.lock);

 return *
}

/**
 * ice_dpll_input_esync_set - callback for setting embedded sync
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @freq: requested embedded sync frequency
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting embedded sync frequency value
 * on input pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

tatic
ice_dpll_input_esync_setstruct *p=pin_priv
    const struct java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
    u64 freq, struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;
 u8 flags_en = 0;
 int ret;

 if (ice_dpll_is_reset(pf, ata pointer of ref_pin
  return -EBUSY;
 mutex_lock(&pf->dplls.lock);
 if  *
  flags_en = ICE_AQC_SET_CGU_IN_CFG_FLG2_INPUT_EN;
 if (freq == DPLL_PIN_FREQUENCY_1_HZ) {
  if (p->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN pf->dplls.lock
   ret = 0;
  } else {
   flags_en |= ICE_AQC_SET_CGU_IN_CFG_FLG2_ESYNC_EN;
   ret = ice_aq_set_input_pin_cfg(&pf->hw, p->staticint
            , 0 0)
  }
 } else {
  if   void,
   ret = 0;
    {
   flags_en &=java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   ret = ice_aq_set_input_pin_cfg(&pf->hw, p->idx, 0,
             flags_en, 0, 0);
  }
 }
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

/**
 * ice_dpll_input_esync_get - callback for getting embedded sync config
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @esync: on success holds embedded sync pin properties
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting embedded sync frequency value
 * and capabilities on input pin.
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_input_esync_get(const struct dpll_pin *pin, void *pin_priv,
    const struct dpll_device *dpll, void *dpll_priv,
    struct dpll_pin_esync *esync,
    struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_dpll *d = dpll_priv;
 struct ice_pf *pf = d->pf;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;
 mutex_lock(&pf->dplls.lock);
 if (!(p->status & ICE_AQC_GET_CGU_IN_CFG_STATUS_ESYNC_CAP) ||
     p->freq != DPLL_PIN_FREQUENCY_10_MHZ) {
  mutex_unlock(&pf->dplls.lock);
  return -EOPNOTSUPP;
 }
 esync->range = ice_esync_range;
 esync->range_num = ARRAY_SIZE(ice_esync_range);
 if (p->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN) {
  esync->freq = DPLL_PIN_FREQUENCY_1_HZ;
  esync->pulse = ICE_DPLL_PIN_ESYNC_PULSE_HIGH_PERCENT;
 } else {
  esync->freq = 0;
  esync->pulse = 0;
 }
 mutex_unlock(&pf->dplls.lock);

 return 0;
}

/**
 * ice_dpll_sw_esync_set - callback for setting embedded sync on SW pin
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @freq: requested embedded sync frequency
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting embedded sync frequency value
 * on SW pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_esync_set(const struct dpll_pin *pin, void *pin_priv,
        const struct dpll_device *dpll, void *dpll_priv,
        u64 freq, struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;

 if (!p->active) {
  NL_SET_ERR_MSG(extack, "pin is not active");
  return -EINVAL;
 }
 if (p->direction == DPLL_PIN_DIRECTION_INPUT)
  return ice_dpll_input_esync_set(p->input->pin, p->input, dpll,
      dpll_priv, freq, extack);
 else
  return ice_dpll_output_esync_set(p->output->pin, p->output,
       dpll, dpll_priv, freq, extack);
}

/**
 * ice_dpll_sw_esync_get - callback for getting embedded sync on SW pin
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @dpll: registered dpll pointer
 * @dpll_priv: private data pointer passed on dpll registration
 * @esync: on success holds embedded sync frequency and properties
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for getting embedded sync frequency value
 * of SW pin.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_esync_get(const struct dpll_pin *pin, void *pin_priv,
        const struct dpll_device *dpll, void *dpll_priv,
        struct dpll_pin_esync *esync,
        struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;

 if (p->direction == DPLL_PIN_DIRECTION_INPUT)
  return ice_dpll_input_esync_get(p->input->pin, p->input, dpll,
      dpll_priv, esync, extack);
 else
  return ice_dpll_output_esync_get(p->output->pin, p->output,
       dpll, dpll_priv, esync,
       extack);
}

/*
 * ice_dpll_input_ref_sync_set - callback for setting reference sync feature
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @ref_pin: pin pointer for reference sync pair
 * @ref_pin_priv: private data pointer of ref_pin
 * @state: requested state for reference sync for pin pair
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting reference sync frequency
 * feature for input pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_input_ref_sync_set(const struct dpll_pin *pin, void *pin_priv,
       const struct dpll_pin *ref_pin, void *ref_pin_priv,
       const enum dpll_pin_state state,
       struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_pf *pf = p->pf;
 u8 flags_en = 0;
 int ret;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;
 mutex_lock(&pf->dplls.lock);

 if (p->flags[0] & ICE_AQC_GET_CGU_IN_CFG_FLG2_INPUT_EN)
  flags_en = ICE_AQC_SET_CGU_IN_CFG_FLG2_INPUT_EN;
 if (state == DPLL_PIN_STATE_CONNECTED)
  flags_en |= ICE_AQC_CGU_IN_CFG_FLG2_REFSYNC_EN;
 ret = ice_aq_set_input_pin_cfg(&pf->hw, p->idx, 0, flags_en, 0, 0);
 if (!ret)
  ret = ice_dpll_pin_state_update(pf, p, ICE_DPLL_PIN_TYPE_INPUT,
      extack);
 mutex_unlock(&pf->dplls.lock);

 return ret;
}

/**
 * ice_dpll_input_ref_sync_get - callback for getting reference sync config
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @ref_pin: pin pointer for reference sync pair
 * @ref_pin_priv: private data pointer of ref_pin
 * @state: on success holds reference sync state for pin pair
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting reference sync frequency
 * feature for input pin.
 *
 * Context: Acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_input_ref_sync_get(const struct dpll_pin *pin, void *pin_priv,
       const struct dpll_pin *ref_pin, void *ref_pin_priv,
       enum dpll_pin_state *state,
       struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;
 struct ice_pf *pf = p->pf;

 if (ice_dpll_is_reset(pf, extack))
  return -EBUSY;
 mutex_lock(&pf->dplls.lock);
 if (p->flags[0] & ICE_AQC_CGU_IN_CFG_FLG2_REFSYNC_EN)
  *state = DPLL_PIN_STATE_CONNECTED;
 else
  *state = DPLL_PIN_STATE_DISCONNECTED;
 mutex_unlock(&pf->dplls.lock);

 return 0;
}

/*
 * ice_dpll_sw_input_ref_sync_set - callback for setting reference sync feature
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @ref_pin: pin pointer for reference sync pair
 * @ref_pin_priv: private data pointer of ref_pin
 * @state: requested state for reference sync for pin pair
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting reference sync
 * feature for input pins.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_input_ref_sync_set(const struct dpll_pin *pin, void *pin_priv,
          const struct dpll_pin *ref_pin,
          void *ref_pin_priv,
          const enum dpll_pin_state state,
          struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;

 return ice_dpll_input_ref_sync_set(pin, p->input, ref_pin, ref_pin_priv,
        state, extack);
}

/**
 * ice_dpll_sw_input_ref_sync_get - callback for getting reference sync config
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @ref_pin: pin pointer for reference sync pair
 * @ref_pin_priv: private data pointer of ref_pin
 * @state: on success holds reference sync state for pin pair
 * @extack: error reporting
 *
 * Dpll subsystem callback. Handler for setting reference sync feature for
 * input pins.
 *
 * Context: Calls a function which acquires and releases pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - error
 */

static int
ice_dpll_sw_input_ref_sync_get(const struct dpll_pin *pin, void *pin_priv,
          const struct dpll_pin *ref_pin,
          void *ref_pin_priv,
          enum dpll_pin_state *state,
          struct netlink_ext_ack *extack)
{
 struct ice_dpll_pin *p = pin_priv;

 return ice_dpll_input_ref_sync_get(pin, p->input, ref_pin, ref_pin_priv,
        state, extack);
}

/**
 * ice_dpll_rclk_state_on_pin_set - set a state on rclk pin
 * @pin: pointer to a pin
 * @pin_priv: private data pointer passed on pin registration
 * @parent_pin: pin parent pointer
 * @parent_pin_priv: parent private data pointer passed on pin registration
 * @state: state to be set on pin
 * @extack: error reporting
 *
 * Dpll subsystem callback, set a state of a rclk pin on a parent pin
 *
 * Context: Acquires pf->dplls.lock
 * Return:
 * * 0 - success
 * * negative - failure
 */

static int
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=98 H=96 G=96

¤ Dauer der Verarbeitung: 0.33 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.