Skip to content

Commit 70c0d36

Browse files
rajanv-xilinxgregkh
authored andcommitted
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: Rajan Vaja <rajan.vaja@xilinx.com> Signed-off-by: Jolly Shah <jolly.shah@xilinx.com> Link: https://lore.kernel.org/r/1587761887-4279-11-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7a1e106 commit 70c0d36

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

‎drivers/clk/zynqmp/clk-mux-zynqmp.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw)
4747
u32 clk_id = mux->clk_id;
4848
u32 val;
4949
int ret;
50-
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
5150

52-
ret = eemi_ops->clock_getparent(clk_id, &val);
51+
ret = zynqmp_pm_clock_getparent(clk_id, &val);
5352

5453
if (ret)
5554
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)
7170
const char *clk_name = clk_hw_get_name(hw);
7271
u32 clk_id = mux->clk_id;
7372
int ret;
74-
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
7573

76-
ret = eemi_ops->clock_setparent(clk_id, index);
74+
ret = zynqmp_pm_clock_setparent(clk_id, index);
7775

7876
if (ret)
7977
pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n",

‎drivers/firmware/xilinx/zynqmp.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate);
485485
*
486486
* Return: Returns status, either success or error+reason
487487
*/
488-
static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
488+
int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
489489
{
490490
return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id,
491491
parent_id, 0, 0, NULL);
492492
}
493+
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent);
493494

494495
/**
495496
* 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)
501502
*
502503
* Return: Returns status, either success or error+reason
503504
*/
504-
static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
505+
int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
505506
{
506507
u32 ret_payload[PAYLOAD_ARG_CNT];
507508
int ret;
@@ -512,6 +513,7 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
512513

513514
return ret;
514515
}
516+
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent);
515517

516518
/**
517519
* 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)
744746
}
745747

746748
static const struct zynqmp_eemi_ops eemi_ops = {
747-
.clock_setparent = zynqmp_pm_clock_setparent,
748-
.clock_getparent = zynqmp_pm_clock_getparent,
749749
.ioctl = zynqmp_pm_ioctl,
750750
.reset_assert = zynqmp_pm_reset_assert,
751751
.reset_get_status = zynqmp_pm_reset_get_status,

‎include/linux/firmware/xlnx-zynqmp.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ struct zynqmp_pm_query_data {
296296
struct zynqmp_eemi_ops {
297297
int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
298298
int (*fpga_get_status)(u32 *value);
299-
int (*clock_setparent)(u32 clock_id, u32 parent_id);
300-
int (*clock_getparent)(u32 clock_id, u32 *parent_id);
301299
int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
302300
int (*reset_assert)(const enum zynqmp_pm_reset reset,
303301
const enum zynqmp_pm_reset_action assert_flag);
@@ -331,6 +329,8 @@ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider);
331329
int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider);
332330
int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate);
333331
int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate);
332+
int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id);
333+
int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id);
334334
#else
335335
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
336336
{
@@ -377,6 +377,14 @@ static inline int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
377377
{
378378
return -ENODEV;
379379
}
380+
static inline int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
381+
{
382+
return -ENODEV;
383+
}
384+
static inline int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
385+
{
386+
return -ENODEV;
387+
}
380388
#endif
381389

382390
#endif /* __FIRMWARE_ZYNQMP_H__ */

0 commit comments

Comments
 (0)