| 
					
				 | 
			
			
				@@ -270,3 +270,54 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		/* Static mapping, never released */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		timer->io_base = ioremap(mem.start, mem.end - mem.start); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (!timer->io_base) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return -ENXIO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	/* After the dmtimer is using hwmod these clocks won't be needed */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	timer->fclk = clk_get(NULL, omap_hwmod_get_main_clk(oh)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (IS_ERR(timer->fclk)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return -ENODEV; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	/* FIXME: Need to remove hard-coded test on timer ID */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (gptimer_id != 12) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		struct clk *src; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		src = clk_get(NULL, fck_source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if (IS_ERR(src)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			r = -EINVAL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			r = clk_set_parent(timer->fclk, src); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			if (IS_ERR_VALUE(r)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				pr_warn("%s: %s cannot set source\n", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					__func__, oh->name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			clk_put(src); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	omap_hwmod_setup_one(oh_name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	omap_hwmod_enable(oh); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	__omap_dm_timer_init_regs(timer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (posted) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		__omap_dm_timer_enable_posted(timer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	/* Check that the intended posted configuration matches the actual */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (posted != timer->posted) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return -EINVAL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	timer->rate = clk_get_rate(timer->fclk); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	timer->reserved = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	return r; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static void __init omap2_gp_clockevent_init(int gptimer_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						const char *fck_source, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						const char *property) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	int res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	clkev.errata = omap_dm_timer_get_errata(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	/* 
			 |