aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/mmp
AgeCommit message (Collapse)AuthorFilesLines
2014-11-12clk: mmp: add clock type mixChao Xie3-1/+580
The clock type mix is a kind of clock combines "div" and "mux". This kind of clock can not allow to change div first then mux or change mux first or div. The reason is 1. Some clock has frequency change bit. Each time want to change the frequency, there are some operations based on this bit, and these operations are time-cost. Seperating div and mux change will make the process longer, and waste more time. 2. Seperting the div and mux may generate middle clock that the peripharals do not support. It may make the peripharals hang. There are three kinds of this type of clock in all SOCes. 1. The clock has bit to trigger the frequency change. 2. Same as #1, but the operations for the bit is different 3. Do not have frequency change bit. So this type of clock has implemented the callbacks ->determine_rate ->set_rate_and_parent These callbacks can help to change the div and mux together. Signed-off-by: Chao Xie <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2014-11-12clk: mmp: move definiton of mmp_clk_frac to clk.hChao Xie2-18/+22
Move the definition of structure of mmp_clk_frac to clk.h. So device tree support can use this structure. Signed-off-by: Chao Xie <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2014-11-12clk: mmp: add init callback for clk-fracChao Xie1-0/+40
For the clk-frac, we need to make sure that the initial clock rate is one item of the table. If it is not, we use the first item in the table by default. Signed-off-by: Chao Xie <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2014-11-12clk: mmp: add spin lock for clk-fracChao Xie5-5/+15
The register used by clk-frac may be shared with other clocks. So it needs to use spin lock to protect the register access. Signed-off-by: Chao Xie <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2014-11-12clk: mmp: add prefix "mmp" for structures defined for clk-fracChao Xie5-21/+22
The structures defined for clk-frac will be used out side of clk-frac.c. To avoid conflicts, add prefix "mmp" for these structures' name. Signed-off-by: Chao Xie <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Michael Turquette <[email protected]>
2014-03-26clk: mmp: try to use closer one when do round rateChao Xie1-3/+7
The orignal code will use the bigger rate between "previous rate" and "current rate" when caculate the rate. In fact, hardware cares about the closest one. So choose the closer rate between "previous rate" and "current rate". Signed-off-by: Chao Xie <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2014-03-26clk: mmp: fix the wrong calculation formulaChao Xie1-5/+5
The formula is numerator/denominator = Fin / (Fout * factor) So Fout = Fin * denominator / (numerator * factor). Current clk_factor_round_rate and clk_factor_recalc_rate use wrong formula. This patch will fix them. Signed-off-by: Chao Xie <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2014-03-26clk: mmp: fix wrong mask when calculate denominatorChao Xie1-1/+1
The code has typo when calculate denominator. It should use den_mask instead of num_mask. Signed-off-by: Chao Xie <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2013-08-19clk: add CLK_SET_RATE_NO_REPARENT flagJames Hogan3-38/+72
Add a CLK_SET_RATE_NO_REPARENT clock flag, which will prevent muxes being reparented during clk_set_rate. To avoid breaking existing platforms, all callers of clk_register_mux() are adjusted to pass the new flag. Platform maintainers are encouraged to remove the flag if they wish to allow mux reparenting on set_rate. Signed-off-by: James Hogan <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Cc: Mike Turquette <[email protected]> Cc: Russell King <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Chao Xie <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Emilio López" <[email protected]> Cc: Gregory CLEMENT <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Prashant Gaikwad <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Peter De Schrijver <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Andrew Chew <[email protected]> Cc: Doug Anderson <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Sylwester Nawrocki <[email protected]> Cc: Thomas Abraham <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Tested-by: Haojian Zhuang <[email protected]> Acked-by: Stephen Warren <[email protected]> [tegra] Acked-by: Maxime Ripard <[email protected]> [sunxi] Acked-by: Sören Brinkmann <[email protected]> [Zynq] Signed-off-by: Mike Turquette <[email protected]>
2013-04-11ARM: pxa: remove cpu_is_xxx in gpio driverHaojian Zhuang3-3/+3
Avoid to use cpu_is_xxx() in pxa gpio driver. Use platform_device_id to identify the difference. Signed-off-by: Haojian Zhuang <[email protected]> Acked-by: Linus Walleij <[email protected]>
2012-08-28clk: mmp: add clock definition for mmp2Chao Xie2-0/+450
Initialize the clocks for mmp2 Signed-off-by: Chao Xie <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2012-08-28clk: mmp: add clock definition for pxa910Chao Xie2-0/+321
Initialize the clocks for pxa910 Signed-off-by: Chao Xie <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2012-08-28clk: mmp: add clock definition for pxa168Chao Xie2-0/+348
Initialize the clocks for pxa168 Signed-off-by: Chao Xie <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
2012-08-28clk: mmp: add mmp specific clocksChao Xie5-0/+442
add mmp specific clocks including apbc cloks, apmu clocks, and pll2, fraction clocks Signed-off-by: Chao Xie <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Mike Turquette <[email protected]>