plat/xilinx/zynqmp/pm_service/pm_api_clock.c
/**
 * pm_api_clk_set_pll_frac_data() -  Set PLL fraction data
 * @pll     PLL id
 * @data    fraction data
 *
 * This function sets fraction data. It is valid for fraction
 * mode only.
 *
 * @return      Returns status, either success or error+reason
 */
Set PLL fraction data
@pll     PLL id
@data    fraction data

This function sets fraction data. It is valid for fraction
mode only.

@return      Returns status, either success or error+reason
Set PLL fraction data @pll PLL id @data fraction data This function sets fraction data . It is valid for fraction mode only . @return Returns status either success or error + reason
enum pm_ret_status pm_api_clk_set_pll_frac_data(unsigned int pll,
						unsigned int data)
{
	enum pm_ret_status ret = PM_RET_SUCCESS;
	unsigned int val, reg, mode = 0;
	if (!pm_clock_valid(pll))
		return PM_RET_ERROR_ARGS;
	if (pm_clock_type(pll) != CLK_TYPE_OUTPUT)
		return PM_RET_ERROR_NOTSUPPORTED;
	if (!ISPLL(pll))
		return PM_RET_ERROR_NOTSUPPORTED;
	ret = pm_api_clk_get_pll_mode(pll, &mode);
	if (ret != PM_RET_SUCCESS)
		return ret;
	if (mode == PLL_FRAC_MODE) {
		reg = clocks[pll].control_reg + PLL_FRAC_OFFSET;
		val = data << PLL_FRAC_DATA_SHIFT;
		ret = pm_mmio_write(reg, PLL_FRAC_DATA_MASK, val);
	} else {
		return PM_RET_ERROR_ARGS;
	}
	return ret;
}
enum pm_ret_status pm_api_clk_set_pll_frac_data ( unsigned int pll , unsigned int data ) { enum pm_ret_status ret = PM_RET_SUCCESS ; unsigned int val , reg , mode = 0 ; if ( ! pm_clock_valid ( pll ) ) return PM_RET_ERROR_ARGS ; if ( pm_clock_type ( pll ) != CLK_TYPE_OUTPUT ) return PM_RET_ERROR_NOTSUPPORTED ; if ( ! ISPLL ( pll ) ) return PM_RET_ERROR_NOTSUPPORTED ; ret = pm_api_clk_get_pll_mode ( pll , & mode ) ; if ( ret != PM_RET_SUCCESS ) return ret ; if ( mode == PLL_FRAC_MODE ) { reg = clocks [ pll ] . control_reg + PLL_FRAC_OFFSET ; val = data << PLL_FRAC_DATA_SHIFT ; ret = pm_mmio_write ( reg , PLL_FRAC_DATA_MASK , val ) ; } else { return PM_RET_ERROR_ARGS ; } return ret ; }
pm_api_clk_set_pll_frac_data() -  Set PLL fraction data
 @pll     PLL id
 @data    fraction data
pm_api_clk_set_pll_frac_data () - Set PLL fraction data @pll PLL id @data fraction data