1. 06 Jul, 2016 2 commits
    • Paul Gortmaker's avatar
      clk: meson: make gxbb explicitly non-modular · 1f501d63
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/clk/meson/Kconfig:config COMMON_CLK_GXBB
      drivers/clk/meson/Kconfig:      bool
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      Also note that MODULE_DEVICE_TABLE and ALIAS are no-op for non-modules.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: linux-clk@vger.kernel.org
      Cc: linux-amlogic@lists.infradead.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarMichael Turquette <mturquette@baylibre.com>
      Link: lkml.kernel.org/r/20160704211220.5685-3-paul.gortmaker@windriver.com
      1f501d63
    • Paul Gortmaker's avatar
      clk: meson8b: make it explicitly non-modular · a718ce38
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/clk/meson/Kconfig:config COMMON_CLK_MESON8B
      drivers/clk/meson/Kconfig:      bool
      
      ...meaning that it currently is not being built as a module by anyone.
      However a recent commit added a bunch of modular boilerplate to this
      driver.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      Also note that MODULE DEVICE_TABLE/ALIAS are no-op when non-modular.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: linux-clk@vger.kernel.org
      Cc: linux-amlogic@lists.infradead.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarMichael Turquette <mturquette@baylibre.com>
      Link: lkml.kernel.org/r/20160704211220.5685-2-paul.gortmaker@windriver.com
      a718ce38
  2. 02 Jul, 2016 12 commits
    • Linus Walleij's avatar
      clk: qcom: add EBI2 clocks to the MSM8660 GCC · cdbf85c1
      Linus Walleij authored
      This adds the EBI2 2X and EBI2 clocks to the MSM8660/APQ8060
      GCC. This is necessary to enable clocking of the external bus
      interface so that peripherals on it can be mounted. These two
      clocks are simple gated branch clocks.
      
      In the vendor tree clock-8x60, these clocks have some kind of
      dependency, the EBI2 clock has .depends = &ebi2_2x_clk.c,
      what this means is undocumented, it doesn't seem like there
      is a parent/child relationship, so the solution I chose was to
      just have the EBI2 driver get and enable both clocks.
      
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      cdbf85c1
    • Dong Aisheng's avatar
      clk: imx7d: only enable minimum required clocks · e8e628fb
      Dong Aisheng authored
      Formerly clk core does not support imx7d clock type well that all
      its clock operations requires the parent clock on.
      Therefore we enabled all clocks by default in clock driver
      initialization for other module clocks operate well.
      
      After patch 'clk: imx7d: using api with flag CLK_OPS_PARENT_ENABLE',
      clk core can handle such clock type well, so we don't have to enable
      them all by default anymore. Instead, we only enable a minimum required
      set of clocks.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      e8e628fb
    • Dong Aisheng's avatar
      clk: imx7d: using api with flag CLK_OPS_PARENT_ENABLE · cbeac74a
      Dong Aisheng authored
      i.MX7D requires all clocks operations including enable/disable,
      rate change and re-parent with its parent clock on.
      Changing to the correct APIs to tell clk core such requirement.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      cbeac74a
    • Dong Aisheng's avatar
      clk: imx: add clk api for supporting CLK_OPS_PARENT_ENABLE clocks · 39c29498
      Dong Aisheng authored
      IMX SoCs like i.MX7D requires using CLK_OPS_PARENT_ENABLE flags,
      adding the corresponding clock APIs variants for easily to use.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      39c29498
    • Dong Aisheng's avatar
      clk: imx: re-order and concentrate the same type of clk api · 5afc9941
      Dong Aisheng authored
      Re-order and concentrate the same type of clk api for better
      code maintenance.
      
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      5afc9941
    • Dong Aisheng's avatar
      clk: core: support clocks which requires parents enable (part 2) · fc8726a2
      Dong Aisheng authored
      On Freescale i.MX7D platform, all clocks operations, including
      enable/disable, rate change and re-parent, requires its parent clock on.
      Current clock core can not support it well.
      This patch adding flag CLK_OPS_PARENT_ENABLE to handle this special case in
      clock core that enable its parent clock firstly for each operation and
      disable it later after operation complete.
      
      The patch part 2 fixes set clock rate and set parent while its parent
      is off. The most special case is for set_parent() operation which requires
      all parents including both old and new one to be enabled at the same time
      during the operation.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      [sboyd@codeaurora.org: Move set_rate tracepoint after prepare_enable]
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      fc8726a2
    • Dong Aisheng's avatar
      clk: core: support clocks which requires parents enable (part 1) · a4b3518d
      Dong Aisheng authored
      On Freescale i.MX7D platform, all clocks operations, including
      enable/disable, rate change and re-parent, requires its parent
      clock enable. Current clock core can not support it well.
      This patch introduce a new flag CLK_OPS_PARENT_ENABLE to handle this
      special case in clock core that enable its parent clock firstly for
      each operation and disable it later after operation complete.
      
      The patch part 1 fixes the possible disabling clocks while its parent
      is off during kernel booting phase in clk_disable_unused_subtree().
      
      Before the completion of kernel booting, clock tree is still not built
      completely, there may be a case that the child clock is on but its
      parent is off which could be caused by either HW initial reset state
      or bootloader initialization.
      
      Taking bootloader as an example, we may enable all clocks in HW by default.
      And during kernel booting time, the parent clock could be disabled in its
      driver probe due to calling clk_prepare_enable and clk_disable_unprepare.
      Because it's child clock is only enabled in HW while its SW usecount
      in clock tree is still 0, so clk_disable of parent clock will gate
      the parent clock in both HW and SW usecount ultimately. Then there will
      be a child clock is still on in HW but its parent is already off.
      
      Later in clk_disable_unused(), this clock disable accessing while its
      parent off will cause system hang due to the limitation of HW which
      must require its parent on.
      
      This patch simply enables the parent clock first before disabling
      if flag CLK_OPS_PARENT_ENABLE is set in clk_disable_unused_subtree().
      This is a simple solution and only affects booting time.
      
      After kernel booting up the clock tree is already created, there will
      be no case that child is off but its parent is off.
      So no need do this checking for normal clk_disable() later.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      a4b3518d
    • Dong Aisheng's avatar
      clk: move clk_disable_unused after clk_core_disable_unprepare function · 7ec986ef
      Dong Aisheng authored
      No function level change, just moving code place.
      clk_disable_unused function will need to call clk_core_prepare_enable/
      clk_core_disable_unprepare when adding CLK_OPS_PARENT_ENABLE features.
      So move it after clk_core_disable_unprepare to avoid adding forward
      declared functions later.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      7ec986ef
    • Dong Aisheng's avatar
      clk: introduce clk_core_enable_lock and clk_core_disable_lock functions · a6adc30b
      Dong Aisheng authored
      This can be useful when clock core wants to enable/disable clocks.
      Then we don't have to convert the struct clk_core to struct clk to call
      clk_enable/clk_disable which is a bit un-align with exist using.
      
      And after introduce clk_core_{enable|disable}_lock, we can refine
      clk_enable and clk_disable a bit.
      
      As well as clk_core_{enable|disable}_lock, we also added
      clk_core_{prepare|unprepare}_lock and clk_core_prepare_enable/
      clk_core_unprepare_disable for clock core to easily use.
      
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      a6adc30b
    • Stephen Boyd's avatar
      Merge tag 'v4.8-rockchip-clk1' of... · 582e2405
      Stephen Boyd authored
      Merge tag 'v4.8-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-next
      
      Pull rockchip clk driver updates from Heiko Stuebner:
      
      Placeholder for the rk3399 watchdog pclk, some newly exported
      rk3228 clockids and a small fix for the not yet used spdif to
      displayport clock on the rk3399.
      
      * tag 'v4.8-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
        clk: rockchip: fix incorrect rk3399 spdif-DPTX divider bits
        clk: rockchip: export rk3228 MAC clocks
        clk: rockchip: rename rk3228 sclk_macphy_50m to sclk_mac_extclk
        clk: rockchip: export rk3228 audio clocks
        clk: rockchip: include rk3228 downstream muxes into fractional dividers
        clk: rockchip: fix incorrect rk3228 clock registers
        clk: rockchip: add clock-ids for rk3228 MAC clocks
        clk: rockchip: add clock-ids for rk3228 audio clocks
        clk: rockchip: add a dummy clock for the watchdog pclk on rk3399
      582e2405
    • Stephen Boyd's avatar
      Merge tag 'tegra-for-4.8-clk' of... · 345c4296
      Stephen Boyd authored
      Merge tag 'tegra-for-4.8-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-next
      
      Pull tegra clk driver updates from Thierry Reding:
      
      Fixes and enhancements mostly for Tegra210 clocks that allow DSI and
      HDMI to work on Tegra X1. There's also a refactoring, including fixes,
      the USB PLL.
      
      * tag 'tegra-for-4.8-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
        clk: tegra: Initialize UTMI PLL when enabling PLLU
        clk: tegra: Micro-optimize Tegra210 clock setup
        clk: tegra: Make sor_safe the parent of dpaux and dpaux1
        clk: tegra: Mark timer clock as critical
        clk: tegra: Enable sor1 and sor1_src on Tegra210
        clk: tegra: Squash sor1 safe/brick/src into a single mux
        clk: tegra: Disable spread spectrum on pll_d2
        clk: tegra: Fixup post dividers on Tegra210
      345c4296
    • Maxime Ripard's avatar
      clk: fixed-factor: Allow for a few clocks to change the parent rate · e6cbf998
      Maxime Ripard authored
      The only way for a fixed factor clock to change its rate would be to change
      its parent rate.
      
      Since passing blindly CLK_SET_RATE_PARENT might break a lot of platforms
      that were relying on the fact that the parent rate wouldn't change,
      introduce a compatible-based whitelist that will allow clocks to opt-in
      that flag.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      e6cbf998
  3. 30 Jun, 2016 26 commits