platform/kernel/linux-rpi.git
18 months agoMerge branches 'clk-loongson' and 'clk-qcom' into clk-next
Stephen Boyd [Thu, 23 Feb 2023 19:04:25 +0000 (11:04 -0800)]
Merge branches 'clk-loongson' and 'clk-qcom' into clk-next

* clk-loongson:
  dt-bindings: clock: add loongson-2 clock
  dt-bindings: clock: add loongson-2 clock include file

* clk-qcom: (143 commits)
  clk: qcom: apcs-msm8986: Include bitfield.h for FIELD_PREP
  clk: qcom: Revert sync_state based clk_disable_unused
  dt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml
  clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
  clk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC
  dt-bindings: clock: qcom,sa8775p-gcc: add the power-domains property
  clk: qcom: cpu-8996: add missing cputype include
  clk: qcom: gcc-sa8775p: remove unused variables
  clk: qcom: smd-rpm: provide RPM_SMD_XO_CLK_SRC on MSM8996 platform
  clk: qcom: add msm8996 Core Bus Framework (CBF) support
  dt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller
  clk: qcom: add the driver for the MSM8996 APCS clocks
  clk: qcom: gcc-qcs404: fix duplicate initializer warning
  clk: qcom: cpu-8996: change setup sequence to follow vendor kernel
  clk: qcom: cpu-8996: fix PLL clock ops
  clk: qcom: cpu-8996: fix ACD initialization
  clk: qcom: cpu-8996: fix PLL configuration sequence
  clk: qcom: cpu-8996: move qcom_cpu_clk_msm8996_acd_init call
  clk: qcom: cpu-8996: setup PLLs before registering clocks
  clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb
  ...

18 months agoMerge branches 'clk-microchip', 'clk-allwinner', 'clk-mediatek', 'clk-imx' and 'clk...
Stephen Boyd [Thu, 23 Feb 2023 19:04:12 +0000 (11:04 -0800)]
Merge branches 'clk-microchip', 'clk-allwinner', 'clk-mediatek', 'clk-imx' and 'clk-core' into clk-next

 - Various cleanups and improvements to Mediatek clk drivers to reduce
   code size and modernize the drivers
 - Support for Mediatek MT7891 SoC clks

* clk-microchip:
  clk: at91: do not compile dt-compat.c for sama7g5 and sam9x60
  clk: at91: mark ddr clocks as critical

* clk-allwinner:
  clk: sunxi-ng: d1: Add CAN bus gates and resets
  dt-bindings: clock: Add D1 CAN bus gates and resets
  clk: sunxi-ng: d1: Mark cpux clock as critical
  clk: sunxi-ng: d1: Allow building for R528/T113
  clk: sunxi-ng: Move SoC driver conditions to dependencies
  clk: sunxi-ng: Remove duplicate ARCH_SUNXI dependencies
  clk: sunxi-ng: Avoid computing the rate twice
  clk: sunxi-ng: h3/h5: Model H3 CLK_DRAM as a fixed clock
  clk: sunxi-ng: fix ccu_mmc_timing.c kernel-doc issues

* clk-mediatek: (29 commits)
  clk: mediatek: clk-mtk: Remove unneeded semicolon
  clk: mediatek: remove MT8195 vppsys/0/1 simple_probe
  dt-bindings: arm: mediatek: migrate MT8195 vppsys0/1 to mtk-mmsys driver
  clk: mediatek: add MT7981 clock support
  dt-bindings: clock: mediatek: add mt7981 clock IDs
  dt-bindings: clock: Add compatibles for MT7981
  clk: mediatek: clk-mt7986-topckgen: Migrate to mtk_clk_simple_probe()
  clk: mediatek: clk-mt7986-topckgen: Properly keep some clocks enabled
  clk: mediatek: clk-mt6795-topckgen: Migrate to mtk_clk_simple_probe()
  clk: mediatek: clk-mt8186-topckgen: Migrate to mtk_clk_simple_probe()
  clk: mediatek: clk-mt8192: Migrate topckgen to mtk_clk_simple_probe()
  clk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe()
  clk: mediatek: clk-mt8183: Join top_aud_muxes and top_aud_divs
  clk: mediatek: mt8186: Join top_adj_div and top_muxes
  clk: mediatek: mt8192: Join top_adj_divs and top_muxes
  clk: mediatek: clk-mt8192: Move CLK_TOP_CSW_F26M_D2 in top_divs
  clk: mediatek: mt8173: Migrate pericfg/topckgen to mtk_clk_simple_probe()
  clk: mediatek: clk-mtk: Extend mtk_clk_simple_probe()
  clk: mediatek: Switch to mtk_clk_simple_probe() where possible
  clk: mediatek: mt8173: Break down clock drivers and allow module build
  ...

* clk-imx:
  clk: imx: pll14xx: fix recalc_rate for negative kdiv
  MAINTAINERS: clk: imx: Add Peng Fan as reviewer
  clk: imx: fix compile testing imxrt1050
  clk: imx: set imx_clk_gpr_mux_ops storage-class-specifier to static
  clk: imx6ul: add ethernet refclock mux support
  clk: imx6ul: fix enet1 gate configuration
  clk: imx: add imx_obtain_fixed_of_clock()
  clk: imx6q: add ethernet refclock mux support
  clk: imx: add clk-gpr-mux driver
  dt-bindings: imx8ulp: clock: no spaces before tabs
  clk: imx6sll: add proper spdx license identifier
  clk: imx: imx93: invoke imx_register_uart_clocks
  clk: imx: remove clk_count of imx_register_uart_clocks
  clk: imx: get stdout clk count from device tree
  clk: imx: avoid memory leak

* clk-core:
  clk: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled()

18 months agoMerge branches 'clk-cleanup', 'clk-bindings', 'clk-renesas', 'clk-versa' and 'clk...
Stephen Boyd [Thu, 23 Feb 2023 19:03:54 +0000 (11:03 -0800)]
Merge branches 'clk-cleanup', 'clk-bindings', 'clk-renesas', 'clk-versa' and 'clk-amlogic' into clk-next

 - Support for Versa 5P49V60 clks

* clk-cleanup:
  clk: rs9: Drop unused pin_xin field
  clk: sprd: Add dependency for SPRD_UMS512_CLK
  clk: ralink: fix 'mt7621_gate_is_enabled()' function
  dt-bindings: clock: remove stih416 bindings
  drivers/clk: Remove "select SRCU"

* clk-bindings:
  dt-bindings: clock: qcom,sm8450-camcc: constrain required-opps
  dt-bindings: clock: imx8m-clock: correct i.MX8MQ node name

* clk-renesas:
  clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
  clk: renesas: r8a779g0: Add CAN-FD clocks
  clk: renesas: r8a779g0: Tidy up DMAC name on SYS-DMAC
  clk: renesas: r8a779a0: Tidy up DMAC name on SYS-DMAC
  clk: renesas: r8a779g0: Add custom clock for PLL2
  clk: renesas: cpg-mssr: Remove superfluous check in resume code
  clk: renesas: r9a06g032: Handle h2mode setting based on USBF presence
  clk: renesas: cpg-mssr: Fix use after free if cpg_mssr_common_init() failed
  clk: renesas: r9a07g044: Add clock and reset entries for CRU
  clk: renesas: r9a09g011: Add SDHI/eMMC clock and reset entries
  clk: renesas: r9a09g011: Add USB clock and reset entries
  clk: renesas: r9a09g011: Add TIM clock and reset entries
  clk: renesas: r8a779g0: Add display related clocks
  clk: renesas: rcar-gen4: Restore PLL enum sort order
  clk: renesas: r8a779g0: Fix OSC predividers
  clk: renesas: r9a09g011: Add PWM clock and reset entries

* clk-versa:
  dt-bindings: clock: versaclock5: Document 5P49V60 compatible string
  clk: vc5: Add support for 5P49V60
  clk: vc5: Use `clamp()` to restrict PLL range

* clk-amlogic:
  clk: meson: clk-cpu-dyndiv: switch from .round_rate to .determine_rate
  clk: meson: sclk-div: switch from .round_rate to .determine_rate
  clk: meson: dualdiv: switch from .round_rate to .determine_rate
  clk: meson: mpll: Switch from .round_rate to .determine_rate

18 months agoclk: qcom: apcs-msm8986: Include bitfield.h for FIELD_PREP
Stephen Boyd [Thu, 23 Feb 2023 01:36:42 +0000 (17:36 -0800)]
clk: qcom: apcs-msm8986: Include bitfield.h for FIELD_PREP

Otherwise some configurations fail.

Fixes: 027726365906 ("clk: qcom: add the driver for the MSM8996 APCS clocks")
Link: https://lore.kernel.org/r/20230223013847.1218900-1-sboyd@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
18 months agoMerge tag 'qcom-clk-for-6.3-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Thu, 23 Feb 2023 00:32:15 +0000 (16:32 -0800)]
Merge tag 'qcom-clk-for-6.3-2' of https://git./linux/kernel/git/qcom/linux into clk-qcom

Pull Qualcomm clk driver updates from Bjorn Andersson:

Support for requesting the next power_off operation for a genpd to be
synchronous is introduced, and implemented in the GDSC driver. To allow
the GPU driver to request power_off to wait for the GDSC to actually
collapse.

Support for QDU1000/QRU1000 Global clock controller, SA8775P Global
clock controller, SM8550 TCSR and display clock controller, SM6350 clock
controller, nd MSM8996 CBF and APCS clock controllers is introduced.

Parent references are updated across a large number of clock drivers, to
align with the design changes since those drivers where introduced.
Similarly, test clocks has been dropped from a range of drivers.

A range of fixes for the MSM8996 CPU clock controller is introduced.

MSM8974 GCC is transitioned off the externally defined sleep_clk.

GDSC in the global clock controller for QCS404 is added, and various
parent definitions are cleaned up.

The SDCC core clocks on SM6115 are moved for floor_ops.

Programming of clk_dis_wait for GPU CX GDSC on SC7180 and SDM845 are
moved to use the recently introduced properties in the GDSC struct.

The RPMh clock driver gains SM8550 and SA8775P clocks, and the IPA clock
is added on a variety of platforms.

The SMD RPM driver receives a big cleanup, in particular a move away
from duplicating declaration of identical clocks between multiple
platforms.
A few missing clocks across msm8998, msm8992, msm8916, qcs404 are added
as well.

Using devm_pm_runtime_enable() to clean up some duplication is done
across SM8250 display and video clock controllers, SM8450 display clock
controller and SC7280 LPASS clock controller.

Devicetree binding changes for above mentioned additions and changes are
introduced.

Support for postponing clk_disable_unused() until sync_state was
introduced, but later reverted again, awaiting an agreement on the
solution.

Lastly, a change to pad a few registers in the SM8250 DTS to 8 digits
was picked up in the wrong tree and kept here, to avoid rebasing.

* tag 'qcom-clk-for-6.3-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (142 commits)
  clk: qcom: Revert sync_state based clk_disable_unused
  dt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml
  clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
  clk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC
  dt-bindings: clock: qcom,sa8775p-gcc: add the power-domains property
  clk: qcom: cpu-8996: add missing cputype include
  clk: qcom: gcc-sa8775p: remove unused variables
  clk: qcom: smd-rpm: provide RPM_SMD_XO_CLK_SRC on MSM8996 platform
  clk: qcom: add msm8996 Core Bus Framework (CBF) support
  dt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller
  clk: qcom: add the driver for the MSM8996 APCS clocks
  clk: qcom: gcc-qcs404: fix duplicate initializer warning
  clk: qcom: cpu-8996: change setup sequence to follow vendor kernel
  clk: qcom: cpu-8996: fix PLL clock ops
  clk: qcom: cpu-8996: fix ACD initialization
  clk: qcom: cpu-8996: fix PLL configuration sequence
  clk: qcom: cpu-8996: move qcom_cpu_clk_msm8996_acd_init call
  clk: qcom: cpu-8996: setup PLLs before registering clocks
  clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb
  clk: qcom: cpu-8996: skip ACD init if the setup is valid
  ...

18 months agoclk: qcom: Revert sync_state based clk_disable_unused
Bjorn Andersson [Wed, 22 Feb 2023 14:31:10 +0000 (06:31 -0800)]
clk: qcom: Revert sync_state based clk_disable_unused

Revert the postponement of clk_disable_unused() for clock providers that
implement sync_state, and the change to drivers implementing this, until
agreement on the implementation has been reached.

This reverts:
29e31415e14e ("clk: qcom: Remove need for clk_ignore_unused on sc8280xp")
99c0f7d35c4b ("clk: qcom: sdm845: Use generic clk_sync_state_disable_unused callback")
26b36df75166 ("clk: Add generic sync_state callback for disabling unused clocks")

Requested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
18 months agoclk: imx: pll14xx: fix recalc_rate for negative kdiv
Kevin Groeneveld [Sat, 10 Dec 2022 20:38:35 +0000 (15:38 -0500)]
clk: imx: pll14xx: fix recalc_rate for negative kdiv

kdiv is a signed 16 bit value in the DEV_CTL1 register. Commit
53990cf9d5b4 ("clk: imx: pll14xx: consolidate rate calculation") changed
the kdiv variable from a short int to just int. When the value read from
the DIV_CTL1 register is assigned directly to an int the sign of the value
is lost resulting in incorrect results when the value is negative. Adding
a s16 cast to the register value fixes the issue.

Fixes: 53990cf9d5b4 ("clk: imx: pll14xx: consolidate rate calculation")
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Link: https://lore.kernel.org/r/20221210203835.9714-1-kgroeneveld@lenbrook.com
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
18 months agoclk: rs9: Drop unused pin_xin field
Marek Vasut [Fri, 16 Dec 2022 21:09:22 +0000 (22:09 +0100)]
clk: rs9: Drop unused pin_xin field

The pin_xin field in struct rs9_driver_data is unused, drop it.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20221216210922.592926-1-marex@denx.de
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
18 months agoMAINTAINERS: clk: imx: Add Peng Fan as reviewer
Abel Vesa [Mon, 13 Feb 2023 08:10:38 +0000 (10:10 +0200)]
MAINTAINERS: clk: imx: Add Peng Fan as reviewer

Peng Fan will step up to help with reviewing.
Add his email to the i.MX clocks drivers entry.

Cc: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230213081038.3958833-1-abel.vesa@linaro.org
Thanks!! Acked-by: Peng Fan <peng.fan@nxp.com>:
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
18 months agoMerge tag 'renesas-clk-for-v6.3-tag3' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Wed, 15 Feb 2023 02:43:54 +0000 (18:43 -0800)]
Merge tag 'renesas-clk-for-v6.3-tag3' of git://git./linux/kernel/git/geert/renesas-drivers into clk-renesas

Pull one more Renesas clk driver update from Geert Uytterhoeven:

 - Disable R-Car H3 ES1.*, as it was only available to an internal
   development group and needed a lot of quirks and workarounds.

* tag 'renesas-clk-for-v6.3-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*

19 months agoclk: sprd: Add dependency for SPRD_UMS512_CLK
Cixi Geng [Wed, 1 Feb 2023 09:13:00 +0000 (17:13 +0800)]
clk: sprd: Add dependency for SPRD_UMS512_CLK

Add depends on and default for ums512 clk config.

Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
Link: https://lore.kernel.org/r/20230201091300.3201-1-cixi.geng@linux.dev
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: ralink: fix 'mt7621_gate_is_enabled()' function
Sergio Paracuellos [Mon, 6 Feb 2023 08:33:05 +0000 (09:33 +0100)]
clk: ralink: fix 'mt7621_gate_is_enabled()' function

Compiling clock driver with CONFIG_UBSAN enabled shows the following trace:

UBSAN: shift-out-of-bounds in drivers/clk/ralink/clk-mt7621.c:121:15
shift exponent 131072 is too large for 32-bit type 'long unsigned int'
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.86 #0
Stack : ...

Call Trace:
[<80009a58>] show_stack+0x38/0x118
[<8045ce04>] dump_stack_lvl+0x60/0x80
[<80458868>] ubsan_epilogue+0x10/0x54
[<804590e0>] __ubsan_handle_shift_out_of_bounds+0x118/0x190
[<804c9a10>] mt7621_gate_is_enabled+0x98/0xa0
[<804bb774>] clk_core_is_enabled+0x34/0x90
[<80aad73c>] clk_disable_unused_subtree+0x98/0x1e4
[<80aad6d4>] clk_disable_unused_subtree+0x30/0x1e4
[<80aad6d4>] clk_disable_unused_subtree+0x30/0x1e4
[<80aad900>] clk_disable_unused+0x78/0x120
[<80002030>] do_one_initcall+0x54/0x1f0
[<80a922a4>] kernel_init_freeable+0x280/0x31c
[<808047c4>] kernel_init+0x20/0x118
[<80003e58>] ret_from_kernel_thread+0x14/0x1c

Shifting a value (131032) larger than the type (32 bit unsigned integer)
is undefined behaviour in C.

The problem is in 'mt7621_gate_is_enabled()' function which is using the
'BIT()' kernel macro with the bit index for the clock gate to check if the
bit is set. When the clock gates structure is created driver is already
setting 'bit_idx' using 'BIT()' macro, so we are wrongly applying an extra
'BIT()' mask here. Removing it solve the problem and makes this function
correct. However when clock gating is correctly working, the kernel starts
disabling those clocks that are not requested. Some drivers for this SoC
are older than this clock driver itself. So to avoid the kernel to disable
clocks that have been enabled until now, we must apply 'CLK_IS_CRITICAL'
flag on gates initialization code.

Fixes: 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20230206083305.147582-1-sergio.paracuellos@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mtk: Remove unneeded semicolon
Yang Li [Thu, 2 Feb 2023 01:07:50 +0000 (09:07 +0800)]
clk: mediatek: clk-mtk: Remove unneeded semicolon

./drivers/clk/mediatek/clk-mtk.c:518:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3926
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230202010750.79515-1-yang.lee@linux.alibaba.com
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agodt-bindings: clock: remove stih416 bindings
Alain Volmat [Thu, 9 Feb 2023 09:16:58 +0000 (10:16 +0100)]
dt-bindings: clock: remove stih416 bindings

Remove the stih416 clock dt-bindings since this platform is no
more supported.

Signed-off-by: Alain Volmat <avolmat@me.com>
Link: https://lore.kernel.org/r/20230209091659.1409-11-avolmat@me.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agodt-bindings: clock: add loongson-2 clock
Yinbo Zhu [Tue, 29 Nov 2022 03:41:57 +0000 (11:41 +0800)]
dt-bindings: clock: add loongson-2 clock

Add the Loongson-2 clock binding with DT schema format using
json-schema.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221129034157.15036-4-zhuyinbo@loongson.cn
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agodt-bindings: clock: add loongson-2 clock include file
Yinbo Zhu [Tue, 29 Nov 2022 03:41:54 +0000 (11:41 +0800)]
dt-bindings: clock: add loongson-2 clock include file

This file defines all Loongson-2 SoC clock indexes, it should be
included in the device tree in which there's device using the
clocks.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221129034157.15036-1-zhuyinbo@loongson.cn
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: imx: fix compile testing imxrt1050
Arnd Bergmann [Thu, 15 Dec 2022 16:58:18 +0000 (17:58 +0100)]
clk: imx: fix compile testing imxrt1050

Randconfig testing revealed multiple issues with this driver:

ERROR: modpost: missing MODULE_LICENSE() in drivers/clk/imx/clk-imxrt1050.o
ERROR: modpost: "imx_clk_hw_pllv3" [drivers/clk/imx/clk-imxrt1050.ko] undefined!
ERROR: modpost: "imx_clk_hw_pfd" [drivers/clk/imx/clk-imxrt1050.ko] undefined!

Export the necessary symbols from the core clk driver and add the
license and author tags. To find this type of problem more easily
in the future, also enable building on other platforms, as we do for
the other i.MX clk drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20221215165836.2136448-1-arnd@kernel.org
Acked-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled()
Chen-Yu Tsai [Tue, 3 Jan 2023 09:23:30 +0000 (17:23 +0800)]
clk: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled()

In the previous commits that added CLK_OPS_PARENT_ENABLE, support for
this flag was only added to rate change operations (rate setting and
reparent) and disabling unused subtree. It was not added to the
clock gate related operations. Any hardware driver that needs it for
these operations will either see bogus results, or worse, hang.

This has been seen on MT8192 and MT8195, where the imp_ii2_* clk
drivers set this, but dumping debugfs clk_summary would cause it
to hang.

Prepare parent on prepare and enable parent on enable dependencies are
already handled automatically by the core as part of its sequencing.
Whether the case for "enable parent on prepare" should be supported by
this flag or not is not clear, and thus ignored for now.

This change solely fixes the handling of clk_core_is_enabled, i.e.
enabling the parent clock when reading the hardware state. Unfortunately
clk_core_is_enabled is called in a variety of places, sometimes with
the enable clock already held. To avoid deadlocking, the core will
ignore readouts and just return false if CLK_OPS_PARENT_ENABLE is set
but the parent isn't currently enabled.

Fixes: fc8726a2c021 ("clk: core: support clocks which requires parents enable (part 2)")
Fixes: a4b3518d146f ("clk: core: support clocks which requires parents enable (part 1)")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230103092330.494102-1-wenst@chromium.org
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: imx: set imx_clk_gpr_mux_ops storage-class-specifier to static
Tom Rix [Sun, 5 Feb 2023 03:01:38 +0000 (19:01 -0800)]
clk: imx: set imx_clk_gpr_mux_ops storage-class-specifier to static

smatch reports
drivers/clk/imx/clk-gpr-mux.c:73:22: warning: symbol 'imx_clk_gpr_mux_ops' was not declared. Should it be static?

imx_clk_gpr_mux_ops is only used in clk-gpr-mux.c, so it should be static.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20230205030138.1723614-1-trix@redhat.com
Fixes: ee394f636ad3 ("clk: imx: add clk-gpr-mux driver")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoMerge tag 'clk-imx-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa...
Stephen Boyd [Fri, 10 Feb 2023 19:26:09 +0000 (11:26 -0800)]
Merge tag 'clk-imx-6.3' of git://git./linux/kernel/git/abelvesa/linux into clk-imx

Pull i.MX clk driver updates from Abel Vesa:

 - Free the imx_uart_clocks even if imx_register_uart_clocks returns early
 - Get the stdout clocks count from device tree
 - Drop the clock count argument from imx_register_uart_clocks.
 - Keep the uart clocks on i.MX93 for when earlycon is used
 - Fix SPDX comment in i.MX6SLL clocks bindings header
 - Drop some unnecessary spaces from i.MX8ULP clocks bindings header
 - Add a new clk-gpr-mux clock type and use it on i.MX6Q to add ENET ref
   clocks
 - Add the imx_obtain_fixed_of_clock for allowing to add a clock that is
   not configured via devicetree
 - Fix the ENET1 gate configuration for i.MX6UL according to the
   reference manual
 - Add ENET refclock mux support for i.MX6UL

* tag 'clk-imx-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux:
  clk: imx6ul: add ethernet refclock mux support
  clk: imx6ul: fix enet1 gate configuration
  clk: imx: add imx_obtain_fixed_of_clock()
  clk: imx6q: add ethernet refclock mux support
  clk: imx: add clk-gpr-mux driver
  dt-bindings: imx8ulp: clock: no spaces before tabs
  clk: imx6sll: add proper spdx license identifier
  clk: imx: imx93: invoke imx_register_uart_clocks
  clk: imx: remove clk_count of imx_register_uart_clocks
  clk: imx: get stdout clk count from device tree
  clk: imx: avoid memory leak

19 months agoclk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
Wolfram Sang [Thu, 2 Feb 2023 09:23:31 +0000 (10:23 +0100)]
clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*

R-Car H3 ES1.* was only available to an internal development group and
needed a lot of quirks and workarounds. These become a maintenance
burden now, so our development group decided to remove upstream support
for this SoC. Public users only have ES2 onwards.

In addition to the ES1 specific removals, a check for it was added
preventing the machine to boot further. It may otherwise inherit wrong
clock settings from ES2 which could damage the hardware.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230202092332.2504-1-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
19 months agodt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml
Dmitry Baryshkov [Mon, 6 Feb 2023 14:57:00 +0000 (16:57 +0200)]
dt-bindings: clock: Merge qcom,gpucc-sm8350 into qcom,gpucc.yaml

The GPU clock controller bindings for the Qualcomm sm8350 platform are
not correct. The driver uses .fw_name instead of using indices to bind
parent clocks, thus demanding the clock-names usage. With the proper
clock-names in place, the bindings becomes equal to the bindings defined
by qcom,gpucc.yaml, so it is impractical to keep them in a separate
file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230206145707.122937-2-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC
Dmitry Baryshkov [Wed, 1 Feb 2023 17:23:05 +0000 (19:23 +0200)]
clk: qcom: gpucc-sdm845: fix clk_dis_wait being programmed for CX GDSC

The gdsc_init() function will rewrite the CLK_DIS_WAIT field while
registering the GDSC (writing the value 0x2 by default). This will
override the setting done in the driver's probe function.

Set cx_gdsc.clk_dis_wait_val to 8 to follow the intention of the probe
function.

Fixes: 453361cdd757 ("clk: qcom: Add graphics clock controller driver for SDM845")
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230201172305.993146-2-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC
Dmitry Baryshkov [Wed, 1 Feb 2023 17:23:04 +0000 (19:23 +0200)]
clk: qcom: gpucc-sc7180: fix clk_dis_wait being programmed for CX GDSC

The gdsc_init() function will rewrite the CLK_DIS_WAIT field while
registering the GDSC (writing the value 0x2 by default). This will
override the setting done in the driver's probe function.

Set cx_gdsc.clk_dis_wait_val to 8 to follow the intention of the probe
function.

Fixes: 745ff069a49c ("clk: qcom: Add graphics clock controller driver for SC7180")
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230201172305.993146-1-dmitry.baryshkov@linaro.org
19 months agodt-bindings: clock: qcom,sa8775p-gcc: add the power-domains property
Bartosz Golaszewski [Mon, 30 Jan 2023 14:51:54 +0000 (15:51 +0100)]
dt-bindings: clock: qcom,sa8775p-gcc: add the power-domains property

The binding document is missing the power-domains property. Add it and
update the example.

Fixes: 0fff9fa043f9 ("dt-bindings: clock: Add Qualcomm SA8775P GCC")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230130145154.195562-1-brgl@bgdev.pl
19 months agoclk: qcom: cpu-8996: add missing cputype include
Krzysztof Kozlowski [Mon, 23 Jan 2023 20:18:10 +0000 (21:18 +0100)]
clk: qcom: cpu-8996: add missing cputype include

Include asm/cputype.h to fix ARMv7 compile test error:

  drivers/clk/qcom/clk-cpu-8996.c: In function â€˜qcom_cpu_clk_msm8996_acd_init’:
  drivers/clk/qcom/clk-cpu-8996.c:468:16: error: implicit declaration of function â€˜read_cpuid_mpidr’ [-Werror=implicit-function-declaration]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[bjorn: Moved asm-include after linux/, per Stephen's request]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230123201812.1230039-1-krzysztof.kozlowski@linaro.org
19 months agoclk: qcom: gcc-sa8775p: remove unused variables
Bartosz Golaszewski [Mon, 23 Jan 2023 10:33:38 +0000 (11:33 +0100)]
clk: qcom: gcc-sa8775p: remove unused variables

There are four struct definitions in the driver that aren't used so
remove them.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: ed432b1ed00a ("clk: qcom: add the GCC driver for sa8775p")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230123103338.230320-1-brgl@bgdev.pl
19 months agoclk: qcom: smd-rpm: provide RPM_SMD_XO_CLK_SRC on MSM8996 platform
Dmitry Baryshkov [Fri, 20 Jan 2023 06:14:14 +0000 (08:14 +0200)]
clk: qcom: smd-rpm: provide RPM_SMD_XO_CLK_SRC on MSM8996 platform

Extend the list of RPM clocks provided on MSM8996 platform to also
include RPM_SMD_XO_CLK_SRC and RPM_SMD_XO_A_CLK_SRC.

Fixes: 7066fdd0d742 ("clk: qcom: clk-smd-rpm: add msm8996 rpmclks")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230120061417.2623751-6-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: add msm8996 Core Bus Framework (CBF) support
Dmitry Baryshkov [Fri, 20 Jan 2023 06:14:12 +0000 (08:14 +0200)]
clk: qcom: add msm8996 Core Bus Framework (CBF) support

Add CBF clock driver as a part of MSM8996 CPU clocks. Significantly
based on AngeloGioacchino del Regno's work at [1].

The CBF is an interconnect between two CPU clusters, setting it up
properly is required for booting the MSM8996 with all four cores
enabled.

[1] https://github.com/sonyxperiadev/kernel/blob/aosp/LE.UM.2.3.2.r1.4/drivers/clk/qcom/clk-cpu-8996.c

Co-developed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[bjorn: Dropped partially uninitialized variable "ret" from cbf_clk_notifier_cb()]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230120061417.2623751-4-dmitry.baryshkov@linaro.org
19 months agodt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller
Dmitry Baryshkov [Fri, 20 Jan 2023 06:14:10 +0000 (08:14 +0200)]
dt-bindings: clock: qcom,msm8996-cbf: Describe the MSM8996 CBF clock controller

MSM8996 Core Bus Fabric (CBF) clock controller clocks an interconnect
between two CPU clusters. The CBF clock should follow the CPU
frequencies to provide enough bandwidth between clusters. Thus a single
driver implements both a clock and an interconnect to set the clock
rate.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230120061417.2623751-2-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: add the driver for the MSM8996 APCS clocks
Dmitry Baryshkov [Thu, 26 Jan 2023 23:03:19 +0000 (01:03 +0200)]
clk: qcom: add the driver for the MSM8996 APCS clocks

Add a simple driver handling the APCS clocks on MSM8996. For now it
supports just a single aux clock, linking GPLL0 to CPU and CBF clocks.

Note, there is little sense in registering sys_apcs_aux as a child of
gpll0. The PLL is always-on. And listing the gpll0 as a property of the
apcs would delay its probing until the GCC has been probed (while we
would like for the apcs to be probed as early as possible).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[bjorn: Fixed spelling of register, per Stephen's feedback]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230126230319.3977109-8-dmitry.baryshkov@linaro.org
19 months agoclk: mediatek: remove MT8195 vppsys/0/1 simple_probe
Moudy Ho [Wed, 18 Jan 2023 03:15:08 +0000 (11:15 +0800)]
clk: mediatek: remove MT8195 vppsys/0/1 simple_probe

MT8195 VPPSYS0/1 will be probed by the compatible name in
the mtk-mmsys driver and then probe its own clock driver as
a platform driver.

Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Link: https://lore.kernel.org/r/20230118031509.29834-4-moudy.ho@mediatek.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: imx6ul: add ethernet refclock mux support
Oleksij Rempel [Tue, 31 Jan 2023 08:46:39 +0000 (09:46 +0100)]
clk: imx6ul: add ethernet refclock mux support

Add ethernet refclock mux support and set it to internal clock by
default. This configuration will not affect existing boards.

clock tree before this patch:
fec1 <- enet1_ref_125m (gate) <- enet1_ref (divider) <-,
                                                       |- pll6_enet
fec2 <- enet2_ref_125m (gate) <- enet2_ref (divider) <-´

after this patch:
fec1 <- enet1_ref_sel(mux) <- enet1_ref_125m (gate) <- ...
               `--<> enet1_ref_pad                      |- pll6_enet
fec2 <- enet2_ref_sel(mux) <- enet2_ref_125m (gate) <- ...
               `--<> enet2_ref_pad

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Lee Jones <lee@kernel.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-17-o.rempel@pengutronix.de
19 months agoclk: imx6ul: fix enet1 gate configuration
Oleksij Rempel [Tue, 31 Jan 2023 08:46:38 +0000 (09:46 +0100)]
clk: imx6ul: fix enet1 gate configuration

According to the "i.MX 6UltraLite Applications Processor Reference Manual,
Rev. 2, 03/2017", BIT(13) is ENET1_125M_EN which is not controlling root
of PLL6. It is controlling ENET1 separately.

So, instead of this picture (implementation before this patch):
fec1 <- enet_ref (divider) <---------------------------,
                                                       |- pll6_enet (gate)
fec2 <- enet2_ref_125m (gate) <- enet2_ref (divider) <-´

we should have this one (after this patch):
fec1 <- enet1_ref_125m (gate) <- enet1_ref (divider) <-,
                                                       |- pll6_enet
fec2 <- enet2_ref_125m (gate) <- enet2_ref (divider) <-´

With this fix, the RMII reference clock will be turned off, after
setting network interface down on each separate interface
(ip l s dev eth0 down). Which was not working before, on system with both
FECs enabled.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-16-o.rempel@pengutronix.de
19 months agoclk: imx: add imx_obtain_fixed_of_clock()
Oleksij Rempel [Tue, 31 Jan 2023 08:46:37 +0000 (09:46 +0100)]
clk: imx: add imx_obtain_fixed_of_clock()

Add imx_obtain_fixed_of_clock() to optionally add clock not configured in
the devicetree.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-15-o.rempel@pengutronix.de
19 months agoclk: imx6q: add ethernet refclock mux support
Oleksij Rempel [Tue, 31 Jan 2023 08:46:25 +0000 (09:46 +0100)]
clk: imx6q: add ethernet refclock mux support

Add ethernet refclock mux support and set it to internal clock by
default. This configuration will not affect existing boards since
machine code currently overwrites this default.

The machine code will be fixed in a separate patch.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-3-o.rempel@pengutronix.de
19 months agoclk: imx: add clk-gpr-mux driver
Oleksij Rempel [Tue, 31 Jan 2023 08:46:24 +0000 (09:46 +0100)]
clk: imx: add clk-gpr-mux driver

Almost(?) every i.MX variant has clk mux for ethernet (rgmii/rmii) reference
clock located in the GPR1 register. So far this clk is configured in
different ways:
- mach-imx6q is doing mux configuration based on ptp vs enet_ref clk
  comparison.
- mach-imx7d is setting mux to PAD for all boards
- mach-imx6ul is setting mux to internal clock for all boards.

Since we have imx7d and imx6ul board variants which do not work with
configurations forced by kernel mach code, we need to implement this clk
mux properly as part of the clk framework. Which is done by this patch.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230131084642.709385-2-o.rempel@pengutronix.de
19 months agodt-bindings: arm: mediatek: migrate MT8195 vppsys0/1 to mtk-mmsys driver
Moudy Ho [Wed, 18 Jan 2023 03:15:06 +0000 (11:15 +0800)]
dt-bindings: arm: mediatek: migrate MT8195 vppsys0/1 to mtk-mmsys driver

MT8195 VPPSYS 0/1 should be probed from mtk-mmsys driver to
populate device by platform_device_register_data then start
its own clock driver.

Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Link: https://lore.kernel.org/r/20230118031509.29834-2-moudy.ho@mediatek.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: add MT7981 clock support
Daniel Golle [Thu, 26 Jan 2023 03:34:24 +0000 (03:34 +0000)]
clk: mediatek: add MT7981 clock support

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

The drivers are based on clk-mt7981.c which can be found in MediaTek's
SDK sources. To be fit for upstream inclusion the driver has been split
into clock domains and the infracfg part has been significantly
de-bloated by removing all the 1:1 factors (aliases).

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/8136eb5b2049177bc2f6d3e0f2aefecc342d626f.1674703830.git.daniel@makrotopia.org
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
[sboyd@kernel.org: Add module license]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agodt-bindings: clock: mediatek: add mt7981 clock IDs
Daniel Golle [Thu, 26 Jan 2023 03:34:05 +0000 (03:34 +0000)]
dt-bindings: clock: mediatek: add mt7981 clock IDs

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

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/e353d32b5a4481766519a037afe1ed44e31ece1a.1674703830.git.daniel@makrotopia.org
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agodt-bindings: clock: Add compatibles for MT7981
Daniel Golle [Thu, 26 Jan 2023 03:33:46 +0000 (03:33 +0000)]
dt-bindings: clock: Add compatibles for MT7981

Add compatible string for MT7981 to existing bindings at
 - mediatek,apmixedsys.yaml
 - mediatek,topckgen.yaml
 - mediatek,ethsys.txt
 - mediatek,infracfg.yaml
 - mediatek,sgmiisys.txt

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/cc85ee470c781ff4013f6c21c92c0a21574b12b2.1674703830.git.daniel@makrotopia.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt7986-topckgen: Migrate to mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:53 +0000 (10:20 +0100)]
clk: mediatek: clk-mt7986-topckgen: Migrate to mtk_clk_simple_probe()

There are no more non-common calls in clk_mt7986_topckgen_probe():
migrate this driver to mtk_clk_simple_probe().

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-24-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt7986-topckgen: Properly keep some clocks enabled
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:52 +0000 (10:20 +0100)]
clk: mediatek: clk-mt7986-topckgen: Properly keep some clocks enabled

Instead of calling clk_prepare_enable() on a bunch of clocks at probe
time, set the CLK_IS_CRITICAL flag to the same as these are required
to be always on, and this is the right way of achieving that.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-23-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt6795-topckgen: Migrate to mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:51 +0000 (10:20 +0100)]
clk: mediatek: clk-mt6795-topckgen: Migrate to mtk_clk_simple_probe()

Migrate away from custom probe functions and use the commonized
mtk_clk_simple_{probe, remove}().

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-22-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt8186-topckgen: Migrate to mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:50 +0000 (10:20 +0100)]
clk: mediatek: clk-mt8186-topckgen: Migrate to mtk_clk_simple_probe()

As done with MT8192, migrate MT8186 topckgen away from a custom probe
function and use mtk_clk_simple_{probe, remove}().

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-21-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt8192: Migrate topckgen to mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:49 +0000 (10:20 +0100)]
clk: mediatek: clk-mt8192: Migrate topckgen to mtk_clk_simple_probe()

Since the common simple probe function for MediaTek clock drivers can
now register the MFG MUX notifier, it's possible to migrate MT8192's
topckgen to that, allowing for some code size reduction.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-20-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:48 +0000 (10:20 +0100)]
clk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe()

In preparation for commonizing topckgen probe on various MediaTek SoCs
clock drivers, add the ability to register the MFG MUX notifier in
mtk_clk_simple_probe() by passing a custom notifier register function
pointer, as this function will be slightly different across different
SoCs.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-19-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt8183: Join top_aud_muxes and top_aud_divs
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:47 +0000 (10:20 +0100)]
clk: mediatek: clk-mt8183: Join top_aud_muxes and top_aud_divs

Join the two to register them in one shot.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-18-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8186: Join top_adj_div and top_muxes
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:46 +0000 (10:20 +0100)]
clk: mediatek: mt8186: Join top_adj_div and top_muxes

Like done for MT8192, join the two to register them in one shot, as
there's no point in doing that separately from one another.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230120092053.182923-17-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8192: Join top_adj_divs and top_muxes
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:45 +0000 (10:20 +0100)]
clk: mediatek: mt8192: Join top_adj_divs and top_muxes

These two are both mtk_composite arrays, one dependent on another, but
that's something that the clock framework is supposed to sort out and
anyway registering them separately isn't going to ease the framework's
job in checking dependencies.

Put the contents of top_adj_divs in top_muxes to join them together
and register them in one shot.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-16-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mt8192: Move CLK_TOP_CSW_F26M_D2 in top_divs
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:44 +0000 (10:20 +0100)]
clk: mediatek: clk-mt8192: Move CLK_TOP_CSW_F26M_D2 in top_divs

This driver is registered early in clk_mt8192_top_init_early() and
then again in clk_mt8192_top_probe(): the difference between the
two is that the early one is probed with CLK_OF_DECLARE_DRIVER and
the latter is regularly probed as a platform_driver.

Knowing that it is not necessary for this platform to register the
TOP_CSW_F26M_D2 clock that early, move it to top_divs and register
it with the others during platform_driver probe for topckgen;

While at it, since the only reason why the early probe existed was
to register that clock, remove that entirely - leaving this driver
to use only platform_driver.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-15-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8173: Migrate pericfg/topckgen to mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:43 +0000 (10:20 +0100)]
clk: mediatek: mt8173: Migrate pericfg/topckgen to mtk_clk_simple_probe()

Function mtk_clk_simple_probe() gained the ability to register multiple
clock types: migrate MT8173's pericfg and topckgen to this common
probe function to reduce duplication and code size.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-14-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mtk: Extend mtk_clk_simple_probe()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:42 +0000 (10:20 +0100)]
clk: mediatek: clk-mtk: Extend mtk_clk_simple_probe()

As a preparation to increase probe functions commonization across
various MediaTek SoC clock controller drivers, extend function
mtk_clk_simple_probe() to be able to register not only gates, but
also fixed clocks, factors, muxes and composites.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-13-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: Switch to mtk_clk_simple_probe() where possible
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:41 +0000 (10:20 +0100)]
clk: mediatek: Switch to mtk_clk_simple_probe() where possible

mtk_clk_simple_probe() is a function that registers mtk gate clocks
and, if reset data is present, a reset controller and across all of
the MTK clock drivers, such a function is duplicated many times:
switch to the common mtk_clk_simple_probe() function for all of the
clock drivers that are registering as platform drivers.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-12-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8173: Break down clock drivers and allow module build
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:40 +0000 (10:20 +0100)]
clk: mediatek: mt8173: Break down clock drivers and allow module build

Split the giant clock driver for MT8173 into smaller drivers and
make it possible to build the non boot critical clock controller
drivers as modules by adding remove functions and both module
description and license where needed.
While at it, also change a mtk_register_reset_controller() call
to mtk_register_reset_controller_with_dev() in mt8173-infracfg.

Some spare code style cleanups were also performed.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230120092053.182923-11-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8173: Remove mtk_clk_enable_critical()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:39 +0000 (10:20 +0100)]
clk: mediatek: mt8173: Remove mtk_clk_enable_critical()

The entire point of mtk_clk_enable_critical() is to raise the refcount
of some clocks so that they won't be turned off during runtime, but
this is the same as what the CLK_IS_CRITICAL flag does.

Set CLK_IS_CRITICAL on all of the critical clocks and remove the
aforementioned function as a cleanup.

No functional changes.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-10-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8173: Migrate to platform driver and common probe
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:38 +0000 (10:20 +0100)]
clk: mediatek: mt8173: Migrate to platform driver and common probe

This driver is using CLK_OF_DECLARE() for all clocks: while this
definitely works, it's not preferred as this makes it impossible
to compile non boot critical clock drivers as modules and to take
advantage of clock controller Runtime PM.

As a preparation for a larger cleanup, migrate all of the clock
controller drivers for MT8173 to platform_driver and use the
common mtk_clk_simple_probe() where possible; while at it, also
add proper error handling to the various probe functions.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-9-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mtk: Add dummy clock ops
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:37 +0000 (10:20 +0100)]
clk: mediatek: clk-mtk: Add dummy clock ops

In order to migrate some (few) old clock drivers to the common
mtk_clk_simple_probe() function, add dummy clock ops to be able
to insert a dummy clock with ID 0 at the beginning of the list.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-8-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mux: Propagate struct device for mtk-mux
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:36 +0000 (10:20 +0100)]
clk: mediatek: clk-mux: Propagate struct device for mtk-mux

Like done for other clocks, propagate struct device for mtk mux clocks
registered through clk-mux helpers to enable runtime pm support.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-7-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-mtk: Propagate struct device for composites
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:35 +0000 (10:20 +0100)]
clk: mediatek: clk-mtk: Propagate struct device for composites

Like done for cpumux clocks, propagate struct device for composite
clocks registered through clk-mtk helpers to be able to get runtime
pm support for MTK clocks.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-6-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: cpumux: Propagate struct device where possible
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:34 +0000 (10:20 +0100)]
clk: mediatek: cpumux: Propagate struct device where possible

Take a pointer to a struct device in mtk_clk_register_cpumuxes() and
propagate the same to mtk_clk_register_cpumux() => clk_hw_register().
Even though runtime pm is unlikely to be used with CPU muxes, this
helps with code consistency and possibly opens to commonization of
some mtk_clk_register_(x) functions.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-5-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: clk-gate: Propagate struct device with mtk_clk_register_gates()
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:33 +0000 (10:20 +0100)]
clk: mediatek: clk-gate: Propagate struct device with mtk_clk_register_gates()

Commit e4c23e19aa2a ("clk: mediatek: Register clock gate with device")
introduces a helper function for the sole purpose of propagating a
struct device pointer to the clk API when registering the mtk-gate
clocks to take advantage of Runtime PM when/where needed and where
a power domain is defined in devicetree.

Function mtk_clk_register_gates() then becomes a wrapper around the
new mtk_clk_register_gates_with_dev() function that will simply pass
NULL as struct device: this is essential when registering drivers
with CLK_OF_DECLARE instead of as a platform device, as there will
be no struct device to pass... but we can as well simply have only
one function that always takes such pointer as a param and pass NULL
when unavoidable.

This commit removes the mtk_clk_register_gates() wrapper and renames
mtk_clk_register_gates_with_dev() to the former and all of the calls
to either of the two functions were fixed in all drivers in order to
reflect this change; also, to improve consistency with other kernel
functions, the pointer to struct device was moved as the first param.

Since a lot of MediaTek clock drivers are actually registering as a
platform device, but were still registering the mtk-gate clocks
without passing any struct device to the clock framework, they've
been changed to pass a valid one now, as to make all those platforms
able to use runtime power management where available.

While at it, some much needed indentation changes were also done.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-4-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8192: Propagate struct device for gate clocks
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:32 +0000 (10:20 +0100)]
clk: mediatek: mt8192: Propagate struct device for gate clocks

Convert instances of mtk_clk_register_gates() to use the newer
mtk_clk_register_gates_with_dev() to propagate struct device to
the clk framework.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-3-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoclk: mediatek: mt8192: Correctly unregister and free clocks on failure
AngeloGioacchino Del Regno [Fri, 20 Jan 2023 09:20:31 +0000 (10:20 +0100)]
clk: mediatek: mt8192: Correctly unregister and free clocks on failure

If anything fails during probe of the clock controller(s), unregister
(and kfree!) whatever we have previously registered to leave with a
clean state and prevent leaks.

Fixes: 710573dee31b ("clk: mediatek: Add MT8192 basic clocks support")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-2-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoMerge tag 'sunxi-clk-for-6.3-1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Mon, 30 Jan 2023 23:31:03 +0000 (15:31 -0800)]
Merge tag 'sunxi-clk-for-6.3-1' of https://git./linux/kernel/git/sunxi/linux into clk-allwinner

Pull Allwinner clk driver updates from Jernej Skrabec:

 - add D1 CAN bus gates and resets
 - mark D1 CPUX clock as critical
 - reuse D1 driver for R528/T113
 - cleanup sunxi-ng kconfig
 - fix sunxi-ng kernel-doc issues
 - model H3/H5 DRAM clock as fixed clock

* tag 'sunxi-clk-for-6.3-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: d1: Add CAN bus gates and resets
  dt-bindings: clock: Add D1 CAN bus gates and resets
  clk: sunxi-ng: d1: Mark cpux clock as critical
  clk: sunxi-ng: d1: Allow building for R528/T113
  clk: sunxi-ng: Move SoC driver conditions to dependencies
  clk: sunxi-ng: Remove duplicate ARCH_SUNXI dependencies
  clk: sunxi-ng: Avoid computing the rate twice
  clk: sunxi-ng: h3/h5: Model H3 CLK_DRAM as a fixed clock
  clk: sunxi-ng: fix ccu_mmc_timing.c kernel-doc issues

19 months agoclk: qcom: gcc-qcs404: fix duplicate initializer warning
Arnd Bergmann [Mon, 30 Jan 2023 13:55:47 +0000 (14:55 +0100)]
clk: qcom: gcc-qcs404: fix duplicate initializer warning

In one of the clocks, a redundant initialization for .num_parents
got left behind by a recent patch:

drivers/clk/qcom/gcc-qcs404.c:63:32: error: initialized field overwritten [-Werror=override-init]
   63 |                 .num_parents = 1,
      |                                ^

Fixes: 2ce81afa0c7c ("clk: qcom: gcc-qcs404: sort out the cxo clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230130135555.3268172-1-arnd@kernel.org
19 months agodt-bindings: imx8ulp: clock: no spaces before tabs
Marcel Ziswiler [Thu, 19 Jan 2023 08:54:21 +0000 (09:54 +0100)]
dt-bindings: imx8ulp: clock: no spaces before tabs

This fixes the following warnings:

include/dt-bindings/clock/imx8ulp-clock.h:204: warning: please, no space
 before tabs
include/dt-bindings/clock/imx8ulp-clock.h:215: warning: please, no space
 before tabs

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230119085421.102804-3-marcel@ziswiler.com
19 months agoclk: imx6sll: add proper spdx license identifier
Marcel Ziswiler [Thu, 19 Jan 2023 08:54:20 +0000 (09:54 +0100)]
clk: imx6sll: add proper spdx license identifier

This fixes the following error:

include/dt-bindings/clock/imx6sll-clock.h:1: warning: Improper SPDX
 comment style for 'include/dt-bindings/clock/imx6sll-clock.h', please
 use '/*' instead
include/dt-bindings/clock/imx6sll-clock.h:1: warning: Missing or
 malformed SPDX-License-Identifier tag in line 1

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230119085421.102804-2-marcel@ziswiler.com
19 months agoclk: imx: imx93: invoke imx_register_uart_clocks
Peng Fan [Wed, 4 Jan 2023 11:00:32 +0000 (19:00 +0800)]
clk: imx: imx93: invoke imx_register_uart_clocks

Invoke imx_register_uart_clocks to keep uart clk on when earlycon
specified.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230104110032.1220721-5-peng.fan@oss.nxp.com
19 months agoclk: imx: remove clk_count of imx_register_uart_clocks
Peng Fan [Wed, 4 Jan 2023 11:00:31 +0000 (19:00 +0800)]
clk: imx: remove clk_count of imx_register_uart_clocks

The clk count has been get with of_clk_get_parent_count, there is
no need to pass clk_count from users.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230104110032.1220721-4-peng.fan@oss.nxp.com
19 months agoclk: imx: get stdout clk count from device tree
Peng Fan [Wed, 4 Jan 2023 11:00:30 +0000 (19:00 +0800)]
clk: imx: get stdout clk count from device tree

Currently the clk_count is specified by API users, but this
parameter is wrongly used, for example, i.MX8M clk driver use 4,
however the uart device tree node only use 2 clock entries. So
let using of_clk_get_parent_count to get the exact clock count.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230104110032.1220721-3-peng.fan@oss.nxp.com
19 months agoclk: imx: avoid memory leak
Peng Fan [Wed, 4 Jan 2023 11:00:29 +0000 (19:00 +0800)]
clk: imx: avoid memory leak

In case imx_register_uart_clocks return early, the imx_uart_clocks
memory will be no freed. So execute kfree always to avoid memory leak.

Fixes: 379c9a24cc23 ("clk: imx: Fix reparenting of UARTs not associated with stdout")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230104110032.1220721-2-peng.fan@oss.nxp.com
19 months agoMerge tag 'renesas-clk-for-v6.3-tag2' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Fri, 27 Jan 2023 21:05:33 +0000 (13:05 -0800)]
Merge tag 'renesas-clk-for-v6.3-tag2' of git://git./linux/kernel/git/geert/renesas-drivers into clk-renesas

Pull more Renesas clk driver updates from Geert Uytterhoeven:

 - Add support for USB host/device configuration on RZ/N1
 - Add PLL2 programming support, and CAN-FD clocks on R-Car V4H
 - Miscellaneous fixes and improvements

* tag 'renesas-clk-for-v6.3-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
  clk: renesas: r8a779g0: Add CAN-FD clocks
  clk: renesas: r8a779g0: Tidy up DMAC name on SYS-DMAC
  clk: renesas: r8a779a0: Tidy up DMAC name on SYS-DMAC
  clk: renesas: r8a779g0: Add custom clock for PLL2
  clk: renesas: cpg-mssr: Remove superfluous check in resume code
  clk: renesas: r9a06g032: Handle h2mode setting based on USBF presence

19 months agoclk: renesas: r8a779g0: Add CAN-FD clocks
Geert Uytterhoeven [Mon, 23 Jan 2023 18:31:24 +0000 (19:31 +0100)]
clk: renesas: r8a779g0: Add CAN-FD clocks

Add the CANFD core clock and the CANFD0 module clock, which are used by
the CAN-FD Interface on the Renesas R-Car V4H (R8A779G0) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/a78f534bd80f170f3f1267f3270fdb3b7a73b5d4.1674498643.git.geert+renesas@glider.be
19 months agoclk: renesas: r8a779g0: Tidy up DMAC name on SYS-DMAC
Kuninori Morimoto [Thu, 19 Jan 2023 01:51:59 +0000 (01:51 +0000)]
clk: renesas: r8a779g0: Tidy up DMAC name on SYS-DMAC

"sydm" is a bit name. Let's rename it to the common "sys-dmac".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/87v8l3z3y8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
19 months agoclk: renesas: r8a779a0: Tidy up DMAC name on SYS-DMAC
Kuninori Morimoto [Thu, 19 Jan 2023 01:52:16 +0000 (01:52 +0000)]
clk: renesas: r8a779a0: Tidy up DMAC name on SYS-DMAC

"sydm" is a bit name. Let's rename it to the common "sys-dmac".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/87tu0nz3xr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
19 months agodt-bindings: clock: qcom,sm8450-camcc: constrain required-opps
Krzysztof Kozlowski [Thu, 19 Jan 2023 13:00:27 +0000 (14:00 +0100)]
dt-bindings: clock: qcom,sm8450-camcc: constrain required-opps

Be specific how many required-opps are allowed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230119130028.106817-1-krzysztof.kozlowski@linaro.org
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
19 months agoMerge tag 'clk-microchip-6.3' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Wed, 25 Jan 2023 19:35:32 +0000 (11:35 -0800)]
Merge tag 'clk-microchip-6.3' of https://git./linux/kernel/git/at91/linux into clk-microchip

Pull Microchip clk updates from Claudiu Beznea:

Only updates for AT91 SoCs this time as follows:
 - DDR clocks were marked as critical in the proper clock driver for each
   AT91 SoC such that drivers/memory/atmel-sdramc.c to be deleted
   in the next releases as it only does clock enablement;
 - Patch to avoid compiling dt-compat.o for all AT91 SoCs as only some of
   them may use it.

* tag 'clk-microchip-6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  clk: at91: do not compile dt-compat.c for sama7g5 and sam9x60
  clk: at91: mark ddr clocks as critical

19 months agoMerge tag 'clk-meson-v6.3-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Stephen Boyd [Wed, 25 Jan 2023 19:31:13 +0000 (11:31 -0800)]
Merge tag 'clk-meson-v6.3-1' of https://github.com/BayLibre/clk-meson into clk-amlogic

Pull Amlogic clk updates from Jerome Brunet:

 - Use .determine_rate() instead of .round_rate() for the dualdiv, mpll,
   sclk-div and cpu-dyn-div amlogic clock drivers

* tag 'clk-meson-v6.3-1' of https://github.com/BayLibre/clk-meson:
  clk: meson: clk-cpu-dyndiv: switch from .round_rate to .determine_rate
  clk: meson: sclk-div: switch from .round_rate to .determine_rate
  clk: meson: dualdiv: switch from .round_rate to .determine_rate
  clk: meson: mpll: Switch from .round_rate to .determine_rate

19 months agoclk: renesas: r8a779g0: Add custom clock for PLL2
Geert Uytterhoeven [Thu, 8 Dec 2022 09:56:58 +0000 (10:56 +0100)]
clk: renesas: r8a779g0: Add custom clock for PLL2

Currently the PLLs are modeled as fixed factor clocks, based on initial
settings.  However, enabling CPU boost clock rates requires increasing
the PLL clock rates.

Add a custom clock driver to model the PLL clocks on R-Car Gen4, and use
it for PLL2 on R-Car V4H.  This allows the Z clock (Cortex-A76 core
clock) to request PLL rate changes, and enable boost mode for the High
Performance mode.  For now this is limited to integer multiplication
modes.

Note that the definition for CPG_PLLxCR0_NI uses the value for R-Car V4H.
On R-Car S4-8, the integer and fractional multiplication fields are one
bit larger resp. smaller, but R-Car S4-8 does not support High
Performance mode.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/76a5952900a6e15604c640bc8a27762e0e936677.1670492384.git.geert+renesas@glider.be
19 months agoclk: renesas: cpg-mssr: Remove superfluous check in resume code
Geert Uytterhoeven [Wed, 11 Jan 2023 08:23:34 +0000 (09:23 +0100)]
clk: renesas: cpg-mssr: Remove superfluous check in resume code

When the code flow arrives at printing the error message in
cpg_mssr_resume_noirq(), we know for sure that we are not running on an
RZ/A Soc, as the code checked for that before.

Fixes: ace342097768e35f ("clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/144a3e66d748c0c17f3524ac8fa6ece5bf5b6f1e.1673425314.git.geert+renesas@glider.be
19 months agoclk: renesas: r9a06g032: Handle h2mode setting based on USBF presence
Herve Codina [Thu, 5 Jan 2023 15:22:54 +0000 (16:22 +0100)]
clk: renesas: r9a06g032: Handle h2mode setting based on USBF presence

The CFG_USB[H2MODE] allows to switch the USB configuration. The
configuration supported are:
  - One host and one device
or
  - Two hosts

Set CFG_USB[H2MODE] based on the USBF controller (USB device)
availability.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230105152257.310642-3-herve.codina@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
19 months agoclk: qcom: cpu-8996: change setup sequence to follow vendor kernel
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:43 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: change setup sequence to follow vendor kernel

Add missing register writes to CPU clocks setup procedure. This makes it
follow the setup procedure used in msm-3.18 kernel.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-14-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: fix PLL clock ops
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:42 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix PLL clock ops

Switch CPU PLLs to use clk_alpha_pll_hwfsm_ops, it seems to suit
better.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-13-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: fix ACD initialization
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:41 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix ACD initialization

The vendor kernel applies different order while programming SSSCTL and
L2ACDCR registers on power and performance clusters. However it was
demonstrated that doing this upstream results in the board reset. Make
both clusters use the same sequence, which fixes the reset.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-12-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: fix PLL configuration sequence
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:40 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix PLL configuration sequence

Switch both power and performance clocks to the GPLL0/2 (sys_apcs_aux)
before PLL configuration. Switch them to the ACD afterwards.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-11-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: move qcom_cpu_clk_msm8996_acd_init call
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:39 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: move qcom_cpu_clk_msm8996_acd_init call

Initialize ACD configuration from qcom_cpu_clk_msm8996_register_clks(),
before registering all clocks. This way we can be sure that the clock is
fully configured before letting CCF touch it.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-10-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: setup PLLs before registering clocks
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:38 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: setup PLLs before registering clocks

Setup all PLLs before registering clocks in the common clock framework.
This ensures that the clocks are not accessed before being setup in the
known way and that the CCF is in sync with the actual HW programming.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-9-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:37 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb

- Do not use the Alt PLL completely. Switch to smux when necessary to
  prevent overvolting
- Restore the parent in case the rate change aborts for some reason
- Do not duplicate resetting the parent in set_parent operation.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-8-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: skip ACD init if the setup is valid
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:36 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: skip ACD init if the setup is valid

Check whether L2 registers contain correct values and skip programming
if they are valid. This follows the code present downstream.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-7-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: support using GPLL0 as SMUX input
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:35 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: support using GPLL0 as SMUX input

In some cases the driver might need using GPLL0 to drive CPU clocks.
Bring it in through the sys_apcs_aux clock.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-6-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: fix the init clock rate
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:34 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: fix the init clock rate

Current multiplier (60) results in CPU getting the rate which is
unlisted in the CPU frequency tables (60 * 19.2 = 1152 MHz). This
results in warnings from the cpufreq during startup.

Change PLL programming (l = 54) to init CPU clocks to start with the
frequency of 54 * 19.2 = 1036.8 MHz which is supported by both power and
performance clusters from all speed bins.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-5-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: cpu-8996: correct PLL programming
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:33 +0000 (14:05 +0200)]
clk: qcom: cpu-8996: correct PLL programming

Change PLL programming to follow the downstream setup.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-4-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: clk-alpha-pll: program PLL_TEST/PLL_TEST_U if required
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:32 +0000 (14:05 +0200)]
clk: qcom: clk-alpha-pll: program PLL_TEST/PLL_TEST_U if required

Program PLL_TEST and PLL_TEST_U registers if required by the pll
configuration.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-3-dmitry.baryshkov@linaro.org
19 months agodt-bindings: clock: qcom,msm8996-apcc: add sys_apcs_aux clock
Dmitry Baryshkov [Fri, 13 Jan 2023 12:05:31 +0000 (14:05 +0200)]
dt-bindings: clock: qcom,msm8996-apcc: add sys_apcs_aux clock

The MSM8996 CPU clock controller can make use of the sys_apcs_aux clock.
Add it to the bindings.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230113120544.59320-2-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: Add QDU1000 and QRU1000 GCC support
Taniya Das [Thu, 12 Jan 2023 20:44:46 +0000 (12:44 -0800)]
clk: qcom: Add QDU1000 and QRU1000 GCC support

Add Global Clock Controller (GCC) support for QDU1000 and QRU1000 SoCs.

Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[bjorn: Made gcc_pcie_0_pipe_clk_src use clk_regmap_phy_mux_ops]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230112204446.30236-3-quic_molvera@quicinc.com
19 months agoMerge branch '20230112204446.30236-2-quic_molvera@quicinc.com' into HEAD
Bjorn Andersson [Thu, 19 Jan 2023 02:47:06 +0000 (20:47 -0600)]
Merge branch '20230112204446.30236-2-quic_molvera@quicinc.com' into HEAD

19 months agodt-bindings: clock: Add QDU1000 and QRU1000 GCC clocks
Melody Olvera [Thu, 12 Jan 2023 20:44:45 +0000 (12:44 -0800)]
dt-bindings: clock: Add QDU1000 and QRU1000 GCC clocks

Add device tree bindings for global clock controller on QDU1000 and
QRU1000 SoCs.

Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230112204446.30236-2-quic_molvera@quicinc.com
19 months agoclk: qcom: mmcc-apq8084: use parent_hws/_data instead of parent_names
Dmitry Baryshkov [Wed, 11 Jan 2023 06:04:01 +0000 (08:04 +0200)]
clk: qcom: mmcc-apq8084: use parent_hws/_data instead of parent_names

Convert the clock driver to specify parent data rather than parent
names, to actually bind using 'clock-names' specified in the DTS rather
than global clock names. Use parent_hws where possible to refer parent
clocks directly, skipping the lookup.

Note, the system names for xo clocks were changed from "xo" to
"xo_board" to follow the example of other platforms. This switches the
clocks to use DT-provided "xo_board" clock instead of manually
registered "xo" clock and allows us to drop qcom_cc_register_board_clk()
call from the driver at some point.

In the same way change the looked up system "sleep_clk_src" clock to
"sleep_clk", which is registered from DT.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230111060402.1168726-12-dmitry.baryshkov@linaro.org
19 months agoclk: qcom: mmcc-apq8084: remove spdm clocks
Dmitry Baryshkov [Wed, 11 Jan 2023 06:04:00 +0000 (08:04 +0200)]
clk: qcom: mmcc-apq8084: remove spdm clocks

SPDM is used for debug/profiling and does not have any other
functionality. These clocks can safely be removed.

Suggested-by: Stephen Boyd <sboyd@kernel.org>
Suggested-by: Georgi Djakov <djakov@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230111060402.1168726-11-dmitry.baryshkov@linaro.org