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>
This commit is contained in:
		
							parent
							
								
									753e5385ca
								
							
						
					
					
						commit
						e6849e2fd8
					
				|  | @ -40,6 +40,7 @@ int clk_register(struct clk *clk, const char *drv_name, | ||||||
| 		return ret; | 		return ret; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	clk->enable_count = 0; | ||||||
| 	/* Store back pointer to clk from udevice */ | 	/* Store back pointer to clk from udevice */ | ||||||
| 	clk->dev->uclass_priv = clk; | 	clk->dev->uclass_priv = clk; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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 */ | 	/* Make fixed rate clock accessible from higher level struct clk */ | ||||||
| 	dev->uclass_priv = clk; | 	dev->uclass_priv = clk; | ||||||
| 	clk->dev = dev; | 	clk->dev = dev; | ||||||
|  | 	clk->enable_count = 0; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -61,6 +61,7 @@ struct clk { | ||||||
| 	struct udevice *dev; | 	struct udevice *dev; | ||||||
| 	long long rate;	/* in HZ */ | 	long long rate;	/* in HZ */ | ||||||
| 	u32 flags; | 	u32 flags; | ||||||
|  | 	int enable_count; | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * Written by of_xlate. In the future, we might add more fields here. | 	 * Written by of_xlate. In the future, we might add more fields here. | ||||||
| 	 */ | 	 */ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue