Commit cf1769b5 authored by Jolly Shah's avatar Jolly Shah
Browse files

zynqmp: pm: Set PLL fractional data using PLL set parameter EEMI API


Fractional data should be set using PLL set parameter EEMI API. This
stands for system-level communication (APU to PMU). Since linux
already uses a specific IOCTL function to do this and we need to
keep it that way, the pll clock ID given by linux has to be mapped
to the pll node ID that is communicated at the system-level (argument
of PLL set parameter API).
With this modification the function pm_api_clk_set_pll_frac_data is
removed from pm_api_clock.c/h because it became unused.
Signed-off-by: default avatarMirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: default avatarWill Wong <WILLW@xilinx.com>
Signed-off-by: default avatarJolly Shah <jollys@xilinx.com>
parent 1e3fb352
No related merge requests found
Showing with 10 additions and 43 deletions
+10 -43
......@@ -3199,42 +3199,3 @@ enum pm_ret_status pm_api_clk_get_pll_mode(unsigned int pll,
return ret;
}
/**
* 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
*/
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;
}
......@@ -312,7 +312,5 @@ enum pm_ret_status pm_api_clk_set_pll_mode(unsigned int pll,
unsigned int mode);
enum pm_ret_status pm_api_clk_get_pll_mode(unsigned int pll,
unsigned int *mode);
enum pm_ret_status pm_api_clk_set_pll_frac_data(unsigned int pll,
unsigned int data);
#endif /* PM_API_CLOCK_H */
......@@ -364,7 +364,7 @@ static enum pm_ret_status pm_ioctl_get_pll_frac_mode
/**
* pm_ioctl_set_pll_frac_data() - Ioctl function for
* setting pll fraction data
* @pll PLL id
* @pll PLL clock id
* @data fraction data
*
* This function sets fraction data.
......@@ -375,7 +375,15 @@ static enum pm_ret_status pm_ioctl_get_pll_frac_mode
static enum pm_ret_status pm_ioctl_set_pll_frac_data
(unsigned int pll, unsigned int data)
{
return pm_api_clk_set_pll_frac_data(pll, data);
enum pm_node_id pll_nid;
enum pm_ret_status status;
/* Get PLL node ID using PLL clock ID */
status = pm_clock_get_pll_node_id(pll, &pll_nid);
if (status != PM_RET_SUCCESS)
return status;
return pm_pll_set_parameter(pll_nid, PM_PLL_PARAM_DATA, data);
}
/**
......
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