Commit 70c0d364 authored by Rajan Vaja's avatar Rajan Vaja Committed by Greg Kroah-Hartman

firmware: xilinx: Remove eemi ops for clock set/get parent

Use direct function call instead of eemi ops for clock set/get parent.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-11-git-send-email-jolly.shah@xilinx.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a1e1062
...@@ -47,9 +47,8 @@ static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw) ...@@ -47,9 +47,8 @@ static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw)
u32 clk_id = mux->clk_id; u32 clk_id = mux->clk_id;
u32 val; u32 val;
int ret; int ret;
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
ret = eemi_ops->clock_getparent(clk_id, &val); ret = zynqmp_pm_clock_getparent(clk_id, &val);
if (ret) if (ret)
pr_warn_once("%s() getparent failed for clock: %s, ret = %d\n", pr_warn_once("%s() getparent failed for clock: %s, ret = %d\n",
...@@ -71,9 +70,8 @@ static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index) ...@@ -71,9 +70,8 @@ static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index)
const char *clk_name = clk_hw_get_name(hw); const char *clk_name = clk_hw_get_name(hw);
u32 clk_id = mux->clk_id; u32 clk_id = mux->clk_id;
int ret; int ret;
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
ret = eemi_ops->clock_setparent(clk_id, index); ret = zynqmp_pm_clock_setparent(clk_id, index);
if (ret) if (ret)
pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n", pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n",
......
...@@ -485,11 +485,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate); ...@@ -485,11 +485,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate);
* *
* Return: Returns status, either success or error+reason * Return: Returns status, either success or error+reason
*/ */
static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
{ {
return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id, return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id,
parent_id, 0, 0, NULL); parent_id, 0, 0, NULL);
} }
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent);
/** /**
* zynqmp_pm_clock_getparent() - Get the clock parent for given id * zynqmp_pm_clock_getparent() - Get the clock parent for given id
...@@ -501,7 +502,7 @@ static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) ...@@ -501,7 +502,7 @@ static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
* *
* Return: Returns status, either success or error+reason * Return: Returns status, either success or error+reason
*/ */
static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
{ {
u32 ret_payload[PAYLOAD_ARG_CNT]; u32 ret_payload[PAYLOAD_ARG_CNT];
int ret; int ret;
...@@ -512,6 +513,7 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) ...@@ -512,6 +513,7 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent);
/** /**
* zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not
...@@ -744,8 +746,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out) ...@@ -744,8 +746,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
} }
static const struct zynqmp_eemi_ops eemi_ops = { static const struct zynqmp_eemi_ops eemi_ops = {
.clock_setparent = zynqmp_pm_clock_setparent,
.clock_getparent = zynqmp_pm_clock_getparent,
.ioctl = zynqmp_pm_ioctl, .ioctl = zynqmp_pm_ioctl,
.reset_assert = zynqmp_pm_reset_assert, .reset_assert = zynqmp_pm_reset_assert,
.reset_get_status = zynqmp_pm_reset_get_status, .reset_get_status = zynqmp_pm_reset_get_status,
......
...@@ -296,8 +296,6 @@ struct zynqmp_pm_query_data { ...@@ -296,8 +296,6 @@ struct zynqmp_pm_query_data {
struct zynqmp_eemi_ops { struct zynqmp_eemi_ops {
int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
int (*fpga_get_status)(u32 *value); int (*fpga_get_status)(u32 *value);
int (*clock_setparent)(u32 clock_id, u32 parent_id);
int (*clock_getparent)(u32 clock_id, u32 *parent_id);
int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
int (*reset_assert)(const enum zynqmp_pm_reset reset, int (*reset_assert)(const enum zynqmp_pm_reset reset,
const enum zynqmp_pm_reset_action assert_flag); const enum zynqmp_pm_reset_action assert_flag);
...@@ -331,6 +329,8 @@ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider); ...@@ -331,6 +329,8 @@ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider);
int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider); int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider);
int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate); int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate);
int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate); int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate);
int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id);
int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id);
#else #else
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
{ {
...@@ -377,6 +377,14 @@ static inline int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) ...@@ -377,6 +377,14 @@ static inline int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
{ {
return -ENODEV; return -ENODEV;
} }
static inline int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
{
return -ENODEV;
}
static inline int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
{
return -ENODEV;
}
#endif #endif
#endif /* __FIRMWARE_ZYNQMP_H__ */ #endif /* __FIRMWARE_ZYNQMP_H__ */
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