/* If the necessary clocks for the OMAP hardware IP block that corresponds to clock @clk are enabled, then wait for the module to indicate readiness (i.e., to leave IDLE). This code does not belong in the clock code and will be moved in the medium term to module-dependent code. No return value.  */
static void omap2_module_wait_ready(struct clk *clk)
/* If the necessary clocks for the OMAP hardware IP block that corresponds to clock @clk are enabled, then wait for the module to indicate readiness (i.e., to leave IDLE). This code does not belong in the clock code and will be moved in the medium term to module-dependent code. No return value.  */
static void omap2_module_wait_ready(struct clk *clk)
{
	void __iomem *companion_reg, *idlest_reg;
	u8 other_bit, idlest_bit;
	if (clk->ops->find_companion) {
		clk->ops->find_companion(clk, &companion_reg, &other_bit);
		if (!(__raw_readl(companion_reg) & (1 << other_bit)))
			return;
	}
	clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit);
	omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), clk->name);
}