OSDN Git Service

uclinux-h8/linux.git
4 years agoMerge branches 'clk-init-destroy', 'clk-doc', 'clk-imx' and 'clk-allwinner' into...
Stephen Boyd [Thu, 19 Sep 2019 22:31:27 +0000 (15:31 -0700)]
Merge branches 'clk-init-destroy', 'clk-doc', 'clk-imx' and 'clk-allwinner' into clk-next

 - Set clk_init_data pointer inside clk_hw to NULL after registration

* clk-init-destroy:
  clk: Overwrite clk_hw::init with NULL during clk_register()
  clk: sunxi: Don't call clk_hw_get_name() on a hw that isn't registered
  clk: ti: Don't reference clk_init_data after registration
  clk: qcom: Remove error prints from DFS registration
  rtc: sun6i: Don't reference clk_init_data after registration
  clk: zx296718: Don't reference clk_init_data after registration
  clk: milbeaut: Don't reference clk_init_data after registration
  clk: socfpga: deindent code to proper indentation
  phy: ti: am654-serdes: Don't reference clk_init_data after registration
  clk: sprd: Don't reference clk_init_data after registration
  clk: socfpga: Don't reference clk_init_data after registration
  clk: sirf: Don't reference clk_init_data after registration
  clk: qcom: Don't reference clk_init_data after registration
  clk: meson: axg-audio: Don't reference clk_init_data after registration
  clk: lochnagar: Don't reference clk_init_data after registration
  clk: actions: Don't reference clk_init_data after registration

* clk-doc:
  clk: remove extra ---help--- tags in Kconfig
  clk: add include guard to clk-conf.h
  clk: Document of_parse_clkspec() some more
  clk: Remove extraneous 'for' word in comments

* clk-imx: (32 commits)
  clk: imx: imx8mn: fix pll mux bit
  clk: imx: imx8mm: fix pll mux bit
  clk: imx: clk-pll14xx: unbypass PLL by default
  clk: imx: pll14xx: avoid glitch when set rate
  clk: imx: imx8mn: fix audio pll setting
  clk: imx8mn: Add necessary frequency support for ARM PLL table
  clk: imx8mn: Add missing rate_count assignment for each PLL structure
  clk: imx8mn: fix int pll clk gate
  clk: imx8mn: Add GIC clock
  clk: imx8mn: Fix incorrect parents
  clk: imx8mm: Fix incorrect parents
  clk: imx8mq: Fix sys3 pll references
  clk: imx8mq: Unregister clks when of_clk_add_provider failed
  clk: imx8mm: Unregister clks when of_clk_add_provider failed
  clk: imx8mq: Mark AHB clock as critical
  clk: imx8mn: Keep uart clocks on for early console
  clk: imx: Remove unused function statement
  clk: imx7ulp: Make sure earlycon's clock is enabled
  clk: imx8mm: Switch to platform driver
  clk: imx: imx8mm: fix audio pll setting
  ...

* clk-allwinner:
  clk: sunxi-ng: h6: Allow I2S to change parent rate
  clk: sunxi-ng: v3s: add Allwinner V3 support
  clk: sunxi-ng: v3s: add missing clock slices for MMC2 module clocks
  dt-bindings: clk: sunxi-ccu: add compatible string for V3 CCU
  clk: sunxi-ng: v3s: add the missing PLL_DDR1

4 years agoMerge branches 'clk-qcom', 'clk-mtk', 'clk-armada', 'clk-ingenic' and 'clk-meson...
Stephen Boyd [Thu, 19 Sep 2019 22:30:59 +0000 (15:30 -0700)]
Merge branches 'clk-qcom', 'clk-mtk', 'clk-armada', 'clk-ingenic' and 'clk-meson' into clk-next

 - Support qcom SM8150 RPMh clks
 - Set floor ops for qcom sd clks
 - Support qcom QCS404 WCSS clks
 - Support for Mediatek MT6779 SoCs
 - Add CPU clock support for Armada 7K/8K (specifically AP806 and AP807)

* clk-qcom:
  clk: qcom: rcg: Return failure for RCG update
  clk: qcom: fix QCS404 TuringCC regmap
  clk: qcom: clk-rpmh: Add support for SM8150
  dt-bindings: clock: Document SM8150 rpmh-clock compatible
  clk: qcom: clk-rpmh: Convert to parent data scheme
  dt-bindings: clock: Document the parent clocks
  clk: qcom: gcc: Use floor ops for SDCC clocks
  clk: qcom: gcc-qcs404: Use floor ops for sdcc clks
  clk: qcom: gcc-sdm845: Use floor ops for sdcc clks
  clk: qcom: define probe by index API as common API
  clk: qcom: Add WCSS gcc clock control for QCS404
  clk: qcom: msm8916: Don't build by default
  clk: qcom: gcc: Add global clock controller driver for SM8150
  dt-bindings: clock: Document gcc bindings for SM8150
  clk: qcom: clk-alpha-pll: Add support for Trion PLLs
  clk: qcom: clk-alpha-pll: Remove post_div_table checks
  clk: qcom: clk-alpha-pll: Remove unnecessary cast

* clk-mtk:
  clk: mediatek: Runtime PM support for MT8183 mcucfg clock provider
  clk: mediatek: Register clock gate with device
  clk: mediatek: add pericfg clocks for MT8183
  dt-bindings: clock: mediatek: add pericfg for MT8183
  clk: mediatek: Add MT6779 clock support
  clk: mediatek: Add dt-bindings for MT6779 clocks
  dt-bindings: mediatek: bindings for MT6779 clk
  clk: reset: Modify reset-controller driver

* clk-armada:
  clk: mvebu: ap80x: add AP807 clock support
  clk: mvebu: ap806: Prepare the introduction of AP807 clock support
  clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
  clk: mvebu: ap806: be more explicit on what SaR is
  clk: mvebu: ap80x-cpu: add AP807 CPU clock support
  clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
  dt-bindings: ap806: Document AP807 clock compatible
  dt-bindings: ap80x: Document AP807 CPU clock compatible
  clk: mvebu: ap806: Fix clock name for the cluster
  clk: mvebu: add CPU clock driver for Armada 7K/8K
  clk: mvebu: add helper file for Armada AP and CP clocks
  dt-bindings: ap806: add the cluster clock node in the syscon file

* clk-ingenic:
  clk: ingenic: Use CLK_OF_DECLARE_DRIVER macro
  clk: ingenic/jz4740: Fix "pll half" divider not read/written properly

* clk-meson: (23 commits)
  clk: meson: g12a: add support for SM1 CPU 1, 2 & 3 clocks
  clk: meson: g12a: add support for SM1 DynamIQ Shared Unit clock
  clk: meson: g12a: add support for SM1 GP1 PLL
  dt-bindings: clk: meson: add sm1 periph clock controller bindings
  clk: meson: axg-audio: add g12a reset support
  dt-bindings: clock: meson: add resets to the audio clock controller
  clk: meson: g12a: expose CPUB clock ID for G12B
  clk: meson: g12a: add notifiers to handle cpu clock change
  clk: meson: add g12a cpu dynamic divider driver
  clk: core: introduce clk_hw_set_parent()
  clk: meson: remove clk input helper
  clk: meson: remove ee input bypass clocks
  clk: meson: clk-regmap: migrate to new parent description method
  clk: meson: meson8b: migrate to the new parent description method
  clk: meson: axg: migrate to the new parent description method
  clk: meson: gxbb: migrate to the new parent description method
  clk: meson: g12a: migrate to the new parent description method
  clk: meson: remove ao input bypass clocks
  clk: meson: axg-aoclk: migrate to the new parent description method
  clk: meson: gxbb-aoclk: migrate to the new parent description method
  ...

4 years agoMerge branches 'clk-aspeed', 'clk-unused', 'clk-of-node-put', 'clk-const-bulk-data...
Stephen Boyd [Thu, 19 Sep 2019 22:30:40 +0000 (15:30 -0700)]
Merge branches 'clk-aspeed', 'clk-unused', 'clk-of-node-put', 'clk-const-bulk-data' and 'clk-debugfs' into clk-next

 - Add SDIO gate to aspeed driver
 - Support aspeed AST2600 SoC
 - Add missing of_node_put() calls in various clk drivers
 - Drop NULL checks in clk debugfs
 - Add min/max rates to clk debugfs

* clk-aspeed:
  clk: Add support for AST2600 SoC
  clk: aspeed: Move structures to header
  clk: aspeed: Add SDIO gate

* clk-unused:
  clk: st: clkgen-pll: remove unused variable 'st_pll3200c32_407_a0'
  clk: st: clkgen-fsyn: remove unused variable 'st_quadfs_fs660c32_ops'
  clk: composite: Drop unused clk.h include
  clk: Si5341/Si5340: remove redundant assignment to n_den
  clk: qoriq: Fix -Wunused-const-variable

* clk-of-node-put:
  clk: ti: dm814x: Add of_node_put() to prevent memory leak
  clk: st: clk-flexgen: Add of_node_put() in st_of_flexgen_setup()
  clk: davinci: pll: Add of_node_put() in of_davinci_pll_init()
  clk: versatile: Add of_node_put() in cm_osc_setup()

* clk-const-bulk-data:
  clk: Constify struct clk_bulk_data * where possible

* clk-debugfs:
  clk: Drop !clk checks in debugfs dumping
  clk: Use seq_puts() in possible_parent_show()
  clk: Assert prepare_lock in clk_core_get_boundaries
  clk: Add clk_min/max_rate entries in debugfs

4 years agoclk: Drop !clk checks in debugfs dumping
Stephen Boyd [Mon, 26 Aug 2019 23:47:29 +0000 (16:47 -0700)]
clk: Drop !clk checks in debugfs dumping

These recursive functions have checks for !clk being passed in, but the
callers are always looping through lists and therefore the pointers
can't be NULL. Drop the checks to simplify the code.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190826234729.145593-1-sboyd@kernel.org
4 years agoclk: imx: imx8mn: fix pll mux bit
Peng Fan [Mon, 9 Sep 2019 03:39:50 +0000 (03:39 +0000)]
clk: imx: imx8mn: fix pll mux bit

pll BYPASS bit should be kept inside pll driver for glitchless freq
setting following spec. If exposing the bit, that means pll driver and
clk driver has two paths to touch this bit, which is wrong.

So use EXT_BYPASS bit here.

And drop uneeded set parent, because EXT_BYPASS default is 0.

Suggested-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lkml.kernel.org/r/1568043491-20680-5-git-send-email-peng.fan@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: imx: imx8mm: fix pll mux bit
Peng Fan [Mon, 9 Sep 2019 03:39:44 +0000 (03:39 +0000)]
clk: imx: imx8mm: fix pll mux bit

pll BYPASS bit should be kept inside pll driver for glitchless freq
setting following spec. If exposing the bit, that means pll driver and
clk driver has two paths to touch this bit, which is wrong.

So use EXT_BYPASS bit here.

And drop uneeded set parent, because EXT_BYPASS default is 0.

Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
Suggested-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lkml.kernel.org/r/1568043491-20680-4-git-send-email-peng.fan@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: imx: clk-pll14xx: unbypass PLL by default
Peng Fan [Mon, 9 Sep 2019 03:39:39 +0000 (03:39 +0000)]
clk: imx: clk-pll14xx: unbypass PLL by default

When registering the PLL, unbypass the PLL.
The PLL has two bypass control bit, BYPASS and EXT_BYPASS.
we will expose EXT_BYPASS to clk driver for mux usage, and keep
BYPASS inside pll14xx usage. The PLL has a restriction that
when M/P change, need to RESET/BYPASS pll to avoid glitch, so
we could not expose BYPASS.

To make it easy for clk driver usage, unbypass PLL which does
not hurt current function.

Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lkml.kernel.org/r/1568043491-20680-3-git-send-email-peng.fan@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: imx: pll14xx: avoid glitch when set rate
Peng Fan [Mon, 9 Sep 2019 03:39:34 +0000 (03:39 +0000)]
clk: imx: pll14xx: avoid glitch when set rate

According to PLL1443XA and PLL1416X spec,
"When BYPASS is 0 and RESETB is changed from 0 to 1, FOUT starts to
output unstable clock until lock time passes. PLL1416X/PLL1443XA may
generate a glitch at FOUT."

So set BYPASS when RESETB is changed from 0 to 1 to avoid glitch.
In the end of set rate, BYPASS will be cleared.

When prepare clock, also need to take care to avoid glitch. So
we also follow Spec to set BYPASS before RESETB changed from 0 to 1.
And add a check if the RESETB is already 0, directly return 0;

Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lkml.kernel.org/r/1568043491-20680-2-git-send-email-peng.fan@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap80x: add AP807 clock support
Ben Peled [Mon, 5 Aug 2019 10:03:10 +0000 (12:03 +0200)]
clk: mvebu: ap80x: add AP807 clock support

Add driver support for AP807 clock.

Signed-off-by: Ben Peled <bpeled@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-9-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap806: Prepare the introduction of AP807 clock support
Ben Peled [Mon, 5 Aug 2019 10:03:09 +0000 (12:03 +0200)]
clk: mvebu: ap806: Prepare the introduction of AP807 clock support

Factor out the code that is only useful to AP806 so it will be easier
to support AP807. No functional changes.

Signed-off-by: Ben Peled <bpeled@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-8-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
Omri Itach [Mon, 5 Aug 2019 10:03:08 +0000 (12:03 +0200)]
clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver

Add dynamic AP-DCLK clock (hclk) to system controller driver. AP-DCLK
is half the rate of DDR clock, so its derrived from Sample At Reset
configuration. The clock frequency is required for AP806 AXI monitor
profiling feature.

Signed-off-by: Omri Itach <omrii@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-7-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap806: be more explicit on what SaR is
Miquel Raynal [Mon, 5 Aug 2019 10:03:07 +0000 (12:03 +0200)]
clk: mvebu: ap806: be more explicit on what SaR is

"SaR" means Sample at Reset. DIP switches can be changed on the board,
their states at reset time is available through a register read.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-6-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap80x-cpu: add AP807 CPU clock support
Ben Peled [Mon, 5 Aug 2019 10:03:06 +0000 (12:03 +0200)]
clk: mvebu: ap80x-cpu: add AP807 CPU clock support

Enhance the ap-cpu-clk driver to support both AP806 and AP807 CPU
clocks.

Signed-off-by: Ben Peled <bpeled@marvell.com>
[<miquel.raynal@bootlin.com>: use device data instead of conditions on
the compatible]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-5-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
Christine Gharzuzi [Mon, 5 Aug 2019 10:03:05 +0000 (12:03 +0200)]
clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock

This patch allows same flow to be executed on chips with different
register mappings like AP806 and, in the future, AP807.

Note: this patch has no functional effect, and only prepares the
driver for additional chips to be supported by retrieving the right
device data depenging on the compatible property.

Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-4-miquel.raynal@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: ap806: Document AP807 clock compatible
Miquel Raynal [Mon, 5 Aug 2019 10:03:04 +0000 (12:03 +0200)]
dt-bindings: ap806: Document AP807 clock compatible

Add AP807 clock compatible to the bindings.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-3-miquel.raynal@bootlin.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: ap80x: Document AP807 CPU clock compatible
Miquel Raynal [Mon, 5 Aug 2019 10:03:03 +0000 (12:03 +0200)]
dt-bindings: ap80x: Document AP807 CPU clock compatible

Add AP807 CPU clock compatible to the bindings.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lkml.kernel.org/r/20190805100310.29048-2-miquel.raynal@bootlin.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: rcg: Return failure for RCG update
Taniya Das [Wed, 8 May 2019 18:24:53 +0000 (23:54 +0530)]
clk: qcom: rcg: Return failure for RCG update

In case of update config failure, return -EBUSY, so that consumers could
handle the failure gracefully.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
Link: https://lkml.kernel.org/r/1557339895-21952-2-git-send-email-tdas@codeaurora.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: remove extra ---help--- tags in Kconfig
Lubomir Rintel [Thu, 22 Aug 2019 09:31:26 +0000 (11:31 +0200)]
clk: remove extra ---help--- tags in Kconfig

Sometimes an extraneous "---help---" follows "help". That is probably a
copy&paste error stemming from their inconsistent use. Remove those.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lkml.kernel.org/r/20190822093126.594013-1-lkundrak@v3.sk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: add include guard to clk-conf.h
Masahiro Yamada [Tue, 20 Aug 2019 03:05:36 +0000 (12:05 +0900)]
clk: add include guard to clk-conf.h

Add a header include guard just in case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lkml.kernel.org/r/20190820030536.1181-1-yamada.masahiro@socionext.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mediatek: Runtime PM support for MT8183 mcucfg clock provider
Weiyi Lu [Mon, 2 Sep 2019 09:00:58 +0000 (17:00 +0800)]
clk: mediatek: Runtime PM support for MT8183 mcucfg clock provider

Enable the runtime PM support and forward the struct device pointer for
registration of MT8183 mcucfg clocks.

Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
Link: https://lkml.kernel.org/r/1567414859-3244-3-git-send-email-weiyi.lu@mediatek.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mediatek: Register clock gate with device
Weiyi Lu [Mon, 2 Sep 2019 09:00:57 +0000 (17:00 +0800)]
clk: mediatek: Register clock gate with device

Allow those clocks under a power domain to do the runtime pm operation
by forwarding the struct device pointer from clock provider.

Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
Link: https://lkml.kernel.org/r/1567414859-3244-2-git-send-email-weiyi.lu@mediatek.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mediatek: add pericfg clocks for MT8183
Chunfeng Yun [Wed, 28 Aug 2019 08:22:13 +0000 (16:22 +0800)]
clk: mediatek: add pericfg clocks for MT8183

Add pericfg clocks for MT8183, it's used when support USB
remote wakeup

Cc: Weiyi Lu <weiyi.lu@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lkml.kernel.org/r/1566980533-28282-2-git-send-email-chunfeng.yun@mediatek.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: clock: mediatek: add pericfg for MT8183
Chunfeng Yun [Wed, 28 Aug 2019 08:22:12 +0000 (16:22 +0800)]
dt-bindings: clock: mediatek: add pericfg for MT8183

This patch adds binding of pericfg for MT8183.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lkml.kernel.org/r/1566980533-28282-1-git-send-email-chunfeng.yun@mediatek.com
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mediatek: Add MT6779 clock support
mtk01761 [Mon, 19 Aug 2019 09:21:41 +0000 (17:21 +0800)]
clk: mediatek: Add MT6779 clock support

Add MT6779 clock support, include topckgen, apmixedsys,
infracfg, and subsystem clocks.

Signed-off-by: mtk01761 <wendell.lin@mediatek.com>
Link: https://lkml.kernel.org/r/1566206502-4347-11-git-send-email-mars.cheng@mediatek.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mediatek: Add dt-bindings for MT6779 clocks
mtk01761 [Mon, 19 Aug 2019 09:21:40 +0000 (17:21 +0800)]
clk: mediatek: Add dt-bindings for MT6779 clocks

Add MT6779 clock dt-bindings, include topckgen, apmixedsys,
infracfg, and subsystem clocks.

Signed-off-by: mtk01761 <wendell.lin@mediatek.com>
Link: https://lkml.kernel.org/r/1566206502-4347-10-git-send-email-mars.cheng@mediatek.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: mediatek: bindings for MT6779 clk
mtk01761 [Mon, 19 Aug 2019 09:21:39 +0000 (17:21 +0800)]
dt-bindings: mediatek: bindings for MT6779 clk

This patch adds the binding documentation for
apmixedsys, audiosys, camsys, imgsys, ipesys,
infracfg, mfgcfg, mmsys, topckgen, vdecsys,
and vencsys for Mediatek MT6779.

Signed-off-by: mtk01761 <wendell.lin@mediatek.com>
Link: https://lkml.kernel.org/r/1566206502-4347-9-git-send-email-mars.cheng@mediatek.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: fix QCS404 TuringCC regmap
Jorge Ramirez-Ortiz [Mon, 9 Sep 2019 08:54:30 +0000 (10:54 +0200)]
clk: qcom: fix QCS404 TuringCC regmap

The max register is 0x23004 as per the manual (the current
max_register that this commit is fixing is actually out of bounds).

Fixes: 892df0191b29 ("clk: qcom: Add QCS404 TuringCC")
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Link: https://lkml.kernel.org/r/20190909085430.8700-1-jorge.ramirez-ortiz@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: clk-rpmh: Add support for SM8150
Vinod Koul [Mon, 26 Aug 2019 17:31:20 +0000 (23:01 +0530)]
clk: qcom: clk-rpmh: Add support for SM8150

Add support for rpmh clocks found in SM8150

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lkml.kernel.org/r/20190826173120.2971-5-vkoul@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: clock: Document SM8150 rpmh-clock compatible
Vinod Koul [Mon, 26 Aug 2019 17:31:19 +0000 (23:01 +0530)]
dt-bindings: clock: Document SM8150 rpmh-clock compatible

Document the SM8150 rpmh-clock compatible for rpmh clock controller
found on SM8150 platforms.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lkml.kernel.org/r/20190826173120.2971-4-vkoul@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: clk-rpmh: Convert to parent data scheme
Vinod Koul [Mon, 26 Aug 2019 17:31:18 +0000 (23:01 +0530)]
clk: qcom: clk-rpmh: Convert to parent data scheme

Convert the rpmh clock driver to use the new parent data scheme by
specifying the parent data for board clock.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lkml.kernel.org/r/20190826173120.2971-3-vkoul@kernel.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: clock: Document the parent clocks
Vinod Koul [Mon, 26 Aug 2019 17:31:17 +0000 (23:01 +0530)]
dt-bindings: clock: Document the parent clocks

With clock parent data scheme we must specify the parent clocks for the
rpmhcc nodes. So describe the parent clock for rpmhcc in the bindings.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lkml.kernel.org/r/20190826173120.2971-2-vkoul@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: gcc: Use floor ops for SDCC clocks
Taniya Das [Mon, 9 Sep 2019 07:44:10 +0000 (13:14 +0530)]
clk: qcom: gcc: Use floor ops for SDCC clocks

Update global clock controller SDCC2/4 clocks to use the floor rcg ops,
so as to use the rounded down clock rates for these clocks.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
Link: https://lkml.kernel.org/r/20190909074410.18977-1-tdas@codeaurora.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: gcc-qcs404: Use floor ops for sdcc clks
Vinod Koul [Fri, 6 Sep 2019 04:56:59 +0000 (10:26 +0530)]
clk: qcom: gcc-qcs404: Use floor ops for sdcc clks

Update the gcc qcs404 clock driver to use floor ops for sdcc clocks. As
disuccsed in [1] it is good idea to use floor ops for sdcc clocks as we
dont want the clock rates to do round up.

[1]: https://lore.kernel.org/linux-arm-msm/20190830195142.103564-1-swboyd@chromium.org/

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lkml.kernel.org/r/20190906045659.20621-1-vkoul@kernel.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: gcc-sdm845: Use floor ops for sdcc clks
Stephen Boyd [Fri, 30 Aug 2019 19:51:42 +0000 (12:51 -0700)]
clk: qcom: gcc-sdm845: Use floor ops for sdcc clks

Some MMC cards fail to enumerate properly when inserted into an MMC slot
on sdm845 devices. This is because the clk ops for qcom clks round the
frequency up to the nearest rate instead of down to the nearest rate.
For example, the MMC driver requests a frequency of 52MHz from
clk_set_rate() but the qcom implementation for these clks rounds 52MHz
up to the next supported frequency of 100MHz. The MMC driver could be
modified to request clk rate ranges but for now we can fix this in the
clk driver by changing the rounding policy for this clk to be round down
instead of round up.

Fixes: 06391eddb60a ("clk: qcom: Add Global Clock controller (GCC) driver for SDM845")
Reported-by: Douglas Anderson <dianders@chromium.org>
Cc: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lkml.kernel.org/r/20190830195142.103564-1-swboyd@chromium.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Add support for AST2600 SoC
Joel Stanley [Sun, 25 Aug 2019 14:18:48 +0000 (23:48 +0930)]
clk: Add support for AST2600 SoC

The ast2600 is a new BMC SoC from ASPEED. It contains many more clocks
than the previous iterations, so support is broken out into it's own
driver.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lkml.kernel.org/r/20190825141848.17346-3-joel@jms.id.au
[sboyd@kernel.org: Mark arrays const]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: aspeed: Move structures to header
Joel Stanley [Sun, 25 Aug 2019 14:18:47 +0000 (23:48 +0930)]
clk: aspeed: Move structures to header

They will be reused by the ast2600 driver.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lkml.kernel.org/r/20190825141848.17346-2-joel@jms.id.au
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: st: clkgen-pll: remove unused variable 'st_pll3200c32_407_a0'
YueHaibing [Fri, 16 Aug 2019 13:55:23 +0000 (21:55 +0800)]
clk: st: clkgen-pll: remove unused variable 'st_pll3200c32_407_a0'

drivers/clk/st/clkgen-pll.c:64:37: warning:
 st_pll3200c32_407_a0 defined but not used [-Wunused-const-variable=]

It is never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lkml.kernel.org/r/20190816135523.73520-1-yuehaibing@huawei.com
Acked-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: st: clkgen-fsyn: remove unused variable 'st_quadfs_fs660c32_ops'
YueHaibing [Fri, 16 Aug 2019 13:53:41 +0000 (21:53 +0800)]
clk: st: clkgen-fsyn: remove unused variable 'st_quadfs_fs660c32_ops'

drivers/clk/st/clkgen-fsyn.c:70:29: warning:
 st_quadfs_fs660c32_ops defined but not used [-Wunused-const-variable=]

It is never used, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lkml.kernel.org/r/20190816135341.52248-1-yuehaibing@huawei.com
Acked-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Document of_parse_clkspec() some more
Stephen Boyd [Mon, 26 Aug 2019 21:20:42 +0000 (14:20 -0700)]
clk: Document of_parse_clkspec() some more

The return value of of_parse_clkspec() is peculiar. If the function is
called with a NULL argument for 'name' it will return -ENOENT, but if
it's called with a non-NULL argument for 'name' it will return -EINVAL.
This peculiarity is documented by commit 5c56dfe63b6e ("clk: Add comment
about __of_clk_get_by_name() error values").

Let's further document this function so that it's clear what the return
value is and how to use the arguments to parse clk specifiers.

Cc: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190826212042.48642-1-sboyd@kernel.org
Reviewed-by: Phil Edworthy <phil.edworthy@renesas.com>
4 years agoMerge tag 'sunxi-clk-for-5.4-1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Wed, 4 Sep 2019 18:14:51 +0000 (11:14 -0700)]
Merge tag 'sunxi-clk-for-5.4-1' of https://git./linux/kernel/git/sunxi/linux into clk-allwinner

Pull Allwinner clock changes from Maxime Ripard:

A few patches to enable the V3 SoC and fix the i2s clock for the H6.

* tag 'sunxi-clk-for-5.4-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: h6: Allow I2S to change parent rate
  clk: sunxi-ng: v3s: add Allwinner V3 support
  clk: sunxi-ng: v3s: add missing clock slices for MMC2 module clocks
  dt-bindings: clk: sunxi-ccu: add compatible string for V3 CCU
  clk: sunxi-ng: v3s: add the missing PLL_DDR1

4 years agoMerge tag 'clk-imx-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
Stephen Boyd [Wed, 4 Sep 2019 18:00:15 +0000 (11:00 -0700)]
Merge tag 'clk-imx-5.4' of git://git./linux/kernel/git/shawnguo/linux into clk-imx

Pull i.MX clock changes from Shawn Guo:

 - Add clock driver for i.MX8MN SoC
 - Switch i.MX8MM clock driver to platform driver
 - Add API for clk unregister when driver probe fail
 - Add Hifi4 DSP related clocks for i.MX8QXP SoC
 - Fix Audio PLL setting and parent clock for USB
 - Misc i.MX8 clock driver improvements and corrections

* tag 'clk-imx-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (28 commits)
  clk: imx: imx8mn: fix audio pll setting
  clk: imx8mn: Add necessary frequency support for ARM PLL table
  clk: imx8mn: Add missing rate_count assignment for each PLL structure
  clk: imx8mn: fix int pll clk gate
  clk: imx8mn: Add GIC clock
  clk: imx8mn: Fix incorrect parents
  clk: imx8mm: Fix incorrect parents
  clk: imx8mq: Fix sys3 pll references
  clk: imx8mq: Unregister clks when of_clk_add_provider failed
  clk: imx8mm: Unregister clks when of_clk_add_provider failed
  clk: imx8mq: Mark AHB clock as critical
  clk: imx8mn: Keep uart clocks on for early console
  clk: imx: Remove unused function statement
  clk: imx7ulp: Make sure earlycon's clock is enabled
  clk: imx8mm: Switch to platform driver
  clk: imx: imx8mm: fix audio pll setting
  clk: imx8mm: GPT1 clock mux option #5 should be sys_pll1_80m
  clk: imx8mm: Fix typo of pwm3 clock's mux option #4
  clk: imx: Remove unused clk based API
  clk: imx8mq: set correct parent for usb ctrl clocks
  ...

4 years agoMerge tag 'clk-meson-v5.4-2' of https://github.com/BayLibre/clk-meson into clk-meson
Stephen Boyd [Wed, 4 Sep 2019 17:53:34 +0000 (10:53 -0700)]
Merge tag 'clk-meson-v5.4-2' of https://github.com/BayLibre/clk-meson into clk-meson

Pull second set of Amlogic clk driver updates from Jerome Brunet:

 - Add g12a reset support to the axg audio clock controller
 - Add sm1 support to the g12a clock controller

* tag 'clk-meson-v5.4-2' of https://github.com/BayLibre/clk-meson:
  clk: meson: g12a: add support for SM1 CPU 1, 2 & 3 clocks
  clk: meson: g12a: add support for SM1 DynamIQ Shared Unit clock
  clk: meson: g12a: add support for SM1 GP1 PLL
  dt-bindings: clk: meson: add sm1 periph clock controller bindings
  clk: meson: axg-audio: add g12a reset support
  dt-bindings: clock: meson: add resets to the audio clock controller

4 years agoclk: meson: g12a: add support for SM1 CPU 1, 2 & 3 clocks
Neil Armstrong [Mon, 26 Aug 2019 07:25:38 +0000 (09:25 +0200)]
clk: meson: g12a: add support for SM1 CPU 1, 2 & 3 clocks

The Amlogic SM1 can set a dedicated clock frequency for each CPU core by
having a dedicate tree for each core similar to the CPU0 tree.
Like the DSU tree, a supplementaty mux has been added to use the CPU0
frequency instead.

But since the cluster only has a single power rail and shares a single PLL,
it's not worth adding 3 unsused clock tree, so we add only the mux to
select the CPU0 clock frequency for each CPU1, CPU2 and CPU3 cores.

They are set read-only because the early boot stages sets them to select
the CPU0 input clock.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: meson: g12a: add support for SM1 DynamIQ Shared Unit clock
Neil Armstrong [Mon, 26 Aug 2019 07:25:37 +0000 (09:25 +0200)]
clk: meson: g12a: add support for SM1 DynamIQ Shared Unit clock

The Amlogic SM1 DynamIQ Shared Unit has a dedicated clock tree similar to
the CPU clock tree with a supplementaty mux to select the CPU0 clock
instead.

Leave this as read-only since it's set up by the early boot stages.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: meson: g12a: add support for SM1 GP1 PLL
Neil Armstrong [Mon, 26 Aug 2019 07:25:36 +0000 (09:25 +0200)]
clk: meson: g12a: add support for SM1 GP1 PLL

Add the new GP1 PLL for the Amlogic SM1 SoC, used to feed the new
DynamIQ Shared Unit of the ARM Cores Complex.

This also adds a dedicated set of clock and compatible for SM1.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoMerge branch 'v5.4/dt' into v5.4/drivers
Jerome Brunet [Mon, 26 Aug 2019 09:01:20 +0000 (11:01 +0200)]
Merge branch 'v5.4/dt' into v5.4/drivers

4 years agodt-bindings: clk: meson: add sm1 periph clock controller bindings
Neil Armstrong [Mon, 26 Aug 2019 07:25:35 +0000 (09:25 +0200)]
dt-bindings: clk: meson: add sm1 periph clock controller bindings

Update the documentation to support clock driver for the Amlogic SM1 SoC
and expose the GP1, DSU and the CPU 1, 2 & 3 clocks.

SM1 clock tree is very close, the main differences are :
- each CPU core can achieve a different frequency, albeit a common PLL
- a similar tree as the clock tree has been added for the DynamIQ Shared
  Unit
- has a new GP1 PLL used for the DynamIQ Shared Unit
- SM1 has additional clocks like for CSI, NanoQ an other components

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: imx: imx8mn: fix audio pll setting
Peng Fan [Tue, 20 Aug 2019 01:55:07 +0000 (01:55 +0000)]
clk: imx: imx8mn: fix audio pll setting

The AUDIO PLL max support 650M, so the original clk settings violate
spec. This patch makes the output 786432000 -> 393216000,
and 722534400 -> 361267200 to aligned with NXP vendor kernel without any
impact on audio functionality and go within 650MHz PLL limit.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: sunxi-ng: h6: Allow I2S to change parent rate
Jernej Skrabec [Wed, 14 Aug 2019 06:08:48 +0000 (08:08 +0200)]
clk: sunxi-ng: h6: Allow I2S to change parent rate

I2S doesn't work if parent rate couldn't be change. Difference between
wanted and actual rate is too big.

Fix this by adding CLK_SET_RATE_PARENT flag to I2S clocks.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
4 years agoclk: meson: axg-audio: add g12a reset support
Jerome Brunet [Mon, 12 Aug 2019 12:32:53 +0000 (14:32 +0200)]
clk: meson: axg-audio: add g12a reset support

On the g12a, the register space dedicated to the audio clock also
provides some resets. Let the clock controller register a reset
provider as well for this SoC family.

the axg SoC family does not appear to provide this feature.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoMerge branch 'v5.4/dt' into v5.4/drivers
Jerome Brunet [Tue, 20 Aug 2019 09:50:54 +0000 (11:50 +0200)]
Merge branch 'v5.4/dt' into v5.4/drivers

4 years agodt-bindings: clock: meson: add resets to the audio clock controller
Jerome Brunet [Mon, 12 Aug 2019 12:32:52 +0000 (14:32 +0200)]
dt-bindings: clock: meson: add resets to the audio clock controller

Add the documentation and bindings for the resets provided by the g12a
audio clock controller

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: imx8mn: Add necessary frequency support for ARM PLL table
Anson Huang [Sun, 18 Aug 2019 06:32:24 +0000 (02:32 -0400)]
clk: imx8mn: Add necessary frequency support for ARM PLL table

i.MX8MN supports CPU running at 1.5GHz/1.4GHz/1.2GHz, add missing
frequency for ARM PLL table.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mn: Add missing rate_count assignment for each PLL structure
Anson Huang [Sun, 18 Aug 2019 06:32:23 +0000 (02:32 -0400)]
clk: imx8mn: Add missing rate_count assignment for each PLL structure

Add .rate_count assignment which is necessary for searching required
PLL rate from the each PLL table.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mn: fix int pll clk gate
Peng Fan [Wed, 14 Aug 2019 01:53:12 +0000 (09:53 +0800)]
clk: imx8mn: fix int pll clk gate

To Frac pll, the gate shift is 13, however to Int PLL the gate shift
is 11.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mn: Add GIC clock
Leonard Crestez [Tue, 13 Aug 2019 17:05:31 +0000 (20:05 +0300)]
clk: imx8mn: Add GIC clock

This is enabled by default but if it's not explicitly defined and marked
as critical then its parent might get turned off.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mn: Fix incorrect parents
Leonard Crestez [Tue, 13 Aug 2019 17:05:30 +0000 (20:05 +0300)]
clk: imx8mn: Fix incorrect parents

* Replace to audio_pll2_clk with audio_pll2_out
* Replace sys3_pll2_out with sys_pll3_out
* Replace sys1_pll_40m with sys_pll1_40m
* qspi parent[2] is sys_pll2_333m not sys_pll1_800m

Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mm: Fix incorrect parents
Leonard Crestez [Tue, 13 Aug 2019 17:05:29 +0000 (20:05 +0300)]
clk: imx8mm: Fix incorrect parents

* There is no video_pll2 on imx8mm, replace with dummy
* Replace reference to sys_pll3_clk with sys_pll3_out
* qspi parent[2] is sys_pll2_333m not sys_pll1_800m

Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mq: Fix sys3 pll references
Leonard Crestez [Tue, 13 Aug 2019 17:05:28 +0000 (20:05 +0300)]
clk: imx8mq: Fix sys3 pll references

The "sys3_pll2_out" CLK was removed in refactoring so all references
need to be updated to "sys3_pll_out"

Fixes: e9dda4af685f ("clk: imx: Refactor entire sccg pll clk")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: Remove extraneous 'for' word in comments
Rishi Gupta [Sat, 17 Aug 2019 06:35:59 +0000 (12:05 +0530)]
clk: Remove extraneous 'for' word in comments

An extra 'for' word is grammatically incorrect in the comment
'verifying ops for multi-parent clks'. This commit removes
this extra for word.

Signed-off-by: Rishi Gupta <gupt21@gmail.com>
Link: https://lkml.kernel.org/r/1566023759-7880-1-git-send-email-gupt21@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: composite: Drop unused clk.h include
Stephen Boyd [Thu, 15 Aug 2019 04:25:00 +0000 (21:25 -0700)]
clk: composite: Drop unused clk.h include

This include isn't used. Drop it.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815042500.9519-1-sboyd@kernel.org
4 years agoclk: Overwrite clk_hw::init with NULL during clk_register()
Stephen Boyd [Wed, 31 Jul 2019 19:35:17 +0000 (12:35 -0700)]
clk: Overwrite clk_hw::init with NULL during clk_register()

We don't want clk provider drivers to use the init structure after clk
registration time, but we leave a dangling reference to it by means of
clk_hw::init. Let's overwrite the member with NULL during clk_register()
so that this can't be used anymore after registration time.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-10-sboyd@kernel.org
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
4 years agoclk: sunxi: Don't call clk_hw_get_name() on a hw that isn't registered
Stephen Boyd [Thu, 15 Aug 2019 04:10:37 +0000 (21:10 -0700)]
clk: sunxi: Don't call clk_hw_get_name() on a hw that isn't registered

The implementation of clk_hw_get_name() relies on the clk_core
associated with the clk_hw pointer existing. If of_clk_hw_register()
fails, there isn't a clk_core created yet, so calling clk_hw_get_name()
here fails. Extract the name first so we can print it later.

Fixes: 1d80c14248d6 ("clk: sunxi-ng: Add common infrastructure")
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: ti: Don't reference clk_init_data after registration
Stephen Boyd [Thu, 15 Aug 2019 22:12:49 +0000 (15:12 -0700)]
clk: ti: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Tero Kristo <t-kristo@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815221249.53235-1-sboyd@kernel.org
4 years agoclk: qcom: Remove error prints from DFS registration
Stephen Boyd [Thu, 15 Aug 2019 16:00:20 +0000 (09:00 -0700)]
clk: qcom: Remove error prints from DFS registration

These aren't useful and they reference the init structure name. Let's
just drop them.

Cc: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815160020.183334-5-sboyd@kernel.org
Acked-by: Taniya Das <tdas@codeaurora.org>
4 years agortc: sun6i: Don't reference clk_init_data after registration
Stephen Boyd [Thu, 15 Aug 2019 16:00:19 +0000 (09:00 -0700)]
rtc: sun6i: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815160020.183334-4-sboyd@kernel.org
Acked-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
4 years agoclk: zx296718: Don't reference clk_init_data after registration
Stephen Boyd [Thu, 15 Aug 2019 16:00:18 +0000 (09:00 -0700)]
clk: zx296718: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815160020.183334-3-sboyd@kernel.org
4 years agoclk: milbeaut: Don't reference clk_init_data after registration
Stephen Boyd [Thu, 15 Aug 2019 16:00:17 +0000 (09:00 -0700)]
clk: milbeaut: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Sugaya Taichi <sugaya.taichi@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190815160020.183334-2-sboyd@kernel.org
4 years agoclk: socfpga: deindent code to proper indentation
Stephen Boyd [Wed, 14 Aug 2019 00:24:02 +0000 (17:24 -0700)]
clk: socfpga: deindent code to proper indentation

This code is indented oddly, causing checkpatch to complain. Indent it
properly.

Cc: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190814002402.18154-1-sboyd@kernel.org
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
4 years agophy: ti: am654-serdes: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:16 +0000 (12:35 -0700)]
phy: ti: am654-serdes: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Roger Quadros <rogerq@ti.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-9-sboyd@kernel.org
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
4 years agoclk: sprd: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:15 +0000 (12:35 -0700)]
clk: sprd: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-8-sboyd@kernel.org
Acked-by: Baolin Wang <baolin.wang@linaro.org>
Acked-by: Chunyan Zhang <zhang.chunyan@linaro.org>
4 years agoclk: socfpga: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:14 +0000 (12:35 -0700)]
clk: socfpga: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-7-sboyd@kernel.org
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
4 years agoclk: sirf: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:13 +0000 (12:35 -0700)]
clk: sirf: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Guo Zeng <Guo.Zeng@csr.com>
Cc: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-6-sboyd@kernel.org
4 years agoclk: qcom: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:12 +0000 (12:35 -0700)]
clk: qcom: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Taniya Das <tdas@codeaurora.org>
Cc: Andy Gross <agross@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-5-sboyd@kernel.org
Acked-by: Taniya Das <tdas@codeaurora.org>
4 years agoclk: meson: axg-audio: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:11 +0000 (12:35 -0700)]
clk: meson: axg-audio: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-4-sboyd@kernel.org
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoclk: lochnagar: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:10 +0000 (12:35 -0700)]
clk: lochnagar: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-3-sboyd@kernel.org
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
4 years agoclk: actions: Don't reference clk_init_data after registration
Stephen Boyd [Wed, 31 Jul 2019 19:35:09 +0000 (12:35 -0700)]
clk: actions: Don't reference clk_init_data after registration

A future patch is going to change semantics of clk_register() so that
clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid
referencing this member here so that we don't run into NULL pointer
exceptions.

Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190731193517.237136-2-sboyd@kernel.org
[sboyd@kernel.org: Move name to after checking for error or NULL hw]
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
4 years agoMerge tag 'clk-meson-v5.4-1' of https://github.com/BayLibre/clk-meson into clk-meson
Stephen Boyd [Wed, 14 Aug 2019 16:45:43 +0000 (09:45 -0700)]
Merge tag 'clk-meson-v5.4-1' of https://github.com/BayLibre/clk-meson into clk-meson

Pull Amlogic clock changes from Jerome Brunet:

 - Migrate to new clock description method
 - Add DVFS support to g12

* tag 'clk-meson-v5.4-1' of https://github.com/BayLibre/clk-meson:
  clk: meson: g12a: expose CPUB clock ID for G12B
  clk: meson: g12a: add notifiers to handle cpu clock change
  clk: meson: add g12a cpu dynamic divider driver
  clk: core: introduce clk_hw_set_parent()
  clk: meson: remove clk input helper
  clk: meson: remove ee input bypass clocks
  clk: meson: clk-regmap: migrate to new parent description method
  clk: meson: meson8b: migrate to the new parent description method
  clk: meson: axg: migrate to the new parent description method
  clk: meson: gxbb: migrate to the new parent description method
  clk: meson: g12a: migrate to the new parent description method
  clk: meson: remove ao input bypass clocks
  clk: meson: axg-aoclk: migrate to the new parent description method
  clk: meson: gxbb-aoclk: migrate to the new parent description method
  clk: meson: g12a-aoclk: migrate to the new parent description method
  clk: meson: axg-audio: migrate to the new parent description method
  clk: meson: g12a: fix hifi typo in mali parent_names

4 years agoclk: ingenic: Use CLK_OF_DECLARE_DRIVER macro
Paul Cercueil [Sat, 10 Aug 2019 12:36:20 +0000 (14:36 +0200)]
clk: ingenic: Use CLK_OF_DECLARE_DRIVER macro

By using CLK_OF_DECLARE_DRIVER instead of the CLK_OF_DECLARE macro, we
allow the driver to probe also as a platform driver.

While this driver does not have code to probe as a platform driver, this
is still useful for probing children devices in the case where the
device node is compatible with "simple-mfd".

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lkml.kernel.org/r/20190810123620.27238-1-paul@crapouillou.net
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: imx8mq: Unregister clks when of_clk_add_provider failed
Anson Huang [Tue, 6 Aug 2019 06:46:14 +0000 (14:46 +0800)]
clk: imx8mq: Unregister clks when of_clk_add_provider failed

When of_clk_add_provider failed, all clks should be unregistered.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: imx8mm: Unregister clks when of_clk_add_provider failed
Anson Huang [Tue, 6 Aug 2019 06:46:13 +0000 (14:46 +0800)]
clk: imx8mm: Unregister clks when of_clk_add_provider failed

When of_clk_add_provider failed, all clks should be unregistered.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoclk: sunxi-ng: v3s: add Allwinner V3 support
Icenowy Zheng [Sun, 28 Jul 2019 03:12:24 +0000 (11:12 +0800)]
clk: sunxi-ng: v3s: add Allwinner V3 support

Allwinner V3 has the same main die with V3s, but with more pins wired.
There's a I2S bus on V3 that is not available on V3s.

Add the V3-only peripheral's clocks and reset to the V3s CCU driver,
bound to a new V3 compatible string. The driver name is not changed
because it's part of the device tree binding (the header file name).

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
4 years agoclk: sunxi-ng: v3s: add missing clock slices for MMC2 module clocks
Icenowy Zheng [Sun, 28 Jul 2019 03:12:23 +0000 (11:12 +0800)]
clk: sunxi-ng: v3s: add missing clock slices for MMC2 module clocks

The MMC2 clock slices are currently not defined in V3s CCU driver, which
makes MMC2 not working.

Fix this issue.

Fixes: d0f11d14b0bc ("clk: sunxi-ng: add support for V3s CCU")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
4 years agoMerge branch 'v5.4/dt' into v5.4/drivers
Jerome Brunet [Fri, 9 Aug 2019 10:12:58 +0000 (12:12 +0200)]
Merge branch 'v5.4/dt' into v5.4/drivers

4 years agoclk: meson: g12a: expose CPUB clock ID for G12B
Neil Armstrong [Wed, 31 Jul 2019 08:40:19 +0000 (10:40 +0200)]
clk: meson: g12a: expose CPUB clock ID for G12B

Expose the CPUB clock id to add DVFS to the second CPU cluster of
the Amlogic G12B SoC.

Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: meson: g12a: add notifiers to handle cpu clock change
Neil Armstrong [Wed, 31 Jul 2019 08:40:18 +0000 (10:40 +0200)]
clk: meson: g12a: add notifiers to handle cpu clock change

In order to implement clock switching for the CLKID_CPU_CLK and
CLKID_CPUB_CLK, notifiers are added on specific points of the
clock tree :

cpu_clk / cpub_clk
|   \- cpu_clk_dyn
|      |  \- cpu_clk_premux0
|      |        |- cpu_clk_postmux0
|      |        |    |- cpu_clk_dyn0_div
|      |        |    \- xtal/fclk_div2/fclk_div3
|      |        \- xtal/fclk_div2/fclk_div3
|      \- cpu_clk_premux1
|            |- cpu_clk_postmux1
|            |    |- cpu_clk_dyn1_div
|            |    \- xtal/fclk_div2/fclk_div3
|            \- xtal/fclk_div2/fclk_div3
\ sys_pll / sys1_pll

This for each cluster, a single one for G12A, two for G12B.

Each cpu_clk_premux1 tree is marked as read-only and CLK_SET_RATE_NO_REPARENT,
to be used as "parking" clock in a safe clock frequency.

A notifier is added on each cpu_clk_premux0 to detech when CCF want to
change the frequency of the cpu_clk_dyn tree.
In this notifier, the cpu_clk_premux1 tree is configured to use the xtal
clock and then the cpu_clk_dyn is switch to cpu_clk_premux1 while CCF
updates the cpu_clk_premux0 tree.

A notifier is added on each sys_pll/sys1_pll to detect when CCF wants to
change the PLL clock source of the cpu_clk.
In this notifier, the cpu_clk is switched to cpu_clk_dyn while CCF
updates the sys_pll/sys1_pll frequency.

A third small notifier is added on each cpu_clk / cpub_clk and cpu_clk_dyn,
add a small delay at PRE_RATE_CHANGE/POST_RATE_CHANGE to let the other
notofiers change propagate before changing the cpu_clk_premux0 and sys_pll
clock trees.

This notifier set permits switching the cpu_clk / cpub_clk without any
glitches and using a safe parking clock while switching between sub-GHz
clocks using the cpu_clk_dyn tree.

This setup has been tested and validated on the Amlogic G12A and G12B
SoCs running the arm64 cpuburn at [1] and cycling between all the possible
cpufreq translations of each cluster and checking the final frequency using
the clock-measurer, script at [2].

[1] https://github.com/ssvb/cpuburn-arm/blob/master/cpuburn-a53.S
[2] https://gist.github.com/superna9999/d4de964dbc0f84b7d527e1df2ddea25f

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: meson: add g12a cpu dynamic divider driver
Neil Armstrong [Wed, 31 Jul 2019 08:40:17 +0000 (10:40 +0200)]
clk: meson: add g12a cpu dynamic divider driver

Add a clock driver for the cpu dynamic divider, this divider needs
to have a flag set before setting the divider value then removed
while writing the new value to the register.

This drivers implements this behavior and will be used essentially
on the Amlogic G12A and G12B SoCs for cpu clock trees.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: core: introduce clk_hw_set_parent()
Neil Armstrong [Wed, 31 Jul 2019 08:40:16 +0000 (10:40 +0200)]
clk: core: introduce clk_hw_set_parent()

Introduce the clk_hw_set_parent() provider call to change parent of
a clock by using the clk_hw pointers.

This eases the clock reparenting from clock rate notifiers and
implementing DVFS with simpler code avoiding the boilerplates
functions as __clk_lookup(clk_hw_get_name()) then clk_set_parent().

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
4 years agoclk: mvebu: ap806: Fix clock name for the cluster
Gregory CLEMENT [Wed, 10 Jul 2019 13:43:44 +0000 (15:43 +0200)]
clk: mvebu: ap806: Fix clock name for the cluster

Actually, the clocks exposed for the cluster are not the CPU clocks, but
the PLL clock used as entry clock for the CPU clocks. The CPU clock will
be managed by a driver submitting in the following patches.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lkml.kernel.org/r/20190710134346.30239-5-gregory.clement@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: add CPU clock driver for Armada 7K/8K
Gregory CLEMENT [Wed, 10 Jul 2019 13:43:43 +0000 (15:43 +0200)]
clk: mvebu: add CPU clock driver for Armada 7K/8K

The CPU frequency is managed at the AP level for the Armada 7K/8K. The
CPU frequency is modified by cluster: the CPUs of the same cluster have
the same frequency.

This patch adds the clock driver that will be used by CPUFreq, it is
based on the work of Omri Itach <omrii@marvell.com>.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lkml.kernel.org/r/20190710134346.30239-4-gregory.clement@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: mvebu: add helper file for Armada AP and CP clocks
Gregory CLEMENT [Wed, 10 Jul 2019 13:43:42 +0000 (15:43 +0200)]
clk: mvebu: add helper file for Armada AP and CP clocks

Clock drivers for Armada AP and Armada CP use the same function to
generate unique clock name. A third drivers is coming with the same
need, so it's time to move this function in a common file.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lkml.kernel.org/r/20190710134346.30239-3-gregory.clement@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agodt-bindings: ap806: add the cluster clock node in the syscon file
Gregory CLEMENT [Wed, 10 Jul 2019 13:43:41 +0000 (15:43 +0200)]
dt-bindings: ap806: add the cluster clock node in the syscon file

Document the device tree binding for the cluster clock controllers found
in the Armada 7K/8K SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lkml.kernel.org/r/20190710134346.30239-2-gregory.clement@bootlin.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: define probe by index API as common API
Govind Singh [Fri, 26 Jul 2019 09:23:28 +0000 (14:53 +0530)]
clk: qcom: define probe by index API as common API

Extend the probe by index API in common code to be used
by other qcom clock controller.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: reset: Modify reset-controller driver
yong.liang [Fri, 26 Jul 2019 07:01:35 +0000 (15:01 +0800)]
clk: reset: Modify reset-controller driver

Set reset signal by a register and
clear reset signal by another register for 8183.

Signed-off-by: yong.liang <yong.liang@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: Add WCSS gcc clock control for QCS404
Govind Singh [Fri, 26 Jul 2019 09:23:26 +0000 (14:53 +0530)]
clk: qcom: Add WCSS gcc clock control for QCS404

Add support for the WCSS QDSP gcc clock control used on qcs404
based devices. This would allow wcss remoteproc driver to control
the required gcc clocks to bring the subsystem out of reset.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Use seq_puts() in possible_parent_show()
Markus Elfring [Mon, 1 Jul 2019 20:20:40 +0000 (22:20 +0200)]
clk: Use seq_puts() in possible_parent_show()

A string which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function “seq_puts”.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Assert prepare_lock in clk_core_get_boundaries
Leonard Crestez [Tue, 2 Jul 2019 13:27:10 +0000 (16:27 +0300)]
clk: Assert prepare_lock in clk_core_get_boundaries

This function iterates the clk consumer list on clk_core so it must be
called under prepare_lock. This is already done by all callers but add a
lockdep assert to check anyway.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Link: https://lkml.kernel.org/r/29453ee8e820457d87a8faf9d496390e59c6826f.1562073871.git.leonard.crestez@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Add clk_min/max_rate entries in debugfs
Leonard Crestez [Tue, 2 Jul 2019 13:27:09 +0000 (16:27 +0300)]
clk: Add clk_min/max_rate entries in debugfs

Add two files to expose min/max clk rates as determined by
clk_core_get_boundaries, taking all consumer requests into account.

This information does not appear to be otherwise exposed to userspace.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Link: https://lkml.kernel.org/r/68e96af2df96512300604d797ade2088d7e6e496.1562073871.git.leonard.crestez@nxp.com
[sboyd@kernel.org: Drop if statements for JSON printing]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: Constify struct clk_bulk_data * where possible
Andrey Smirnov [Wed, 17 Jul 2019 14:56:51 +0000 (07:56 -0700)]
clk: Constify struct clk_bulk_data * where possible

The following functions:

    - clk_bulk_enable()
    - clk_bulk_prepare()
    - clk_bulk_disable()
    - clk_bulk_unprepare()

already expect const clk_bulk_data * as a second parameter, however
their no-op version have mismatching prototypes that don't. Fix that.

While at it, constify the second argument of clk_bulk_prepare_enable()
and clk_bulk_disable_unprepare(), since the functions they are
comprised of already accept const clk_bulk_data *.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Link: https://lkml.kernel.org/r/20190717145651.17250-1-andrew.smirnov@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
4 years agoclk: qcom: msm8916: Don't build by default
Marc Gonzalez [Thu, 13 Jun 2019 15:09:34 +0000 (17:09 +0200)]
clk: qcom: msm8916: Don't build by default

QCOM_A53PLL and QCOM_CLK_APCS_MSM8916 stand out as the only options
built by default. Let's bring them back in line with the rest.

Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Link: https://lkml.kernel.org/r/d654907d-a3a2-a00f-d6f5-3a34ae25ebcf@free.fr
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>