1. 02 6月, 2016 1 次提交
  2. 22 4月, 2016 1 次提交
  3. 20 4月, 2016 10 次提交
    • S
      clk: fixed-rate: Add hw based registration APIs · 26ef56be
      Stephen Boyd 提交于
      Add registration APIs in the clk fixed-rate code to return struct
      clk_hw pointers instead of struct clk pointers. This way we hide
      the struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      26ef56be
    • S
      clk: gpio: Add hw based registration APIs · b120743a
      Stephen Boyd 提交于
      Add registration APIs in the clk gpio code to return struct
      clk_hw pointers instead of struct clk pointers. This way we hide
      the struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      b120743a
    • S
      clk: composite: Add hw based registration APIs · 49cb392d
      Stephen Boyd 提交于
      Add registration APIs in the clk composite code to return struct
      clk_hw pointers instead of struct clk pointers. This way we hide
      the struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      49cb392d
    • S
      clk: fractional-divider: Add hw based registration APIs · 39b44cff
      Stephen Boyd 提交于
      Add registration APIs in the clk fractional divider code to
      return struct clk_hw pointers instead of struct clk pointers.
      This way we hide the struct clk pointer from providers unless
      they need to use consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      39b44cff
    • S
      clk: fixed-factor: Add hw based registration APIs · 0759ac8a
      Stephen Boyd 提交于
      Add registration APIs in the clk fixed-factor code to return
      struct clk_hw pointers instead of struct clk pointers. This way
      we hide the struct clk pointer from providers unless they need to
      use consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      0759ac8a
    • S
      clk: mux: Add hw based registration APIs · 264b3171
      Stephen Boyd 提交于
      Add registration APIs in the clk mux code to return struct clk_hw
      pointers instead of struct clk pointers. This way we hide the
      struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      264b3171
    • S
      clk: gate: Add hw based registration APIs · e270d8cb
      Stephen Boyd 提交于
      Add registration APIs in the clk gate code to return struct
      clk_hw pointers instead of struct clk pointers. This way we hide
      the struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      e270d8cb
    • S
      clk: divider: Add hw based registration APIs · eb7d264f
      Stephen Boyd 提交于
      Add registration APIs in the clk divider code to return struct
      clk_hw pointers instead of struct clk pointers. This way we hide
      the struct clk pointer from providers unless they need to use
      consumer facing APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      eb7d264f
    • S
      clk: Add clk_hw OF clk providers · 0861e5b8
      Stephen Boyd 提交于
      Now that we have a clk registration API that doesn't return
      struct clks, we need to have some way to hand out struct clks via
      the clk_get() APIs that doesn't involve associating struct clk
      pointers with an OF node. Currently we ask the OF provider to
      give us a struct clk pointer for some clkspec, turn that struct
      clk into a struct clk_hw and then allocate a new struct clk to
      return to the caller.
      
      Let's add a clk_hw based OF provider hook that returns a struct
      clk_hw directly, so that we skip the intermediate step of
      converting from struct clk to struct clk_hw. Eventually when
      we've converted all OF clk providers to struct clk_hw based APIs
      we can remove the struct clk based ones.
      
      It should also be noted that we change the onecell provider to
      have a flex array instead of a pointer for the array of clk_hw
      pointers. This allows providers to allocate one structure of the
      correct length in one step instead of two.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      0861e5b8
    • S
      clk: Add {devm_}clk_hw_{register,unregister}() APIs · 4143804c
      Stephen Boyd 提交于
      We've largely split the clk consumer and provider APIs along
      struct clk and struct clk_hw, but clk_register() still returns a
      struct clk pointer for each struct clk_hw that's registered.
      Eventually we'd like to only allocate struct clks when there's a
      user, because struct clk is per-user now, so clk_register() needs
      to change.
      
      Let's add new APIs to register struct clk_hws, but this time
      we'll hide the struct clk from the caller by returning an int
      error code. Also add an unregistration API that takes the clk_hw
      structure that was passed to the registration API. This way
      provider drivers never have to deal with a struct clk pointer
      unless they're using the clk consumer APIs.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      4143804c
  4. 10 4月, 2016 2 次提交
  5. 27 2月, 2016 1 次提交
    • S
      clk: Make of_clk_get_parent_count() return unsigned ints · 929e7f3b
      Stephen Boyd 提交于
      Russell King recently pointed out a bug in the clk-gpio code
      where it fails to register the clk if of_clk_get_parent_count()
      returns an error because the "clocks" property isn't present in
      the DT node. If we're trying to count parents from DT we'd like
      to know the count, not if there is a "clocks" property or not.
      Furthermore, some drivers are assigning the return value to their
      clk_init_data::num_parents member which is unsigned, leading to
      potentially large numbers of parents when the property isn't
      present.
      
      Let's change the API to return an unsigned int instead of an int.
      All the callers just want to know the count anyway, and this
      avoids the bug that was in the clk-gpio driver.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      929e7f3b
  6. 07 2月, 2016 2 次提交
  7. 30 1月, 2016 4 次提交
  8. 24 12月, 2015 1 次提交
  9. 21 11月, 2015 2 次提交
  10. 27 10月, 2015 2 次提交
  11. 24 10月, 2015 1 次提交
  12. 22 10月, 2015 1 次提交
    • M
      clk: Add a basic multiplier clock · f2e0a532
      Maxime Ripard 提交于
      Some clocks are using a multiplier component, however, unlike their mux,
      gate or divider counterpart, these factors don't have a basic clock
      implementation.
      
      This leads to code duplication across platforms that want to use that kind
      of clocks, and the impossibility to use the composite clocks with such a
      clock without defining your own rate operations.
      
      Create such a driver in order to remove these issues, and hopefully factor
      the implementations, reducing code size across platforms and consolidating
      the various implementations.
      Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: NChen-Yu Tsai <wens@csie.org>
      f2e0a532
  13. 17 10月, 2015 1 次提交
  14. 03 10月, 2015 1 次提交
  15. 25 8月, 2015 3 次提交
  16. 29 7月, 2015 3 次提交
  17. 28 7月, 2015 1 次提交
    • B
      clk: change clk_ops' ->determine_rate() prototype · 0817b62c
      Boris Brezillon 提交于
      Clock rates are stored in an unsigned long field, but ->determine_rate()
      (which returns a rounded rate from a requested one) returns a long
      value (errors are reported using negative error codes), which can lead
      to long overflow if the clock rate exceed 2Ghz.
      
      Change ->determine_rate() prototype to return 0 or an error code, and pass
      a pointer to a clk_rate_request structure containing the expected target
      rate and the rate constraints imposed by clk users.
      
      The clk_rate_request structure might be extended in the future to contain
      other kind of constraints like the rounding policy, the maximum clock
      inaccuracy or other things that are not yet supported by the CCF
      (power consumption constraints ?).
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      CC: Jonathan Corbet <corbet@lwn.net>
      CC: Tony Lindgren <tony@atomide.com>
      CC: Ralf Baechle <ralf@linux-mips.org>
      CC: "Emilio López" <emilio@elopez.com.ar>
      CC: Maxime Ripard <maxime.ripard@free-electrons.com>
      Acked-by: NTero Kristo <t-kristo@ti.com>
      CC: Peter De Schrijver <pdeschrijver@nvidia.com>
      CC: Prashant Gaikwad <pgaikwad@nvidia.com>
      CC: Stephen Warren <swarren@wwwdotorg.org>
      CC: Thierry Reding <thierry.reding@gmail.com>
      CC: Alexandre Courbot <gnurou@gmail.com>
      CC: linux-doc@vger.kernel.org
      CC: linux-kernel@vger.kernel.org
      CC: linux-arm-kernel@lists.infradead.org
      CC: linux-omap@vger.kernel.org
      CC: linux-mips@linux-mips.org
      CC: linux-tegra@vger.kernel.org
      [sboyd@codeaurora.org: Fix parent dereference problem in
      __clk_determine_rate()]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Tested-by: NRomain Perier <romain.perier@gmail.com>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      [sboyd@codeaurora.org: Folded in fix from Heiko for fixed-rate
      clocks without parents or a rate determining op]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      0817b62c
  18. 21 7月, 2015 1 次提交
  19. 07 7月, 2015 1 次提交
  20. 21 6月, 2015 1 次提交
    • B
      clk: add CLK_RECALC_NEW_RATES clock flag for Exynos cpu clock support · d8d91987
      Bartlomiej Zolnierkiewicz 提交于
      This flag is needed to fix the issue with wrong dividers being setup
      by Common Clock Framework when using the new Exynos cpu clock support.
      
      The issue happens because clk_core_set_rate_nolock()  calls
      clk_calc_new_rates(clk, rate) before both pre/post clock notifiers have
      a chance to run.  In case of Exynos cpu clock support pre/post clock
      notifiers are registered for mout_apll clock which is a parent of armclk
      cpu clock and dividers are modified in both pre and post clock notifier.
      This results in wrong dividers values being later programmed by
      clk_change_rate(top).  To workaround the problem CLK_RECALC_NEW_RATES
      flag is added and it is set for mout_apll clock later so the correct
      divider values are re-calculated after both pre and post clock notifiers
      had run.
      
      For example when using "performance" governor on Exynos4210 Origen board
      the cpufreq-dt driver requests to change the frequency from 1000MHz to
      1200MHz and after the change state of the relevant clocks is following:
      
      Without use of CLK_GET_RATE_NOCACHE flag:
      
       fout_apll rate: 1200000000
               fout_apll_div_2 rate: 600000000
                       mout_clkout_cpu rate: 600000000
                               div_clkout_cpu rate: 600000000
                                       clkout_cpu rate: 600000000
               mout_apll rate: 1200000000
                       armclk rate: 1200000000
                       mout_hpm rate: 1200000000
                               div_copy rate: 300000000
                                       div_hpm rate: 300000000
                       mout_core rate: 1200000000
                               div_core rate: 1200000000
                                       div_core2 rate: 1200000000
                                               arm_clk_div_2 rate: 600000000
                                               div_corem0 rate: 300000000
                                               div_corem1 rate: 150000000
                                               div_periph rate: 300000000
                               div_atb rate: 300000000
                                       div_pclk_dbg rate: 150000000
                       sclk_apll rate: 1200000000
                               sclk_apll_div_2 rate: 600000000
      
      With use of CLK_GET_RATE_NOCACHE flag:
      
       fout_apll rate: 1200000000
               fout_apll_div_2 rate: 600000000
                       mout_clkout_cpu rate: 600000000
                               div_clkout_cpu rate: 600000000
                                       clkout_cpu rate: 600000000
               mout_apll rate: 1200000000
                       armclk rate: 1200000000
                       mout_hpm rate: 1200000000
                               div_copy rate: 200000000
                                       div_hpm rate: 200000000
                       mout_core rate: 1200000000
                               div_core rate: 1200000000
                                       div_core2 rate: 1200000000
                                               arm_clk_div_2 rate: 600000000
                                               div_corem0 rate: 300000000
                                               div_corem1 rate: 150000000
                                               div_periph rate: 300000000
                               div_atb rate: 240000000
                                       div_pclk_dbg rate: 120000000
                       sclk_apll rate: 150000000
                               sclk_apll_div_2 rate: 75000000
      
      Without this change cpufreq-dt driver showed ~10 mA larger energy
      consumption when compared to cpufreq-exynos one when "performance"
      cpufreq governor was used on Exynos4210 SoC based Origen board.
      
      This issue was probably meant to be workarounded by use of
      CLK_GET_RATE_NOCACHE and CLK_DIVIDER_READ_ONLY clock flags in
      the original Exynos cpu clock patchset (in "[PATCH v12 6/6] clk:
      samsung: remove unused clock aliases and update clock flags" patch)
      but usage of these flags is not sufficient to fix the issue observed.
      
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Tomasz Figa <tomasz.figa@gmail.com>
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NMichael Turquette <mturquette@baylibre.com>
      d8d91987