| #include <linux/spinlock.h> |
| DEFINE_SPINLOCK(imx_ccm_lock); |
| static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name) |
| struct of_phandle_args phandle; |
| struct clk *clk = ERR_PTR(-ENODEV); |
| path = kasprintf(GFP_KERNEL, "/clocks/%s", name); |
| phandle.np = of_find_node_by_path(path); |
| clk = of_clk_get_from_provider(&phandle); |
| struct clk * __init imx_obtain_fixed_clock( |
| const char *name, unsigned long rate) |
| clk = imx_obtain_fixed_clock_from_dt(name); |
| clk = imx_clk_fixed(name, rate); |
| * This fixups the register CCM_CSCMR1 write value. |
| * The write/read/divider values of the aclk_podf field |
| * of that register have the relationship described by |
| * write value read value divider |
| * 3b'111 3b'001 2(default) |
| * That's why we do the xor operation below. |
| #define CSCMR1_FIXUP 0x00600000 |
| void imx_cscmr1_fixup(u32 *val) |