platform/kernel/linux-rpi.git
6 years agoMerge branch 'clk-devm-provider' into clk-next
Stephen Boyd [Tue, 14 Nov 2017 18:07:39 +0000 (10:07 -0800)]
Merge branch 'clk-devm-provider' into clk-next

* clk-devm-provider:
  clk: qcom: common: Migrate to devm_* APIs for resets and clk providers
  clk: Add devm_of_clk_add_hw_provider()/del_provider() APIs

6 years agoMerge branch 'clk-const' into clk-next
Stephen Boyd [Tue, 14 Nov 2017 18:07:38 +0000 (10:07 -0800)]
Merge branch 'clk-const' into clk-next

* clk-const:
  clk: make clk_init_data const
  clk: imx: make clk_ops const
  clk: mmp: make clk_ops const
  clk: hisilicon: make clk_ops const
  clk: mxs: make clk_ops const
  clk: sirf: make clk_ops const
  clk: spear: make clk_ops const
  CLK: SPEAr: make aux_clk_masks structures const
  CLK: SPEAr: make structure field and function argument as const

6 years agoMerge branch 'clk-sunxi' into clk-next
Stephen Boyd [Tue, 14 Nov 2017 18:07:37 +0000 (10:07 -0800)]
Merge branch 'clk-sunxi' into clk-next

* clk-sunxi:
  clk: sunxi: explicitly request exclusive reset control
  clk: sunxi: fix build warning

6 years agoMerge branch 'clk-hikey' into clk-next
Stephen Boyd [Tue, 14 Nov 2017 18:07:35 +0000 (10:07 -0800)]
Merge branch 'clk-hikey' into clk-next

* clk-hikey:
  clk: hi3798cv200: correct parent mux clock for 'clk_sdio0_ciu'
  clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()
  clk: hi3660: fix incorrect uart3 clock freqency
  clk: hi6220: mark clock cs_atb_syspll as critical

6 years agoMerge tag 'tegra-for-4.15-clk-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Tue, 14 Nov 2017 18:07:15 +0000 (10:07 -0800)]
Merge tag 'tegra-for-4.15-clk-2' of git://git./linux/kernel/git/tegra/linux into clk-next

Pull tegra clk drivers updates from Thierry Reding:

This contains cleanups and minor fixes for the Tegra clock driver.

* tag 'tegra-for-4.15-clk-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  clk: tegra: Use readl_relaxed_poll_timeout_atomic() in tegra210_clock_init()
  clk: tegra: dfll: Fix drvdata overwriting issue
  clk: tegra: Fix cclk_lp divisor register
  clk: tegra: Bump SCLK clock rate to 216 MHz
  clk: tegra: Use common definition of APBDMA clock gate
  clk: tegra: Correct parent of the APBDMA clock
  clk: tegra: Add AHB DMA clock entry
  clk: tegra: Mark APB clock as critical
  clk: tegra: Make tegra_clk_pll_params __ro_after_init
  clk: tegra: Fix sor1_out clock implementation
  clk: tegra: Use tegra_clk_register_periph_data()
  clk: tegra: Add peripheral clock registration helper
  clk: tegra: Check BPMP response return code
  dt-bindings: clock: tegra: Add sor1_out clock
  firmware: tegra: Propagate error code to caller

6 years agoclk: hi3798cv200: correct parent mux clock for 'clk_sdio0_ciu'
Shawn Guo [Wed, 27 Sep 2017 18:59:40 +0000 (11:59 -0700)]
clk: hi3798cv200: correct parent mux clock for 'clk_sdio0_ciu'

Other than 'mmc_mux', 'clk_sdio0_ciu' uses a different parent mux clock.
Let's add this mux clock as 'sdio0_mux', and correct the parent of
'clk_sdio0_ciu' to be it.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: hisilicon: Delete an error message for a failed memory allocation in hisi_regist...
Markus Elfring [Tue, 26 Sep 2017 20:00:05 +0000 (22:00 +0200)]
clk: hisilicon: Delete an error message for a failed memory allocation in hisi_register_clkgate_sep()

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: hi3660: fix incorrect uart3 clock freqency
Zhong Kaihua [Mon, 7 Aug 2017 14:51:56 +0000 (22:51 +0800)]
clk: hi3660: fix incorrect uart3 clock freqency

UART3 clock rate is doubled in previous commit.

This error is not detected until recently a mezzanine board which makes
real use of uart3 port (through LS connector of 96boards) was setup
and tested on hi3660-hikey960 board.

This patch changes clock source rate of clk_factor_uart3 to 100000000.

Signed-off-by: Zhong Kaihua <zhongkaihua@huawei.com>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: qcom: common: Migrate to devm_* APIs for resets and clk providers
Stephen Boyd [Fri, 1 Sep 2017 23:16:41 +0000 (16:16 -0700)]
clk: qcom: common: Migrate to devm_* APIs for resets and clk providers

Now that we have devm APIs for the reset controller and of clk hw
provider APIs we can remove the custom code here.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: Add devm_of_clk_add_hw_provider()/del_provider() APIs
Stephen Boyd [Fri, 1 Sep 2017 23:16:40 +0000 (16:16 -0700)]
clk: Add devm_of_clk_add_hw_provider()/del_provider() APIs

Sometimes we only have one of_clk_del_provider() call in driver
error and remove paths, because we're missing a
devm_of_clk_add_hw_provider() API. Introduce the API so we can
convert drivers to use this and potentially reduce the amount of
code needed to remove providers in drivers.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: make clk_init_data const
Bhumika Goyal [Fri, 18 Aug 2017 10:08:17 +0000 (15:38 +0530)]
clk: make clk_init_data const

Make these const as they are only stored in the init field of a clk_hw
structure, which is const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: imx: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 13:18:29 +0000 (18:48 +0530)]
clk: imx: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: mmp: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 13:35:55 +0000 (19:05 +0530)]
clk: mmp: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: hisilicon: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 13:42:07 +0000 (19:12 +0530)]
clk: hisilicon: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: mxs: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 13:52:47 +0000 (19:22 +0530)]
clk: mxs: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: sirf: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 14:02:21 +0000 (19:32 +0530)]
clk: sirf: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: spear: make clk_ops const
Bhumika Goyal [Tue, 22 Aug 2017 13:14:50 +0000 (18:44 +0530)]
clk: spear: make clk_ops const

Make these const as they are only stored in the const field of a
clk_init_data structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoCLK: SPEAr: make aux_clk_masks structures const
Bhumika Goyal [Tue, 17 Oct 2017 14:38:34 +0000 (16:38 +0200)]
CLK: SPEAr: make aux_clk_masks structures const

Make these const as they are either stored in the masks 'const' field
of a clk_aux structure or passed to the function clk_register_aux
having the argument as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoCLK: SPEAr: make structure field and function argument as const
Bhumika Goyal [Tue, 17 Oct 2017 14:38:33 +0000 (16:38 +0200)]
CLK: SPEAr: make structure field and function argument as const

Make the masks field of clk_aux structure const as it do not modify the
fields of the aux_clk_masks structure it points to.

Make the struct aux_clk_masks *aux argument of the function
clk_register_aux as const as the argument is only stored in the masks
field of a clk_aux structure which is now made const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: sunxi: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:13 +0000 (17:25 +0200)]
clk: sunxi: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: sunxi: fix build warning
Corentin LABBE [Tue, 24 Oct 2017 17:06:16 +0000 (19:06 +0200)]
clk: sunxi: fix build warning

This patch fix the following build warning:
drivers/clk/sunxi/clk-factors.c:279:14: warning: variable 'name' set but not used [-Wunused-but-set-variable]

Fixes: 4cbeaebb8af1 ("clk: sunxi: factors: Add unregister function")

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: hi6220: mark clock cs_atb_syspll as critical
Leo Yan [Fri, 1 Sep 2017 00:47:14 +0000 (08:47 +0800)]
clk: hi6220: mark clock cs_atb_syspll as critical

Clock cs_atb_syspll is pll used for coresight trace bus; when clock
cs_atb_syspll is disabled and operates its child clock node cs_atb
results in system hang. So mark clock cs_atb_syspll as critical to
keep it enabled.

Cc: Guodong Xu <guodong.xu@linaro.org>
Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1504226835-2115-2-git-send-email-leo.yan@linaro.org

6 years agoclk: tegra: Use readl_relaxed_poll_timeout_atomic() in tegra210_clock_init()
Nicolin Chen [Fri, 15 Sep 2017 19:10:13 +0000 (12:10 -0700)]
clk: tegra: Use readl_relaxed_poll_timeout_atomic() in tegra210_clock_init()

Below is the call trace of tegra210_init_pllu() function:
  start_kernel()
  -> time_init()
  --> of_clk_init()
  ---> tegra210_clock_init()
  ----> tegra210_pll_init()
  -----> tegra210_init_pllu()

Because the preemption is disabled in the start_kernel before calling
time_init, tegra210_init_pllu is actually in an atomic context while
it includes a readl_relaxed_poll_timeout that might sleep.

So this patch just changes this readl_relaxed_poll_timeout() to its
atomic version.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: dfll: Fix drvdata overwriting issue
Nicolin Chen [Thu, 12 Oct 2017 23:09:59 +0000 (16:09 -0700)]
clk: tegra: dfll: Fix drvdata overwriting issue

Both tegra124-dfll and clk-dfll are using platform_set_drvdata
to set drvdata of the exact same pdev while they use different
pointers for the drvdata. Once the drvdata has been overwritten
by tegra124-dfll, clk-dfll will never get its td pointer as it
expects.

Since tegra124-dfll merely needs its soc pointer in its remove
function, this patch fixes the bug by removing the overwriting
in the tegra124-dfll file and letting the tegra_dfll_unregister
return an soc pointer for it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Fix cclk_lp divisor register
Michał Mirosław [Tue, 19 Sep 2017 02:48:10 +0000 (04:48 +0200)]
clk: tegra: Fix cclk_lp divisor register

According to comments in code and common sense, cclk_lp uses its
own divisor, not cclk_g's.

Fixes: b08e8c0ecc42 ("clk: tegra: add clock support for Tegra30")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Bump SCLK clock rate to 216 MHz
Dmitry Osipenko [Tue, 3 Oct 2017 23:02:41 +0000 (02:02 +0300)]
clk: tegra: Bump SCLK clock rate to 216 MHz

AHB DMA is a running on 1/2 of SCLK rate, APB DMA on 1/4. Increasing SCLK
rate results in an increased DMA transfer rate.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Use common definition of APBDMA clock gate
Dmitry Osipenko [Tue, 3 Oct 2017 23:02:40 +0000 (02:02 +0300)]
clk: tegra: Use common definition of APBDMA clock gate

The APBDMA clock is defined in the common clock gates table that is used
by Tegra30+. Tegra20 can use it too, let's remove the custom definition
and use the common one.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Correct parent of the APBDMA clock
Dmitry Osipenko [Tue, 3 Oct 2017 23:02:39 +0000 (02:02 +0300)]
clk: tegra: Correct parent of the APBDMA clock

APBDMA represents a clock gate to the APB DMA controller, the actual
clock source for the controller is PCLK.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Add AHB DMA clock entry
Dmitry Osipenko [Tue, 3 Oct 2017 23:02:38 +0000 (02:02 +0300)]
clk: tegra: Add AHB DMA clock entry

AHB DMA engine presents on Tegra20/30. Add missing clock entries, so that
driver for the AHB DMA controller could be implemented.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Mark APB clock as critical
Jon Hunter [Mon, 23 Oct 2017 11:12:52 +0000 (12:12 +0100)]
clk: tegra: Mark APB clock as critical

Currently, the APB clock is registered with the CLK_IGNORE_UNUSED flag
to prevent the clock from being disabled if unused on boot. However,
even if it is used, it still needs to be always kept enabled so that it
doesn't get inadvertently disabled when all of its children are, and so
update the flag for the APB clock to be CLK_IS_CRITICAL.

Suggested-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoMerge tag 'v4.15-rockchip-clk-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Tue, 31 Oct 2017 23:28:02 +0000 (16:28 -0700)]
Merge tag 'v4.15-rockchip-clk-1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-next

Pull Rockchip clk drivers updates from Heiko Stuebner:

 - new clock ids for rk3188 and rk3368
 - removal of a superfluous memory allocation error message

* tag 'v4.15-rockchip-clk-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  clk: rockchip: use new cif/vdpu clock ids on rk3188
  clk: rockchip: export clock pclk_efuse_256 for RK3368 SoCs
  clk: rockchip: add more rk3188 graphics clock ids
  clk: rockchip: add clock id for PCLK_EFUSE256 of RK3368 SoCs
  clk: rockchip: Remove superfluous error message in rockchip_clk_register_cpuclk()

6 years agoMerge tag 'clk-renesas-for-v4.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Tue, 31 Oct 2017 23:25:38 +0000 (16:25 -0700)]
Merge tag 'clk-renesas-for-v4.15-tag2' of git://git./linux/kernel/git/geert/renesas-drivers into clk-next

Pull Renesas clk driver updates from Geert Uytterhoeven:

  - Add support for the second display unit clock on RZ/G1E,
  - Add git repository to MAINTAINERS,
  - Add suspend/resume support for R-Car Gen3 CPG/MSSR,
  - Small fixes and cleanups.

* tag 'clk-renesas-for-v4.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: rcar-gen3: Restore R clock during resume
  clk: renesas: rcar-gen3: Restore SDHI clocks during resume
  clk: renesas: div6: Restore clock state during resume
  clk: renesas: cpg-mssr: Add support to restore core clocks during resume
  clk: renesas: cpg-mssr: Restore module clocks during resume
  MAINTAINERS: Add git repository to Renesas clock driver section
  clk: renesas: cpg-mssr: Add du1 clock to R8A7745
  clk: renesas: rz: clk-rz is meant for RZ/A1
  clk: renesas: r8a77995: Correct parent clock of INTC-AP
  clk: renesas: r8a7796: Correct parent clock of INTC-AP
  clk: renesas: r8a7795: Correct parent clock of INTC-AP

6 years agoMerge tag 'meson-clk-for-4.15' of git://github.com/baylibre/clk-meson into clk-next
Stephen Boyd [Tue, 31 Oct 2017 23:25:07 +0000 (16:25 -0700)]
Merge tag 'meson-clk-for-4.15' of git://github.com/baylibre/clk-meson into clk-next

Pull Amlogic clock driver updates from Neil Armstrong:

 - Addition of Video Processing Unit VPU and VAPB clocks

* tag 'meson-clk-for-4.15' of git://github.com/baylibre/clk-meson:
  clk: meson: gxbb: Add VPU and VAPB clocks data
  clk: meson: gxbb: Add VPU and VAPB clockids

6 years agoMerge tag 'sunxi-clk-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Tue, 31 Oct 2017 21:52:21 +0000 (14:52 -0700)]
Merge tag 'sunxi-clk-for-4.15' of https://git./linux/kernel/git/sunxi/linux into clk-next

Pull Allwinner clock driver updates from Maxime Ripard:

  - Addition of sigma/delta modulation for the audio PLLs on the newer SoCs
  - A83t Display clocks supports
  - minor fixes that didn't have any impact on current features

* tag 'sunxi-clk-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: sun4i: Export video PLLs
  clk: sunxi-ng: Add A83T display clocks
  clk: sunxi-ng: sun8i: a23: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: sun6i: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: sun5i: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: sun4i: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: sun8i: h3: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: nm: Add support for sigma-delta modulation
  clk: sunxi-ng: Add sigma-delta modulation support
  clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock
  clk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider
  clk: sunxi-ng: a83t: Fix invalid csi-mclk mux offset
  clk: sunxi-ng: sun6i: Rename HDMI DDC clock to avoid name collision
  clk: sunxi-ng: sun6i: Export video PLLs
  clk: sunxi-ng: Implement reset control status readback
  clk: sunxi-ng: Fix missing CLK_SET_RATE_PARENT in ccu-sun4i-a10.c
  clk: sunxi-ng: add CLK_SET_RATE_PARENT flag to H3 GPU clock
  clk: sunxi-ng: add CLK_SET_RATE_UNGATE to all H3 PLLs

6 years agoMerge tag 'clk-v4.15-exynos-pm' of git://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Tue, 31 Oct 2017 00:59:10 +0000 (17:59 -0700)]
Merge tag 'clk-v4.15-exynos-pm' of git://git./linux/kernel/git/snawrocki/clk into clk-next

Pull Samsung clk driver updates from Sylwester Nawrocki:

 - An addition of separate driver for the Exynos 4412 ISP CMU, needed
   to model and properly handle the clock controller's dependencies
   on the ISP power domain.
 - Adding __maybe_unused attributes to the exynos5433_cmu_{suspend,
   resume} ops to suppress compiler warnings with CONFIG_PM disabled.

* tag 'clk-v4.15-exynos-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk:
  clk: samsung: Add a separate driver for Exynos4412 ISP clocks
  clk: samsung: Add dt bindings for Exynos4412 ISP clock controller
  clk: samsung: Instantiate Exynos4412 ISP clocks only when available
  clk: samsung: exynos5433: mark PM functions as __maybe_unused

6 years agoMerge tag 'clk-v4.15-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/snawro...
Stephen Boyd [Wed, 25 Oct 2017 09:37:03 +0000 (02:37 -0700)]
Merge tag 'clk-v4.15-samsung' of git://git./linux/kernel/git/snawrocki/clk into clk-next

Pull Samsung clk driver updates from Sylwester Nawrocki:

Overall clk/samsung clean up and fixes. Removed remaining unused code
after removal of exynos4212 SoC support; dropped internal data structure
fields and related code for registering clkdev lookup entry for each
possible clock object, clkdev aliases could still be defined if needed
in a separate table; other minor fixes of the clock tree definitions.

* tag 'clk-v4.15-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk:
  clk: samsung: Remove obsolete clkdev alias support
  clk: samsung: Add explicit MPLL, EPLL clkdev aliases in S3C2443 driver
  clk: samsung: Rework clkdev alias handling in S3C2443 driver
  clk: samsung: Rework clkdev alias handling in Exynos5440 driver
  clk: samsung: Drop useless alias in Exynos5420 clk driver
  clk: samsung: Remove clkdev alias support in Exynos5250 clk driver
  clk: samsung: Remove double assignment of CLK_ARM_CLK in Exynos4 driver
  clk: samsung: Remove clkdev alias support in Exynos4 clk driver
  clk: samsung: Remove support for obsolete Exynos4212 CPU clock
  clk: samsung: Remove support for Exynos4212 SoCs in Exynos CLKOUT driver
  clk: samsung: Properly propagate flags in __PLL macro
  clk: samsung: Fix m2m scaler clock on Exynos542x
  clk: samsung: Delete a memory allocation error message in clk-cpu.c

6 years agoMerge tag 'clk-renesas-for-v4.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Wed, 25 Oct 2017 09:34:15 +0000 (02:34 -0700)]
Merge tag 'clk-renesas-for-v4.15-tag1' of git://git./linux/kernel/git/geert/renesas-drivers into clk-next

Pull Renesas clk driver updates from Geert Uytterhoeven:

  - Add support for the new R-Car V3M SoC,
  - Small fixes and cleanups.

* tag 'clk-renesas-for-v4.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: rcar-gen2: Delete error message for failed memory allocation
  clk: renesas: mstp: Delete error messages for failed memory allocations
  clk: renesas: cpg-mssr: Add R8A77970 support
  dt-bindings: clock: Add R8A77970 CPG core clock definitions

6 years agoclk: renesas: rcar-gen3: Restore R clock during resume
Geert Uytterhoeven [Wed, 28 Jun 2017 19:15:49 +0000 (21:15 +0200)]
clk: renesas: rcar-gen3: Restore R clock during resume

On R-Car Gen3 systems, PSCI system suspend powers down the SoC, losing
clock configuration.  Register a notifier to save/restore the RCKCR
register during system suspend/resume.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoclk: renesas: rcar-gen3: Restore SDHI clocks during resume
Geert Uytterhoeven [Wed, 21 Jun 2017 20:51:21 +0000 (22:51 +0200)]
clk: renesas: rcar-gen3: Restore SDHI clocks during resume

On R-Car Gen3 systems, PSCI system suspend powers down the SoC, losing
clock configuration.  Register a notifier to save/restore SDHI clock
registers during system suspend/resume.

This is implemented using the cpg_simple_notifier abstraction, which can
be reused for others clocks that just need to save/restore a single
register.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoclk: renesas: div6: Restore clock state during resume
Geert Uytterhoeven [Wed, 21 Jun 2017 20:34:33 +0000 (22:34 +0200)]
clk: renesas: div6: Restore clock state during resume

On R-Car Gen3 systems, PSCI system suspend powers down the SoC, losing
clock configuration.  Register an (optional) notifier to restore the
DIV6 clock state during system resume.

As DIV6 clocks can be picky w.r.t. modifying multiple register fields at
once, restore is not implemented by blindly restoring the register
value, but by using the existing cpg_div6_clock_{en,dis}able() helpers.

Note that this does not yet support DIV6 clocks with multiple parents,
which do not exist on R-Car Gen3 SoCs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoclk: renesas: cpg-mssr: Add support to restore core clocks during resume
Geert Uytterhoeven [Wed, 21 Jun 2017 20:24:15 +0000 (22:24 +0200)]
clk: renesas: cpg-mssr: Add support to restore core clocks during resume

On R-Car Gen3 systems, PSCI system suspend powers down the SoC, possibly
losing clock configuration.  Hence add a notifier chain that can be used
by core clocks to save/restore clock state during system suspend/resume.

The implementation of the actual clock state save/restore operations is
clock-specific, and to be registered with the notifier chain in the SoC
or family-specific cpg_mssr_info.cpg_clk_register() callback.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoclk: renesas: cpg-mssr: Restore module clocks during resume
Geert Uytterhoeven [Wed, 7 Jun 2017 11:20:06 +0000 (13:20 +0200)]
clk: renesas: cpg-mssr: Restore module clocks during resume

During PSCI system suspend, R-Car Gen3 SoCs are powered down, and their
clock register state is lost.  Note that as the boot loader skips most
initialization after system resume, clock register state differs from
the state encountered during normal system boot, too.

Hence after s2ram, some operations may fail because module clocks are
disabled, while drivers expect them to be still enabled.  E.g. EtherAVB
fails when Wake-on-LAN has been enabled using "ethtool -s eth0 wol g":

    ravb e6800000.ethernet eth0: failed to switch device to config mode
    ravb e6800000.ethernet eth0: device will be stopped after h/w processes are done.
    ravb e6800000.ethernet eth0: failed to switch device to config
    PM: Device e6800000.ethernet failed to resume: error -110

In addition, some module clocks that were disabled by
clk_disable_unused() may have been re-enabled, wasting power.

To fix this, restore all bits of the SMSTPCR registers that represent
clocks under control of Linux.

Notes:
  - While this fixes EtherAVB operation after resume from s2ram,
    EtherAVB cannot be used as an actual wake-up source from s2ram, only
    from s2idle, due to PSCI limitations,
  - To avoid overhead on platforms not needing it, the suspend/resume
    code has a build time dependency on sleep and PSCI support, and a
    runtime dependency on PSCI.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
6 years agoMAINTAINERS: Add git repository to Renesas clock driver section
Geert Uytterhoeven [Wed, 13 Sep 2017 07:44:54 +0000 (09:44 +0200)]
MAINTAINERS: Add git repository to Renesas clock driver section

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: renesas: cpg-mssr: Add du1 clock to R8A7745
Fabrizio Castro [Fri, 13 Oct 2017 15:22:21 +0000 (16:22 +0100)]
clk: renesas: cpg-mssr: Add du1 clock to R8A7745

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
6 years agoclk: renesas: rz: clk-rz is meant for RZ/A1
Geert Uytterhoeven [Thu, 12 Oct 2017 08:54:22 +0000 (10:54 +0200)]
clk: renesas: rz: clk-rz is meant for RZ/A1

The RZ family of Renesas SoCs has several different subfamilies (RZ/A,
RZ/G, RZ/N, and RZ/T).  Clarify that the renesas,rz-cpg-clocks DT
bindings and clk-rz driver apply to RZ/A1 only.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Rob Herring <robh@kernel.org>
6 years agoclk: meson: gxbb: Add VPU and VAPB clocks data
Neil Armstrong [Mon, 16 Oct 2017 15:34:45 +0000 (17:34 +0200)]
clk: meson: gxbb: Add VPU and VAPB clocks data

The Amlogic Meson GX SoCs needs these two clocks to power up the
VPU power domain.

These two clocks are similar to the MALI clocks by having a glitch-free
mux and two similar clocks with gate, divider and muxes.

Acked-by: Jerome Brunet <jbrunet@baylibre.com>
[narmstrong: removed the CLK_IGNORE_UNUSED on muxes and dividers]
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoclk: meson: gxbb: Add VPU and VAPB clockids
Neil Armstrong [Mon, 16 Oct 2017 15:34:44 +0000 (17:34 +0200)]
clk: meson: gxbb: Add VPU and VAPB clockids

Add the clkids for the clocks feeding the Video Processing Unit.

Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoclk: tegra: Make tegra_clk_pll_params __ro_after_init
Bhumika Goyal [Mon, 2 Oct 2017 20:12:08 +0000 (01:42 +0530)]
clk: tegra: Make tegra_clk_pll_params __ro_after_init

These structures are only passed to the functions tegra_clk_register_pll,
tegra_clk_register_pll{e/u} or tegra_periph_clk_init during the init
phase. These functions modify the structures only during the init phase
and after that the structures are never modified. Therefore, make them
__ro_after_init.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Fix sor1_out clock implementation
Thierry Reding [Wed, 30 Aug 2017 10:21:04 +0000 (12:21 +0200)]
clk: tegra: Fix sor1_out clock implementation

This clock was previously called sor1_src and was modelled as an input
to the sor1 module clock. However, it's really an output clock that can
be fed either from the safe, the sor1_pad_clkout or the sor1 module
clocks. sor1 itself can take input from either of the display PLLs.

The same implementation for the sor1_out clock is used on Tegra186, so
this nicely lines up both SoC generations to deal with this clock in a
uniform way.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Use tegra_clk_register_periph_data()
Thierry Reding [Wed, 30 Aug 2017 10:19:08 +0000 (12:19 +0200)]
clk: tegra: Use tegra_clk_register_periph_data()

Instead of open-coding the same pattern repeatedly, reuse the newly
introduced tegra_clk_register_periph_data() helper that will unpack
the initialization structure.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Add peripheral clock registration helper
Thierry Reding [Wed, 30 Aug 2017 10:11:53 +0000 (12:11 +0200)]
clk: tegra: Add peripheral clock registration helper

There is a common pattern that registers individual peripheral clocks
from an initialization table. Add a common implementation to remove the
duplication from various call sites.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: tegra: Check BPMP response return code
Timo Alho [Thu, 7 Sep 2017 09:31:02 +0000 (12:31 +0300)]
clk: tegra: Check BPMP response return code

Check return code in BPMP response message(s). The typical error case is
when a clock operation is attempted with an invalid clock identifier.

Also remove error print from call to clk_get_info() as the
implementation loops through the range of all possible identifiers, yet
the operation is expected to error out when the clock ID is unused.

Signed-off-by: Timo Alho <talho@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoMerge branch 'for-4.15/firmware' into for-4.15/clk
Thierry Reding [Thu, 19 Oct 2017 14:38:21 +0000 (16:38 +0200)]
Merge branch 'for-4.15/firmware' into for-4.15/clk

6 years agoMerge branch 'for-4.15/dt-bindings' into for-4.15/clk
Thierry Reding [Thu, 19 Oct 2017 14:37:38 +0000 (16:37 +0200)]
Merge branch 'for-4.15/dt-bindings' into for-4.15/clk

6 years agoclk: sunxi-ng: sun4i: Export video PLLs
Jonathan Liu [Tue, 17 Oct 2017 12:18:03 +0000 (20:18 +0800)]
clk: sunxi-ng: sun4i: Export video PLLs

The video PLLs are used directly by the HDMI controller. Export them so
that we can use them in our DT node.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: Add A83T display clocks
Maxime Ripard [Tue, 17 Oct 2017 09:06:17 +0000 (11:06 +0200)]
clk: sunxi-ng: Add A83T display clocks

Unfortunately, the A83t display clocks are not children of the de clock,
since that clocks doesn't exist at all on the A83t.

For now, they are orphans, so let's move them to their true, existing,
parent.

Fixes: 763c5bd045b1 ("clk: sunxi-ng: add support for DE2 CCU")
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agodt-bindings: clock: tegra: Add sor1_out clock
Thierry Reding [Wed, 30 Aug 2017 10:05:26 +0000 (12:05 +0200)]
dt-bindings: clock: tegra: Add sor1_out clock

The sor1_src clock implemented on Tegra210 is modelled the wrong way
around, which causes some issues with HDMI and DP support. This clock
implementation is provided by BPMP on Tegra186, which models this in
a more correct way. Since this introduces incompatibilities between
the two SoC generations which we want to avoid, the Tegra210 will be
fixed in subsequent patches.

This change adds sor1_out as an alias for sor1_src.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agofirmware: tegra: Propagate error code to caller
Timo Alho [Thu, 7 Sep 2017 09:31:01 +0000 (12:31 +0300)]
firmware: tegra: Propagate error code to caller

Response messages from Tegra BPMP firmware contain an error return code
as the first word of payload. The error code is used to indicate
incorrectly formatted request message or use of non-existing resource
(clk, reset, powergate) identifier. Current implementation of
tegra_bpmp_transfer() ignores this code and does not pass it to caller.
Fix this by adding an extra struct member to tegra_bpmp_message and
populate that with return code.

Signed-off-by: Timo Alho <talho@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agoclk: samsung: Add a separate driver for Exynos4412 ISP clocks
Marek Szyprowski [Wed, 11 Oct 2017 09:25:13 +0000 (11:25 +0200)]
clk: samsung: Add a separate driver for Exynos4412 ISP clocks

Some registers for the Exynos 4412 ISP (Camera subsystem) clocks are
located in the ISP power domain. Because those registers are also
located in a different memory region than the main clock controller,
support for them can be provided by a separate clock controller.
This in turn allows to almost seamlessly make it aware of the power
domain using recently introduced runtime PM support for clocks.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Add dt bindings for Exynos4412 ISP clock controller
Marek Szyprowski [Wed, 11 Oct 2017 09:25:12 +0000 (11:25 +0200)]
clk: samsung: Add dt bindings for Exynos4412 ISP clock controller

Some registers for the Exynos 4412 ISP (Camera subsystem) clocks are
located in the ISP power domain. Because those registers are also
located in a different memory region than the main clock controller,
support for them can be provided by a separate clock controller.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Instantiate Exynos4412 ISP clocks only when available
Marek Szyprowski [Wed, 11 Oct 2017 09:25:11 +0000 (11:25 +0200)]
clk: samsung: Instantiate Exynos4412 ISP clocks only when available

Some registers for the Exynos 4412 ISP (Camera subsystem) clocks are
located in the ISP power domain. Instantiate those clocks only when
provided clock registers resource covers those registers. This is
a preparation for adding a separate clock driver for ISP clocks,
which will be integrated with power domain using runtime PM feature.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: renesas: r8a77995: Correct parent clock of INTC-AP
Geert Uytterhoeven [Tue, 10 Oct 2017 11:08:11 +0000 (13:08 +0200)]
clk: renesas: r8a77995: Correct parent clock of INTC-AP

According to the R-Car Gen3 Hardware Manual Errata for Rev 0.55 of
September 8, 2017, the parent clock of the INTC-AP module clock on R-Car
D3 is S1D2.

This change has no functional impact.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
6 years agoclk: renesas: r8a7796: Correct parent clock of INTC-AP
Geert Uytterhoeven [Tue, 10 Oct 2017 11:07:45 +0000 (13:07 +0200)]
clk: renesas: r8a7796: Correct parent clock of INTC-AP

According to the R-Car Gen3 Hardware Manual Errata for Rev 0.55 of
September 8, 2017, the parent clock of the INTC-AP module clock on R-Car
M3-W is S0D3.

This change has no functional impact.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
6 years agoclk: renesas: r8a7795: Correct parent clock of INTC-AP
Geert Uytterhoeven [Tue, 10 Oct 2017 11:04:28 +0000 (13:04 +0200)]
clk: renesas: r8a7795: Correct parent clock of INTC-AP

According to the R-Car Gen3 Hardware Manual Errata for Rev 0.55 of
September 8, 2017, the parent clock of the INTC-AP module clock on R-Car
H3 ES2.0 is S0D3.

This change has no functional impact.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
6 years agoclk: rockchip: use new cif/vdpu clock ids on rk3188
Heiko Stuebner [Fri, 15 Sep 2017 08:33:50 +0000 (10:33 +0200)]
clk: rockchip: use new cif/vdpu clock ids on rk3188

Use the new clock-ids for cif, vdpu, vepu on rk3188

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
6 years agoclk: rockchip: export clock pclk_efuse_256 for RK3368 SoCs
Romain Perier [Mon, 4 Sep 2017 08:51:17 +0000 (10:51 +0200)]
clk: rockchip: export clock pclk_efuse_256 for RK3368 SoCs

This exports the clock for the pclk gate of the eFuse that is part of
the RK3368 SoCs. So we can use it from the dt-bindings.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
6 years agoMerge branch 'v4.15-shared/clkids' into v4.15-clk/next
Heiko Stuebner [Sat, 14 Oct 2017 19:31:05 +0000 (21:31 +0200)]
Merge branch 'v4.15-shared/clkids' into v4.15-clk/next

6 years agoclk: rockchip: add more rk3188 graphics clock ids
Heiko Stuebner [Fri, 15 Sep 2017 08:33:49 +0000 (10:33 +0200)]
clk: rockchip: add more rk3188 graphics clock ids

Add ids for cif, v{d/e}pu clocks on rk3188. ACLK_CIF does get a needed
1 at it's end but that should be safe because no driver for the camera
interface has surfaced so far and the old vendor kernels for these socs
are based on linux-3.0 and still used board files then, so there really
are no previous users anywhere to be found.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
6 years agoclk: rockchip: add clock id for PCLK_EFUSE256 of RK3368 SoCs
Romain Perier [Mon, 4 Sep 2017 08:51:16 +0000 (10:51 +0200)]
clk: rockchip: add clock id for PCLK_EFUSE256 of RK3368 SoCs

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
6 years agoclk: sunxi-ng: sun8i: a23: Use sigma-delta modulation for audio PLL
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:05 +0000 (16:37 +0800)]
clk: sunxi-ng: sun8i: a23: Use sigma-delta modulation for audio PLL

The audio blocks require specific clock rates. Until now we were using
the closest clock rate possible with integer N-M factors. This resulted
in audio playback being slightly slower than it should be.

The vendor kernel gets around this (for newer SoCs) by using sigma-delta
modulation to generate a fractional-N factor. As the PLL hardware is
identical in most chips, we can back port the settings from the newer
SoC, in this case the H3, onto the A23.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun6i: Use sigma-delta modulation for audio PLL
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:04 +0000 (16:37 +0800)]
clk: sunxi-ng: sun6i: Use sigma-delta modulation for audio PLL

The audio blocks require specific clock rates. Until now we were using
the closest clock rate possible with integer N-M factors. This resulted
in audio playback being slightly slower than it should be.

The vendor kernel gets around this (for newer SoCs) by using sigma-delta
modulation to generate a fractional-N factor. As the PLL hardware is
identical in most chips, we can back port the settings from the newer
SoC, in this case the H3, onto the A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun5i: Use sigma-delta modulation for audio PLL
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:03 +0000 (16:37 +0800)]
clk: sunxi-ng: sun5i: Use sigma-delta modulation for audio PLL

The audio blocks require specific clock rates. Until now we were using
the closest clock rate possible with integer N-M factors. This resulted
in audio playback being slightly slower than it should be.

The vendor kernel gets around this (for newer SoCs) by using sigma-delta
modulation to generate a fractional-N factor. As the PLL hardware is
identical in most chips, we can back port the settings from the newer
SoC, in this case the H3, onto the sun5i family.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun4i: Use sigma-delta modulation for audio PLL
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:02 +0000 (16:37 +0800)]
clk: sunxi-ng: sun4i: Use sigma-delta modulation for audio PLL

The audio blocks require specific clock rates. Until now we were using
the closest clock rate possible with integer N-M factors. This resulted
in audio playback being slightly slower than it should be.

The vendor kernel gets around this (for newer SoCs) by using sigma-delta
modulation to generate a fractional-N factor. As the PLL hardware is
identical in most chips, we can back port the settings from the newer
SoC, in this case the H3, onto the A10 and A20.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun8i: h3: Use sigma-delta modulation for audio PLL
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:01 +0000 (16:37 +0800)]
clk: sunxi-ng: sun8i: h3: Use sigma-delta modulation for audio PLL

The audio blocks require specific clock rates. Until now we were using
the closest clock rate possible with integer N-M factors. This resulted
in audio playback being slightly slower than it should be.

The vendor kernel gets around this (for newer SoCs) by using sigma-delta
modulation to generate a fractional-N factor. This patch copies the
parameters for the H3.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: nm: Add support for sigma-delta modulation
Chen-Yu Tsai [Thu, 12 Oct 2017 08:37:00 +0000 (16:37 +0800)]
clk: sunxi-ng: nm: Add support for sigma-delta modulation

Some of the N-M-style clocks, namely the PLLs, support sigma-delta
modulation to do fractional-N frequency synthesis. This is used in
the audio PLL to generate the exact frequency the audio blocks need.
These frequencies can not be generated with integer N-M factors.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: Add sigma-delta modulation support
Chen-Yu Tsai [Thu, 12 Oct 2017 08:36:59 +0000 (16:36 +0800)]
clk: sunxi-ng: Add sigma-delta modulation support

Sigma-delta modulation is supported for some PLLs. This allows
fractional-N multipliers to be used. In reality we don't know
how to configure the individual settings for it. However we can
copy existing settings from the vendor kernel to support clock
rates that cannot be generated from integer factors, but are
really desired. The vendor kernel only uses this for the audio
PLL clock, and only on the latest chips.

This patch adds a new class of clocks, along with helper functions.
It is intended to be merged into N-M-factor style clocks as a
feature, much like fractional clocks.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: nm: Check if requested rate is supported by fractional clock
Chen-Yu Tsai [Thu, 12 Oct 2017 08:36:58 +0000 (16:36 +0800)]
clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock

The round_rate callback for N-M-factor style clocks does not check if
the requested clock rate is supported by the fractional clock mode.
While this doesn't affect usage in practice, since the clock rates
are also supported through N-M factors, it does not match the set_rate
code.

Add a check to the round_rate callback so it matches the set_rate
callback.

Fixes: 6174a1e24b0d ("clk: sunxi-ng: Add N-M-factor clock support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider
Chen-Yu Tsai [Thu, 12 Oct 2017 08:36:57 +0000 (16:36 +0800)]
clk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider

The post-divider for the audio PLL is in bits [29:26], as specified
in the user manual, not [19:16] as currently programmed in the code.
The post-divider has a default register value of 2, i.e. a divider
of 3. This means the clock rate fed to the audio codec would be off.

This was discovered when porting sigma-delta modulation for the PLL
to sun5i, which needs the post-divider to be 1.

Fix the bit offset, so we do actually force the post-divider to a
certain value.

Fixes: 5e73761786d6 ("clk: sunxi-ng: Add sun5i CCU driver")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: samsung: exynos5433: mark PM functions as __maybe_unused
Arnd Bergmann [Tue, 10 Oct 2017 09:15:12 +0000 (11:15 +0200)]
clk: samsung: exynos5433: mark PM functions as __maybe_unused

The suspend/resume functions are referenced conditionally, causing
a harmless warning when CONFIG_PM is disabled:

drivers/clk/samsung/clk-exynos5433.c:5476:12: error: 'exynos5433_cmu_resume' defined but not used [-Werror=unused-function]
drivers/clk/samsung/clk-exynos5433.c:5453:12: error: 'exynos5433_cmu_suspend' defined but not used [-Werror=unused-function]

This marks both as __maybe_unused to shut up the warning.

Fixes: 523d3de41f02 ("clk: samsung: exynos5433: Add support for runtime PM")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove obsolete clkdev alias support
Marek Szyprowski [Tue, 3 Oct 2017 10:00:16 +0000 (12:00 +0200)]
clk: samsung: Remove obsolete clkdev alias support

Remove support for obsolete clkdev alias definition in generic helper
macros for MUX, DIV, GATE and PLL clocks. clkdev aliases can be still
created using samsung_clk_register_alias() function if given platform
still needs them. All current drivers have been converted not to use
*_A-style macros and checked if there are any clients for the PLL
clocks, which had aliases created unconditionally.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Add explicit MPLL, EPLL clkdev aliases in S3C2443 driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:15 +0000 (12:00 +0200)]
clk: samsung: Add explicit MPLL, EPLL clkdev aliases in S3C2443 driver

S3C2443 platform still use non-dt based lookup in some of its drivers
to get MPLL and EPLL clocks. Till now it worked only because PLL()
macro implicitly created aliases for all instantiated clocks. This
feature will be removed, so explicitly create aliases for MPLL and
EPLL clocks.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Rework clkdev alias handling in S3C2443 driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:14 +0000 (12:00 +0200)]
clk: samsung: Rework clkdev alias handling in S3C2443 driver

S3C2443 SoC still uses old, non-dt CPUfreq driver, which requires clkdev
aliases to get access to proper clocks. Create those aliases using
samsung_clk_register_alias() function instead of using *_A clock macros,
which will be removed soon.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Rework clkdev alias handling in Exynos5440 driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:13 +0000 (12:00 +0200)]
clk: samsung: Rework clkdev alias handling in Exynos5440 driver

Exynos5440 still uses old, non-dt CPUfreq driver, which requires clkdev
aliases to get access to proper clocks. Create those aliases using
samsung_clk_register_alias() function instead of using *_A clock macros,
which will be removed soon.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Drop useless alias in Exynos5420 clk driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:12 +0000 (12:00 +0200)]
clk: samsung: Drop useless alias in Exynos5420 clk driver

Drop clkdev alias for "mout_aclk400_mscl" clock. It was not used at all
and it was probably committed by accident.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove clkdev alias support in Exynos5250 clk driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:11 +0000 (12:00 +0200)]
clk: samsung: Remove clkdev alias support in Exynos5250 clk driver

All Exynos5250 boards have been fully converted to device-tree and use
generic dt-based CPUfreq driver, so there is no need to create any clkdev
aliases for the clocks. Drop all the code related to aliases handling.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove double assignment of CLK_ARM_CLK in Exynos4 driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:10 +0000 (12:00 +0200)]
clk: samsung: Remove double assignment of CLK_ARM_CLK in Exynos4 driver

CLK_ARM_CLK ("armclk") clock is provided by cpu-clk subdriver, which is
instantiated after creating all divider clocks from exynos4_div_clks
array. There is no point assigning this id to "div_core2" clock and later
overwrite with proper "armcpu" clock by cpu-clk subdriver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove clkdev alias support in Exynos4 clk driver
Marek Szyprowski [Tue, 3 Oct 2017 10:00:09 +0000 (12:00 +0200)]
clk: samsung: Remove clkdev alias support in Exynos4 clk driver

All Exynos4 boards have been fully converted to device-tree and use generic
dt-based CPUfreq driver, so there is no need to create any clkdev aliases
for the clocks. Drop all the code related to aliases handling.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove support for obsolete Exynos4212 CPU clock
Marek Szyprowski [Tue, 3 Oct 2017 10:00:08 +0000 (12:00 +0200)]
clk: samsung: Remove support for obsolete Exynos4212 CPU clock

Support for Exynos 4212 SoC has been removed by commit bca9085e0ae9 ("ARM:
dts: exynos: remove Exynos4212 support (dead code)"), so there is no need
to keep dead code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Remove support for Exynos4212 SoCs in Exynos CLKOUT driver
Marek Szyprowski [Wed, 4 Oct 2017 06:38:26 +0000 (08:38 +0200)]
clk: samsung: Remove support for Exynos4212 SoCs in Exynos CLKOUT driver

Support for Exynos4212 SoCs has been removed by commit bca9085e0ae9 ("ARM:
dts: exynos: remove Exynos4212 support (dead code)"), so there is no need
to keep remaining dead code related to this SoC version.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: sunxi-ng: a83t: Fix invalid csi-mclk mux offset
Ondrej Jirman [Thu, 5 Oct 2017 02:33:14 +0000 (04:33 +0200)]
clk: sunxi-ng: a83t: Fix invalid csi-mclk mux offset

Datasheet specified that parent MUX settings are at bits [10:8],
but current implementation specifies incorrect offset at [10:12].
Fix this.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Thu, 5 Oct 2017 23:52:59 +0000 (16:52 -0700)]
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: samsung: exynos4: Enable VPLL and EPLL clocks for suspend/resume cycle

6 years agoclk: samsung: exynos4: Enable VPLL and EPLL clocks for suspend/resume cycle
Marek Szyprowski [Tue, 19 Sep 2017 10:01:08 +0000 (12:01 +0200)]
clk: samsung: exynos4: Enable VPLL and EPLL clocks for suspend/resume cycle

Commit 6edfa11cb396 ("clk: samsung: Add enable/disable operation for
PLL36XX clocks") added enable/disable operations to PLL clocks. Prior that
VPLL and EPPL clocks were always enabled because the enable bit was never
touched. Those clocks have to be enabled during suspend/resume cycle,
because otherwise board fails to enter sleep mode. This patch enables them
unconditionally before entering system suspend state. System restore
function will set them to the previous state saved in the register cache
done before that unconditional enable.

Fixes: 6edfa11cb396 ("clk: samsung: Add enable/disable operation for PLL36XX clocks")
CC: stable@vger.kernel.org # v4.13
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: samsung: Properly propagate flags in __PLL macro
Marek Szyprowski [Thu, 14 Sep 2017 14:38:17 +0000 (16:38 +0200)]
clk: samsung: Properly propagate flags in __PLL macro

All users of __PLL macro already provide flags parameter, so don't
overwrite it unconditionally with CLK_GET_RATE_NOCACHE.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoMerge branch 'clk-pm-runtime' into clk-next
Stephen Boyd [Fri, 29 Sep 2017 23:07:28 +0000 (16:07 -0700)]
Merge branch 'clk-pm-runtime' into clk-next

* clk-pm-runtime:
  clk: samsung: exynos-audss: Add support for runtime PM
  clk: samsung: exynos-audss: Use local variable for controller's device
  clk: samsung: exynos5433: Add support for runtime PM
  clk: samsung: Add support for runtime PM
  clk: Add support for runtime PM

6 years agoMerge tag 'v4.14-rockchip-clkfixes-1' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Fri, 29 Sep 2017 21:17:51 +0000 (14:17 -0700)]
Merge tag 'v4.14-rockchip-clkfixes-1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-fixes

Pull Rockchip clk driver fixes from Heiko Stuebner:

Some smallish fixes for the rk3128 clock support including
some register errors and some clocks that should be critical
for safe usage.

* tag 'v4.14-rockchip-clkfixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  clk: rockchip: add sclk_timer5 as critical clock on rk3128
  clk: rockchip: fix up rk3128 pvtm and mipi_24m gate regs error
  clk: rockchip: add pclk_pmu as critical clock on rk3128

6 years agoclk: Export clk_bulk_prepare()
Bjorn Andersson [Sat, 23 Sep 2017 05:00:29 +0000 (22:00 -0700)]
clk: Export clk_bulk_prepare()

Allow clk_bulk_prepare() to be referenced by kernel modules by adding
the missing EXPORT_SYMBOL_GPL().

Fixes: 266e4e9d9150 ("clk: add clk_bulk_get accessories")
Reported-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 years agoclk: sunxi-ng: sun6i: Rename HDMI DDC clock to avoid name collision
Chen-Yu Tsai [Fri, 29 Sep 2017 08:22:54 +0000 (16:22 +0800)]
clk: sunxi-ng: sun6i: Rename HDMI DDC clock to avoid name collision

The HDMI DDC clock found in the CCU is the parent of the actual DDC
clock within the HDMI controller. That clock is also named "hdmi-ddc".

Rename the one in the CCU to "ddc". This makes more sense than renaming
the one in the HDMI controller to something else.

Fixes: c6e6c96d8fa6 ("clk: sunxi-ng: Add A31/A31s clocks")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: sunxi-ng: sun6i: Export video PLLs
Chen-Yu Tsai [Fri, 29 Sep 2017 08:22:53 +0000 (16:22 +0800)]
clk: sunxi-ng: sun6i: Export video PLLs

The 2x outputs of the 2 video PLL clocks are directly used by the
HDMI controller block.

Export them so they can be referenced in the device tree.

Fixes: c6e6c96d8fa6 ("clk: sunxi-ng: Add A31/A31s clocks")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoclk: samsung: Fix m2m scaler clock on Exynos542x
Andrzej Pietrasiewicz [Fri, 29 Sep 2017 07:32:53 +0000 (09:32 +0200)]
clk: samsung: Fix m2m scaler clock on Exynos542x

The TOP "aclk400_mscl" clock should be kept enabled all the time
to allow proper access to power management control for MSC power
domain and devices that are a part of it. This change is required
for the scaler to work properly after domain power on/off sequence.

Fixes: 318fa46cc60d ("clk/samsung: exynos542x: mark some clocks as critical")
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: renesas: rcar-gen2: Delete error message for failed memory allocation
Markus Elfring [Mon, 25 Sep 2017 08:10:51 +0000 (10:10 +0200)]
clk: renesas: rcar-gen2: Delete error message for failed memory allocation

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus fix affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>