Commit 75b90fe8 authored by Rajan Vaja's avatar Rajan Vaja Committed by Jolly Shah
Browse files

zynqmp: pm: clock: Add support for custom type flags



Add support to add extra custom type flags and provide
to caller in topology query.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: default avatarJolly Shah <jolly.shah@xilinx.com>
Change-Id: Id9cc065dbadfed2291dd4f62674d7838da4cdf40
parent b0eae6f9
......@@ -30,6 +30,10 @@
#define CLK_TYPE_SHIFT U(2)
#define CLK_CLKFLAGS_SHIFT U(8)
#define CLK_TYPEFLAGS_SHIFT U(24)
#define CLK_TYPEFLAGS2_SHIFT U(4)
#define CLK_TYPEFLAGS_BITS_MASK U(0xFF)
#define CLK_TYPEFLAGS2_BITS_MASK U(0x0F00)
#define CLK_TYPEFLAGS_BITS U(8)
#define CLK_EXTERNAL_PARENT (PARENT_CLK_EXTERNAL << CLK_PARENTS_ID_LEN)
......@@ -2461,6 +2465,7 @@ enum pm_ret_status pm_api_clock_get_topology(unsigned int clock_id,
struct pm_clock_node *clock_nodes;
uint8_t num_nodes;
unsigned int i;
uint16_t typeflags;
if (!pm_clock_valid(clock_id))
return PM_RET_ERROR_ARGS;
......@@ -2483,8 +2488,11 @@ enum pm_ret_status pm_api_clock_get_topology(unsigned int clock_id,
topology[i] = clock_nodes[index + i].type;
topology[i] |= clock_nodes[index + i].clkflags <<
CLK_CLKFLAGS_SHIFT;
topology[i] |= clock_nodes[index + i].typeflags <<
typeflags = clock_nodes[index + i].typeflags;
topology[i] |= (typeflags & CLK_TYPEFLAGS_BITS_MASK) <<
CLK_TYPEFLAGS_SHIFT;
topology[i] |= (typeflags & CLK_TYPEFLAGS2_BITS_MASK) >>
(CLK_TYPEFLAGS_BITS - CLK_TYPEFLAGS2_SHIFT);
}
return PM_RET_SUCCESS;
......
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