plat/xilinx/zynqmp/pm_service/pm_api_clock.c
/**
 * pm_api_clock_get_parents() - PM call to request a clock's first 3 parents
 * @clock_id	Clock ID
 * @index	Index of next parent
 * @parents	Parents of the given clock
 *
 * This function is used by master to get clock's parents information.
 * This API will return 3 parents with a single response. To get other
 * parents, master should call same API in loop with new parent index
 * till error is returned.
 *
 * E.g First call should have index 0 which will return parents 0, 1 and
 * 2. Next call, index should be 3 which will return parent 3,4 and 5 and
 * so on.
 *
 * @return	Returns status, either success or error+reason
 */
PM call to request a clock's first 3 parents
@clock_id    Clock ID
@index       Index of next parent
@parents     Parents of the given clock

This function is used by master to get clock's parents information.
This API will return 3 parents with a single response. To get other
parents, master should call same API in loop with new parent index
till error is returned.

E.g First call should have index 0 which will return parents 0, 1 and
2. Next call, index should be 3 which will return parent 3,4 and 5 and
so on.

@return      Returns status, either success or error+reason
PM call to request a clock ' s first 3 parents @clock_id Clock ID @index Index of next parent @parents Parents of the given clock This function is used by master to get clock ' s parents information . This API will return 3 parents with a single response . To get other parents master should call same API in loop with new parent index till error is returned . E . g First call should have index 0 which will return parents 0 1 and 2 . Next call index should be 3 which will return parent 3 4 and 5 and so on . @return Returns status either success or error + reason
enum pm_ret_status pm_api_clock_get_parents(unsigned int clock_id,
					    unsigned int index,
					    uint32_t *parents)
{
	unsigned int i;
	int32_t *clk_parents;
	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;
	clk_parents = *clocks[clock_id].parents;
	if (clk_parents == NULL)
		return PM_RET_ERROR_ARGS;
	memset(parents, 0, CLK_PARENTS_PAYLOAD_LEN);
	for (i = 0; i < index; i++)
		if (clk_parents[i] == CLK_NA_PARENT)
			return PM_RET_SUCCESS;
	for (i = 0; i < 3; i++) {
		parents[i] = clk_parents[index + i];
		if (clk_parents[index + i] == CLK_NA_PARENT)
			break;
	}
	return PM_RET_SUCCESS;
}
enum pm_ret_status pm_api_clock_get_parents ( unsigned int clock_id , unsigned int index , uint32_t * parents ) { unsigned int i ; int32_t * clk_parents ; 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 ; clk_parents = * clocks [ clock_id ] . parents ; if ( clk_parents == NULL ) return PM_RET_ERROR_ARGS ; memset ( parents , 0 , CLK_PARENTS_PAYLOAD_LEN ) ; for ( i = 0 ; i < index ; i ++ ) if ( clk_parents [ i ] == CLK_NA_PARENT ) return PM_RET_SUCCESS ; for ( i = 0 ; i < 3 ; i ++ ) { parents [ i ] = clk_parents [ index + i ] ; if ( clk_parents [ index + i ] == CLK_NA_PARENT ) break ; } return PM_RET_SUCCESS ; }
pm_api_clock_get_parents() - PM call to request a clock's first 3 parents
 @clock_id    Clock ID
 @index       Index of next parent
 @parents     Parents of the given clock
pm_api_clock_get_parents () - PM call to request a clock ' s first 3 parents @clock_id Clock ID @index Index of next parent @parents Parents of the given clock
/* Skip parent till index */