Unverified Commit d853d3b2 authored by Soby Mathew's avatar Soby Mathew Committed by GitHub
Browse files

Merge pull request #1541 from rajanv-xilinx/integration-num-clocks

zynqmp: pm: Add API to get number of clocks
parents a1256912 ec9712ce
......@@ -2306,6 +2306,21 @@ static unsigned int pm_clock_type(unsigned int clock_id)
CLK_TYPE_OUTPUT : CLK_TYPE_EXTERNAL;
}
/**
* pm_api_clock_get_num_clocks() - PM call to request number of clocks
* @nclocks Number of clocks
*
* This function is used by master to get number of clocks.
*
* @return Returns success.
*/
enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks)
{
*nclocks = CLK_MAX;
return PM_RET_SUCCESS;
}
/**
* pm_api_clock_get_name() - PM call to request a clock's name
* @clock_id Clock ID
......
......@@ -276,6 +276,7 @@ enum {
enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name);
enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks);
enum pm_ret_status pm_api_clock_get_topology(unsigned int clock_id,
unsigned int index,
uint32_t *topology);
......
......@@ -712,6 +712,19 @@ enum pm_ret_status pm_ioctl(enum pm_node_id nid,
return pm_api_ioctl(nid, ioctl_id, arg1, arg2, value);
}
/**
* pm_clock_get_num_clocks - PM call to request number of clocks
* @nclockss: Number of clocks
*
* This function is used by master to get number of clocks.
*
* Return: Returns status, either success or error+reason.
*/
static enum pm_ret_status pm_clock_get_num_clocks(uint32_t *nclocks)
{
return pm_api_clock_get_num_clocks(nclocks);
}
/**
* pm_clock_get_name() - PM call to request a clock's name
* @clock_id Clock ID
......@@ -1118,6 +1131,10 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid,
(uint16_t *)&data[1]);
data[0] = (unsigned int)ret;
break;
case PM_QID_CLOCK_GET_NUM_CLOCKS:
ret = pm_clock_get_num_clocks(&data[1]);
data[0] = (unsigned int)ret;
break;
default:
ret = PM_RET_ERROR_ARGS;
WARN("Unimplemented query service call: 0x%x\n", qid);
......
......@@ -23,6 +23,7 @@ enum pm_query_id {
PM_QID_PINCTRL_GET_FUNCTION_NAME,
PM_QID_PINCTRL_GET_FUNCTION_GROUPS,
PM_QID_PINCTRL_GET_PIN_GROUPS,
PM_QID_CLOCK_GET_NUM_CLOCKS,
};
/**********************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment