mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 18:44:22 +00:00
feat(clk): add set_parent callback
This callback will be used to set a clock's parent if the underlying clock driver supports this option. Change-Id: Ie8a77d17dd3cc867bd520217b481cd188317a9c9 Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
This commit is contained in:
parent
6f05b8d45e
commit
a2c6016f92
2 changed files with 9 additions and 0 deletions
|
@ -41,6 +41,13 @@ int clk_get_parent(unsigned long id)
|
||||||
return ops->get_parent(id);
|
return ops->get_parent(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int clk_set_parent(unsigned long id, unsigned long parent_id)
|
||||||
|
{
|
||||||
|
assert((ops != NULL) && (ops->set_parent != NULL));
|
||||||
|
|
||||||
|
return ops->set_parent(id, parent_id);
|
||||||
|
}
|
||||||
|
|
||||||
bool clk_is_enabled(unsigned long id)
|
bool clk_is_enabled(unsigned long id)
|
||||||
{
|
{
|
||||||
assert((ops != NULL) && (ops->is_enabled != NULL));
|
assert((ops != NULL) && (ops->is_enabled != NULL));
|
||||||
|
|
|
@ -14,6 +14,7 @@ struct clk_ops {
|
||||||
void (*disable)(unsigned long id);
|
void (*disable)(unsigned long id);
|
||||||
unsigned long (*get_rate)(unsigned long id);
|
unsigned long (*get_rate)(unsigned long id);
|
||||||
int (*get_parent)(unsigned long id);
|
int (*get_parent)(unsigned long id);
|
||||||
|
int (*set_parent)(unsigned long id, unsigned long parent_id);
|
||||||
bool (*is_enabled)(unsigned long id);
|
bool (*is_enabled)(unsigned long id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ void clk_disable(unsigned long id);
|
||||||
unsigned long clk_get_rate(unsigned long id);
|
unsigned long clk_get_rate(unsigned long id);
|
||||||
bool clk_is_enabled(unsigned long id);
|
bool clk_is_enabled(unsigned long id);
|
||||||
int clk_get_parent(unsigned long id);
|
int clk_get_parent(unsigned long id);
|
||||||
|
int clk_set_parent(unsigned long id, unsigned long parent_id);
|
||||||
|
|
||||||
void clk_register(const struct clk_ops *ops);
|
void clk_register(const struct clk_ops *ops);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue