plat/xilinx/zynqmp/pm_service/pm_api_clock.c
/**
 * pm_api_clock_get_fixedfactor_params() - PM call to request a clock's fixed
 *					   factor parameters for fixed clock
 * @clock_id	Clock ID
 * @mul		Multiplication value
 * @div		Divisor value
 *
 * This function is used by master to get fixed factor parameers for the
 * fixed clock. This API is application only for the fixed clock.
 *
 * @return	Returns status, either success or error+reason
 */
PM call to request a clock's fixed
factor parameters for fixed clock
@clock_id    Clock ID
@mul         Multiplication value
@div         Divisor value

This function is used by master to get fixed factor parameers for the
fixed clock. This API is application only for the fixed clock.

@return      Returns status, either success or error+reason
PM call to request a clock ' s fixed factor parameters for fixed clock @clock_id Clock ID @mul Multiplication value @div Divisor value This function is used by master to get fixed factor parameers for the fixed clock . This API is application only for the fixed clock . @return Returns status either success or error + reason
enum pm_ret_status pm_api_clock_get_fixedfactor_params(unsigned int clock_id,
						       uint32_t *mul,
						       uint32_t *div)
{
	struct pm_clock_node *clock_nodes;
	uint8_t num_nodes;
	unsigned int type, i;
	if (!pm_clock_valid(clock_id))
		return PM_RET_ERROR_ARGS;
	if (pm_clock_type(clock_id) != CLK_TYPE_OUTPUT)
		return PM_RET_ERROR_NOTSUPPORTED;
	clock_nodes = *clocks[clock_id].nodes;
	num_nodes = clocks[clock_id].num_nodes;
	for (i = 0; i < num_nodes; i++) {
		type =  clock_nodes[i].type;
		if (type == TYPE_FIXEDFACTOR) {
			*mul = clock_nodes[i].mult;
			*div = clock_nodes[i].div;
			break;
		}
	}
	if (i == num_nodes)
		return PM_RET_ERROR_ARGS;
	return PM_RET_SUCCESS;
}
enum pm_ret_status pm_api_clock_get_fixedfactor_params ( unsigned int clock_id , uint32_t * mul , uint32_t * div ) { struct pm_clock_node * clock_nodes ; uint8_t num_nodes ; unsigned int type , i ; if ( ! pm_clock_valid ( clock_id ) ) return PM_RET_ERROR_ARGS ; if ( pm_clock_type ( clock_id ) != CLK_TYPE_OUTPUT ) return PM_RET_ERROR_NOTSUPPORTED ; clock_nodes = * clocks [ clock_id ] . nodes ; num_nodes = clocks [ clock_id ] . num_nodes ; for ( i = 0 ; i < num_nodes ; i ++ ) { type = clock_nodes [ i ] . type ; if ( type == TYPE_FIXEDFACTOR ) { * mul = clock_nodes [ i ] . mult ; * div = clock_nodes [ i ] . div ; break ; } } if ( i == num_nodes ) return PM_RET_ERROR_ARGS ; return PM_RET_SUCCESS ; }
pm_api_clock_get_fixedfactor_params() - PM call to request a clock's fixed
                                         factor parameters for fixed clock
 @clock_id    Clock ID
 @mul         Multiplication value
 @div         Divisor value
pm_api_clock_get_fixedfactor_params () - PM call to request a clock ' s fixed factor parameters for fixed clock @clock_id Clock ID @mul Multiplication value @div Divisor value
/* Clock is not fixed clock */