1
0
Fork 0
Commit Graph

616072 Commits (2886c84681c4a10a8fecdea58bf749af09406a33)

Author SHA1 Message Date
James Liao 2886c84681 clk: mediatek: Refine the makefile to support multiple clock drivers
Add a Kconfig to define clock configuration for each SoC, and
modify the Makefile to build drivers that only selected in config.

Signed-off-by: Shunli Wang <shunli.wang@mediatek.com>
Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Signed-off-by: Erin Lo <erin.lo@mediatek.com>
Tested-by: John Crispin <blogic@openwrt.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-19 12:18:38 -07:00
James Liao 928f3bfb81 clk: mediatek: remove __init from clk registration functions
Remove __init from functions that will be used by init functions
that support probe deferral.

Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Signed-off-by: Erin Lo <erin.lo@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-18 17:15:30 -07:00
Stephen Boyd 944b9a41e0 clk: ls1x: Migrate to clk_hw based OF and registration APIs
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.

Cc: Kelvin Cheung <keguang.zhang@gmail.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-18 17:07:50 -07:00
Tang Yuantian 8964193f6b clk: qoriq: fix a register offset error
The offset of Core Cluster clock control/status register
on cluster group V3 version is different from others, and
should be plus 0x70000.

Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com>
Reviewed-by: Scott Wood <oss@buserror.net>
Fixes: 9e19ca2f62 ("clk: qoriq: Add ls2080a support.")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-18 16:52:24 -07:00
Stephen Boyd 9b4cac33ad clk: max77686: Migrate to clk_hw based OF and registration APIs
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-18 16:42:36 -07:00
Stephen Boyd 91d17dc341 clk: renesas: r8a7796: Add watchdog clocks
Add all clocks related to the Watchdog Timer (WDT) controller on the
 Renesas R-Car M3-W (r8a7796) SoC.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXtHgSAAoJEEgEtLw/Ve77DgcP/1620tFIcsgBC5bGlbA54+Zh
 z9r4cFiCgR7Xsi45UZijKvs8JtiBF5UwQIPokjHP7/KrQFyiQPga7IMUDDC3GwG2
 K50zK9q+d1pRl3Gjw8TCvfzYx+ooaGryNrvxyxrMSc5oFG3NtiBLiBdY2muPzTY0
 CYMW4dOy33FzG5wsYHEmUQAI+VOW65ovE2j0zoJ8Juj3KHJoe0kvf5dN4Pk0hUCR
 zZjGqUQ+9P5ZJG8/ToR8lrvOm8B6r9WmN9BLFD2eDmyU6osuPcmQ86pIICA9fHQS
 uoVv3qjmSqBenEhOKBB6Jp0fhAwwyu1XVSCmb17Rw93QfKDuy4yB1ZP8L+aTQoG9
 y1k4H80FFZTVoL5DLHGnB7iJMKUP0ROovoLYs1teGhIj8825C4EtxTITKKHwdbKy
 8hOCQBAENxIlX5y7cyhUkdR0O+8kV7r8NYt4LDnYp2oAMD6hgN/7kXf92+QeALxl
 B5u9Z2sKmPjfmXHE8eH2Z4/aAgMTqRfwaW6U8WFndF6IVsmGWz/p5fhvaLJY1zNf
 jK5LJWJmKiIkkpiGLhrhVVfl0pyJLQtmIxPv/fIMxUbp1rynT5o6jFOKaWsNRuA2
 8Stmca2L/8/BfLpk6z5vRZ95U00++LS5GPSr3PGBfg45HrOVAEUSvvj+vjaggkXR
 1YvK2hqYXGZ34pZcFA4i
 =0CHq
 -----END PGP SIGNATURE-----

Merge tag 'clk-renesas-for-v4.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-next

Merge r8a7796 watchdog clk support from Geert Uytterhoeven:

Add all clocks related to the Watchdog Timer (WDT) controller on the
Renesas R-Car M3-W (r8a7796) SoC.

* tag 'clk-renesas-for-v4.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r8a7796: Add watchdog module clock
  clk: renesas: r8a7796: Add watchdog core clocks
2016-08-18 16:41:05 -07:00
Stephen Boyd f6475e2982 clk: berlin: Migrate to clk_hw based registration and OF APIs
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs. We also remove some __init
markings in header files as they're useless and we're in the
area.

Tested-by: Jisheng Zhang <jszhang@marvell.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-18 11:30:01 -07:00
Markus Elfring 57c4a2ac8f clk: gcc-ipq4019: Delete unnecessary assignment for the field "owner"
The field "owner" is set by the core.
Thus delete an unneeded initialisation.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-17 14:32:08 -07:00
Stephen Boyd 7e6a3a1d79 clk: qcom: Sort Makefile alphabetically
We've started getting out of order, fix it.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 16:09:04 -07:00
Stephen Boyd cd1e29a93c Merge branch 'clk-qcom-9615' into clk-next
* clk-qcom-9615:
  dt-bindings: clock: Update bindings for MDM9615 GCC and LCC
  clk: mdm9615: Add support for MDM9615 Clock Controllers
  dt-bindings: Add MDM9615 DT bindings include files for GCC and LCC
2016-08-15 16:08:49 -07:00
Neil Armstrong 3e99c7ab16 dt-bindings: clock: Update bindings for MDM9615 GCC and LCC
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 16:06:40 -07:00
Neil Armstrong 7792a8d671 clk: mdm9615: Add support for MDM9615 Clock Controllers
In order to support the Qualcomm MDM9615 SoC, add support for
the Global and LPASS Clock Controllers.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:51:21 -07:00
Neil Armstrong f7508fedd8 dt-bindings: Add MDM9615 DT bindings include files for GCC and LCC
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:51:18 -07:00
Stephen Boyd ddf7e5377b Merge branch 'clk-meson-gxbb' into clk-next
* clk-meson-gxbb:
  clk: gxbb: add MMC gate clocks, and expose for DT
2016-08-15 15:47:15 -07:00
Kevin Hilman 33608dcd01 clk: gxbb: add MMC gate clocks, and expose for DT
Add the SD/eMMC gate clocks and expose them for use by DT.

While at it, also explose FCLK_DIV2 since this is one of the input
clocks to the mux internal to each of the SD/eMMC blocks.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:45:57 -07:00
Laxman Dewangan 5a227cd1ab clk: max77686: Add support for MAX77620 clocks
Maxim Max77620 has one 32KHz clock output and the clock HW
IP used on this PMIC is same as what it is there in the MAX77686.

Add clock driver support for MAX77620 on the MAX77686 driver.

CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:39:32 -07:00
Laxman Dewangan e581245d8a clk: max77686: Add DT binding details for PMIC MAX77620
Maxim has used the same clock IP on multiple PMICs like MAX77686,
MAX77802, MAX77620. Only differences are the number of clocks
from these PMICs like MAX77686 has 3 clocks output, MAX776802 have
two clock output and MAX77620 has one clock output.

Add clock binding details and DT example for the MAX77620.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Javier Martinez Canillas <javier@dowhile0.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:33:14 -07:00
Laxman Dewangan 24f668debc clk: Combine DT binding doc for max77686 and max77802
The clock IP used on the Maxim PMICs max77686 and max77802 are
same. The configuration of clock register is also same except
the number of clocks.

Define the common DT binding file for the clocks of Maxim PMICs
MAX77686 and MAX77802. For this, remove the separate DT binding
document file for maxim,max77802 and move all information to
maxim,max77686 DT binding document.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Javier Martinez Canillas <javier@dowhile0.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:32:59 -07:00
Laxman Dewangan 8ad313fe4e clk: max77686: Combine Maxim max77686 and max77802 driver
The clock IP used on the Maxim PMICs max77686 and max77802 are
same. The configuration of clock register is also same except
the number of clocks.

Part of common code utilisation, there is 3 files for these chips
clock driver, one for common and two files for driver registration.

Combine both drivers into single file and move common code into
same common file reduces the 2 files and make max77686 and max77802
clock driver in single fine. This driver does not depends on the
parent driver structure. The regmap handle is acquired through
regmap APIs for the register access.

This combination of driver helps on adding clock driver for different
Maxim PMICs which has similar clock IP like MAX77620 and MAX20024.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Javier Martinez Canillas <javier@dowhile0.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:32:41 -07:00
Stephen Boyd d336e9a71e clk: fixed-rate: Remove export symbol on setup function
This function is only called by builtin code, but we always
exported it and had marked it as __init before commit
e4eda8e065 (clk: remove exported function from __init section,
2013-01-06) removed that marking. Given that it isn't used by
modules, lets unexport it and add back __init.

Cc: Denis Efremov <yefremov.denis@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:08:06 -07:00
Stephen Boyd 1caadde436 clk: fixed-factor: Remove export symbol on setup function
This function is marked __init, so it can't possibly need to be
exported to modules. Remove the marking.

Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 15:08:03 -07:00
Stephen Boyd f155d15b64 clk: Return errors from clk providers in __of_clk_get_from_provider()
Before commit 0861e5b8cf (clk: Add clk_hw OF clk providers,
2016-02-05) __of_clk_get_from_provider() would return an error
pointer of the provider's choosing if there was a provider
registered and EPROBE_DEFER otherwise. After that commit, it
would return EPROBE_DEFER regardless of whether or not the
provider returned an error. This is odd and can lead to behavior
where clk consumers keep probe deferring when they should be
seeing some other error.

Let's restore the previous behavior where we only return
EPROBE_DEFER when there isn't a provider in our of_clk_providers
list. Otherwise, return the error from the last provider we find
that matches the node.

Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 0861e5b8cf ("clk: Add clk_hw OF clk providers")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:32:23 -07:00
Wei Yongjun 00746f1044 clk: gxbb: use builtin_platform_driver to simplify the code
Use the builtin_platform_driver() macro to make the code simpler.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:29:51 -07:00
Gregory CLEMENT 8ca4746a78 clk: mvebu: Add the peripheral clock driver for Armada 3700
These clocks are the ones which will be used as source for the
peripherals of the Armada 3700 SoC. On this SoC there is two blocks of
clocks: the North bridge one and the South bridge one.

Most of them are gatable. Most of the time their rate are their parent
rated divided by a ratio depending of two registers. Their parent can be
choose between the TBG clocks for most of them.

However, some of them can't choose their parent or directly depend of the
xtal clocks. Other ones do not use exactly the same pattern to find the
ratio between their parent rate and their rate.

For these reason each clock is a composite clock and the operations they
use are different depending of the clock.

According to the datasheet it would be possible to select the parent
clock and the ratio, however currently the driver does not support it.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:10:27 -07:00
Gregory CLEMENT c6d591c14e dt-bindings: clock: add DT binding for the peripheral clocks on Armada 3700
This commit adds the DT binding documentation for the peripheral clocks
used in the Marvell Armada 3700 SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:10:25 -07:00
Gregory CLEMENT 96265523ac clk: mvebu Add the time base generator clocks for Armada 3700
These clocks are children of the xtal clock and each one can be selected
as a source for the peripheral clocks.

According to the datasheet it should be possible to modify their rate,
but currently it is not supported.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:10:20 -07:00
Gregory CLEMENT c302588e17 dt-bindings: clock: add DT binding for the TBG clocks on Armada 3700
This commit adds the DT binding documentation for the Time Base Generator
clock used in the Marvell Armada 3700 SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:07:40 -07:00
Gregory CLEMENT 7ea8250406 clk: mvebu: Add the xtal clock for Armada 3700 SoC
This clock is the parent of all the Armada 3700 clocks. It is a fixed
rate clock which depends on the gpio configuration read when resetting
the SoC.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:07:04 -07:00
Gregory CLEMENT cedfbc309d dt-bindings: clock: add DT binding for the Xtal clock on Armada 3700
This commit adds the DT binding documentation for the the Xtal clock on
Armada 3700 used in the Marvell Armada 3700 SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 14:06:41 -07:00
Peter Ujfalusi 7e37deb7fa clk: twl6040: Rename the driver and use consistent names in the code
The driver is to provide the functional clock to OMAP4/5 McPDM. The clock
is named as pdmclk in the documentations so change the function names,
structure names and variables to align with this.
At the same time rename the driver from "twl6040-clk" to "twl6040-pdmclk".
This can be done w/o regression since the clock driver is not in use at
the moment, the MFD core driver is not even registering the device for it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 12:09:54 -07:00
Peter Ujfalusi 994deaae37 clk: twl6040: Register the clock as of_clk_provider
In order ot be able to use the pdmclk clock via DT it need to be registered
as of_clk_provide.
Since the twl6040 clock driver does not have it's own DT node, use the
parent's node for registering.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 12:09:52 -07:00
Peter Ujfalusi 225ff4e87a clk: twl6040: Correct clk_ops
Since the drover only supports prepare callbacks, the use of is_enabled is
not correct, it should be handling is_prepared.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-15 12:09:48 -07:00
Grzegorz Jaszczyk 7752f09cb1 clk: mvebu: armada-39x: add clk description for supported interfaces
Both SATA and second USB3.0 interface are supported in Armada-39x SoC
family. Add necessary clk description, so both xhci and sata drivers
can be correctly initialized.

The binding documentation has also been updated accordingly.

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:20:01 -07:00
Masahiro Yamada 8a23133c7a clk: use ERR_CAST() for __clk_create_clk()
This code is clear enough, but the intention will be even clearer
with this.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:17:04 -07:00
Ricardo Ribalda Delgado 435779fe13 clk: fixed-rate: Convert into a module platform driver
Adds support for fixed-rate clock providers which have not been
enabled via of_clk_init().

This is required by Device trees overlays that introduce clocks
providers.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
[sboyd@codeaurora.org: Make new private function static, don't
check clk for NULL when unregistering in driver remove]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:15:41 -07:00
Ricardo Ribalda Delgado 971451b3b1 clk: fixed-factor: Convert into a module platform driver
Adds support for fixed-factor clock providers which have not been
enabled via of_clk_init().

This is required by Device trees overlays that introduce clocks
providers.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
[sboyd@codeaurora.org: Make new private function static, don't
check clk for NULL when unregistering in driver remove]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:15:39 -07:00
Ricardo Ribalda Delgado 989eafd0b6 clk: core: Avoid double initialization of clocks
Some clock providers can be initialized via of_clk_init() and also via
platform device probe.

Avoid double initialization of them by setting the OF_POPULATED flag.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:01:58 -07:00
Ricardo Ribalda Delgado 915128b621 clk: sunxi: apb0: Use new macro CLK_OF_DECLARE_DRIVER
This driver initializes a clock provider via sun8i_a23_apb0_setup
and then continues the initialization on sun8i_a23_apb0_clk_probe.

Use the new macro to notify the clk subsystem about this behaviour.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:01:50 -07:00
Ricardo Ribalda Delgado cb1291c3fd clk: sunxi: mod0: Use new macro CLK_OF_DECLARE_DRIVER
This driver initializes a clock provider via sun4i_a10_mod0_setup
and then continues the initialization on sun4i_a10_mod0_clk_probe.

Use the new macro to notify the clk subsystem about this behaviour.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:01:20 -07:00
Ricardo Ribalda Delgado 9a0c42d216 clk: nxp: Use new macro CLK_OF_DECLARE_DRIVER
This driver initializes a clock provider via lpc18xx_creg_clk_init
and then continues the initialization on lpc18xx_creg_clk_probe.

Use the new macro to notify the clk subsystem about this behaviour.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
[sboyd@codeaurora.org: s/npx/nxp/ in subject]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:00:48 -07:00
Ricardo Ribalda Delgado aa8d712260 clk: axis: Use new macro CLK_OF_DECLARE_DRIVER
This driver initializes a clock provider via of_artpec6_clkctrl_setup
and then continues the initialization on artpec6_clkctrl_probe.

Use the new macro to notify the clk subsystem about this behaviour.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:00:37 -07:00
Ricardo Ribalda Delgado c7296c51ce clk: core: New macro CLK_OF_DECLARE_DRIVER
This will be used by drivers that requires initialization at
of_clk_init() time and also during platform device probing.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 18:00:34 -07:00
Geert Uytterhoeven 2cf9a57811 clk: divider: Fix clk_divider_round_rate() to use clk_readl()
clk-divider uses clk_readl()/clk_writel() everywhere, except in
clk_divider_round_rate(), where plain readl() is used. Change this to
clk_readl(), as it makes a difference on powerpc.

Fixes: e6d5e7d90b ("clk-divider: Fix READ_ONLY when divider > 1")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-12 17:33:09 -07:00
Fabio Estevam 1fd92dbaab clk: imx7d: do not set the parent of IMX7D_ENET_AXI_ROOT_SRC
Booting the kernel on a imx7s-warp leads to several warnings like these:

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:3536 lock_release+0x2f8/0x330
[    0.000000] releasing a pinned lock

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:2722 trace_hardirqs_on_caller+0x1ac/0x1f4
[    0.000000] DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled))

[    0.000000] ---[ end trace cb88537fdc8fa201 ]---
[    0.000000] bad: scheduling from the idle thread!
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W       4.7.0-rc7-next-20160715 #404

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/time/sched_clock.c:179 sched_clock_register+0x44/0x1f8
[    0.000000] Modules linked in:

[    0.000591] ------------[ cut here ]------------
[    0.000610] WARNING: CPU: 0 PID: 0 at kernel/time/sched_clock.c:179 sched_clock_register+0x44/0x1f8

[    0.002084] ------------[ cut here ]------------
[    0.002104] WARNING: CPU: 0 PID: 0 at init/main.c:576 start_kernel+0x258/0x3b0
[    0.002114] Interrupts were enabled early

This fix is along the same lines as 5e33ebff7e ("clk: imx7d: do not
set parent of ethernet time/ref clocks") and the explanation from that
commit is:

"The reason for the warning is that setting the parent enables the ENET
 PLL since we are using CLK_OPS_PARENT_ENABLE. Enabling the ENET PLL can
 cause clk_pllv3_wait_lock to sleep. See also:
 commit fc8726a2c0 ("clk: core: support clocks which requires parents
 enable (part 2)")."

imx7s-warp does not even use the FEC interface, so we should not really
configure the parent of IMX7D_ENET_AXI_ROOT_SRC in the common MX7 clock
driver code.

The dts file should use the assigned-clocks/assigned-clock-parents method,
so simply remove the configuration of IMX7D_ENET_AXI_ROOT_SRC parent.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-11 18:49:20 -07:00
Stephen Boyd 22d61acffb MAINTAINERS: Add linux-clk patchwork URL
The common clk framework has a patchwork associated with it.
Update the maintainers file to reflect this.

Cc: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-11 18:18:13 -07:00
Michael Turquette 904e6ead02 clk: migrate ref counts when orphans are reunited
It's always nice to see families reunited, and this is equally true when
talking about parent clocks and their children. However, if the orphan
clk had a positive prepare_count or enable_count, then we would not
migrate those counts up the parent chain correctly.

This has manifested with the recent critical clocks feature, which often
enables clocks very early, before their parents have been registered.

Fixed by replacing the call to clk_core_reparent with calls to
__clk_set_parent_{before,after}.

Cc: James Liao <jamesjj.liao@mediatek.com>
Cc: Erin Lo <erin.lo@mediatek.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
[sboyd@codeaurora.org: Recalc accuracies and rates too]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-11 18:06:50 -07:00
Yoshihiro Shimoda e0cb1b8416 clk: renesas: r8a7795: Fix SD clocks
According to the datasheet, SDn clocks are from the SDSRC clock. And
the SDSRC has a 1/2 divider. So, we should have ".sdsrc" as an internal
core clock. Otherwise, since the sdhi driver will calculate clock for
a sd card using the wrong parent clock rate, and then performance will
be not good.

Fixes: 90c073e539 ("clk: shmobile: r8a7795: Add SD divider support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-11 17:47:56 -07:00
Chen-Yu Tsai ed0ab11023 clk: sunxi-ng: Fix inverted test condition in ccu_helper_wait_for_lock
The condition passed to read*_poll_timeout() is the break condition,
i.e. wait for this condition to happen and return success.

The original code assumed the opposite, resulting in a warning when
the PLL clock rate was changed but never lost it's lock as far as
the readout indicated. This was verified by checking the read out
register value.

Fixes: 1d80c14248 ("clk: sunxi-ng: Add common infrastructure")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-08-10 15:07:01 -07:00
Geert Uytterhoeven b51d527501 clk: renesas: r8a7796: Add watchdog module clock
Add the module clock for the Watchdog Timer (WDT) controller on the
Renesas R-Car M3-W (r8a7796) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-09 09:53:47 +02:00
Geert Uytterhoeven 2570d4005d clk: renesas: r8a7796: Add watchdog core clocks
Add all core clocks related to the Watchdog Timer (WDT) controller on
the Renesas R-Car M3-W (r8a7796) SoC: OSC, Internal RCLK, and RCLK.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-08-09 09:53:47 +02:00