|  | @@ -350,3 +350,67 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		if (dd->lpmode_mask) {
 | 
	
		
			
				|  |  | +			if (dd->last_rounded_lpmode)
 | 
	
		
			
				|  |  | +				v |= dd->lpmode_mask;
 | 
	
		
			
				|  |  | +			else
 | 
	
		
			
				|  |  | +				v &= ~dd->lpmode_mask;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		__raw_writel(v, dd->control_reg);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* We let the clock framework set the other output dividers later */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* REVISIT: Set ramp-up delay? */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	_omap3_noncore_dpll_lock(clk);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Public functions */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * omap3_dpll_recalc - recalculate DPLL rate
 | 
	
		
			
				|  |  | + * @clk: DPLL struct clk
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Recalculate and propagate the DPLL rate.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	struct clk_hw_omap *clk = to_clk_hw_omap(hw);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return omap2_get_dpll_rate(clk);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * omap3_noncore_dpll_enable - instruct a DPLL to enter bypass or lock mode
 | 
	
		
			
				|  |  | + * @clk: pointer to a DPLL struct clk
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Instructs a non-CORE DPLL to enable, e.g., to enter bypass or lock.
 | 
	
		
			
				|  |  | + * The choice of modes depends on the DPLL's programmed rate: if it is
 | 
	
		
			
				|  |  | + * the same as the DPLL's parent clock, it will enter bypass;
 | 
	
		
			
				|  |  | + * otherwise, it will enter lock.  This code will wait for the DPLL to
 | 
	
		
			
				|  |  | + * indicate readiness before returning, unless the DPLL takes too long
 | 
	
		
			
				|  |  | + * to enter the target state.  Intended to be used as the struct clk's
 | 
	
		
			
				|  |  | + * enable function.  If DPLL3 was passed in, or the DPLL does not
 | 
	
		
			
				|  |  | + * support low-power stop, or if the DPLL took too long to enter
 | 
	
		
			
				|  |  | + * bypass or lock, return -EINVAL; otherwise, return 0.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +int omap3_noncore_dpll_enable(struct clk_hw *hw)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	struct clk_hw_omap *clk = to_clk_hw_omap(hw);
 | 
	
		
			
				|  |  | +	int r;
 | 
	
		
			
				|  |  | +	struct dpll_data *dd;
 | 
	
		
			
				|  |  | +	struct clk *parent;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	dd = clk->dpll_data;
 | 
	
		
			
				|  |  | +	if (!dd)
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (clk->clkdm) {
 | 
	
		
			
				|  |  | +		r = clkdm_clk_enable(clk->clkdm, hw->clk);
 | 
	
		
			
				|  |  | +		if (r) {
 | 
	
		
			
				|  |  | +			WARN(1,
 |