mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	clk: ingenic: Support specifying "wait for clock stable" delay
Some clocks need a small delay after being ungated to run stable, as using them too soon might result in hardware lockups. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
		
							parent
							
								
									7ef3844fc5
								
							
						
					
					
						commit
						261a831f04
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		|  | @ -512,6 +512,9 @@ static int ingenic_clk_enable(struct clk_hw *hw) | |||
| 		spin_lock_irqsave(&cgu->lock, flags); | ||||
| 		ingenic_cgu_gate_set(cgu, &clk_info->gate, false); | ||||
| 		spin_unlock_irqrestore(&cgu->lock, flags); | ||||
| 
 | ||||
| 		if (clk_info->gate.delay_us) | ||||
| 			udelay(clk_info->gate.delay_us); | ||||
| 	} | ||||
| 
 | ||||
| 	return 0; | ||||
|  |  | |||
|  | @ -112,11 +112,13 @@ struct ingenic_cgu_fixdiv_info { | |||
|  * @reg: offset of the gate control register within the CGU | ||||
|  * @bit: offset of the bit in the register that controls the gate | ||||
|  * @clear_to_gate: if set, the clock is gated when the bit is cleared | ||||
|  * @delay_us: delay in microseconds after which the clock is considered stable | ||||
|  */ | ||||
| struct ingenic_cgu_gate_info { | ||||
| 	unsigned reg; | ||||
| 	u8 bit; | ||||
| 	bool clear_to_gate; | ||||
| 	u16 delay_us; | ||||
| }; | ||||
| 
 | ||||
| /**
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Paul Cercueil
						Paul Cercueil