[RFC V1 7/8] ARM i.MX: prepare common clk support

Mike Turquette mturquette at linaro.org
Mon Nov 28 21:36:33 EST 2011


On Wed, Nov 23, 2011 at 3:12 AM, Richard Zhao <richard.zhao at linaro.org> wrote:
> +#define DEFINE_CLK_DIVIDER(_name, _parent, _flags, _reg, _shift, _width) \
> +       struct clk_divider _name = { \
> +               .clk = { \
> +                       .name = #_name, \
> +                       .ops = &clk_divider_ops, \
> +                       .parent = _parent, \
> +                       .flags = _flags, \
> +               }, \
> +               .reg = (_reg), \
> +               .shift = (_shift), \
> +               .width = (_width), \
> +               .lock = &imx_ccm_lock, \
> +       }
> +
> +#define DEFINE_CLK_MUX(_name, _reg, _shift, _width, _clks) \
> +       struct clk_mux _name = { \
> +               .clk = { \
> +                       .name = #_name, \
> +                       .ops = &clk_mux_ops, \
> +               }, \
> +               .reg = (_reg), \
> +               .shift = (_shift), \
> +               .width = (_width), \
> +               .clks = (_clks), \
> +               .num_clks = ARRAY_SIZE(_clks), \
> +               .lock = &imx_ccm_lock, \
> +       }
> +
> +#define DEFINE_CLK_FIXED(_name, _rate) \
> +       struct clk_hw_fixed _name = { \
> +               .clk = { \
> +                       .name = #_name, \
> +                       .ops = &clk_hw_fixed_ops, \
> +               }, \
> +               .fixed_rate = (_rate), \
> +       }
> +
>  #endif /* CONFIG_GENERIC_CLK */
>  #endif /* __ASSEMBLY__ */
>  #endif /* __ASM_ARCH_MXC_CLOCK_H__ */
> --
> 1.7.5.4
>
>
>

Can you move these into clk.h/approriate header?  Just add _lock to it
and it'll work fine for your code.

Thanks,
Mike



More information about the linux-arm-kernel mailing list