4 #include <linux/slab.h>
5 #include <linux/spinlock.h>
8 DEFINE_SPINLOCK(imx_ccm_lock
);
10 static struct clk
* __init
imx_obtain_fixed_clock_from_dt(const char *name
)
12 struct of_phandle_args phandle
;
13 struct clk
*clk
= ERR_PTR(-ENODEV
);
16 path
= kasprintf(GFP_KERNEL
, "/clocks/%s", name
);
18 return ERR_PTR(-ENOMEM
);
20 phandle
.np
= of_find_node_by_path(path
);
24 clk
= of_clk_get_from_provider(&phandle
);
25 of_node_put(phandle
.np
);
30 struct clk
* __init
imx_obtain_fixed_clock(
31 const char *name
, unsigned long rate
)
35 clk
= imx_obtain_fixed_clock_from_dt(name
);
37 clk
= imx_clk_fixed(name
, rate
);
42 * This fixups the register CCM_CSCMR1 write value.
43 * The write/read/divider values of the aclk_podf field
44 * of that register have the relationship described by
45 * the following table:
47 * write value read value divider
55 * 3b'111 3b'001 2(default)
57 * That's why we do the xor operation below.
59 #define CSCMR1_FIXUP 0x00600000
61 void imx_cscmr1_fixup(u32
*val
)