GitHub/moto-9609/android_kernel_motorola_exynos9610.git
7 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Wed, 14 Jun 2017 23:48:21 +0000 (16:48 -0700)]
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM
  clk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM
  dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
  clk: sunxi-ng: enable SUNXI_CCU_MP for PRCM
  clk: sunxi-ng: v3s: Fix usb otg device reset bit
  clk: sunxi-ng: a31: Correct lcd1-ch1 clock register offset

7 years agoMerge tag 'sunxi-clk-fixes-for-4.12' of https://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Wed, 14 Jun 2017 23:48:03 +0000 (16:48 -0700)]
Merge tag 'sunxi-clk-fixes-for-4.12' of https://git./linux/kernel/git/sunxi/linux into clk-fixes

Allwinner clock fixes for 4.12

Some fixes that fix some bindings that went in 4.12, fix a few reset and
clock offsets and a build error fix

* tag 'sunxi-clk-fixes-for-4.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM
  clk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM
  dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
  clk: sunxi-ng: enable SUNXI_CCU_MP for PRCM
  clk: sunxi-ng: v3s: Fix usb otg device reset bit
  clk: sunxi-ng: a31: Correct lcd1-ch1 clock register offset

7 years agoMerge tag 'clk-v4.13-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/snawro...
Stephen Boyd [Wed, 14 Jun 2017 17:36:30 +0000 (10:36 -0700)]
Merge tag 'clk-v4.13-samsung' of git://git./linux/kernel/git/snawrocki/clk into clk-next

Pull samsung clk driver updates from Sylwester Nawrocki

 - conversion to the clk_hw API
 - definitions and fixes of exynos5420 SoC audio subsystem
   related clocks

* tag 'clk-v4.13-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk:
  clk: samsung: exynos542x: Add EPLL rate table
  clk: samsung: Add missing exynos5420 audio related clocks
  clk: samsung: Add enable/disable operation for PLL36XX clocks
  clk: samsung: s5pv210-audss: Convert to the new clk_hw API
  clk: samsung: exynos-clkout: Convert to the new clk_hw API
  clk: samsung: exynos-audss: Convert to the new clk_hw API
  clk: samsung: Convert common drivers to the new clk_hw API
  clk: samsung: Add local variable to match its purpose
  clk: samsung: Remove dead code

7 years agoMerge tag 'v4.13-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Wed, 14 Jun 2017 17:33:04 +0000 (10:33 -0700)]
Merge tag 'v4.13-rockchip-clk1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-next

Pull rockchip clk driver updates from Heiko Stuebner:

One new clock controller for the rk3128 soc, a fixup for the rk3228 cpuclk
table and the usual bunch of some new clock-ids and some clocks marked as
critical.

* tag 'v4.13-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  clk: rockchip: mark some special clk as critical on rk3368
  clk: rockchip: mark noc and some special clk as critical on rk3288
  clk: rockchip: mark noc and some special clk as critical on rk3228
  clk: rockchip: mark pclk_ddrupctl as critical_clock on rk3036
  clk: rockchip: add clock controller for rk3128
  dt-bindings: add bindings for rk3128 clock controller
  clk: rockchip: export more rk3228 clocks ids
  clk: rockchip: add ids for rk3399 testclks used for camera handling
  clk: rockchip: add dt-binding header for rk3128
  clk: rockchip: fix up the RK3228 clk cpu setting table
  clk: rockchip: add clock-ids for more rk3228 clocks
  clk: rockchip: add ids for camera on rk3399

7 years agoclk: keystone: Add sci-clk driver support
Tero Kristo [Tue, 13 Jun 2017 07:09:27 +0000 (10:09 +0300)]
clk: keystone: Add sci-clk driver support

In K2G, the clock handling is done through firmware executing on a
separate core. Linux kernel needs to communicate to the firmware
through TI system control interface to access any power management
related resources, including clocks.

The keystone sci-clk driver does this, by communicating to the
firmware through the TI SCI driver. The driver adds support for
registering clocks through DT, and basic required clock operations
like prepare/get_rate, etc.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
[sboyd@codeaurora.org: Make ti_sci_init_clocks() static]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoDocumentation: dt: Add TI SCI clock driver
Tero Kristo [Mon, 22 May 2017 13:01:52 +0000 (16:01 +0300)]
Documentation: dt: Add TI SCI clock driver

Add a clock implementation, TI SCI clock, that will hook to the common
clock framework, and allow each clock to be controlled via TI SCI
protocol.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: samsung: exynos542x: Add EPLL rate table
Sylwester Nawrocki [Fri, 9 Jun 2017 10:46:06 +0000 (12:46 +0200)]
clk: samsung: exynos542x: Add EPLL rate table

A specific clock rate table is added for EPLL so it is possible
to set frequency of the EPLL output clock as multiple of various
audio sampling rates.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: Add missing exynos5420 audio related clocks
Sylwester Nawrocki [Thu, 8 Jun 2017 10:03:24 +0000 (12:03 +0200)]
clk: samsung: Add missing exynos5420 audio related clocks

This patch adds missing definitions of mux clocks required for using
EPLL as the audio subsystem root clock on exynos5420/exynos5422 SoCs.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: Add enable/disable operation for PLL36XX clocks
Sylwester Nawrocki [Thu, 8 Jun 2017 14:17:11 +0000 (16:17 +0200)]
clk: samsung: Add enable/disable operation for PLL36XX clocks

The existing enable/disable ops for PLL35XX are made more generic
and used also for PLL36XX. This fixes issues in the kernel with
PLL36XX PLLs when the PLL has not been already enabled by bootloader.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: s5pv210-audss: Convert to the new clk_hw API
Marek Szyprowski [Mon, 15 May 2017 06:51:04 +0000 (08:51 +0200)]
clk: samsung: s5pv210-audss: Convert to the new clk_hw API

Clock providers should use the new struct clk_hw based API, so convert
Samsung S5PV210 Audio Subsystem clock provider to the new approach.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
7 years agoclk: samsung: exynos-clkout: Convert to the new clk_hw API
Marek Szyprowski [Mon, 24 Apr 2017 06:42:22 +0000 (08:42 +0200)]
clk: samsung: exynos-clkout: Convert to the new clk_hw API

Clock providers should use the new struct clk_hw based API, so convert
Exynos CLKOUT clock provider to the new approach.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: exynos-audss: Convert to the new clk_hw API
Marek Szyprowski [Mon, 15 May 2017 06:50:47 +0000 (08:50 +0200)]
clk: samsung: exynos-audss: Convert to the new clk_hw API

Clock providers should use the new struct clk_hw based API, so convert
Exynos Audio Subsystem clock provider to the new approach.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
7 years agoclk: samsung: Convert common drivers to the new clk_hw API
Marek Szyprowski [Mon, 24 Apr 2017 06:42:20 +0000 (08:42 +0200)]
clk: samsung: Convert common drivers to the new clk_hw API

Clock providers should use the new struct clk_hw based API, so convert
Samsung clock providers and their helper functions to the new approach.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: Add local variable to match its purpose
Marek Szyprowski [Mon, 24 Apr 2017 07:54:12 +0000 (09:54 +0200)]
clk: samsung: Add local variable to match its purpose

Add new variable to avoid using clk pointer for different purposes across
the exynos_register_cpu_clock() function. This will help in future rewrite
for the new clk_hw API.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: samsung: Remove dead code
Marek Szyprowski [Mon, 24 Apr 2017 06:42:18 +0000 (08:42 +0200)]
clk: samsung: Remove dead code

samsung_clk_register_pll2550x() function is not used anymore,
so remove its declaration.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
7 years agoclk: imx7d: Fix the DDR PLL enable bit
Fabio Estevam [Tue, 6 Jun 2017 15:45:54 +0000 (12:45 -0300)]
clk: imx7d: Fix the DDR PLL enable bit

Commit ad14972422899b6 ("clk: imx7d: Fix the powerdown bit location
of PLL DDR") used the incorrect bit for the IMX_PLLV3_DDR_IMX7 case.

Fix it accordingly to avoid a kernel hang.

Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: at91: fix clk-generated compilation
Alexandre Belloni [Sun, 4 Jun 2017 22:02:57 +0000 (00:02 +0200)]
clk: at91: fix clk-generated compilation

Fix missing }

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: versatile: delete old RealView clock implementation
Linus Walleij [Fri, 12 May 2017 07:40:49 +0000 (09:40 +0200)]
clk: versatile: delete old RealView clock implementation

The old RealView clock implementation is not used anymore
(nothing in the kernel calls realview_clk_init()) as we have
moved all clocks over to device tree. Delete it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: bcm2835: Minimise clock jitter for PCM clock
Phil Elwell [Thu, 1 Jun 2017 14:14:22 +0000 (15:14 +0100)]
clk: bcm2835: Minimise clock jitter for PCM clock

Fractional clock dividers generate accurate average frequencies but
with jitter, particularly when the integer divisor is small.

Introduce a new metric of clock accuracy to penalise clocks with a good
average but worse jitter compared to clocks with an average which is no
better but with lower jitter. The metric is the ideal rate minus the
worse deviation from that ideal using the nearest integer divisors.

Use this metric for parent selection for clocks requiring low jitter
(currently just PCM).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: bcm2835: Limit PCM clock to OSC and PLLD_PER
Phil Elwell [Thu, 1 Jun 2017 14:14:16 +0000 (15:14 +0100)]
clk: bcm2835: Limit PCM clock to OSC and PLLD_PER

Restrict clock sources for the PCM peripheral to the oscillator and
PLLD_PER because other source may have varying rates or be switched off.
Prevent other sources from being selected by replacing their names in
the list of potential parents with dummy entries (entry index is
significant).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: bcm2835: Correct the prediv logic
Phil Elwell [Mon, 15 May 2017 17:35:04 +0000 (10:35 -0700)]
clk: bcm2835: Correct the prediv logic

If a clock has the prediv flag set, both the integer and fractional
parts must be scaled when calculating the resulting frequency.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoMerge branch 'clk-bulk-get' into clk-next
Stephen Boyd [Fri, 2 Jun 2017 22:39:32 +0000 (15:39 -0700)]
Merge branch 'clk-bulk-get' into clk-next

* clk-bulk-get:
  clk: add managed version of clk_bulk_get
  clk: add clk_bulk_get accessories

7 years agoclk: add managed version of clk_bulk_get
Dong Aisheng [Fri, 19 May 2017 13:49:05 +0000 (21:49 +0800)]
clk: add managed version of clk_bulk_get

This patch introduces the managed version of clk_bulk_get.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: add clk_bulk_get accessories
Dong Aisheng [Fri, 19 May 2017 13:49:04 +0000 (21:49 +0800)]
clk: add clk_bulk_get accessories

These helper function allows drivers to get several clk consumers in
one operation. If any of the clk cannot be acquired then any clks
that were got will be put before returning to the caller.

This can relieve the driver owners' life who needs to handle many clocks,
as well as each clock error reporting.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: meson-gxbb: Add const to some parent name arrays
Stephen Boyd [Fri, 2 Jun 2017 17:57:05 +0000 (10:57 -0700)]
clk: meson-gxbb: Add const to some parent name arrays

These can be marked as const * const.

Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoMerge tag 'meson-clk-for-4.13' of git://github.com/BayLibre/clk-meson into clk-next
Stephen Boyd [Fri, 2 Jun 2017 17:51:41 +0000 (10:51 -0700)]
Merge tag 'meson-clk-for-4.13' of git://github.com/BayLibre/clk-meson into clk-next

Pull Amlogic clock driver updates from Jerome Brunet:

 * Expose more i2s and spdif output clocks
 * Expose EE uart and SPICC gate clocks
 * Remove cpu_clk from to gxbb
 * Mark clk81 as critical on gxbb
 * Add CEC EE clocks

* tag 'meson-clk-for-4.13' of git://github.com/BayLibre/clk-meson:
  clk: meson-gxbb: Add EE 32K Clock for CEC
  clk: gxbb: remove CLK_IGNORE_UNUSED from clk81
  clk: meson: meson8b: mark clk81 as critical
  clk: meson: gxbb: remove the "cpu_clk" from the GXBB and GXL driver
  clk: meson-gxbb: un-export the CPU clock
  clk: meson-gxbb: expose UART clocks
  clk: meson-gxbb: expose SPICC gate
  clk: meson-gxbb: expose spdif master clock
  clk: meson-gxbb: expose i2s master clock
  clk: meson-gxbb: expose spdif clock gates

7 years agoclk: palmas: undo preparation of a clock source.
Arvind Yadav [Fri, 28 Apr 2017 13:03:07 +0000 (18:33 +0530)]
clk: palmas: undo preparation of a clock source.

Undo preparation of a clock source, if palmas_clks_init_configure is not
successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: Provide dummy of_clk_get_from_provider() for compile-testing
Geert Uytterhoeven [Fri, 28 Apr 2017 13:08:53 +0000 (15:08 +0200)]
clk: Provide dummy of_clk_get_from_provider() for compile-testing

When CONFIG_ON=n, dummies are provided for of_clk_get() and
of_clk_get_by_name(), but not for of_clk_get_from_provider().

Provide a dummy for the latter, to improve the ability to do
compile-testing.  This requires removing the existing dummy in the
Lantiq clock code.

Fixes: 766e6a4ec602d0c1 ("clk: add DT clock binding support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Thomas Langer <thomas.langer@intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: rockchip: mark some special clk as critical on rk3368
Elaine Zhang [Tue, 2 May 2017 07:34:06 +0000 (15:34 +0800)]
clk: rockchip: mark some special clk as critical on rk3368

The jtag clk no driver to handle them.
But this clk need enable,so make it as critical.

The ddrphy/ddrupctl clks no driver to handle them,
Chip design requirements for these clock to always on,

The pmu_hclk_otg0 is Chip design defect, must be always on,

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: mark noc and some special clk as critical on rk3288
Elaine Zhang [Tue, 2 May 2017 07:34:05 +0000 (15:34 +0800)]
clk: rockchip: mark noc and some special clk as critical on rk3288

The atclk/dbg/jtag/hsic-xin12m/pclk_core clks no driver to handle them.
But this clks need enable,so make it as ignore_unused for now.

The ddrupctl0/ddrupctl1/publ0/publ1 clks no driver to handle them,
Chip design requirements for these clock to always on,

The pmu_hclk_otg0 is Chip design defect, must be always on,

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: mark noc and some special clk as critical on rk3228
Elaine Zhang [Tue, 2 May 2017 07:34:04 +0000 (15:34 +0800)]
clk: rockchip: mark noc and some special clk as critical on rk3228

The jtag/bus/peri/initmem/rom/stimer/phy clks no driver to handle them.
But this clks need enable,so make it as critical.

The ddrupctl/ddrmon/ddrphy clks no driver to handle them,
Chip design requirements for these clock to always on,

The hclk_otg_pmu is Chip design defect, must be always on,
The new document will update the description of this clock.

All these non-noc/non-arbi clocks,IC suggest always on,
Because it's have some order limitation, between the NOC clock switch
and bus IDLE(or pd on/off).

The software is not very good to solve this constraint.
Always on these clocks, has no effect on the system power consumption.
The new document will update the description of these clock.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: mark pclk_ddrupctl as critical_clock on rk3036
Elaine Zhang [Tue, 2 May 2017 07:34:03 +0000 (15:34 +0800)]
clk: rockchip: mark pclk_ddrupctl as critical_clock on rk3036

No driver to handle this clk yet, but chip design requiress for this clock
supplying the ddr controller to be always on.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: add clock controller for rk3128
Elaine Zhang [Fri, 2 Jun 2017 01:47:25 +0000 (09:47 +0800)]
clk: rockchip: add clock controller for rk3128

Add the clock tree definition for the new rk3128 SoC.
And it also applies to the RK3126 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agodt-bindings: add bindings for rk3128 clock controller
Elaine Zhang [Fri, 2 Jun 2017 01:47:24 +0000 (09:47 +0800)]
dt-bindings: add bindings for rk3128 clock controller

Add devicetree bindings for Rockchip cru which found on
Rockchip SoCs.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: export more rk3228 clocks ids
Elaine Zhang [Fri, 28 Apr 2017 07:02:47 +0000 (15:02 +0800)]
clk: rockchip: export more rk3228 clocks ids

This patch exports related BUS/VPU/RGA/HDCP/IEP/TSP/WIFI/
VIO/USB/EFUSE/GPU/CRYPTO clocks for dts reference.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: add ids for rk3399 testclks used for camera handling
Eddie Cai [Tue, 25 Apr 2017 06:41:10 +0000 (14:41 +0800)]
clk: rockchip: add ids for rk3399 testclks used for camera handling

clk_testout1 and clk_testout2 are used for camera handling, so add their ids.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoMerge branch 'v4.13-shared/clkids' into v4.13-clk/next
Heiko Stuebner [Fri, 2 Jun 2017 12:48:32 +0000 (14:48 +0200)]
Merge branch 'v4.13-shared/clkids' into v4.13-clk/next

7 years agoclk: rockchip: add dt-binding header for rk3128
Elaine Zhang [Fri, 2 Jun 2017 01:47:23 +0000 (09:47 +0800)]
clk: rockchip: add dt-binding header for rk3128

Add the dt-bindings header for the rk3128,
that gets shared between the clock controller and
the clock references in the dts.
Add softreset ID for rk3128.
And it also applies to the RK3126 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoMerge tag 'clk-renesas-for-v4.13-tag1' of git://git.kernel.org/pub/scm/linux/kernel...
Michael Turquette [Fri, 2 Jun 2017 05:03:59 +0000 (14:03 +0900)]
Merge tag 'clk-renesas-for-v4.13-tag1' of git://git./linux/kernel/git/geert/renesas-drivers into clk-next

clk: renesas: Updates for v4.13

  - Add more module clocks for R-Car H3 ES2.0 and M3-W,
  - Add CPG/MSSR drivers for all supported R-Car Gen2 SoCs, enabling support
    for module resets, which are not supported by the existing driver,
  - Rework Kconfig and Makefile logic,
  - Small fixes and cleanups.

7 years agoclk: Fix __set_clk_rates error print-string
Bryan O'Donoghue [Mon, 15 May 2017 10:58:59 +0000 (11:58 +0100)]
clk: Fix __set_clk_rates error print-string

When failing to set a clock the printout emitted is incorrect.
"u32 rate" is formatted as %d and should be %u whereas "unsigned long
clk_set_rate()" is formatted as %ld and should be %lu as per
Documentation/printk-formats.txt.

Fixes: 2885c3b2a3da ("clk: Show correct information when fail to set clock rate")
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: scpi: fix return type of __scpi_dvfs_round_rate
Sudeep Holla [Thu, 18 May 2017 16:19:28 +0000 (17:19 +0100)]
clk: scpi: fix return type of __scpi_dvfs_round_rate

The frequencies above the maximum value of signed integer(i.e. 2^31 -1)
will overflow with the current code.

This patch fixes the return type of __scpi_dvfs_round_rate from 'int'
to 'unsigned long'.

Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)")
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: qoriq: Separate root input clock for core PLLs on ls1012a
Scott Wood [Mon, 20 Mar 2017 02:37:23 +0000 (10:37 +0800)]
clk: qoriq: Separate root input clock for core PLLs on ls1012a

ls1012a has separate input root clocks for core PLLs versus the
platform PLL, with the latter described as sysclk in the hw docs.
If a second input clock, named "coreclk", is present, this clock will be
used for the core PLLs.

Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agodt-bindings: qoriq-clock: Add coreclk
Scott Wood [Mon, 20 Mar 2017 02:37:22 +0000 (10:37 +0800)]
dt-bindings: qoriq-clock: Add coreclk

ls1012a has separate input root clocks for core PLLs versus the platform
PLL, with the latter described as sysclk in the hw docs.
Update the qoriq-clock binding to allow a second input clock, named
"coreclk".  If present, this clock will be used for the core PLLs.

Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: at91: fix clk-generated parenting
Alexandre Belloni [Fri, 12 May 2017 14:25:30 +0000 (16:25 +0200)]
clk: at91: fix clk-generated parenting

clk_generated_startup is called after clk_hw_register. So the first call to
get_parent will not have the correct value (i.e. 0) and because this is
cached, it may never be updated.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Fixes: df70aeef6083 ("clk: at91: add generated clock driver")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: imx7d: Fix the powerdown bit location of PLL DDR
Fabio Estevam [Mon, 15 May 2017 11:55:05 +0000 (08:55 -0300)]
clk: imx7d: Fix the powerdown bit location of PLL DDR

According to the MX7D Reference Manual the powerdown bit of
CCM_ANALOG_PLL_DDRn register is bit 20, so fix it accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: mvebu: armada-38x: add support for 1866MHz variants
Ralph Sennhauser [Wed, 24 May 2017 14:58:52 +0000 (16:58 +0200)]
clk: mvebu: armada-38x: add support for 1866MHz variants

The Linksys WRT3200ACM CPU is clocked at 1866MHz. Add 1866MHz to the
list of supported CPU frequencies. Also update multiplier and divisor
for the l2clk and ddrclk.

Noticed by the following warning:
[    0.000000] Selected CPU frequency (16) unsupported

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoMerge branch 'clk-ap806' into clk-next
Michael Turquette [Thu, 1 Jun 2017 03:16:35 +0000 (12:16 +0900)]
Merge branch 'clk-ap806' into clk-next

7 years agoclk: mvebu: ap806: introduce a new binding
Gregory CLEMENT [Wed, 31 May 2017 14:07:26 +0000 (16:07 +0200)]
clk: mvebu: ap806: introduce a new binding

As for cp110, the initial intent when the binding of the ap806 system
controller was to have one flat node. The idea being that what is
currently a clock-only driver in drivers would become a MFD driver,
exposing the clock, GPIO and pinctrl functionality. However, after taking
a step back, this would lead to a messy binding. Indeed, a single node
would be a GPIO controller, clock controller, pinmux controller, and
more.

This patch adopts a more classical solution of a top-level syscon node
with sub-nodes for the individual devices. The main benefit will be to
have each functional block associated to its own sub-node where we can
put its own properties.

The introduction of the Armada 7K/8K is still in the early stage so the
plan is to remove the old binding. However, we don't want to break the
device tree compatibility for the few devices already in the field. For
this we still keep the support of the legacy compatible string with a big
warning in the kernel about updating the device tree.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/cc8c8c40fa4c4e71133033358992ec38e5aa2be5.1496239589.git-series.gregory.clement@free-electrons.com

7 years agoclk: mvebu: ap806: do not depend anymore of the *-clock-output-names
Gregory CLEMENT [Wed, 31 May 2017 14:07:24 +0000 (16:07 +0200)]
clk: mvebu: ap806: do not depend anymore of the *-clock-output-names

As it was done for the cp110, this patch modifies the way the clock names
are created. The name of each clock is now created by using its physical
address as a prefix (as it was done for the platform device
names). Thanks to this we have an automatic way to compute a unique name.

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/e66cdd54d36c6bef78460a51e577f171b6ccb031.1496239589.git-series.gregory.clement@free-electrons.com

7 years agoclk: mvebu: ap806: cosmetic improvement
Gregory CLEMENT [Wed, 31 May 2017 14:07:22 +0000 (16:07 +0200)]
clk: mvebu: ap806: cosmetic improvement

Instead of using &pdev->dev all over the place, introduce a pointer
variable for it.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/5a55e081d96fc6d2a28331b59df90f56d32a9f24.1496239589.git-series.gregory.clement@free-electrons.com

7 years agodt-bindings: ap806: introduce a new binding
Gregory CLEMENT [Wed, 31 May 2017 14:07:25 +0000 (16:07 +0200)]
dt-bindings: ap806: introduce a new binding

This patch updates the documentation according to the changes made in the
patch "clk: mvebu: ap806: introduce a new binding"

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/32e35c1d5919bdf9dc7d58678f0c0b462886d03e.1496239589.git-series.gregory.clement@free-electrons.com

7 years agodt-bindings: ap806: do not depend anymore of the *-clock-output-names
Gregory CLEMENT [Wed, 31 May 2017 14:07:23 +0000 (16:07 +0200)]
dt-bindings: ap806: do not depend anymore of the *-clock-output-names

This patch updates the documentation according to the change made in the
patch "clk: mvebu: ap806: do not depend anymore of the
*-clock-output-names": the clock names are no more part of the binding.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/d502b5abc68cbb5739ce72ba8be27528f9042a28.1496239589.git-series.gregory.clement@free-electrons.com

7 years agoclk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM
Chen-Yu Tsai [Wed, 31 May 2017 07:58:23 +0000 (15:58 +0800)]
clk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM

The PRCM takes PLL_PERIPH0 as one of its parents for the AR100 clock.
As such we need to be able to describe this relationship in the device
tree.

Export the PLL_PERIPH0 clock so we can reference it in the PRCM node.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agoclk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM
Chen-Yu Tsai [Wed, 31 May 2017 07:58:21 +0000 (15:58 +0800)]
clk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM

The PRCM takes PLL_PERIPH0 as one of its parents for the AR100 clock.
As such we need to be able to describe this relationship in the device
tree.

Export the PLL_PERIPH0 clock so we can reference it in the PRCM node.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agodt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
Chen-Yu Tsai [Wed, 31 May 2017 07:58:19 +0000 (15:58 +0800)]
dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks

The AR100 clock in the PRCM has parents, one of which is pll-periph from
the main CCU.

Add it to the list of required clocks for the PRCM CCU.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agoclk: meson-gxbb: Add EE 32K Clock for CEC
Neil Armstrong [Wed, 24 May 2017 09:43:45 +0000 (11:43 +0200)]
clk: meson-gxbb: Add EE 32K Clock for CEC

On Amlogic GX SoCs, there is two CEC controllers :
- An Amlogic CEC custom in the AO domain
- The Synopsys HDMI-TX Controller in the EE domain

Each of these controllers needs a 32.768KHz clock, but there is two paths :
- In the EE domain, the "32k_clk" this patchs is adding
- In the AO domain, with a more complex dual divider more precise setup

The AO 32K clock support will be pushed later in the corresponding
gxbb-aoclk driver when the AE CEC driver is ready.

The EE 32k_clk must be pushed earlier since mainline support for CEC in the
Synopsys HDMI-TX controller is nearby.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[Rebased patch on top of last changes]
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: gxbb: remove CLK_IGNORE_UNUSED from clk81
Jerome Brunet [Wed, 24 May 2017 09:39:32 +0000 (11:39 +0200)]
clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

clk81 already has CLK_IS_CRITICAL so CLK_IGNORE_UNUSED is not
necessary

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
7 years agoclk: meson: meson8b: mark clk81 as critical
Martin Blumenstingl [Wed, 24 May 2017 09:39:31 +0000 (11:39 +0200)]
clk: meson: meson8b: mark clk81 as critical

Disabling clk81 results in an immediate freeze of the whole system. This
can happen "accidentally" when the last child-clock of clk81 is disabled
(in this case the common clock framework also disables clk81, even if it
was only enabled indirectly before).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
7 years agoclk: meson: gxbb: remove the "cpu_clk" from the GXBB and GXL driver
Martin Blumenstingl [Thu, 4 May 2017 18:19:20 +0000 (20:19 +0200)]
clk: meson: gxbb: remove the "cpu_clk" from the GXBB and GXL driver

It seems that the "cpu_clk" was carried over from the meson8b clock
controller driver. On Meson GX (GXBB/GXL/GXM) the registers which are
used by the cpu_clk have a different purpose (in other words: they don't
control the CPU clock anymore). HHI_SYS_CPU_CLK_CNTL1 bits 31:24 are
reserved according to the public S905 datasheet, while bit 23 is the
"A53_trace_clk_DIS" gate (which according to the datasheet should only
be used in case a silicon bug is discovered) and bits 22:20 are a
divider (A53_trace_clk). The meson clk-cpu code however expects that
bits 28:20 are reserved for a divider (according to the public S805
datasheet this "SCALE_DIV: This value represents an N+1 divider of the
input clock.").

The CPU clock on Meson GX SoCs is provided by the SCPI DVFS clock
driver instead. Two examples from a Meson GXL S905X SoC:
- vcpu (SCPI DVFS clock 0) rate: 1000000000 / cpu_clk rate: 708000000
- vcpu (SCPI DVFS clock 0) rate: 1512000000 / cpu_clk rate: 708000000

Unfortunately the CLKID_CPUCLK was already exported (but is currently
not used) to DT. Due to the removal of this clock definition there is
now a hole in the clk_hw_onecell_data (which is not a problem because
this case is already handled in gxbb_clkc_probe).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: un-export the CPU clock
Martin Blumenstingl [Thu, 4 May 2017 18:19:19 +0000 (20:19 +0200)]
clk: meson-gxbb: un-export the CPU clock

The CPU clock defined in the Meson GX clock driver is actually a
left-over from the Meson8b clock controller. Un-export the clock so we
can remove it from the driver.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: expose UART clocks
Helmut Klein [Fri, 31 Mar 2017 16:54:34 +0000 (18:54 +0200)]
clk: meson-gxbb: expose UART clocks

Expose the clock ids of the three none AO uarts to the dt-bindings

Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Helmut Klein <hgkr.klein@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[tidy the commit message to match similar change]
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: expose SPICC gate
Neil Armstrong [Thu, 20 Apr 2017 11:59:10 +0000 (13:59 +0200)]
clk: meson-gxbb: expose SPICC gate

Expose the SPICC gate clock to enable the SPICC controller.

Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[tidy commit message to match similar changes]
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: expose spdif master clock
Jerome Brunet [Thu, 2 Mar 2017 14:23:38 +0000 (15:23 +0100)]
clk: meson-gxbb: expose spdif master clock

Expose the spdif master clock and the mux to select the appropriate spdif
clock parent depending on the data source.

Acked-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: expose i2s master clock
Jerome Brunet [Thu, 26 Jan 2017 10:12:52 +0000 (11:12 +0100)]
clk: meson-gxbb: expose i2s master clock

Expose cts_amclk in the device tree bindings

Acked-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoclk: meson-gxbb: expose spdif clock gates
Jerome Brunet [Thu, 2 Mar 2017 14:22:29 +0000 (15:22 +0100)]
clk: meson-gxbb: expose spdif clock gates

Expose the clock gates required for the spdif output

Acked-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
7 years agoMerge tag 'meson-clk-fixes-for-4.12-rc2' of git://github.com/baylibre/clk-meson into...
Michael Turquette [Thu, 25 May 2017 21:11:11 +0000 (14:11 -0700)]
Merge tag 'meson-clk-fixes-for-4.12-rc2' of git://github.com/baylibre/clk-meson into clk-fixes

KConfig fix:
- clk: meson: gxbb: fix build error without RESET_CONTROLLER

7 years agoclk: sunxi-ng: sun5i: Fix ahb_bist_clk definition
Boris Brezillon [Wed, 24 May 2017 16:34:29 +0000 (18:34 +0200)]
clk: sunxi-ng: sun5i: Fix ahb_bist_clk definition

AHB BIST gate is actually controlled with bit 7.

This bug was detected while trying to use the NAND controller which is
using the DMA engine to transfer data to the NAND.
Since the ahb_bist_clk gate bit conflicts with the ahb_dma_clk gate bit,
the core was disabling the DMA engine clock as part of its 'disable
unused clks' procedure, which was causing all DMA transfers to fail after
this point.

Fixes: 5e73761786d6 ("clk: sunxi-ng: Add sun5i CCU driver")
Cc: stable@vger.kernel.org
Reported-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Angus Ainslie <angus@akkea.ca>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1495643669-28221-1-git-send-email-boris.brezillon@free-electrons.com

7 years agoclk: renesas: r8a7794: Add new CPG/MSSR driver
Geert Uytterhoeven [Sun, 19 Mar 2017 17:12:51 +0000 (18:12 +0100)]
clk: renesas: r8a7794: Add new CPG/MSSR driver

Add a new R-Car E2 Clock Pulse Generator / Module Standby and Software
Reset driver, using the CPG/MSSR driver core.  This will enable support
for module resets, which are not supported by the existing driver.

The old driver can still be used through a Kconfig option, to preserve
backward compatibility with old DTBs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7792: Add new CPG/MSSR driver
Geert Uytterhoeven [Sun, 19 Mar 2017 17:08:59 +0000 (18:08 +0100)]
clk: renesas: r8a7792: Add new CPG/MSSR driver

Add a new R-Car V2H Clock Pulse Generator / Module Standby and Software
Reset driver, using the CPG/MSSR driver core.  This will enable support
for module resets, which are not supported by the existing driver.

The old driver can still be used through a Kconfig option, to preserve
backward compatibility with old DTBs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7791/r8a7793: Add new CPG/MSSR driver
Geert Uytterhoeven [Fri, 16 Oct 2015 09:41:19 +0000 (11:41 +0200)]
clk: renesas: r8a7791/r8a7793: Add new CPG/MSSR driver

Add a new R-Car M2-W/N Clock Pulse Generator / Module Standby and
Software Reset driver, using the CPG/MSSR driver core.  This will enable
support for module resets, which are not supported by the existing
driver.

The old driver can still be used through a Kconfig option, to preserve
backward compatibility with old DTBs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7790: Add new CPG/MSSR driver
Geert Uytterhoeven [Sun, 19 Mar 2017 17:05:42 +0000 (18:05 +0100)]
clk: renesas: r8a7790: Add new CPG/MSSR driver

Add a new R-Car H2 Clock Pulse Generator / Module Standby and Software
Reset driver, using the CPG/MSSR driver core.  This will enable support
for module resets, which are not supported by the existing driver.

The old driver can still be used through a Kconfig option, to preserve
backward compatibility with old DTBs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: Add r8a7794 CPG Core Clock Definitions
Geert Uytterhoeven [Sun, 19 Mar 2017 15:38:05 +0000 (16:38 +0100)]
clk: renesas: Add r8a7794 CPG Core Clock Definitions

Add all R-Car E2 Clock Pulse Generator Core Clock Outputs, as listed in
Table 7.2d ("List of Clocks [R-Car E2]") of the R-Car Gen2 Hardware
User's Manual rev. 2.00.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
7 years agoclk: renesas: Add r8a7793 CPG Core Clock Definitions
Geert Uytterhoeven [Sun, 19 Mar 2017 15:38:05 +0000 (16:38 +0100)]
clk: renesas: Add r8a7793 CPG Core Clock Definitions

Add all R-Car M2-N Clock Pulse Generator Core Clock Outputs, as listed
in Table 7.2b ("List of Clocks [R-Car M2-W/M2-N]") of the R-Car Gen2
Hardware User's Manual rev. 2.00.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
7 years agoclk: renesas: Add r8a7792 CPG Core Clock Definitions
Geert Uytterhoeven [Sun, 19 Mar 2017 15:38:05 +0000 (16:38 +0100)]
clk: renesas: Add r8a7792 CPG Core Clock Definitions

Add all R-Car V2H Clock Pulse Generator Core Clock Outputs, as listed in
Table 7.2c ("List of Clocks [R-Car V2H]") of the R-Car Gen2 Hardware
User's Manual rev. 2.00.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
7 years agoclk: renesas: Add r8a7791 CPG Core Clock Definitions
Geert Uytterhoeven [Mon, 12 Oct 2015 09:28:17 +0000 (11:28 +0200)]
clk: renesas: Add r8a7791 CPG Core Clock Definitions

Add all R-Car M2-W Clock Pulse Generator Core Clock Outputs, as listed
in Table 7.2b ("List of Clocks [R-Car M2-W/M2-N]") of the R-Car Gen2
Hardware User's Manual rev. 2.00.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
7 years agoclk: renesas: Add r8a7790 CPG Core Clock Definitions
Geert Uytterhoeven [Fri, 16 Oct 2015 09:41:19 +0000 (11:41 +0200)]
clk: renesas: Add r8a7790 CPG Core Clock Definitions

Add all R-Car H2 Clock Pulse Generator Core Clock Outputs, as listed in
Table 7.2a ("List of Clocks [R-Car H2]") of the R-Car Gen2 Hardware
User's Manual rev. 2.00.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
7 years agoclk: renesas: cpg-mssr: Document R-Car Gen2 support
Geert Uytterhoeven [Mon, 20 Mar 2017 16:46:22 +0000 (17:46 +0100)]
clk: renesas: cpg-mssr: Document R-Car Gen2 support

Document use of the Renesas Clock Pulse Generator / Module Standby and
Software Reset DT Bindings for various member of the R-Car Gen2 family
(H2, M2-W, V2H, M2-N, and E2).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
7 years agoclk: renesas: Rework Kconfig and Makefile logic
Geert Uytterhoeven [Mon, 24 Apr 2017 14:54:14 +0000 (16:54 +0200)]
clk: renesas: Rework Kconfig and Makefile logic

The goals are to:
  - Allow precise control over and automatic selection of which
    (sub)drivers are used for which SoC (which may change in the
    future),
  - Allow adding support for new SoCs easily,
  - Allow compile-testing of all (sub)drivers,
  - Keep driver selection logic in the subsystem-specific Kconfig,
    independent from the architecture-specific Kconfig (i.e. no "select"
    from arch/arm64/Kconfig.platforms), to avoid dependencies.

This is implemented by:
  - Introducing Kconfig symbols for all drivers and sub-drivers,
  - Introducing the Kconfig symbol CLK_RENESAS, which is enabled
    automatically when building for a Renesas ARM platform, and which
    enables all required drivers without interaction of the user, based
    on SoC-specific ARCH_* symbols,
  - Allowing the user to enable any Kconfig symbol manually if
    COMPILE_TEST is enabled,
  - Using the new Kconfig symbols instead of the ARCH_* symbols to
    control compilation in the Makefile,
  - Always entering drivers/clk/renesas/ during the build.

Note that currently not all (sub)drivers are enabled for
compile-testing, as they depend on independent fixes in other
subsystems.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
7 years agoclk: renesas: cpg-mssr: Initialize error pointer using ERR_PTR()
Geert Uytterhoeven [Wed, 17 May 2017 13:43:56 +0000 (15:43 +0200)]
clk: renesas: cpg-mssr: Initialize error pointer using ERR_PTR()

Coccinelle warns:

    drivers/clk/renesas/renesas-cpg-mssr.c:323:14-21: ERROR: PTR_ERR applied after initialization to constant on line 260

Initialize clk using ERR_PTR(-ENOTSUPP) instead of NULL to fix this.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: sunxi-ng: enable SUNXI_CCU_MP for PRCM
Arnd Bergmann [Wed, 17 May 2017 21:19:01 +0000 (23:19 +0200)]
clk: sunxi-ng: enable SUNXI_CCU_MP for PRCM

The newly added PRCM CCU driver uses SUNXI_CCU_MP_WITH_MUX_GATE, which causes
a link error when no other driver enables SUNXI_CCU_MP:

drivers/clk/built-in.o:(.data+0x5c8c8): undefined reference to `ccu_mp_ops'

This adds an explicit 'select' statement for it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agoclk: rockchip: fix up the RK3228 clk cpu setting table
Elaine Zhang [Fri, 28 Apr 2017 07:02:45 +0000 (15:02 +0800)]
clk: rockchip: fix up the RK3228 clk cpu setting table

support more cpu freq, and add armcore div setting.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: add clock-ids for more rk3228 clocks
Elaine Zhang [Fri, 28 Apr 2017 07:02:46 +0000 (15:02 +0800)]
clk: rockchip: add clock-ids for more rk3228 clocks

This patch exports related BUS/VPU/RGA/HDCP/IEP/TSP/WIFI/
VIO/USB/EFUSE/GPU/CRYPTO clocks for dts reference.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: rockchip: add ids for camera on rk3399
Eddie Cai [Tue, 25 Apr 2017 06:41:09 +0000 (14:41 +0800)]
clk: rockchip: add ids for camera on rk3399

we use SCLK_TESTCLKOUT1 and SCLK_TESTCLKOUT2 for camera, so add those ids.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
7 years agoclk: meson: gxbb: fix build error without RESET_CONTROLLER
Tobias Regnery [Mon, 24 Apr 2017 10:05:42 +0000 (12:05 +0200)]
clk: meson: gxbb: fix build error without RESET_CONTROLLER

With CONFIG_RESET_CONTROLLER=n we see the following link error in the
meson gxbb clk driver:

drivers/built-in.o: In function 'gxbb_aoclkc_probe':
drivers/clk/meson/gxbb-aoclk.c:161: undefined reference to 'devm_reset_controller_register'

Fix this by selecting the reset controller subsystem.

Fixes: f8c11f79912d ("clk: meson: Add GXBB AO Clock and Reset controller driver")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
[narmstrong: Added fixes-by tag]
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
7 years agoclk: renesas: r8a7795: Correct pwm, gpio, and i2c parent clocks on ES2.0
Geert Uytterhoeven [Mon, 8 May 2017 09:43:49 +0000 (11:43 +0200)]
clk: renesas: r8a7795: Correct pwm, gpio, and i2c parent clocks on ES2.0

Cfr. the errata of April 14, 2017, for the R-Car Gen3 Hardware Manual
Rev. 0.53E.

These have no user-visible effect, as the clock frequencies stay the
same.

Fixes: 5573d194128b4733 ("clk: renesas: r8a7795: Add support for R-Car H3 ES2.0")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoclk: renesas: Use pm_clk_no_clocks() helper i.s.o. direct access
Geert Uytterhoeven [Wed, 8 Feb 2017 18:08:44 +0000 (19:08 +0100)]
clk: renesas: Use pm_clk_no_clocks() helper i.s.o. direct access

The pm_subsys_data.clock_list member exists only if CONFIG_PM_CLK=y.
Hence direct accesses to this field break compile-testing on platforms
where CONFIG_PM_CLK=n.

To fix this, use the pm_clk_no_clocks() helper instead, for which a
dummy version is provided if CONFIG_PM_CLK=n.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
7 years agoclk: renesas: Do not build clk-div6 for R8A7792
Geert Uytterhoeven [Mon, 24 Apr 2017 12:37:20 +0000 (14:37 +0200)]
clk: renesas: Do not build clk-div6 for R8A7792

R-Car V2H does not have "DIV6" programmable clocks, hence there is no
need to build clk-div6.o.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoclk: renesas: r8a7796: Add INTC-EX clock
Takeshi Kihara [Wed, 19 Apr 2017 17:46:41 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add INTC-EX clock

Add the "intc-ex" clock to the R8A7796 CPG MSSR driver.

According to information from the hardware team the INTC-EX
parent clock is CP. The next data sheet version will include
this information.

[takeshi.kihara.df: Ported from commit f099aa075749 ("clk: shmobile:
 r8a7795: Add INTC-EX clock") to drivers/clk/renesas/r8a7796-cpg-mssr.c]
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add PCIe clocks
Harunobu Kurokawa [Wed, 19 Apr 2017 17:46:39 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add PCIe clocks

This patch adds PCIEC{0,1} clocks for R8A7796 SoC.

Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add PWM clock
Ryo Kodama [Wed, 19 Apr 2017 17:46:38 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add PWM clock

This patch adds PWM clock for PWM.

Signed-off-by: Ryo Kodama <ryo.kodama.vz@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
[geert: Correct parent clock]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add HS-USB clock
Kazuya Mizuguchi [Wed, 19 Apr 2017 17:46:37 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add HS-USB clock

This patch adds HS-USB-IF clock for R8A7796 SoC.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add Sound DVC clocks
Kazuya Mizuguchi [Wed, 19 Apr 2017 17:46:36 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add Sound DVC clocks

This patch adds adds SCU(DVC{0,1}) clocks for R8A7796 SoC.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add Sound SRC clock
Kazuya Mizuguchi [Wed, 19 Apr 2017 17:46:35 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add Sound SRC clock

This patch adds SCU(all), SCU(SRC{0,1,2,3,4,5,6,7,8,9}), SCU(CTU00,
CTU01, CTU02, CTU03, MIX0) and SCU (CTU10, CTU11, CTU12, CTU13, MIX1)
clocks for R8A7796 SoC.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add Sound SSI clock
Kazuya Mizuguchi [Wed, 19 Apr 2017 17:46:34 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add Sound SSI clock

This patch adds SSI(all) and SSI{0,1,2,3,4,5,6,7,8,9} clocks for R8A7796
SoC.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add USB-DMAC clocks
Hiromitsu Yamasaki [Wed, 19 Apr 2017 17:46:29 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add USB-DMAC clocks

This patch adds USB-DMAC{0,1} clocks for R8A7796 SoC.

Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add Audio-DMAC clocks
Hiromitsu Yamasaki [Wed, 19 Apr 2017 17:46:28 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add Audio-DMAC clocks

This patch adds A-DMAC{0,1} clocks for R8A7796 SoC.

Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
[geert: Correct parent clocks, preserve sort order]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add EHCI/OHCI clocks
Kazuya Mizuguchi [Wed, 19 Apr 2017 17:46:27 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add EHCI/OHCI clocks

This patch adds EHCI/OHCI{0,1} clocks for R8A7796 SoC.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7796: Add HDMI clock
Koji Matsuoka [Wed, 19 Apr 2017 17:46:26 +0000 (02:46 +0900)]
clk: renesas: r8a7796: Add HDMI clock

This patch adds HDMI-IF0 clock for R8A7796 SoC.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7795: Add HS-USB ch3 clock
Takeshi Kihara [Wed, 19 Apr 2017 17:46:25 +0000 (02:46 +0900)]
clk: renesas: r8a7795: Add HS-USB ch3 clock

This patch adds valid HS-USB ch3 clock from R8A7795 ES2.0 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
7 years agoclk: renesas: r8a7795: Add USB-DMAC ch3 clock
Takeshi Kihara [Wed, 19 Apr 2017 17:46:24 +0000 (02:46 +0900)]
clk: renesas: r8a7795: Add USB-DMAC ch3 clock

This patch supports the clock of USB-DMAC ch3 module added from R8A7795
ES2.0 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>