Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
d853d3b2
Unverified
Commit
d853d3b2
authored
Sep 03, 2018
by
Soby Mathew
Committed by
GitHub
Sep 03, 2018
Browse files
Merge pull request #1541 from rajanv-xilinx/integration-num-clocks
zynqmp: pm: Add API to get number of clocks
parents
a1256912
ec9712ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
plat/xilinx/zynqmp/pm_service/pm_api_clock.c
View file @
d853d3b2
...
...
@@ -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
...
...
plat/xilinx/zynqmp/pm_service/pm_api_clock.h
View file @
d853d3b2
...
...
@@ -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
);
...
...
plat/xilinx/zynqmp/pm_service/pm_api_sys.c
View file @
d853d3b2
...
...
@@ -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
);
...
...
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
View file @
d853d3b2
...
...
@@ -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
,
};
/**********************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment