1. 27 2月, 2014 6 次提交
    • T
      clk: ti/divider: fix rate calculation for fractional rates · 7e50e7e1
      Tomi Valkeinen 提交于
      ti/clk-divider.c does not calculate the rates consistently at the moment.
      
      As an example, on OMAP3 we have a clock divider with a source clock of
      864000000 Hz. With dividers 6, 7 and 8 the theoretical rates are:
      
      6: 144000000
      7: 123428571.428571...
      8: 108000000
      
      Calling clk_round_rate() with the rate in the first column will give the
      rate in the second column:
      
      144000000 -> 144000000
      143999999 -> 123428571
      123428572 -> 123428571
      123428571 -> 108000000
      
      Note how clk_round_rate() returns 123428571 for rates from 123428572 to
      143999999, which is mathematically correct, but when clk_round_rate() is
      called with 123428571, the returned value is surprisingly 108000000.
      
      This means that the following code works a bit oddly:
      
      rate = clk_round_rate(clk, 123428572);
      clk_set_rate(clk, rate);
      
      As clk_set_rate() also does clock rate rounding, the result is that the
      clock is set to the rate of 108000000, not 123428571 returned by the
      clk_round_rate.
      
      This patch changes the ti/clk-divider.c to use DIV_ROUND_UP when
      calculating the rate. This gives the following behavior which fixes the
      inconsistency:
      
      144000000 -> 144000000
      143999999 -> 123428572
      123428572 -> 123428572
      123428571 -> 108000000
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      7e50e7e1
    • T
      clk: divider: fix rate calculation for fractional rates · b11d282d
      Tomi Valkeinen 提交于
      clk-divider.c does not calculate the rates consistently at the moment.
      
      As an example, on OMAP3 we have a clock divider with a source clock of
      864000000 Hz. With dividers 6, 7 and 8 the theoretical rates are:
      
      6: 144000000
      7: 123428571.428571...
      8: 108000000
      
      Calling clk_round_rate() with the rate in the first column will give the
      rate in the second column:
      
      144000000 -> 144000000
      143999999 -> 123428571
      123428572 -> 123428571
      123428571 -> 108000000
      
      Note how clk_round_rate() returns 123428571 for rates from 123428572 to
      143999999, which is mathematically correct, but when clk_round_rate() is
      called with 123428571, the returned value is surprisingly 108000000.
      
      This means that the following code works a bit oddly:
      
      rate = clk_round_rate(clk, 123428572);
      clk_set_rate(clk, rate);
      
      As clk_set_rate() also does clock rate rounding, the result is that the
      clock is set to the rate of 108000000, not 123428571 returned by the
      clk_round_rate.
      
      This patch changes the clk-divider.c to use DIV_ROUND_UP when
      calculating the rate. This gives the following behavior which fixes the
      inconsistency:
      
      144000000 -> 144000000
      143999999 -> 123428572
      123428572 -> 123428572
      123428571 -> 108000000
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      b11d282d
    • L
      clk: axi-clkgen: Add support for v2 · 1887c3a6
      Lars-Peter Clausen 提交于
      This patch adds support for the new v2 version of the axi-clkgen core.
      Unfortunately the method of accessing the registers is quite different on v2,
      while the content still stays largely the same. So the patch adds a small
      abstraction layer which implements the specific read and write functions for v1
      and v2 in callback functions.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      1887c3a6
    • Z
      clk: hisilicon: add hi3620_mmc_clks · 62ac983b
      Zhangfei Gao 提交于
      Suggest by Arnd: abstract mmc tuning as clock behavior,
      also because different soc have different tuning method and registers.
      hi3620_mmc_clks is added to handle mmc clock specifically on hi3620.
      Signed-off-by: NZhangfei Gao <zhangfei.gao@linaro.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      62ac983b
    • D
      clk: socfpga: Support multiple parents for the pll clocks · b89cd950
      Dinh Nguyen 提交于
      The PLLs can be from 3 different sources: osc1, osc2, or the f2s_ref_clk.
      Update the clock driver to be able to get the correct parent.
      Signed-off-by: NDinh Nguyen <dinguyen@altera.com>
      Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      b89cd950
    • D
      clk: socfpga: Fix integer overflow in clock calculation · 5585f731
      Dinh Nguyen 提交于
      Use 64-bit integer for calculating clock rate. Also use do_div for the
      64-bit division.
      Signed-off-by: NGraham Moore <grmoore@altera.com>
      Signed-off-by: NDinh Nguyen <dinguyen@altera.com>
      Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      5585f731
  2. 26 2月, 2014 1 次提交
  3. 25 2月, 2014 8 次提交
  4. 24 2月, 2014 17 次提交
  5. 23 2月, 2014 8 次提交