diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-08-21 16:35:03 +0300 |
---|---|---|
committer | Lukasz Majewski <lukma@denx.de> | 2019-08-22 01:10:09 +0300 |
commit | e6849e2fd88f16d9592059422173f7f6ab790e07 (patch) | |
tree | 85eb51885ac8cbbacef4304abd27375b210f8b12 /drivers | |
parent | 753e5385ca6d0fe5b5f5a3a97cc96b0f2469ca94 (diff) | |
download | u-boot-e6849e2fd88f16d9592059422173f7f6ab790e07.tar.xz |
clk: introduce enable_count
As what Linux Kernel 5.3.0 provides when enable/disable clk,
there is an enable_count in clk_core_disable/enable. Introduce
enable_count to track the clk enable/disable count when
clk_enable/disable for CCF. And Initialize enable_count to 0 when
register the clk.
And clk tree dump with enable_count will be supported, it will
be easy for us to check the clk status with enable_count
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk.c | 1 | ||||
-rw-r--r-- | drivers/clk/clk_fixed_rate.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 39b3087067..1cf9987f6c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -40,6 +40,7 @@ int clk_register(struct clk *clk, const char *drv_name, return ret; } + clk->enable_count = 0; /* Store back pointer to clk from udevice */ clk->dev->uclass_priv = clk; diff --git a/drivers/clk/clk_fixed_rate.c b/drivers/clk/clk_fixed_rate.c index 08cce0d79b..f51126793e 100644 --- a/drivers/clk/clk_fixed_rate.c +++ b/drivers/clk/clk_fixed_rate.c @@ -27,6 +27,7 @@ static int clk_fixed_rate_ofdata_to_platdata(struct udevice *dev) /* Make fixed rate clock accessible from higher level struct clk */ dev->uclass_priv = clk; clk->dev = dev; + clk->enable_count = 0; return 0; } |