|
|
Subscribe / Log in / New account

rockchip: clk: add GATE_LINK support

From:  Sebastian Reichel <sebastian.reichel-AT-collabora.com>
To:  Heiko Stuebner <heiko-AT-sntech.de>, linux-clk-AT-vger.kernel.org
Subject:  [PATCH v12 0/5] rockchip: clk: add GATE_LINK support
Date:  Wed, 11 Dec 2024 17:58:49 +0100
Message-ID:  <20241211165957.94922-1-sebastian.reichel@collabora.com>
Cc:  Michael Turquette <mturquette-AT-baylibre.com>, Stephen Boyd <sboyd-AT-kernel.org>, Elaine Zhang <zhangqing-AT-rock-chips.com>, Kever Yang <kever.yang-AT-rock-chips.com>, Rob Herring <robh+dt-AT-kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt-AT-linaro.org>, Conor Dooley <conor+dt-AT-kernel.org>, huangtao-AT-rock-chips.com, andy.yan-AT-rock-chips.com, Michal Tomek <mtdev79b-AT-gmail.com>, Ilya K <me-AT-0upti.me>, Chad LeClair <leclair-AT-gmail.com>, devicetree-AT-vger.kernel.org, linux-rockchip-AT-lists.infradead.org, Sebastian Reichel <sebastian.reichel-AT-collabora.com>, kernel-AT-collabora.com
Archive-link:  Article

Hi,

This implements proper GATE_LINK support following the suggestion from Stephen
Boyd to use clk PM operations by creating MFD dynamically. This required some
restructuring, since CLK_OF_DECLARE() is called before devices are available.

Apart from improved power consumption, this fixes the runtime errors from the
pmdomain driver (failed to set idle on domain '%s'). Last but not least it is
a first step towards reducing usage of CLK_OF_DECLARE_DRIVER() registered
clocks, which should only be used for early clocks needed for the system
timer (see this talk from LPC: https://www.youtube.com/watch?v=dofbbVuIAPk ).

Changes since PATCHv11:
 * https://lore.kernel.org/all/20241024181621.210509-1-sebas...
 * rebase to v6.13-rc1 based for-next branch from Heiko
   - no changes needed, so v12 is more or less a resend of v11

Changes since PATCHv10:
 * https://lore.kernel.org/linux-rockchip/20240913184720.573...
 * rebased to v6.12-rc1
 * make struct platform_driver static

Changes since PATCHv9:
 * https://lore.kernel.org/linux-rockchip/20240325193609.237...
 * drop patches 1 & 5 (merged)
 * keep reporting ENOENT for missing clocks after CRU has been fully initialized
 * drop module remove support for the linked gate clock driver

Changes since PATCHv8:
 * https://lore.kernel.org/linux-rockchip/20240126182919.484...
 * rebased to v6.9-rc1
 * dropped all merged patches (i.e. all but the last one)
 * rewrote and split the final patch
   - should be easier to review
   - properly calls pm_clk_suspend/pm_clk_resume
   - now works on Orange Pi

Changes since PATCHv7:
 * https://lore.kernel.org/all/20231213185114.47565-1-sebast...
 * rebased to v6.8-rc1
 * Collected Reviewed-by/Acked-by from Krzysztof Kozlowski for DT binding patches
 * support nr_clk=0 in rockchip_clk_find_max_clk_id() for smatch

Greetings,

-- Sebstian

Sebastian Reichel (5):
  clk: rockchip: support clocks registered late
  clk: rockchip: rk3588: register GATE_LINK later
  clk: rockchip: expose rockchip_clk_set_lookup
  clk: rockchip: implement linked gate clock support
  clk: rockchip: rk3588: drop RK3588_LINKED_CLK

 drivers/clk/rockchip/Makefile     |   1 +
 drivers/clk/rockchip/clk-rk3588.c | 116 ++++++++++++++++++------------
 drivers/clk/rockchip/clk.c        | 101 ++++++++++++++++++++++----
 drivers/clk/rockchip/clk.h        |  40 +++++++++++
 drivers/clk/rockchip/gate-link.c  |  85 ++++++++++++++++++++++
 5 files changed, 285 insertions(+), 58 deletions(-)
 create mode 100644 drivers/clk/rockchip/gate-link.c

-- 
2.45.2




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds