/** * omap2_clksel_get_divisor - get current divider applied to parent clock. * @clk: OMAP struct clk to use. * * Returns the integer divisor upon success or 0 on error. */ u32 omap2_clksel_get_divisor(struct clk *clk) { u32 v; if (!clk->clksel_mask) return 0; v = __raw_readl(clk->clksel_reg) & clk->clksel_mask; v >>= __ffs(clk->clksel_mask); return omap2_clksel_to_divisor(clk, v); }
/** * omap2_clksel_get_divisor - get current divider applied to parent clock. * @clk: OMAP struct clk to use. * * Returns the integer divisor upon success or 0 on error. */ u32 omap2_clksel_get_divisor(struct clk *clk) { u32 field_mask, field_val; void __iomem *div_addr; div_addr = omap2_get_clksel(clk, &field_mask); if (div_addr == 0) return 0; field_val = __raw_readl(div_addr) & field_mask; field_val >>= __ffs(field_mask); return omap2_clksel_to_divisor(clk, field_val); }