/*******************************************
*clk debugfs init
********************************************/
static int __init clock_late_init(void)
{
	struct clk_lookup *cl_lookups = &hi6930_clk_lookup[0];
       int i = 0;
	clock_debug_init();
	while((cl_lookups[i].clk != NULL) ) {
		clock_debug_add(cl_lookups[i].clk);
		i++;
      }
	return 0;
}
예제 #2
0
/*
 * The bootloader and/or AMSS may have left various clocks enabled.
 * Disable any clocks that have not been explicitly enabled by a
 * clk_enable() call and don't have the CLKFLAG_SKIP_AUTO_OFF flag.
 */
static int __init clock_late_init(void)
{
	unsigned n, count = 0;
	unsigned long flags;
	int ret = 0;

#ifdef CONFIG_DEBUG_FS	
	clock_debug_init(clk_init_data);
	for (n = 0; n < clk_init_data->size; n++) {
		struct clk *clk = clk_init_data->table[n].clk;
		bool handoff = false;
#endif

		clock_debug_add(clk);
		if (!(clk->flags & CLKFLAG_SKIP_AUTO_OFF)) {
			spin_lock_irqsave(&clk->lock, flags);
			if (!clk->count && clk->ops->auto_off) {
				count++;
				clk->ops->auto_off(clk);
			}
			if (clk->flags & CLKFLAG_HANDOFF_RATE) {
				clk->flags &= ~CLKFLAG_HANDOFF_RATE;
				handoff = true;
			}
			spin_unlock_irqrestore(&clk->lock, flags);
			/*
			 * Calling clk_disable() outside the lock is safe since
			 * it doesn't need to be atomic with the flag change.
			 */
			if (handoff)
				clk_disable(clk);
		}
	}
#ifdef CONFIG_DEBUG_FS
	pr_info("clock_late_init() disabled %d unused clocks\n", count);
	if (clk_init_data->late_init)
		ret = clk_init_data->late_init();
	return ret;
}
/*
 * The bootloader and/or AMSS may have left various clocks enabled.
 * Disable any clocks that have not been explicitly enabled by a
 * clk_enable() call and don't have the CLKFLAG_SKIP_AUTO_OFF flag.
 */
static int __init clock_late_init(void)
{
	unsigned n;
	unsigned long flags;
	unsigned count = 0;

	clock_debug_init(msm_clocks, msm_num_clocks);
	for (n = 0; n < msm_num_clocks; n++) {
		struct clk *clk = msm_clocks[n].clk;

		clock_debug_add(clk);
		if (!(clk->flags & CLKFLAG_SKIP_AUTO_OFF)) {
			spin_lock_irqsave(&clk->lock, flags);
			if (!clk->count && clk->ops->auto_off) {
				count++;
				clk->ops->auto_off(clk);
			}
			spin_unlock_irqrestore(&clk->lock, flags);
		}
	}
	pr_info("clock_late_init() disabled %d unused clocks\n", count);
	return 0;
}