[PATCH v2 00/24] clk: mediatek: more clock parent improvements

David Lechner dlechner at baylibre.com
Fri Jul 10 20:56:16 CEST 2026


This is the start of another wave of Mediatek clock driver improvements
with the aim to simplify things.

This series replaces complex rules about clock tree ancestor relations
used to look up parent clocks with a simple table to register clock
trees that provide a certain parent type.

Now, clock trees that contain parent clocks just need to populate the
type field with the appropriate type and they will be registered during
driver init. Then we can just look up the clock tree that contains a
parent clock from this table at runtime without having to walk ancestors
in the clock tree.

This is done in phases to break things down into logical components:
* First patch is something that was missed in earlier cleanups where
  all clocks now have a parent flag set rather than relying on implicit
  parent relationships from the clock tree structure itself.
* The next patch adds the infrastructure to register clock trees with
  a specific parent type.
* Then there is a group of patches to add the required info to each
  chip-specific clock trees so that they actually get registered.
* The next patch then replaces all of the lookups for parent clocks to
  use the new table-based mechanism.
* Then the rest of the patches are removing code that is no longer used
  after the previous changes.

Signed-off-by: David Lechner <dlechner at baylibre.com>
---
Changes in v2:
- Make the clock parent providers bind on probe.
- Moved removing unused `int ret;` to the correct patch.
- Link to v1: https://patch.msgid.link/20260707-mtk-clk-parent-lookup-improvements-v1-0-65d24cc0d569@baylibre.com

---
David Lechner (24):
      clk: mediatek: mt7622: set parent flag for GATE_APMIXED()
      clk: mediatek: add registration function for clock tree types
      clk: mediaTek: mt7622: add clock tree type flags
      clk: mediaTek: mt7623: add clock tree type flags
      clk: mediaTek: mt7629: add clock tree type flags
      clk: mediaTek: mt7981: add clock tree type flags
      clk: mediaTek: mt7986: add clock tree type flags
      clk: mediaTek: mt7987: add clock tree type flags
      clk: mediaTek: mt7988: add clock tree type flags
      clk: mediaTek: mt8183: add clock tree type flags
      clk: mediaTek: mt8188: add clock tree type flags
      clk: mediaTek: mt8189: add clock tree type flags
      clk: mediaTek: mt8195: add clock tree type flags
      clk: mediaTek: mt8365: add clock tree type flags
      clk: mediaTek: mt8512: add clock tree type flags
      clk: mediaTek: mt8516: add clock tree type flags
      clk: mediaTek: mt8518: add clock tree type flags
      clk: mediatek: use registered provider for parent lookup
      clk: mediatek: drop parent udevice field
      clk: mediatek: remove mtk_common_clk_infrasys_init()
      arm: dts: mt7981: remove clock-parent properties
      arm: dts: mt7986: remove clock-parent properties
      arm: dts: mt7988: remove clock-parent properties
      clk: mediatek: mt7629: remove mt7629_peri_clk_tree

 arch/arm/dts/mt7981.dtsi          |   3 -
 arch/arm/dts/mt7986.dtsi          |   3 -
 arch/arm/dts/mt7988.dtsi          |  12 ---
 drivers/clk/mediatek/clk-mt7622.c |  33 ++++---
 drivers/clk/mediatek/clk-mt7623.c |   6 +-
 drivers/clk/mediatek/clk-mt7629.c |  30 +++----
 drivers/clk/mediatek/clk-mt7981.c |  19 +++-
 drivers/clk/mediatek/clk-mt7986.c |  15 +++-
 drivers/clk/mediatek/clk-mt7987.c |  15 +++-
 drivers/clk/mediatek/clk-mt7988.c |  22 +++--
 drivers/clk/mediatek/clk-mt8183.c |  24 +++--
 drivers/clk/mediatek/clk-mt8188.c |   4 +
 drivers/clk/mediatek/clk-mt8189.c |  16 +++-
 drivers/clk/mediatek/clk-mt8195.c |   4 +
 drivers/clk/mediatek/clk-mt8365.c |   4 +
 drivers/clk/mediatek/clk-mt8512.c |  24 +++--
 drivers/clk/mediatek/clk-mt8516.c |  24 +++--
 drivers/clk/mediatek/clk-mt8518.c |  24 +++--
 drivers/clk/mediatek/clk-mtk.c    | 184 ++++++++++++++++----------------------
 drivers/clk/mediatek/clk-mtk.h    |  21 ++++-
 20 files changed, 292 insertions(+), 195 deletions(-)
---
base-commit: f1d4a6f0c80ee17081131b706f48d00a5c8586ea
change-id: 20260706-mtk-clk-parent-lookup-improvements-811460a93ecf

Best regards,
--  
David Lechner <dlechner at baylibre.com>



More information about the U-Boot mailing list