]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/arm/mach-imx/clk.c
4 #include <linux/slab.h>
5 #include <linux/spinlock.h>
8 DEFINE_SPINLOCK(imx_ccm_lock
);
10 void __init
imx_check_clocks(struct clk
*clks
[], unsigned int count
)
14 for (i
= 0; i
< count
; i
++)
16 pr_err("i.MX clk %u: register failed with %ld\n",
20 static struct clk
* __init
imx_obtain_fixed_clock_from_dt(const char *name
)
22 struct of_phandle_args phandle
;
23 struct clk
*clk
= ERR_PTR(-ENODEV
);
26 path
= kasprintf(GFP_KERNEL
, "/clocks/%s", name
);
28 return ERR_PTR(-ENOMEM
);
30 phandle
.np
= of_find_node_by_path(path
);
34 clk
= of_clk_get_from_provider(&phandle
);
35 of_node_put(phandle
.np
);
40 struct clk
* __init
imx_obtain_fixed_clock(
41 const char *name
, unsigned long rate
)
45 clk
= imx_obtain_fixed_clock_from_dt(name
);
47 clk
= imx_clk_fixed(name
, rate
);
52 * This fixups the register CCM_CSCMR1 write value.
53 * The write/read/divider values of the aclk_podf field
54 * of that register have the relationship described by
55 * the following table:
57 * write value read value divider
65 * 3b'111 3b'001 2(default)
67 * That's why we do the xor operation below.
69 #define CSCMR1_FIXUP 0x00600000
71 void imx_cscmr1_fixup(u32
*val
)