linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
@ 2025-08-11 15:17 Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 001/114] clk: at91: peripheral: fix return value Brian Masney via B4 Relay
                   ` (120 more replies)
  0 siblings, 121 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() clk ops, so let's go ahead and convert the
various clk drivers using the Coccinelle semantic patch posted below.
I did a few minor cosmetic cleanups of the code in a few cases.

This series is broken up into several categories:

- Patch 1 to clk/at91/peripheral is a bug fix for a return value.

- Patch 2 to clk/at91/peripheral wasn't straight forward like the other
  drivers, so I'm explicitly calling this one out separately.

- Patch 3 adds a determine_rate() op and keeps the round_rate() in place
  since this is needed by drivers/clk/actions/owl-composite.c and keeps
  the tree bisectable. The deprecated round_rate() op is dropped in patch
  113.

- Patches 4-70 are for drivers where there is no clk submaintainer
  listed in the MAINTAINERS file. Patch 19 includes a minor fix so that
  Coccinelle can be ran against a particular source file.

- Patches 71-110 are for drivers where this is an entry in MAINTAINERS
  for the driver.

- Patches 111-114 are for drivers that implement both round_rate() and
  determine_rate(), so the round_rate() implementation is dropped.

Once all of my conversion patches across the various trees in the kernel
have been merged, I will post a small series that removes the
round_rate() op from the clk core and the documentation. Here's the
other patch series that are currently in flight that need to be merged
before we can remove round_rate() from the core.

- arm32 (3): https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
- clk/tegra (6): https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
- clk/ti (7): https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
- clocksource (1): https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
- drm (9): https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
- drm/msm (7): https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
- i2c (1): https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
- media (4): https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
- mips (1): https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
- net (1): https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
- peci (1): https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
- phy (9): https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
- pmdomain (1): https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
- tty (1): https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/

Coccinelle semantic patch:

    virtual patch

    // Look up the current name of the round_rate function
    @ has_round_rate @
    identifier round_rate_name =~ ".*_round_rate";
    identifier hw_param, rate_param, parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    	...
    }

    // Rename the route_rate function name to determine_rate()
    @ script:python generate_name depends on has_round_rate @
    round_rate_name << has_round_rate.round_rate_name;
    new_name;
    @@

    coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")

    // Change rate to req->rate; also change occurrences of 'return XXX'.
    @ chg_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier ERR =~ "E.*";
    expression E;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    -return -ERR;
    +return -ERR;
    |
    - return rate_param;
    + return 0;
    |
    - return E;
    + req->rate = E;
    +
    + return 0;
    |
    - rate_param
    + req->rate
    )
    ...>
    }

    // Coccinelle only transforms the first occurrence of the rate parameter
    // Run a second time. FIXME: Is there a better way to do this?
    @ chg_rate2 depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    - rate_param
    + req->rate
    ...>
    }

    // Change parent_rate to req->best_parent_rate
    @ chg_parent_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

    // Convert the function definition from round_rate() to determine_rate()
    @ func_definition depends on chg_rate @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier generate_name.new_name;
    @@

    - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
    -               unsigned long *parent_rate_param)
    + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
    {
        ...
    }

    // Update the ops from round_rate() to determine_rate()
    @ ops depends on func_definition @
    identifier has_round_rate.round_rate_name;
    identifier generate_name.new_name;
    @@

    {
        ...,
    -   .round_rate = round_rate_name,
    +   .determine_rate = new_name,
        ...,
    }

Note that I used coccinelle 1.2 instead of 1.3 since the newer version
adds unnecessary braces as described in this post.
https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Brian Masney (114):
      clk: at91: peripheral: fix return value
      clk: at91: peripheral: convert from round_rate() to determine_rate()
      clk: fixed-factor: add determine_rate() ops
      clk: at91: audio-pll: convert from round_rate() to determine_rate()
      clk: at91: h32mx: convert from round_rate() to determine_rate()
      clk: at91: pll: convert from round_rate() to determine_rate()
      clk: at91: plldiv: convert from round_rate() to determine_rate()
      clk: at91: sam9x60-pll: convert from round_rate() to determine_rate()
      clk: at91: usb: convert from round_rate() to determine_rate()
      clk: baikal-t1: ccu-div: convert from round_rate() to determine_rate()
      clk: baikal-t1: ccu-pll: convert from round_rate() to determine_rate()
      clk: cdce925: convert from round_rate() to determine_rate()
      clk: cs2000-cp: convert from round_rate() to determine_rate()
      clk: ep93xx: convert from round_rate() to determine_rate()
      clk: fractional-divider: convert from round_rate() to determine_rate()
      clk: gemini: convert from round_rate() to determine_rate()
      clk: highbank: convert from round_rate() to determine_rate()
      clk: hisilicon: clkdivider-hi6220: convert from round_rate() to determine_rate()
      clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB()
      clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate()
      clk: hisilicon: hi6220-stub: convert from round_rate() to determine_rate()
      clk: ingenic: cgu: convert from round_rate() to determine_rate()
      clk: ingenic: jz4780-cgu: convert from round_rate() to determine_rate()
      clk: ingenic: x1000-cgu: convert from round_rate() to determine_rate()
      clk: lmk04832: convert from round_rate() to determine_rate()
      clk: loongson1: convert from round_rate() to determine_rate()
      clk: max9485: convert from round_rate() to determine_rate()
      clk: milbeaut: convert from round_rate() to determine_rate()
      clk: mmp: audio: convert from round_rate() to determine_rate()
      clk: mmp: frac: convert from round_rate() to determine_rate()
      clk: multiplier: convert from round_rate() to determine_rate()
      clk: mxs: div: convert from round_rate() to determine_rate()
      clk: mxs: frac: convert from round_rate() to determine_rate()
      clk: mxs: ref: convert from round_rate() to determine_rate()
      clk: nuvoton: ma35d1-divider: convert from round_rate() to determine_rate()
      clk: nuvoton: ma35d1-pll: convert from round_rate() to determine_rate()
      clk: nxp: lpc18xx-cgu: convert from round_rate() to determine_rate()
      clk: nxp: lpc32xx: convert from round_rate() to determine_rate()
      clk: pistachio: pll: convert from round_rate() to determine_rate()
      clk: scpi: convert from round_rate() to determine_rate()
      clk: si514: convert from round_rate() to determine_rate()
      clk: si521xx: convert from round_rate() to determine_rate()
      clk: si5341: convert from round_rate() to determine_rate()
      clk: si544: convert from round_rate() to determine_rate()
      clk: si570: convert from round_rate() to determine_rate()
      clk: sifive: sifive-prci: convert from round_rate() to determine_rate()
      clk: sophgo: cv18xx-ip: convert from round_rate() to determine_rate()
      clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
      clk: sparx5: convert from round_rate() to determine_rate()
      clk: sprd: div: convert from round_rate() to determine_rate()
      clk: sprd: pll: convert from round_rate() to determine_rate()
      clk: st: clkgen-fsyn: convert from round_rate() to determine_rate()
      clk: st: clkgen-pll: convert from round_rate() to determine_rate()
      clk: stm32f4: convert from round_rate() to determine_rate()
      clk: stm32: stm32-core: convert from round_rate() to determine_rate()
      clk: stm32: stm32mp1: convert from round_rate() to determine_rate()
      clk: tps68470: convert from round_rate() to determine_rate()
      clk: versaclock3: convert from round_rate() to determine_rate()
      clk: vt8500: convert from round_rate() to determine_rate()
      clk: wm831x: convert from round_rate() to determine_rate()
      clk: x86: cgu: convert from round_rate() to determine_rate()
      clk: xgene: convert from round_rate() to determine_rate()
      clk: xilinx: xlnx-clock-wizard: convert from round_rate() to determine_rate()
      clk: xilinx: xlnx_vcu: convert from round_rate() to determine_rate()
      clk: zynqmp: divider: convert from round_rate() to determine_rate()
      clk: zynqmp: pll: convert from round_rate() to determine_rate()
      clk: zynq: pll: convert from round_rate() to determine_rate()
      clk: actions: owl-composite: convert from round_rate() to determine_rate()
      clk: actions: owl-divider: convert from round_rate() to determine_rate()
      clk: actions: owl-factor: convert from round_rate() to determine_rate()
      clk: actions: owl-pll: convert from round_rate() to determine_rate()
      clk: apple-nco: convert from round_rate() to determine_rate()
      clk: axs10x: i2s_pll_clock: convert from round_rate() to determine_rate()
      clk: axs10x: pll_clock: convert from round_rate() to determine_rate()
      clk: bcm: iproc-asiu: convert from round_rate() to determine_rate()
      clk: bm1880: convert from round_rate() to determine_rate()
      clk: cdce706: convert from round_rate() to determine_rate()
      clk: hsdk-pll: convert from round_rate() to determine_rate()
      clk: mediatek: pll: convert from round_rate() to determine_rate()
      clk: microchip: core: convert from round_rate() to determine_rate()
      clk: mstar: msc313-cpupll: convert from round_rate() to determine_rate()
      clk: mvebu: ap-cpu-clk: convert from round_rate() to determine_rate()
      clk: mvebu: armada-37xx-periph: convert from round_rate() to determine_rate()
      clk: mvebu: corediv: convert from round_rate() to determine_rate()
      clk: mvebu: cpu: convert from round_rate() to determine_rate()
      clk: mvebu: dove-divider: convert from round_rate() to determine_rate()
      clk: qcom: alpha-pll: convert from round_rate() to determine_rate()
      clk: qcom: regmap-divider: convert from round_rate() to determine_rate()
      clk: renesas: rzg2l-cpg: convert from round_rate() to determine_rate()
      clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate()
      clk: rockchip: ddr: convert from round_rate() to determine_rate()
      clk: rockchip: half-divider: convert from round_rate() to determine_rate()
      clk: rockchip: pll: convert from round_rate() to determine_rate()
      clk: rp1: convert from round_rate() to determine_rate()
      clk: samsung: cpu: convert from round_rate() to determine_rate()
      clk: samsung: pll: convert from round_rate() to determine_rate()
      clk: sp7021: convert from round_rate() to determine_rate()
      clk: spear: aux-synth: convert from round_rate() to determine_rate()
      clk: spear: frac-synth: convert from round_rate() to determine_rate()
      clk: spear: gpt-synth: convert from round_rate() to determine_rate()
      clk: spear: vco-pll: convert from round_rate() to determine_rate()
      clk: ux500: prcmu: convert from round_rate() to determine_rate()
      clk: versaclock5: convert from round_rate() to determine_rate()
      clk: versaclock7: convert from round_rate() to determine_rate()
      clk: versatile: icst: convert from round_rate() to determine_rate()
      clk: versatile: vexpress-osc: convert from round_rate() to determine_rate()
      clk: visconti: pll: convert from round_rate() to determine_rate()
      clk: divider: remove round_rate() in favor of determine_rate()
      clk: scmi: remove round_rate() in favor of determine_rate()
      clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate()
      clk: fixed-factor: drop round_rate() clk ops

 drivers/clk/actions/owl-composite.c        |   8 +-
 drivers/clk/actions/owl-divider.c          |  13 +--
 drivers/clk/actions/owl-factor.c           |  12 +--
 drivers/clk/actions/owl-pll.c              |  25 ++++--
 drivers/clk/at91/clk-audio-pll.c           |  42 +++++----
 drivers/clk/at91/clk-h32mx.c               |  33 ++++---
 drivers/clk/at91/clk-peripheral.c          |  48 ++++++----
 drivers/clk/at91/clk-pll.c                 |  12 +--
 drivers/clk/at91/clk-plldiv.c              |  34 +++++---
 drivers/clk/at91/clk-sam9x60-pll.c         |  29 +++---
 drivers/clk/at91/clk-usb.c                 |  20 +++--
 drivers/clk/axs10x/i2s_pll_clock.c         |  14 +--
 drivers/clk/axs10x/pll_clock.c             |  12 +--
 drivers/clk/baikal-t1/ccu-div.c            |  27 +++---
 drivers/clk/baikal-t1/ccu-pll.c            |  14 +--
 drivers/clk/bcm/clk-iproc-asiu.c           |  25 +++---
 drivers/clk/clk-apple-nco.c                |  14 +--
 drivers/clk/clk-bm1880.c                   |  21 +++--
 drivers/clk/clk-cdce706.c                  |  16 ++--
 drivers/clk/clk-cdce925.c                  |  50 ++++++-----
 drivers/clk/clk-cs2000-cp.c                |  14 +--
 drivers/clk/clk-divider.c                  |  23 -----
 drivers/clk/clk-ep93xx.c                   |  18 ++--
 drivers/clk/clk-fixed-factor.c             |  16 ++--
 drivers/clk/clk-fractional-divider.c       |  25 ++++--
 drivers/clk/clk-gemini.c                   |  15 ++--
 drivers/clk/clk-highbank.c                 |  26 +++---
 drivers/clk/clk-hsdk-pll.c                 |  12 +--
 drivers/clk/clk-lmk04832.c                 |  53 ++++++-----
 drivers/clk/clk-loongson1.c                |  12 +--
 drivers/clk/clk-max9485.c                  |  27 +++---
 drivers/clk/clk-milbeaut.c                 |  22 +++--
 drivers/clk/clk-multiplier.c               |  12 +--
 drivers/clk/clk-rp1.c                      |  45 ++++++----
 drivers/clk/clk-scmi.c                     |  30 -------
 drivers/clk/clk-scpi.c                     |  18 ++--
 drivers/clk/clk-si514.c                    |  24 +++--
 drivers/clk/clk-si521xx.c                  |  14 +--
 drivers/clk/clk-si5341.c                   |  22 +++--
 drivers/clk/clk-si544.c                    |  10 +--
 drivers/clk/clk-si570.c                    |  24 +++--
 drivers/clk/clk-sp7021.c                   |  22 ++---
 drivers/clk/clk-sparx5.c                   |  10 ++-
 drivers/clk/clk-stm32f4.c                  |  26 +++---
 drivers/clk/clk-tps68470.c                 |  12 +--
 drivers/clk/clk-versaclock3.c              |  70 +++++++++------
 drivers/clk/clk-versaclock5.c              |  71 ++++++++-------
 drivers/clk/clk-versaclock7.c              |  30 ++++---
 drivers/clk/clk-vt8500.c                   |  59 ++++++++-----
 drivers/clk/clk-wm831x.c                   |  14 +--
 drivers/clk/clk-xgene.c                    |  41 +++++----
 drivers/clk/hisilicon/clk-hi3660-stub.c    |  18 ++--
 drivers/clk/hisilicon/clk-hi6220-stub.c    |  12 +--
 drivers/clk/hisilicon/clkdivider-hi6220.c  |  12 +--
 drivers/clk/ingenic/cgu.c                  |  12 +--
 drivers/clk/ingenic/jz4780-cgu.c           |  24 ++---
 drivers/clk/ingenic/x1000-cgu.c            |  19 ++--
 drivers/clk/mediatek/clk-pll.c             |  13 +--
 drivers/clk/mediatek/clk-pll.h             |   3 +-
 drivers/clk/mediatek/clk-pllfh.c           |   2 +-
 drivers/clk/microchip/clk-core.c           |  44 ++++++----
 drivers/clk/mmp/clk-audio.c                |  18 ++--
 drivers/clk/mmp/clk-frac.c                 |  27 +++---
 drivers/clk/mstar/clk-msc313-cpupll.c      |  18 ++--
 drivers/clk/mvebu/ap-cpu-clk.c             |  12 +--
 drivers/clk/mvebu/armada-37xx-periph.c     |  15 ++--
 drivers/clk/mvebu/clk-corediv.c            |  18 ++--
 drivers/clk/mvebu/clk-cpu.c                |  12 +--
 drivers/clk/mvebu/dove-divider.c           |  16 ++--
 drivers/clk/mxs/clk-div.c                  |   8 +-
 drivers/clk/mxs/clk-frac.c                 |  16 ++--
 drivers/clk/mxs/clk-ref.c                  |  16 ++--
 drivers/clk/nuvoton/clk-ma35d1-divider.c   |  12 ++-
 drivers/clk/nuvoton/clk-ma35d1-pll.c       |  28 +++---
 drivers/clk/nxp/clk-lpc18xx-cgu.c          |  16 ++--
 drivers/clk/nxp/clk-lpc32xx.c              |  59 +++++++------
 drivers/clk/pistachio/clk-pll.c            |  20 +++--
 drivers/clk/qcom/clk-alpha-pll.c           | 136 ++++++++++++++++-------------
 drivers/clk/qcom/clk-regmap-divider.c      |  27 +++---
 drivers/clk/renesas/rzg2l-cpg.c            |   9 +-
 drivers/clk/renesas/rzv2h-cpg.c            |  10 ---
 drivers/clk/rockchip/clk-ddr.c             |  13 +--
 drivers/clk/rockchip/clk-half-divider.c    |  12 +--
 drivers/clk/rockchip/clk-pll.c             |  23 +++--
 drivers/clk/samsung/clk-cpu.c              |  12 +--
 drivers/clk/samsung/clk-pll.c              |  33 ++++---
 drivers/clk/sifive/fu540-prci.h            |   2 +-
 drivers/clk/sifive/fu740-prci.h            |   2 +-
 drivers/clk/sifive/sifive-prci.c           |  11 +--
 drivers/clk/sifive/sifive-prci.h           |   4 +-
 drivers/clk/sophgo/clk-cv18xx-ip.c         |  10 ++-
 drivers/clk/sophgo/clk-sg2042-clkgen.c     |  17 ++--
 drivers/clk/sophgo/clk-sg2042-pll.c        |  24 ++---
 drivers/clk/spacemit/ccu_ddn.c             |  11 ++-
 drivers/clk/spacemit/ccu_mix.c             |  12 +--
 drivers/clk/spacemit/ccu_pll.c             |  10 ++-
 drivers/clk/spear/clk-aux-synth.c          |  12 +--
 drivers/clk/spear/clk-frac-synth.c         |  12 +--
 drivers/clk/spear/clk-gpt-synth.c          |  12 +--
 drivers/clk/spear/clk-vco-pll.c            |  23 +++--
 drivers/clk/sprd/div.c                     |  13 +--
 drivers/clk/sprd/pll.c                     |   8 +-
 drivers/clk/st/clkgen-fsyn.c               |  33 +++----
 drivers/clk/st/clkgen-pll.c                |  38 ++++----
 drivers/clk/stm32/clk-stm32-core.c         |  28 +++---
 drivers/clk/stm32/clk-stm32mp1.c           |  13 +--
 drivers/clk/ux500/clk-prcmu.c              |  14 +--
 drivers/clk/versatile/clk-icst.c           |  72 +++++++++------
 drivers/clk/versatile/clk-vexpress-osc.c   |  16 ++--
 drivers/clk/visconti/pll.c                 |  17 ++--
 drivers/clk/x86/clk-cgu.c                  |  35 ++++----
 drivers/clk/xilinx/clk-xlnx-clock-wizard.c |  55 ++++++------
 drivers/clk/xilinx/xlnx_vcu.c              |  15 ++--
 drivers/clk/zynq/pll.c                     |  12 +--
 drivers/clk/zynqmp/divider.c               |  23 ++---
 drivers/clk/zynqmp/pll.c                   |  24 ++---
 116 files changed, 1477 insertions(+), 1132 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250729-clk-for-stephen-round-rate-5a88ebdf8da6

Best regards,
-- 
Brian Masney <bmasney@redhat.com>



^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH 001/114] clk: at91: peripheral: fix return value
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:59   ` Alexander Sverdlin
  2025-08-11 15:17 ` [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (119 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

determine_rate() is expected to return an error code, or 0 on success.
clk_sam9x5_peripheral_determine_rate() has a branch that returns the
parent rate on a certain case. This is the behavior of round_rate(),
so let's go ahead and fix this by setting req->rate.

Fixes: b4c115c76184f ("clk: at91: clk-peripheral: add support for changeable parent rate")
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-peripheral.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
index c173a44c800aa8cc6970c266995f4a60b0a38554..629f050a855aaebfd1a03ff87c2b016cd2284a5a 100644
--- a/drivers/clk/at91/clk-peripheral.c
+++ b/drivers/clk/at91/clk-peripheral.c
@@ -279,8 +279,11 @@ static int clk_sam9x5_peripheral_determine_rate(struct clk_hw *hw,
 	long best_diff = LONG_MIN;
 	u32 shift;
 
-	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max)
-		return parent_rate;
+	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max) {
+		req->rate = parent_rate;
+
+		return 0;
+	}
 
 	/* Fist step: check the available dividers. */
 	for (shift = 0; shift <= PERIPHERAL_MAX_SHIFT; shift++) {

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 001/114] clk: at91: peripheral: fix return value Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 16:00   ` Alexander Sverdlin
  2025-08-11 15:17 ` [PATCH 003/114] clk: fixed-factor: add determine_rate() ops Brian Masney via B4 Relay
                   ` (118 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

This driver already has a clk_sam9x5_peripheral_determine_rate()
implementation, however it can change the parent rate. The existing
round rate does not have this functionality. I could add a check
for CLK_SET_RATE_PARENT, and combine the two functions, however there
are some other minor differences in the two implementations. I don't
have access to this particular hardware. I believe that they could
be combined, however it would need to be tested on real hardware.
So, let's play it safe and convert the existing round rate
implementation to ensure that the driver keeps the same functionality
as before.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-peripheral.c | 41 +++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
index 629f050a855aaebfd1a03ff87c2b016cd2284a5a..e700f40fd87f9327365f250366f7f7bde01f5987 100644
--- a/drivers/clk/at91/clk-peripheral.c
+++ b/drivers/clk/at91/clk-peripheral.c
@@ -335,50 +335,57 @@ static int clk_sam9x5_peripheral_determine_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long clk_sam9x5_peripheral_round_rate(struct clk_hw *hw,
-					     unsigned long rate,
-					     unsigned long *parent_rate)
+static int clk_sam9x5_peripheral_no_parent_determine_rate(struct clk_hw *hw,
+							  struct clk_rate_request *req)
 {
 	int shift = 0;
 	unsigned long best_rate;
 	unsigned long best_diff;
-	unsigned long cur_rate = *parent_rate;
+	unsigned long cur_rate = req->best_parent_rate;
 	unsigned long cur_diff;
 	struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw);
 
-	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max)
-		return *parent_rate;
+	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max) {
+		req->rate = req->best_parent_rate;
+
+		return 0;
+	}
 
 	if (periph->range.max) {
 		for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
-			cur_rate = *parent_rate >> shift;
+			cur_rate = req->best_parent_rate >> shift;
 			if (cur_rate <= periph->range.max)
 				break;
 		}
 	}
 
-	if (rate >= cur_rate)
-		return cur_rate;
+	if (req->rate >= cur_rate) {
+		req->rate = cur_rate;
+
+		return 0;
+	}
 
-	best_diff = cur_rate - rate;
+	best_diff = cur_rate - req->rate;
 	best_rate = cur_rate;
 	for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
-		cur_rate = *parent_rate >> shift;
-		if (cur_rate < rate)
-			cur_diff = rate - cur_rate;
+		cur_rate = req->best_parent_rate >> shift;
+		if (cur_rate < req->rate)
+			cur_diff = req->rate - cur_rate;
 		else
-			cur_diff = cur_rate - rate;
+			cur_diff = cur_rate - req->rate;
 
 		if (cur_diff < best_diff) {
 			best_diff = cur_diff;
 			best_rate = cur_rate;
 		}
 
-		if (!best_diff || cur_rate < rate)
+		if (!best_diff || cur_rate < req->rate)
 			break;
 	}
 
-	return best_rate;
+	req->rate = best_rate;
+
+	return 0;
 }
 
 static int clk_sam9x5_peripheral_set_rate(struct clk_hw *hw,
@@ -430,7 +437,7 @@ static const struct clk_ops sam9x5_peripheral_ops = {
 	.disable = clk_sam9x5_peripheral_disable,
 	.is_enabled = clk_sam9x5_peripheral_is_enabled,
 	.recalc_rate = clk_sam9x5_peripheral_recalc_rate,
-	.round_rate = clk_sam9x5_peripheral_round_rate,
+	.determine_rate = clk_sam9x5_peripheral_no_parent_determine_rate,
 	.set_rate = clk_sam9x5_peripheral_set_rate,
 	.save_context = clk_sam9x5_peripheral_save_context,
 	.restore_context = clk_sam9x5_peripheral_restore_context,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 003/114] clk: fixed-factor: add determine_rate() ops
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 001/114] clk: at91: peripheral: fix return value Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 004/114] clk: at91: audio-pll: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (117 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, and determine_rate() should be
used instead. We can't just simply convert this driver over initially
since other drivers depend on this. So let's go ahead and add a
determine_rate() clk ops. Once all of the drivers have been converted,
then the round_rate() clk ops can be dropped.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-fixed-factor.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index e62ae8794d445f685156276d5135448f340fca3f..79b9a8c57d4b84be990955d8bc3159b818f38d50 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -30,6 +30,23 @@ static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
 	return (unsigned long)rate;
 }
 
+static int clk_factor_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
+{
+	struct clk_fixed_factor *fix = to_clk_fixed_factor(hw);
+
+	if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
+		unsigned long best_parent;
+
+		best_parent = (req->rate / fix->mult) * fix->div;
+		req->best_parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
+	}
+
+	req->rate = (req->best_parent_rate / fix->div) * fix->mult;
+
+	return 0;
+}
+
 static long clk_factor_round_rate(struct clk_hw *hw, unsigned long rate,
 				unsigned long *prate)
 {
@@ -50,7 +67,7 @@ static int clk_factor_set_rate(struct clk_hw *hw, unsigned long rate,
 {
 	/*
 	 * We must report success but we can do so unconditionally because
-	 * clk_factor_round_rate returns values that ensure this call is a
+	 * clk_factor_determine_rate returns values that ensure this call is a
 	 * nop.
 	 */
 
@@ -69,6 +86,7 @@ static unsigned long clk_factor_recalc_accuracy(struct clk_hw *hw,
 }
 
 const struct clk_ops clk_fixed_factor_ops = {
+	.determine_rate = clk_factor_determine_rate,
 	.round_rate = clk_factor_round_rate,
 	.set_rate = clk_factor_set_rate,
 	.recalc_rate = clk_factor_recalc_rate,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 004/114] clk: at91: audio-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (2 preceding siblings ...)
  2025-08-11 15:17 ` [PATCH 003/114] clk: fixed-factor: add determine_rate() ops Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 005/114] clk: at91: h32mx: " Brian Masney via B4 Relay
                   ` (116 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-audio-pll.c | 42 ++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-pll.c
index a92da64c12e1cff5961d0b85bd630a25015206b1..bf9b635ac9d6e2fa3523376799315f04ea0ead2a 100644
--- a/drivers/clk/at91/clk-audio-pll.c
+++ b/drivers/clk/at91/clk-audio-pll.c
@@ -270,8 +270,8 @@ static int clk_audio_pll_frac_determine_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate,
-					 unsigned long *parent_rate)
+static int clk_audio_pll_pad_determine_rate(struct clk_hw *hw,
+					    struct clk_rate_request *req)
 {
 	struct clk_hw *pclk = clk_hw_get_parent(hw);
 	long best_rate = -EINVAL;
@@ -283,7 +283,7 @@ static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate,
 	int best_diff = -1;
 
 	pr_debug("A PLL/PAD: %s, rate = %lu (parent_rate = %lu)\n", __func__,
-		 rate, *parent_rate);
+		 req->rate, req->best_parent_rate);
 
 	/*
 	 * Rate divisor is actually made of two different divisors, multiplied
@@ -304,12 +304,12 @@ static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate,
 				continue;
 
 			best_parent_rate = clk_hw_round_rate(pclk,
-							rate * tmp_qd * div);
+							req->rate * tmp_qd * div);
 			tmp_rate = best_parent_rate / (div * tmp_qd);
-			tmp_diff = abs(rate - tmp_rate);
+			tmp_diff = abs(req->rate - tmp_rate);
 
 			if (best_diff < 0 || best_diff > tmp_diff) {
-				*parent_rate = best_parent_rate;
+				req->best_parent_rate = best_parent_rate;
 				best_rate = tmp_rate;
 				best_diff = tmp_diff;
 			}
@@ -318,11 +318,13 @@ static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate,
 	pr_debug("A PLL/PAD: %s, best_rate = %ld, best_parent_rate = %lu\n",
 		 __func__, best_rate, best_parent_rate);
 
-	return best_rate;
+	req->rate = best_rate;
+
+	return 0;
 }
 
-static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate,
-					 unsigned long *parent_rate)
+static int clk_audio_pll_pmc_determine_rate(struct clk_hw *hw,
+					    struct clk_rate_request *req)
 {
 	struct clk_hw *pclk = clk_hw_get_parent(hw);
 	long best_rate = -EINVAL;
@@ -333,20 +335,20 @@ static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate,
 	int best_diff = -1;
 
 	pr_debug("A PLL/PMC: %s, rate = %lu (parent_rate = %lu)\n", __func__,
-		 rate, *parent_rate);
+		 req->rate, req->best_parent_rate);
 
-	if (!rate)
+	if (!req->rate)
 		return 0;
 
 	best_parent_rate = clk_round_rate(pclk->clk, 1);
-	div = max(best_parent_rate / rate, 1UL);
+	div = max(best_parent_rate / req->rate, 1UL);
 	for (; div <= AUDIO_PLL_QDPMC_MAX; div++) {
-		best_parent_rate = clk_round_rate(pclk->clk, rate * div);
+		best_parent_rate = clk_round_rate(pclk->clk, req->rate * div);
 		tmp_rate = best_parent_rate / div;
-		tmp_diff = abs(rate - tmp_rate);
+		tmp_diff = abs(req->rate - tmp_rate);
 
 		if (best_diff < 0 || best_diff > tmp_diff) {
-			*parent_rate = best_parent_rate;
+			req->best_parent_rate = best_parent_rate;
 			best_rate = tmp_rate;
 			best_diff = tmp_diff;
 			tmp_qd = div;
@@ -356,9 +358,11 @@ static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate,
 	}
 
 	pr_debug("A PLL/PMC: %s, best_rate = %ld, best_parent_rate = %lu (qd = %d)\n",
-		 __func__, best_rate, *parent_rate, tmp_qd - 1);
+		 __func__, best_rate, req->best_parent_rate, tmp_qd - 1);
+
+	req->rate = best_rate;
 
-	return best_rate;
+	return 0;
 }
 
 static int clk_audio_pll_frac_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -436,7 +440,7 @@ static const struct clk_ops audio_pll_pad_ops = {
 	.enable = clk_audio_pll_pad_enable,
 	.disable = clk_audio_pll_pad_disable,
 	.recalc_rate = clk_audio_pll_pad_recalc_rate,
-	.round_rate = clk_audio_pll_pad_round_rate,
+	.determine_rate = clk_audio_pll_pad_determine_rate,
 	.set_rate = clk_audio_pll_pad_set_rate,
 };
 
@@ -444,7 +448,7 @@ static const struct clk_ops audio_pll_pmc_ops = {
 	.enable = clk_audio_pll_pmc_enable,
 	.disable = clk_audio_pll_pmc_disable,
 	.recalc_rate = clk_audio_pll_pmc_recalc_rate,
-	.round_rate = clk_audio_pll_pmc_round_rate,
+	.determine_rate = clk_audio_pll_pmc_determine_rate,
 	.set_rate = clk_audio_pll_pmc_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 005/114] clk: at91: h32mx: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (3 preceding siblings ...)
  2025-08-11 15:17 ` [PATCH 004/114] clk: at91: audio-pll: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 006/114] clk: at91: pll: " Brian Masney via B4 Relay
                   ` (115 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-h32mx.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 1e6c12eeda10c4abb51c2046ea27b238db2560cb..a9aa93b5a870988677ad4609a210ed9570295228 100644
--- a/drivers/clk/at91/clk-h32mx.c
+++ b/drivers/clk/at91/clk-h32mx.c
@@ -40,21 +40,32 @@ static unsigned long clk_sama5d4_h32mx_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long clk_sama5d4_h32mx_round_rate(struct clk_hw *hw, unsigned long rate,
-				       unsigned long *parent_rate)
+static int clk_sama5d4_h32mx_determine_rate(struct clk_hw *hw,
+					    struct clk_rate_request *req)
 {
 	unsigned long div;
 
-	if (rate > *parent_rate)
-		return *parent_rate;
-	div = *parent_rate / 2;
-	if (rate < div)
-		return div;
+	if (req->rate > req->best_parent_rate) {
+		req->rate = req->best_parent_rate;
 
-	if (rate - div < *parent_rate - rate)
-		return div;
+		return 0;
+	}
+	div = req->best_parent_rate / 2;
+	if (req->rate < div) {
+		req->rate = div;
+
+		return 0;
+	}
+
+	if (req->rate - div < req->best_parent_rate - req->rate) {
+		req->rate = div;
 
-	return *parent_rate;
+		return 0;
+	}
+
+	req->rate = req->best_parent_rate;
+
+	return 0;
 }
 
 static int clk_sama5d4_h32mx_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -77,7 +88,7 @@ static int clk_sama5d4_h32mx_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops h32mx_ops = {
 	.recalc_rate = clk_sama5d4_h32mx_recalc_rate,
-	.round_rate = clk_sama5d4_h32mx_round_rate,
+	.determine_rate = clk_sama5d4_h32mx_determine_rate,
 	.set_rate = clk_sama5d4_h32mx_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 006/114] clk: at91: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (4 preceding siblings ...)
  2025-08-11 15:17 ` [PATCH 005/114] clk: at91: h32mx: " Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:17 ` [PATCH 007/114] clk: at91: plldiv: " Brian Masney via B4 Relay
                   ` (114 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-pll.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c
index 249d6a53cedf5da1c2d877762474592e4b3fda40..5c5f7398effee1447ff86516c2cec1ddc1adc542 100644
--- a/drivers/clk/at91/clk-pll.c
+++ b/drivers/clk/at91/clk-pll.c
@@ -231,13 +231,15 @@ static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate,
 	return bestrate;
 }
 
-static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *parent_rate)
+static int clk_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct clk_pll *pll = to_clk_pll(hw);
 
-	return clk_pll_get_best_div_mul(pll, rate, *parent_rate,
-					NULL, NULL, NULL);
+	req->rate = clk_pll_get_best_div_mul(pll, req->rate, req->best_parent_rate,
+					     NULL, NULL, NULL);
+
+	return 0;
 }
 
 static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -302,7 +304,7 @@ static const struct clk_ops pll_ops = {
 	.unprepare = clk_pll_unprepare,
 	.is_prepared = clk_pll_is_prepared,
 	.recalc_rate = clk_pll_recalc_rate,
-	.round_rate = clk_pll_round_rate,
+	.determine_rate = clk_pll_determine_rate,
 	.set_rate = clk_pll_set_rate,
 	.save_context = clk_pll_save_context,
 	.restore_context = clk_pll_restore_context,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 007/114] clk: at91: plldiv: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (5 preceding siblings ...)
  2025-08-11 15:17 ` [PATCH 006/114] clk: at91: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:17 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 008/114] clk: at91: sam9x60-pll: " Brian Masney via B4 Relay
                   ` (113 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:17 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-plldiv.c | 34 +++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c
index ba3a1839a96dc229ef27293a38bd26704d064d7f..3ac09fecc54eaed1a9b3fb51df5debfc25d0053b 100644
--- a/drivers/clk/at91/clk-plldiv.c
+++ b/drivers/clk/at91/clk-plldiv.c
@@ -33,21 +33,33 @@ static unsigned long clk_plldiv_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long clk_plldiv_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *parent_rate)
+static int clk_plldiv_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	unsigned long div;
 
-	if (rate > *parent_rate)
-		return *parent_rate;
-	div = *parent_rate / 2;
-	if (rate < div)
-		return div;
+	if (req->rate > req->best_parent_rate) {
+		req->rate = req->best_parent_rate;
 
-	if (rate - div < *parent_rate - rate)
-		return div;
+		return 0;
+	}
+
+	div = req->best_parent_rate / 2;
+	if (req->rate < div) {
+		req->rate = div;
+
+		return 0;
+	}
+
+	if (req->rate - div < req->best_parent_rate - req->rate) {
+		req->rate = div;
 
-	return *parent_rate;
+		return 0;
+	}
+
+	req->rate = req->best_parent_rate;
+
+	return 0;
 }
 
 static int clk_plldiv_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -66,7 +78,7 @@ static int clk_plldiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops plldiv_ops = {
 	.recalc_rate = clk_plldiv_recalc_rate,
-	.round_rate = clk_plldiv_round_rate,
+	.determine_rate = clk_plldiv_determine_rate,
 	.set_rate = clk_plldiv_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 008/114] clk: at91: sam9x60-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (6 preceding siblings ...)
  2025-08-11 15:17 ` [PATCH 007/114] clk: at91: plldiv: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 009/114] clk: at91: usb: " Brian Masney via B4 Relay
                   ` (112 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-sam9x60-pll.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
index cefd9948e10393e4762f8a1f5f2ca0a7e1180a87..bc1498c5704ad9dadbef4e990156602f2dd0bfea 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -230,12 +230,16 @@ static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
 	return tmprate;
 }
 
-static long sam9x60_frac_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *parent_rate)
+static int sam9x60_frac_pll_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
 
-	return sam9x60_frac_pll_compute_mul_frac(core, rate, *parent_rate, false);
+	req->rate = sam9x60_frac_pll_compute_mul_frac(core, req->rate,
+						      req->best_parent_rate,
+						      false);
+
+	return 0;
 }
 
 static int sam9x60_frac_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -321,7 +325,7 @@ static const struct clk_ops sam9x60_frac_pll_ops = {
 	.unprepare = sam9x60_frac_pll_unprepare,
 	.is_prepared = sam9x60_frac_pll_is_prepared,
 	.recalc_rate = sam9x60_frac_pll_recalc_rate,
-	.round_rate = sam9x60_frac_pll_round_rate,
+	.determine_rate = sam9x60_frac_pll_determine_rate,
 	.set_rate = sam9x60_frac_pll_set_rate,
 	.save_context = sam9x60_frac_pll_save_context,
 	.restore_context = sam9x60_frac_pll_restore_context,
@@ -332,7 +336,7 @@ static const struct clk_ops sam9x60_frac_pll_ops_chg = {
 	.unprepare = sam9x60_frac_pll_unprepare,
 	.is_prepared = sam9x60_frac_pll_is_prepared,
 	.recalc_rate = sam9x60_frac_pll_recalc_rate,
-	.round_rate = sam9x60_frac_pll_round_rate,
+	.determine_rate = sam9x60_frac_pll_determine_rate,
 	.set_rate = sam9x60_frac_pll_set_rate_chg,
 	.save_context = sam9x60_frac_pll_save_context,
 	.restore_context = sam9x60_frac_pll_restore_context,
@@ -487,12 +491,15 @@ static long sam9x60_div_pll_compute_div(struct sam9x60_pll_core *core,
 	return best_rate;
 }
 
-static long sam9x60_div_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				       unsigned long *parent_rate)
+static int sam9x60_div_pll_determine_rate(struct clk_hw *hw,
+					  struct clk_rate_request *req)
 {
 	struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
 
-	return sam9x60_div_pll_compute_div(core, parent_rate, rate);
+	req->rate = sam9x60_div_pll_compute_div(core, &req->best_parent_rate,
+						req->rate);
+
+	return 0;
 }
 
 static int sam9x60_div_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -601,7 +608,7 @@ static const struct clk_ops sam9x60_div_pll_ops = {
 	.unprepare = sam9x60_div_pll_unprepare,
 	.is_prepared = sam9x60_div_pll_is_prepared,
 	.recalc_rate = sam9x60_div_pll_recalc_rate,
-	.round_rate = sam9x60_div_pll_round_rate,
+	.determine_rate = sam9x60_div_pll_determine_rate,
 	.set_rate = sam9x60_div_pll_set_rate,
 	.save_context = sam9x60_div_pll_save_context,
 	.restore_context = sam9x60_div_pll_restore_context,
@@ -612,7 +619,7 @@ static const struct clk_ops sam9x60_div_pll_ops_chg = {
 	.unprepare = sam9x60_div_pll_unprepare,
 	.is_prepared = sam9x60_div_pll_is_prepared,
 	.recalc_rate = sam9x60_div_pll_recalc_rate,
-	.round_rate = sam9x60_div_pll_round_rate,
+	.determine_rate = sam9x60_div_pll_determine_rate,
 	.set_rate = sam9x60_div_pll_set_rate_chg,
 	.save_context = sam9x60_div_pll_save_context,
 	.restore_context = sam9x60_div_pll_restore_context,
@@ -623,7 +630,7 @@ static const struct clk_ops sam9x60_fixed_div_pll_ops = {
 	.unprepare = sam9x60_div_pll_unprepare,
 	.is_prepared = sam9x60_div_pll_is_prepared,
 	.recalc_rate = sam9x60_fixed_div_pll_recalc_rate,
-	.round_rate = sam9x60_div_pll_round_rate,
+	.determine_rate = sam9x60_div_pll_determine_rate,
 	.save_context = sam9x60_div_pll_save_context,
 	.restore_context = sam9x60_div_pll_restore_context,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 009/114] clk: at91: usb: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (7 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 008/114] clk: at91: sam9x60-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 010/114] clk: baikal-t1: ccu-div: " Brian Masney via B4 Relay
                   ` (111 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/at91/clk-usb.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
index b0696a928aa98d6fd75c3f2e1911aa9b6d1827e6..e906928cfbf05143a1fa4fc69cd7004a30824b6b 100644
--- a/drivers/clk/at91/clk-usb.c
+++ b/drivers/clk/at91/clk-usb.c
@@ -319,8 +319,8 @@ static unsigned long at91rm9200_clk_usb_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long at91rm9200_clk_usb_round_rate(struct clk_hw *hw, unsigned long rate,
-					  unsigned long *parent_rate)
+static int at91rm9200_clk_usb_determine_rate(struct clk_hw *hw,
+					     struct clk_rate_request *req)
 {
 	struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw);
 	struct clk_hw *parent = clk_hw_get_parent(hw);
@@ -336,25 +336,27 @@ static long at91rm9200_clk_usb_round_rate(struct clk_hw *hw, unsigned long rate,
 		if (!usb->divisors[i])
 			continue;
 
-		tmp_parent_rate = rate * usb->divisors[i];
+		tmp_parent_rate = req->rate * usb->divisors[i];
 		tmp_parent_rate = clk_hw_round_rate(parent, tmp_parent_rate);
 		tmprate = DIV_ROUND_CLOSEST(tmp_parent_rate, usb->divisors[i]);
-		if (tmprate < rate)
-			tmpdiff = rate - tmprate;
+		if (tmprate < req->rate)
+			tmpdiff = req->rate - tmprate;
 		else
-			tmpdiff = tmprate - rate;
+			tmpdiff = tmprate - req->rate;
 
 		if (bestdiff < 0 || bestdiff > tmpdiff) {
 			bestrate = tmprate;
 			bestdiff = tmpdiff;
-			*parent_rate = tmp_parent_rate;
+			req->best_parent_rate = tmp_parent_rate;
 		}
 
 		if (!bestdiff)
 			break;
 	}
 
-	return bestrate;
+	req->rate = bestrate;
+
+	return 0;
 }
 
 static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -384,7 +386,7 @@ static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops at91rm9200_usb_ops = {
 	.recalc_rate = at91rm9200_clk_usb_recalc_rate,
-	.round_rate = at91rm9200_clk_usb_round_rate,
+	.determine_rate = at91rm9200_clk_usb_determine_rate,
 	.set_rate = at91rm9200_clk_usb_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 010/114] clk: baikal-t1: ccu-div: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (8 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 009/114] clk: at91: usb: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 011/114] clk: baikal-t1: ccu-pll: " Brian Masney via B4 Relay
                   ` (110 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/baikal-t1/ccu-div.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/baikal-t1/ccu-div.c b/drivers/clk/baikal-t1/ccu-div.c
index 8d5fc7158f33f9c5f8a04241cb62f1ec6ced6e5d..849d1f55765f503c23954754b994d1c28fe3f525 100644
--- a/drivers/clk/baikal-t1/ccu-div.c
+++ b/drivers/clk/baikal-t1/ccu-div.c
@@ -228,15 +228,18 @@ static inline unsigned long ccu_div_var_calc_divider(unsigned long rate,
 		       CCU_DIV_CLKDIV_MAX(mask));
 }
 
-static long ccu_div_var_round_rate(struct clk_hw *hw, unsigned long rate,
-				   unsigned long *parent_rate)
+static int ccu_div_var_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct ccu_div *div = to_ccu_div(hw);
 	unsigned long divider;
 
-	divider = ccu_div_var_calc_divider(rate, *parent_rate, div->mask);
+	divider = ccu_div_var_calc_divider(req->rate, req->best_parent_rate,
+					   div->mask);
 
-	return ccu_div_calc_freq(*parent_rate, divider);
+	req->rate = ccu_div_calc_freq(req->best_parent_rate, divider);
+
+	return 0;
 }
 
 /*
@@ -308,12 +311,14 @@ static unsigned long ccu_div_fixed_recalc_rate(struct clk_hw *hw,
 	return ccu_div_calc_freq(parent_rate, div->divider);
 }
 
-static long ccu_div_fixed_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *parent_rate)
+static int ccu_div_fixed_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct ccu_div *div = to_ccu_div(hw);
 
-	return ccu_div_calc_freq(*parent_rate, div->divider);
+	req->rate = ccu_div_calc_freq(req->best_parent_rate, div->divider);
+
+	return 0;
 }
 
 static int ccu_div_fixed_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -534,14 +539,14 @@ static const struct clk_ops ccu_div_var_gate_to_set_ops = {
 	.disable = ccu_div_gate_disable,
 	.is_enabled = ccu_div_gate_is_enabled,
 	.recalc_rate = ccu_div_var_recalc_rate,
-	.round_rate = ccu_div_var_round_rate,
+	.determine_rate = ccu_div_var_determine_rate,
 	.set_rate = ccu_div_var_set_rate_fast,
 	.debug_init = ccu_div_var_debug_init
 };
 
 static const struct clk_ops ccu_div_var_nogate_ops = {
 	.recalc_rate = ccu_div_var_recalc_rate,
-	.round_rate = ccu_div_var_round_rate,
+	.determine_rate = ccu_div_var_determine_rate,
 	.set_rate = ccu_div_var_set_rate_slow,
 	.debug_init = ccu_div_var_debug_init
 };
@@ -551,7 +556,7 @@ static const struct clk_ops ccu_div_gate_ops = {
 	.disable = ccu_div_gate_disable,
 	.is_enabled = ccu_div_gate_is_enabled,
 	.recalc_rate = ccu_div_fixed_recalc_rate,
-	.round_rate = ccu_div_fixed_round_rate,
+	.determine_rate = ccu_div_fixed_determine_rate,
 	.set_rate = ccu_div_fixed_set_rate,
 	.debug_init = ccu_div_gate_debug_init
 };
@@ -565,7 +570,7 @@ static const struct clk_ops ccu_div_buf_ops = {
 
 static const struct clk_ops ccu_div_fixed_ops = {
 	.recalc_rate = ccu_div_fixed_recalc_rate,
-	.round_rate = ccu_div_fixed_round_rate,
+	.determine_rate = ccu_div_fixed_determine_rate,
 	.set_rate = ccu_div_fixed_set_rate,
 	.debug_init = ccu_div_fixed_debug_init
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 011/114] clk: baikal-t1: ccu-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (9 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 010/114] clk: baikal-t1: ccu-div: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 012/114] clk: cdce925: " Brian Masney via B4 Relay
                   ` (109 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/baikal-t1/ccu-pll.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/baikal-t1/ccu-pll.c b/drivers/clk/baikal-t1/ccu-pll.c
index 13ef28001439e37ff4c5230a82fd4a81728861cc..357269f41cdcf5772ee56fc55f1fdb3e67d823e6 100644
--- a/drivers/clk/baikal-t1/ccu-pll.c
+++ b/drivers/clk/baikal-t1/ccu-pll.c
@@ -228,14 +228,16 @@ static void ccu_pll_calc_factors(unsigned long rate, unsigned long parent_rate,
 	}
 }
 
-static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int ccu_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	unsigned long nr = 1, nf = 1, od = 1;
 
-	ccu_pll_calc_factors(rate, *parent_rate, &nr, &nf, &od);
+	ccu_pll_calc_factors(req->rate, req->best_parent_rate, &nr, &nf, &od);
 
-	return ccu_pll_calc_freq(*parent_rate, nr, nf, od);
+	req->rate = ccu_pll_calc_freq(req->best_parent_rate, nr, nf, od);
+
+	return 0;
 }
 
 /*
@@ -481,7 +483,7 @@ static const struct clk_ops ccu_pll_gate_to_set_ops = {
 	.disable = ccu_pll_disable,
 	.is_enabled = ccu_pll_is_enabled,
 	.recalc_rate = ccu_pll_recalc_rate,
-	.round_rate = ccu_pll_round_rate,
+	.determine_rate = ccu_pll_determine_rate,
 	.set_rate = ccu_pll_set_rate_norst,
 	.debug_init = ccu_pll_debug_init
 };
@@ -491,7 +493,7 @@ static const struct clk_ops ccu_pll_straight_set_ops = {
 	.disable = ccu_pll_disable,
 	.is_enabled = ccu_pll_is_enabled,
 	.recalc_rate = ccu_pll_recalc_rate,
-	.round_rate = ccu_pll_round_rate,
+	.determine_rate = ccu_pll_determine_rate,
 	.set_rate = ccu_pll_set_rate_reset,
 	.debug_init = ccu_pll_debug_init
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 012/114] clk: cdce925: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (10 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 011/114] clk: baikal-t1: ccu-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 013/114] clk: cs2000-cp: " Brian Masney via B4 Relay
                   ` (108 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-cdce925.c | 50 +++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/clk/clk-cdce925.c b/drivers/clk/clk-cdce925.c
index c51818c1af982619265306bbd418929a948a4c72..0b2ad21e6e4d34ea1297de489b2e226ff2af40c4 100644
--- a/drivers/clk/clk-cdce925.c
+++ b/drivers/clk/clk-cdce925.c
@@ -128,13 +128,15 @@ static void cdce925_pll_find_rate(unsigned long rate,
 	}
 }
 
-static long cdce925_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int cdce925_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	u16 n, m;
 
-	cdce925_pll_find_rate(rate, *parent_rate, &n, &m);
-	return (long)cdce925_pll_calculate_rate(*parent_rate, n, m);
+	cdce925_pll_find_rate(req->rate, req->best_parent_rate, &n, &m);
+	req->rate = (long)cdce925_pll_calculate_rate(req->best_parent_rate, n, m);
+
+	return 0;
 }
 
 static int cdce925_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -266,7 +268,7 @@ static const struct clk_ops cdce925_pll_ops = {
 	.prepare = cdce925_pll_prepare,
 	.unprepare = cdce925_pll_unprepare,
 	.recalc_rate = cdce925_pll_recalc_rate,
-	.round_rate = cdce925_pll_round_rate,
+	.determine_rate = cdce925_pll_determine_rate,
 	.set_rate = cdce925_pll_set_rate,
 };
 
@@ -420,20 +422,23 @@ static unsigned long cdce925_clk_best_parent_rate(
 	return rate * pdiv_best;
 }
 
-static long cdce925_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int cdce925_clk_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
-	unsigned long l_parent_rate = *parent_rate;
-	u16 divider = cdce925_calc_divider(rate, l_parent_rate);
+	unsigned long l_parent_rate = req->best_parent_rate;
+	u16 divider = cdce925_calc_divider(req->rate, l_parent_rate);
 
-	if (l_parent_rate / divider != rate) {
-		l_parent_rate = cdce925_clk_best_parent_rate(hw, rate);
-		divider = cdce925_calc_divider(rate, l_parent_rate);
-		*parent_rate = l_parent_rate;
+	if (l_parent_rate / divider != req->rate) {
+		l_parent_rate = cdce925_clk_best_parent_rate(hw, req->rate);
+		divider = cdce925_calc_divider(req->rate, l_parent_rate);
+		req->best_parent_rate = l_parent_rate;
 	}
 
 	if (divider)
-		return (long)(l_parent_rate / divider);
+		req->rate = (long)(l_parent_rate / divider);
+	else
+		req->rate = 0;
+
 	return 0;
 }
 
@@ -451,7 +456,7 @@ static const struct clk_ops cdce925_clk_ops = {
 	.prepare = cdce925_clk_prepare,
 	.unprepare = cdce925_clk_unprepare,
 	.recalc_rate = cdce925_clk_recalc_rate,
-	.round_rate = cdce925_clk_round_rate,
+	.determine_rate = cdce925_clk_determine_rate,
 	.set_rate = cdce925_clk_set_rate,
 };
 
@@ -473,14 +478,17 @@ static u16 cdce925_y1_calc_divider(unsigned long rate,
 	return (u16)divider;
 }
 
-static long cdce925_clk_y1_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int cdce925_clk_y1_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
-	unsigned long l_parent_rate = *parent_rate;
-	u16 divider = cdce925_y1_calc_divider(rate, l_parent_rate);
+	unsigned long l_parent_rate = req->best_parent_rate;
+	u16 divider = cdce925_y1_calc_divider(req->rate, l_parent_rate);
 
 	if (divider)
-		return (long)(l_parent_rate / divider);
+		req->rate = (long)(l_parent_rate / divider);
+	else
+		req->rate = 0;
+
 	return 0;
 }
 
@@ -498,7 +506,7 @@ static const struct clk_ops cdce925_clk_y1_ops = {
 	.prepare = cdce925_clk_prepare,
 	.unprepare = cdce925_clk_unprepare,
 	.recalc_rate = cdce925_clk_recalc_rate,
-	.round_rate = cdce925_clk_y1_round_rate,
+	.determine_rate = cdce925_clk_y1_determine_rate,
 	.set_rate = cdce925_clk_y1_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 013/114] clk: cs2000-cp: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (11 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 012/114] clk: cdce925: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 014/114] clk: ep93xx: " Brian Masney via B4 Relay
                   ` (107 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-cs2000-cp.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c
index 35cb93ad298a7188ada8548a9e5995676d72e49f..8800472ba63f297c94b293323770ebb97999e12e 100644
--- a/drivers/clk/clk-cs2000-cp.c
+++ b/drivers/clk/clk-cs2000-cp.c
@@ -305,15 +305,19 @@ static unsigned long cs2000_recalc_rate(struct clk_hw *hw,
 	return cs2000_ratio_to_rate(ratio, parent_rate, priv->lf_ratio);
 }
 
-static long cs2000_round_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *parent_rate)
+static int cs2000_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct cs2000_priv *priv = hw_to_priv(hw);
 	u32 ratio;
 
-	ratio = cs2000_rate_to_ratio(*parent_rate, rate, priv->lf_ratio);
+	ratio = cs2000_rate_to_ratio(req->best_parent_rate, req->rate,
+				     priv->lf_ratio);
 
-	return cs2000_ratio_to_rate(ratio, *parent_rate, priv->lf_ratio);
+	req->rate = cs2000_ratio_to_rate(ratio, req->best_parent_rate,
+					 priv->lf_ratio);
+
+	return 0;
 }
 
 static int cs2000_select_ratio_mode(struct cs2000_priv *priv,
@@ -430,7 +434,7 @@ static u8 cs2000_get_parent(struct clk_hw *hw)
 static const struct clk_ops cs2000_ops = {
 	.get_parent	= cs2000_get_parent,
 	.recalc_rate	= cs2000_recalc_rate,
-	.round_rate	= cs2000_round_rate,
+	.determine_rate = cs2000_determine_rate,
 	.set_rate	= cs2000_set_rate,
 	.prepare	= cs2000_enable,
 	.unprepare	= cs2000_disable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 014/114] clk: ep93xx: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (12 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 013/114] clk: cs2000-cp: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:50   ` Alexander Sverdlin
  2025-08-11 15:18 ` [PATCH 015/114] clk: fractional-divider: " Brian Masney via B4 Relay
                   ` (106 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-ep93xx.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-ep93xx.c b/drivers/clk/clk-ep93xx.c
index 4bd8d6ecf6a2bde26287e4e949b062a5660139e6..b081ef920e250dd99134af6845c443ee11266da8 100644
--- a/drivers/clk/clk-ep93xx.c
+++ b/drivers/clk/clk-ep93xx.c
@@ -389,23 +389,25 @@ static unsigned long ep93xx_div_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_CLOSEST(parent_rate, clk->div[index]);
 }
 
-static long ep93xx_div_round_rate(struct clk_hw *hw, unsigned long rate,
-				   unsigned long *parent_rate)
+static int ep93xx_div_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct ep93xx_clk *clk = ep93xx_clk_from(hw);
 	unsigned long best = 0, now;
 	unsigned int i;
 
 	for (i = 0; i < clk->num_div; i++) {
-		if ((rate * clk->div[i]) == *parent_rate)
-			return rate;
+		if (req->rate * clk->div[i] == req->best_parent_rate)
+			return 0;
 
-		now = DIV_ROUND_CLOSEST(*parent_rate, clk->div[i]);
-		if (!best || is_best(rate, now, best))
+		now = DIV_ROUND_CLOSEST(req->best_parent_rate, clk->div[i]);
+		if (!best || is_best(req->rate, now, best))
 			best = now;
 	}
 
-	return best;
+	req->rate = best;
+
+	return 0;
 }
 
 static int ep93xx_div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -437,7 +439,7 @@ static const struct clk_ops ep93xx_div_ops = {
 	.disable = ep93xx_clk_disable,
 	.is_enabled = ep93xx_clk_is_enabled,
 	.recalc_rate = ep93xx_div_recalc_rate,
-	.round_rate = ep93xx_div_round_rate,
+	.determine_rate = ep93xx_div_determine_rate,
 	.set_rate = ep93xx_div_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 015/114] clk: fractional-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (13 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 014/114] clk: ep93xx: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 016/114] clk: gemini: " Brian Masney via B4 Relay
                   ` (105 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-fractional-divider.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c
index da057172cc90f145743a4f7dfd71870bd63b564b..cd36a6e27f251f88c5fdf06e7de4bd8cbe332c24 100644
--- a/drivers/clk/clk-fractional-divider.c
+++ b/drivers/clk/clk-fractional-divider.c
@@ -151,25 +151,32 @@ void clk_fractional_divider_general_approximation(struct clk_hw *hw,
 }
 EXPORT_SYMBOL_GPL(clk_fractional_divider_general_approximation);
 
-static long clk_fd_round_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *parent_rate)
+static int clk_fd_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct clk_fractional_divider *fd = to_clk_fd(hw);
 	unsigned long m, n;
 	u64 ret;
 
-	if (!rate || (!clk_hw_can_set_rate_parent(hw) && rate >= *parent_rate))
-		return *parent_rate;
+	if (!req->rate || (!clk_hw_can_set_rate_parent(hw) && req->rate >= req->best_parent_rate)) {
+		req->rate = req->best_parent_rate;
+
+		return 0;
+	}
 
 	if (fd->approximation)
-		fd->approximation(hw, rate, parent_rate, &m, &n);
+		fd->approximation(hw, req->rate, &req->best_parent_rate, &m, &n);
 	else
-		clk_fractional_divider_general_approximation(hw, rate, parent_rate, &m, &n);
+		clk_fractional_divider_general_approximation(hw, req->rate,
+							     &req->best_parent_rate,
+							     &m, &n);
 
-	ret = (u64)*parent_rate * m;
+	ret = (u64)req->best_parent_rate * m;
 	do_div(ret, n);
 
-	return ret;
+	req->rate = ret;
+
+	return 0;
 }
 
 static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -250,7 +257,7 @@ static void clk_fd_debug_init(struct clk_hw *hw, struct dentry *dentry)
 
 const struct clk_ops clk_fractional_divider_ops = {
 	.recalc_rate = clk_fd_recalc_rate,
-	.round_rate = clk_fd_round_rate,
+	.determine_rate = clk_fd_determine_rate,
 	.set_rate = clk_fd_set_rate,
 #ifdef CONFIG_DEBUG_FS
 	.debug_init = clk_fd_debug_init,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 016/114] clk: gemini: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (14 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 015/114] clk: fractional-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-19  9:46   ` Linus Walleij
  2025-08-11 15:18 ` [PATCH 017/114] clk: highbank: " Brian Masney via B4 Relay
                   ` (104 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-gemini.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c
index 856b008e07c6b7e967b01c4ef43af838f7f18fe2..e94589c385688e0c48e047b2fde87304b0a1150f 100644
--- a/drivers/clk/clk-gemini.c
+++ b/drivers/clk/clk-gemini.c
@@ -126,13 +126,16 @@ static unsigned long gemini_pci_recalc_rate(struct clk_hw *hw,
 	return 33000000;
 }
 
-static long gemini_pci_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
+static int gemini_pci_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	/* We support 33 and 66 MHz */
-	if (rate < 48000000)
-		return 33000000;
-	return 66000000;
+	if (req->rate < 48000000)
+		req->rate = 33000000;
+	else
+		req->rate = 66000000;
+
+	return 0;
 }
 
 static int gemini_pci_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -179,7 +182,7 @@ static int gemini_pci_is_enabled(struct clk_hw *hw)
 
 static const struct clk_ops gemini_pci_clk_ops = {
 	.recalc_rate = gemini_pci_recalc_rate,
-	.round_rate = gemini_pci_round_rate,
+	.determine_rate = gemini_pci_determine_rate,
 	.set_rate = gemini_pci_set_rate,
 	.enable = gemini_pci_enable,
 	.disable = gemini_pci_disable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 017/114] clk: highbank: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (15 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 016/114] clk: gemini: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 018/114] clk: hisilicon: clkdivider-hi6220: " Brian Masney via B4 Relay
                   ` (103 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-highbank.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-highbank.c b/drivers/clk/clk-highbank.c
index 6e68a41a70a1b7160359c98138de76fb30535e68..cc583934ecf2481f481f470a185afb1fc6064760 100644
--- a/drivers/clk/clk-highbank.c
+++ b/drivers/clk/clk-highbank.c
@@ -130,15 +130,17 @@ static void clk_pll_calc(unsigned long rate, unsigned long ref_freq,
 	*pdivf = divf;
 }
 
-static long clk_pll_round_rate(struct clk_hw *hwclk, unsigned long rate,
-			       unsigned long *parent_rate)
+static int clk_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	u32 divq, divf;
-	unsigned long ref_freq = *parent_rate;
+	unsigned long ref_freq = req->best_parent_rate;
 
-	clk_pll_calc(rate, ref_freq, &divq, &divf);
+	clk_pll_calc(req->rate, ref_freq, &divq, &divf);
 
-	return (ref_freq * (divf + 1)) / (1 << divq);
+	req->rate = (ref_freq * (divf + 1)) / (1 << divq);
+
+	return 0;
 }
 
 static int clk_pll_set_rate(struct clk_hw *hwclk, unsigned long rate,
@@ -185,7 +187,7 @@ static const struct clk_ops clk_pll_ops = {
 	.enable = clk_pll_enable,
 	.disable = clk_pll_disable,
 	.recalc_rate = clk_pll_recalc_rate,
-	.round_rate = clk_pll_round_rate,
+	.determine_rate = clk_pll_determine_rate,
 	.set_rate = clk_pll_set_rate,
 };
 
@@ -227,16 +229,18 @@ static unsigned long clk_periclk_recalc_rate(struct clk_hw *hwclk,
 	return parent_rate / div;
 }
 
-static long clk_periclk_round_rate(struct clk_hw *hwclk, unsigned long rate,
-				   unsigned long *parent_rate)
+static int clk_periclk_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	u32 div;
 
-	div = *parent_rate / rate;
+	div = req->best_parent_rate / req->rate;
 	div++;
 	div &= ~0x1;
 
-	return *parent_rate / div;
+	req->rate = req->best_parent_rate / div;
+
+	return 0;
 }
 
 static int clk_periclk_set_rate(struct clk_hw *hwclk, unsigned long rate,
@@ -255,7 +259,7 @@ static int clk_periclk_set_rate(struct clk_hw *hwclk, unsigned long rate,
 
 static const struct clk_ops periclk_ops = {
 	.recalc_rate = clk_periclk_recalc_rate,
-	.round_rate = clk_periclk_round_rate,
+	.determine_rate = clk_periclk_determine_rate,
 	.set_rate = clk_periclk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 018/114] clk: hisilicon: clkdivider-hi6220: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (16 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 017/114] clk: highbank: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 019/114] clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB() Brian Masney via B4 Relay
                   ` (102 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/hisilicon/clkdivider-hi6220.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/hisilicon/clkdivider-hi6220.c b/drivers/clk/hisilicon/clkdivider-hi6220.c
index 5348bafe694f0dacf30a59af92606c56efdb443b..6bae18a84cb6c0e19dd00762613fd9051849fdd0 100644
--- a/drivers/clk/hisilicon/clkdivider-hi6220.c
+++ b/drivers/clk/hisilicon/clkdivider-hi6220.c
@@ -55,13 +55,15 @@ static unsigned long hi6220_clkdiv_recalc_rate(struct clk_hw *hw,
 				   CLK_DIVIDER_ROUND_CLOSEST, dclk->width);
 }
 
-static long hi6220_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *prate)
+static int hi6220_clkdiv_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct hi6220_clk_divider *dclk = to_hi6220_clk_divider(hw);
 
-	return divider_round_rate(hw, rate, prate, dclk->table,
-				  dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, dclk->table,
+				       dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
+
+	return 0;
 }
 
 static int hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -93,7 +95,7 @@ static int hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops hi6220_clkdiv_ops = {
 	.recalc_rate = hi6220_clkdiv_recalc_rate,
-	.round_rate = hi6220_clkdiv_round_rate,
+	.determine_rate = hi6220_clkdiv_determine_rate,
 	.set_rate = hi6220_clkdiv_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 019/114] clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (17 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 018/114] clk: hisilicon: clkdivider-hi6220: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 020/114] clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (101 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

When trying to use Coccinelle to make changes inside drivers/clk/, it
really does not like the trailing comma at the end of the declaration
of DEFINE_CLK_STUB, and fails to process this file. It also looks weird
to not have commas to separate the various array members of
hi3660_stub_clks. Let's move the trailing comma out of the define so
that Coccinelle can be ran against this source file.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/hisilicon/clk-hi3660-stub.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi3660-stub.c b/drivers/clk/hisilicon/clk-hi3660-stub.c
index 3a653d54bee0562d26d0de1dd31525786d05d40d..b0a996385301af7bcce231be9e7d5092dd21c3ac 100644
--- a/drivers/clk/hisilicon/clk-hi3660-stub.c
+++ b/drivers/clk/hisilicon/clk-hi3660-stub.c
@@ -34,7 +34,7 @@
 			.num_parents = 0,			\
 			.flags = CLK_GET_RATE_NOCACHE,		\
 		},						\
-	},
+	}
 
 #define to_stub_clk(_hw) container_of(_hw, struct hi3660_stub_clk, hw)
 
@@ -102,10 +102,10 @@ static const struct clk_ops hi3660_stub_clk_ops = {
 };
 
 static struct hi3660_stub_clk hi3660_stub_clks[HI3660_CLK_STUB_NUM] = {
-	DEFINE_CLK_STUB(HI3660_CLK_STUB_CLUSTER0, 0x0001030A, "cpu-cluster.0")
-	DEFINE_CLK_STUB(HI3660_CLK_STUB_CLUSTER1, 0x0002030A, "cpu-cluster.1")
-	DEFINE_CLK_STUB(HI3660_CLK_STUB_GPU, 0x0003030A, "clk-g3d")
-	DEFINE_CLK_STUB(HI3660_CLK_STUB_DDR, 0x00040309, "clk-ddrc")
+	DEFINE_CLK_STUB(HI3660_CLK_STUB_CLUSTER0, 0x0001030A, "cpu-cluster.0"),
+	DEFINE_CLK_STUB(HI3660_CLK_STUB_CLUSTER1, 0x0002030A, "cpu-cluster.1"),
+	DEFINE_CLK_STUB(HI3660_CLK_STUB_GPU, 0x0003030A, "clk-g3d"),
+	DEFINE_CLK_STUB(HI3660_CLK_STUB_DDR, 0x00040309, "clk-ddrc"),
 };
 
 static struct clk_hw *hi3660_stub_clk_hw_get(struct of_phandle_args *clkspec,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 020/114] clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (18 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 019/114] clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB() Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 021/114] clk: hisilicon: hi6220-stub: " Brian Masney via B4 Relay
                   ` (100 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/hisilicon/clk-hi3660-stub.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi3660-stub.c b/drivers/clk/hisilicon/clk-hi3660-stub.c
index b0a996385301af7bcce231be9e7d5092dd21c3ac..7c8b00ee60195e94f3b414bbf79ee5ec3cbf6c79 100644
--- a/drivers/clk/hisilicon/clk-hi3660-stub.c
+++ b/drivers/clk/hisilicon/clk-hi3660-stub.c
@@ -67,14 +67,14 @@ static unsigned long hi3660_stub_clk_recalc_rate(struct clk_hw *hw,
 	return stub_clk->rate;
 }
 
-static long hi3660_stub_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				       unsigned long *prate)
+static int hi3660_stub_clk_determine_rate(struct clk_hw *hw,
+					  struct clk_rate_request *req)
 {
 	/*
 	 * LPM3 handles rate rounding so just return whatever
 	 * rate is requested.
 	 */
-	return rate;
+	return 0;
 }
 
 static int hi3660_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -97,7 +97,7 @@ static int hi3660_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops hi3660_stub_clk_ops = {
 	.recalc_rate    = hi3660_stub_clk_recalc_rate,
-	.round_rate     = hi3660_stub_clk_round_rate,
+	.determine_rate = hi3660_stub_clk_determine_rate,
 	.set_rate       = hi3660_stub_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 021/114] clk: hisilicon: hi6220-stub: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (19 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 020/114] clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 022/114] clk: ingenic: cgu: " Brian Masney via B4 Relay
                   ` (99 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/hisilicon/clk-hi6220-stub.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi6220-stub.c b/drivers/clk/hisilicon/clk-hi6220-stub.c
index a8319795ed1cc349a53ce977881620a11ec650ed..bf99cfafafa0133d64f3fbb09f14242fbabac3a1 100644
--- a/drivers/clk/hisilicon/clk-hi6220-stub.c
+++ b/drivers/clk/hisilicon/clk-hi6220-stub.c
@@ -161,11 +161,11 @@ static int hi6220_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	return ret;
 }
 
-static long hi6220_stub_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int hi6220_stub_clk_determine_rate(struct clk_hw *hw,
+					  struct clk_rate_request *req)
 {
 	struct hi6220_stub_clk *stub_clk = to_stub_clk(hw);
-	unsigned long new_rate = rate / 1000;  /* kHz */
+	unsigned long new_rate = req->rate / 1000;  /* kHz */
 
 	switch (stub_clk->id) {
 	case HI6220_STUB_ACPU0:
@@ -181,12 +181,14 @@ static long hi6220_stub_clk_round_rate(struct clk_hw *hw, unsigned long rate,
 		break;
 	}
 
-	return new_rate;
+	req->rate = new_rate;
+
+	return 0;
 }
 
 static const struct clk_ops hi6220_stub_clk_ops = {
 	.recalc_rate	= hi6220_stub_clk_recalc_rate,
-	.round_rate	= hi6220_stub_clk_round_rate,
+	.determine_rate = hi6220_stub_clk_determine_rate,
 	.set_rate	= hi6220_stub_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 022/114] clk: ingenic: cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (20 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 021/114] clk: hisilicon: hi6220-stub: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-09-03 19:18   ` Paul Cercueil
  2025-08-11 15:18 ` [PATCH 023/114] clk: ingenic: jz4780-cgu: " Brian Masney via B4 Relay
                   ` (98 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/ingenic/cgu.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c
index 0c9c8344ad1103b13337a26e14b0d5d5c340d705..91e7ac0cc3342e3552acb9d2ec00865a5234ad4f 100644
--- a/drivers/clk/ingenic/cgu.c
+++ b/drivers/clk/ingenic/cgu.c
@@ -174,14 +174,16 @@ ingenic_pll_calc(const struct ingenic_cgu_clk_info *clk_info,
 		n * od);
 }
 
-static long
-ingenic_pll_round_rate(struct clk_hw *hw, unsigned long req_rate,
-		       unsigned long *prate)
+static int ingenic_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
 	const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
 
-	return ingenic_pll_calc(clk_info, req_rate, *prate, NULL, NULL, NULL);
+	req->rate = ingenic_pll_calc(clk_info, req->rate, req->best_parent_rate,
+				     NULL, NULL, NULL);
+
+	return 0;
 }
 
 static inline int ingenic_pll_check_stable(struct ingenic_cgu *cgu,
@@ -317,7 +319,7 @@ static int ingenic_pll_is_enabled(struct clk_hw *hw)
 
 static const struct clk_ops ingenic_pll_ops = {
 	.recalc_rate = ingenic_pll_recalc_rate,
-	.round_rate = ingenic_pll_round_rate,
+	.determine_rate = ingenic_pll_determine_rate,
 	.set_rate = ingenic_pll_set_rate,
 
 	.enable = ingenic_pll_enable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 023/114] clk: ingenic: jz4780-cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (21 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 022/114] clk: ingenic: cgu: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 024/114] clk: ingenic: x1000-cgu: " Brian Masney via B4 Relay
                   ` (97 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/ingenic/jz4780-cgu.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-cgu.c
index b1dadc0a5e7556a8570286344818c2d1157bf9e8..07e2f3c5c4549e28726b2dccd5f465f56aa9e694 100644
--- a/drivers/clk/ingenic/jz4780-cgu.c
+++ b/drivers/clk/ingenic/jz4780-cgu.c
@@ -128,19 +128,19 @@ static unsigned long jz4780_otg_phy_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long jz4780_otg_phy_round_rate(struct clk_hw *hw, unsigned long req_rate,
-				      unsigned long *parent_rate)
+static int jz4780_otg_phy_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
-	if (req_rate < 15600000)
-		return 12000000;
-
-	if (req_rate < 21600000)
-		return 19200000;
+	if (req->rate < 15600000)
+		req->rate = 12000000;
+	else if (req->rate < 21600000)
+		req->rate = 19200000;
+	else if (req->rate < 36000000)
+		req->rate = 24000000;
+	else
+		req->rate = 48000000;
 
-	if (req_rate < 36000000)
-		return 24000000;
-
-	return 48000000;
+	return 0;
 }
 
 static int jz4780_otg_phy_set_rate(struct clk_hw *hw, unsigned long req_rate,
@@ -212,7 +212,7 @@ static int jz4780_otg_phy_is_enabled(struct clk_hw *hw)
 
 static const struct clk_ops jz4780_otg_phy_ops = {
 	.recalc_rate = jz4780_otg_phy_recalc_rate,
-	.round_rate = jz4780_otg_phy_round_rate,
+	.determine_rate = jz4780_otg_phy_determine_rate,
 	.set_rate = jz4780_otg_phy_set_rate,
 
 	.enable		= jz4780_otg_phy_enable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 024/114] clk: ingenic: x1000-cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (22 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 023/114] clk: ingenic: jz4780-cgu: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-09-03 19:20   ` Paul Cercueil
  2025-08-11 15:18 ` [PATCH 025/114] clk: lmk04832: " Brian Masney via B4 Relay
                   ` (96 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/ingenic/x1000-cgu.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/ingenic/x1000-cgu.c b/drivers/clk/ingenic/x1000-cgu.c
index feb03eed4fe8c8f617ef98254a522d72d452ac17..d80886caf393309a0c908c06fb5aa8b59aced127 100644
--- a/drivers/clk/ingenic/x1000-cgu.c
+++ b/drivers/clk/ingenic/x1000-cgu.c
@@ -84,16 +84,17 @@ static unsigned long x1000_otg_phy_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long x1000_otg_phy_round_rate(struct clk_hw *hw, unsigned long req_rate,
-				      unsigned long *parent_rate)
+static int x1000_otg_phy_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
-	if (req_rate < 18000000)
-		return 12000000;
-
-	if (req_rate < 36000000)
-		return 24000000;
+	if (req->rate < 18000000)
+		req->rate = 12000000;
+	else if (req->rate < 36000000)
+		req->rate = 24000000;
+	else
+		req->rate = 48000000;
 
-	return 48000000;
+	return 0;
 }
 
 static int x1000_otg_phy_set_rate(struct clk_hw *hw, unsigned long req_rate,
@@ -161,7 +162,7 @@ static int x1000_usb_phy_is_enabled(struct clk_hw *hw)
 
 static const struct clk_ops x1000_otg_phy_ops = {
 	.recalc_rate = x1000_otg_phy_recalc_rate,
-	.round_rate = x1000_otg_phy_round_rate,
+	.determine_rate = x1000_otg_phy_determine_rate,
 	.set_rate = x1000_otg_phy_set_rate,
 
 	.enable		= x1000_usb_phy_enable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 025/114] clk: lmk04832: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (23 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 024/114] clk: ingenic: x1000-cgu: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 026/114] clk: loongson1: " Brian Masney via B4 Relay
                   ` (95 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-lmk04832.c | 53 +++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 22 deletions(-)

diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index 2bcf422f0b04e6789993849b1d80123872978418..b2107b31efa28ee93e83639d220a8bcaaeab49e4 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -491,28 +491,33 @@ static long lmk04832_calc_pll2_params(unsigned long prate, unsigned long rate,
 	return DIV_ROUND_CLOSEST(prate * 2 * pll2_p * pll2_n, pll2_r);
 }
 
-static long lmk04832_vco_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int lmk04832_vco_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct lmk04832 *lmk = container_of(hw, struct lmk04832, vco);
 	unsigned int n, p, r;
 	long vco_rate;
 	int ret;
 
-	ret = lmk04832_check_vco_ranges(lmk, rate);
+	ret = lmk04832_check_vco_ranges(lmk, req->rate);
 	if (ret < 0)
 		return ret;
 
-	vco_rate = lmk04832_calc_pll2_params(*prate, rate, &n, &p, &r);
+	vco_rate = lmk04832_calc_pll2_params(req->best_parent_rate, req->rate,
+					     &n, &p, &r);
 	if (vco_rate < 0) {
 		dev_err(lmk->dev, "PLL2 parameters out of range\n");
-		return vco_rate;
+		req->rate = vco_rate;
+
+		return 0;
 	}
 
-	if (rate != vco_rate)
+	if (req->rate != vco_rate)
 		return -EINVAL;
 
-	return vco_rate;
+	req->rate = vco_rate;
+
+	return 0;
 }
 
 static int lmk04832_vco_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -579,7 +584,7 @@ static const struct clk_ops lmk04832_vco_ops = {
 	.prepare = lmk04832_vco_prepare,
 	.unprepare = lmk04832_vco_unprepare,
 	.recalc_rate = lmk04832_vco_recalc_rate,
-	.round_rate = lmk04832_vco_round_rate,
+	.determine_rate = lmk04832_vco_determine_rate,
 	.set_rate = lmk04832_vco_set_rate,
 };
 
@@ -888,25 +893,27 @@ static unsigned long lmk04832_sclk_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_CLOSEST(prate, sysref_div);
 }
 
-static long lmk04832_sclk_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *prate)
+static int lmk04832_sclk_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct lmk04832 *lmk = container_of(hw, struct lmk04832, sclk);
 	unsigned long sclk_rate;
 	unsigned int sysref_div;
 
-	sysref_div = DIV_ROUND_CLOSEST(*prate, rate);
-	sclk_rate = DIV_ROUND_CLOSEST(*prate, sysref_div);
+	sysref_div = DIV_ROUND_CLOSEST(req->best_parent_rate, req->rate);
+	sclk_rate = DIV_ROUND_CLOSEST(req->best_parent_rate, sysref_div);
 
 	if (sysref_div < 0x07 || sysref_div > 0x1fff) {
 		dev_err(lmk->dev, "SYSREF divider out of range\n");
 		return -EINVAL;
 	}
 
-	if (rate != sclk_rate)
+	if (req->rate != sclk_rate)
 		return -EINVAL;
 
-	return sclk_rate;
+	req->rate = sclk_rate;
+
+	return 0;
 }
 
 static int lmk04832_sclk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -945,7 +952,7 @@ static const struct clk_ops lmk04832_sclk_ops = {
 	.prepare = lmk04832_sclk_prepare,
 	.unprepare = lmk04832_sclk_unprepare,
 	.recalc_rate = lmk04832_sclk_recalc_rate,
-	.round_rate = lmk04832_sclk_round_rate,
+	.determine_rate = lmk04832_sclk_determine_rate,
 	.set_rate = lmk04832_sclk_set_rate,
 };
 
@@ -1069,26 +1076,28 @@ static unsigned long lmk04832_dclk_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long lmk04832_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *prate)
+static int lmk04832_dclk_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct lmk_dclk *dclk = container_of(hw, struct lmk_dclk, hw);
 	struct lmk04832 *lmk = dclk->lmk;
 	unsigned long dclk_rate;
 	unsigned int dclk_div;
 
-	dclk_div = DIV_ROUND_CLOSEST(*prate, rate);
-	dclk_rate = DIV_ROUND_CLOSEST(*prate, dclk_div);
+	dclk_div = DIV_ROUND_CLOSEST(req->best_parent_rate, req->rate);
+	dclk_rate = DIV_ROUND_CLOSEST(req->best_parent_rate, dclk_div);
 
 	if (dclk_div < 1 || dclk_div > 0x3ff) {
 		dev_err(lmk->dev, "%s_div out of range\n", clk_hw_get_name(hw));
 		return -EINVAL;
 	}
 
-	if (rate != dclk_rate)
+	if (req->rate != dclk_rate)
 		return -EINVAL;
 
-	return dclk_rate;
+	req->rate = dclk_rate;
+
+	return 0;
 }
 
 static int lmk04832_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -1158,7 +1167,7 @@ static const struct clk_ops lmk04832_dclk_ops = {
 	.prepare = lmk04832_dclk_prepare,
 	.unprepare = lmk04832_dclk_unprepare,
 	.recalc_rate = lmk04832_dclk_recalc_rate,
-	.round_rate = lmk04832_dclk_round_rate,
+	.determine_rate = lmk04832_dclk_determine_rate,
 	.set_rate = lmk04832_dclk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 026/114] clk: loongson1: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (24 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 025/114] clk: lmk04832: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 027/114] clk: max9485: " Brian Masney via B4 Relay
                   ` (94 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-loongson1.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-loongson1.c b/drivers/clk/clk-loongson1.c
index a3467aa6790f36e3f5eaf84853b4710804c6c11a..f9f060d08a5fae3291a9408c6dc93531b435609f 100644
--- a/drivers/clk/clk-loongson1.c
+++ b/drivers/clk/clk-loongson1.c
@@ -93,14 +93,16 @@ static unsigned long ls1x_divider_recalc_rate(struct clk_hw *hw,
 				   d->flags, d->width);
 }
 
-static long ls1x_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int ls1x_divider_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct ls1x_clk *ls1x_clk = to_ls1x_clk(hw);
 	const struct ls1x_clk_div_data *d = ls1x_clk->data;
 
-	return divider_round_rate(hw, rate, prate, d->table,
-				  d->width, d->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       d->table, d->width, d->flags);
+
+	return 0;
 }
 
 static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -146,7 +148,7 @@ static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops ls1x_clk_divider_ops = {
 	.recalc_rate = ls1x_divider_recalc_rate,
-	.round_rate = ls1x_divider_round_rate,
+	.determine_rate = ls1x_divider_determine_rate,
 	.set_rate = ls1x_divider_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 027/114] clk: max9485: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (25 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 026/114] clk: loongson1: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 028/114] clk: milbeaut: " Brian Masney via B4 Relay
                   ` (93 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-max9485.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/clk-max9485.c b/drivers/clk/clk-max9485.c
index be9020b6c789642e6d63065aa905088e01929147..0515e3e41162e38fb31809e7cb3116257204f2c0 100644
--- a/drivers/clk/clk-max9485.c
+++ b/drivers/clk/clk-max9485.c
@@ -159,29 +159,32 @@ static unsigned long max9485_clkout_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long max9485_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
-				      unsigned long *parent_rate)
+static int max9485_clkout_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	const struct max9485_rate *curr, *prev = NULL;
 
 	for (curr = max9485_rates; curr->out != 0; curr++) {
 		/* Exact matches */
-		if (curr->out == rate)
-			return rate;
+		if (curr->out == req->rate)
+			return 0;
 
 		/*
 		 * Find the first entry that has a frequency higher than the
 		 * requested one.
 		 */
-		if (curr->out > rate) {
+		if (curr->out > req->rate) {
 			unsigned int mid;
 
 			/*
 			 * If this is the first entry, clamp the value to the
 			 * lowest possible frequency.
 			 */
-			if (!prev)
-				return curr->out;
+			if (!prev) {
+				req->rate = curr->out;
+
+				return 0;
+			}
 
 			/*
 			 * Otherwise, determine whether the previous entry or
@@ -189,14 +192,18 @@ static long max9485_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
 			 */
 			mid = prev->out + ((curr->out - prev->out) / 2);
 
-			return (mid > rate) ? prev->out : curr->out;
+			req->rate = mid > req->rate ? prev->out : curr->out;
+
+			return 0;
 		}
 
 		prev = curr;
 	}
 
 	/* If the last entry was still too high, clamp the value */
-	return prev->out;
+	req->rate = prev->out;
+
+	return 0;
 }
 
 struct max9485_clk {
@@ -221,7 +228,7 @@ static const struct max9485_clk max9485_clks[MAX9485_NUM_CLKS] = {
 		.parent_index = -1,
 		.ops = {
 			.set_rate	= max9485_clkout_set_rate,
-			.round_rate	= max9485_clkout_round_rate,
+			.determine_rate = max9485_clkout_determine_rate,
 			.recalc_rate	= max9485_clkout_recalc_rate,
 		},
 	},

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 028/114] clk: milbeaut: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (26 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 027/114] clk: max9485: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 029/114] clk: mmp: audio: " Brian Masney via B4 Relay
                   ` (92 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-milbeaut.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-milbeaut.c b/drivers/clk/clk-milbeaut.c
index 18c20aff45f7698ac40451ef8000ec4fc4efc96b..b4f9b7143eaa658a7f2a14ff3cc9d91d8aa071c6 100644
--- a/drivers/clk/clk-milbeaut.c
+++ b/drivers/clk/clk-milbeaut.c
@@ -386,8 +386,8 @@ static unsigned long m10v_clk_divider_recalc_rate(struct clk_hw *hw,
 				   divider->flags, divider->width);
 }
 
-static long m10v_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int m10v_clk_divider_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct m10v_clk_divider *divider = to_m10v_div(hw);
 
@@ -398,13 +398,19 @@ static long m10v_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
 		val = readl(divider->reg) >> divider->shift;
 		val &= clk_div_mask(divider->width);
 
-		return divider_ro_round_rate(hw, rate, prate, divider->table,
-					     divider->width, divider->flags,
-					     val);
+		req->rate = divider_ro_round_rate(hw, req->rate,
+						  &req->best_parent_rate,
+						  divider->table,
+						  divider->width,
+						  divider->flags, val);
+
+		return 0;
 	}
 
-	return divider_round_rate(hw, rate, prate, divider->table,
-				  divider->width, divider->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       divider->table, divider->width, divider->flags);
+
+	return 0;
 }
 
 static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -450,7 +456,7 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops m10v_clk_divider_ops = {
 	.recalc_rate = m10v_clk_divider_recalc_rate,
-	.round_rate = m10v_clk_divider_round_rate,
+	.determine_rate = m10v_clk_divider_determine_rate,
 	.set_rate = m10v_clk_divider_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 029/114] clk: mmp: audio: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (27 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 028/114] clk: milbeaut: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 030/114] clk: mmp: frac: " Brian Masney via B4 Relay
                   ` (91 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mmp/clk-audio.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/mmp/clk-audio.c b/drivers/clk/mmp/clk-audio.c
index 88d798d510cdbe950a61a0bbb312dc546a6853fb..ed27fc796c941d8cf5b3297573db84a7830b7e4f 100644
--- a/drivers/clk/mmp/clk-audio.c
+++ b/drivers/clk/mmp/clk-audio.c
@@ -164,23 +164,23 @@ static unsigned long audio_pll_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long audio_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *parent_rate)
+static int audio_pll_determine_rate(struct clk_hw *hw,
+				    struct clk_rate_request *req)
 {
 	unsigned int prediv;
 	unsigned int postdiv;
 	long rounded = 0;
 
 	for (prediv = 0; prediv < ARRAY_SIZE(predivs); prediv++) {
-		if (predivs[prediv].parent_rate != *parent_rate)
+		if (predivs[prediv].parent_rate != req->best_parent_rate)
 			continue;
 		for (postdiv = 0; postdiv < ARRAY_SIZE(postdivs); postdiv++) {
 			long freq = predivs[prediv].freq_vco;
 
 			freq /= postdivs[postdiv].divisor;
-			if (freq == rate)
-				return rate;
-			if (freq < rate)
+			if (freq == req->rate)
+				return 0;
+			if (freq < req->rate)
 				continue;
 			if (rounded && freq > rounded)
 				continue;
@@ -188,7 +188,9 @@ static long audio_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 		}
 	}
 
-	return rounded;
+	req->rate = rounded;
+
+	return 0;
 }
 
 static int audio_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -228,7 +230,7 @@ static int audio_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops audio_pll_ops = {
 	.recalc_rate = audio_pll_recalc_rate,
-	.round_rate = audio_pll_round_rate,
+	.determine_rate = audio_pll_determine_rate,
 	.set_rate = audio_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 030/114] clk: mmp: frac: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (28 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 029/114] clk: mmp: audio: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 031/114] clk: multiplier: " Brian Masney via B4 Relay
                   ` (90 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mmp/clk-frac.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c
index 6556f6ada2e830178b9525462f684bad683db454..0b1bb01346f0d7b450e85b805f6c84da6f803f56 100644
--- a/drivers/clk/mmp/clk-frac.c
+++ b/drivers/clk/mmp/clk-frac.c
@@ -21,8 +21,8 @@
 
 #define to_clk_factor(hw) container_of(hw, struct mmp_clk_factor, hw)
 
-static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
-		unsigned long *prate)
+static int clk_factor_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct mmp_clk_factor *factor = to_clk_factor(hw);
 	u64 rate = 0, prev_rate;
@@ -33,19 +33,20 @@ static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
 		d = &factor->ftbl[i];
 
 		prev_rate = rate;
-		rate = (u64)(*prate) * d->denominator;
+		rate = (u64)(req->best_parent_rate) * d->denominator;
 		do_div(rate, d->numerator * factor->masks->factor);
-		if (rate > drate)
+		if (rate > req->rate)
 			break;
 	}
-	if ((i == 0) || (i == factor->ftbl_cnt)) {
-		return rate;
-	} else {
-		if ((drate - prev_rate) > (rate - drate))
-			return rate;
-		else
-			return prev_rate;
-	}
+
+	if ((i == 0) || (i == factor->ftbl_cnt))
+		req->rate = rate;
+	else if ((req->rate - prev_rate) > (rate - req->rate))
+		req->rate = rate;
+	else
+		req->rate = prev_rate;
+
+	return 0;
 }
 
 static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
@@ -160,7 +161,7 @@ static int clk_factor_init(struct clk_hw *hw)
 
 static const struct clk_ops clk_factor_ops = {
 	.recalc_rate = clk_factor_recalc_rate,
-	.round_rate = clk_factor_round_rate,
+	.determine_rate = clk_factor_determine_rate,
 	.set_rate = clk_factor_set_rate,
 	.init = clk_factor_init,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 031/114] clk: multiplier: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (29 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 030/114] clk: mmp: frac: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 032/114] clk: mxs: div: " Brian Masney via B4 Relay
                   ` (89 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-multiplier.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-multiplier.c b/drivers/clk/clk-multiplier.c
index e507aa958da91683ec83837df28fc48be4b7bafa..6f2955d408b651d5c0b943f7c14f83a2974df3e7 100644
--- a/drivers/clk/clk-multiplier.c
+++ b/drivers/clk/clk-multiplier.c
@@ -112,14 +112,16 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
 	return bestmult;
 }
 
-static long clk_multiplier_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *parent_rate)
+static int clk_multiplier_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct clk_multiplier *mult = to_clk_multiplier(hw);
-	unsigned long factor = __bestmult(hw, rate, parent_rate,
+	unsigned long factor = __bestmult(hw, req->rate, &req->best_parent_rate,
 					  mult->width, mult->flags);
 
-	return *parent_rate * factor;
+	req->rate = req->best_parent_rate * factor;
+
+	return 0;
 }
 
 static int clk_multiplier_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -150,7 +152,7 @@ static int clk_multiplier_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops clk_multiplier_ops = {
 	.recalc_rate	= clk_multiplier_recalc_rate,
-	.round_rate	= clk_multiplier_round_rate,
+	.determine_rate = clk_multiplier_determine_rate,
 	.set_rate	= clk_multiplier_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_multiplier_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 032/114] clk: mxs: div: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (30 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 031/114] clk: multiplier: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 033/114] clk: mxs: frac: " Brian Masney via B4 Relay
                   ` (88 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

The change to call div->ops->determine_rate() instead of
div->ops->round_rate() was done by hand.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mxs/clk-div.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/mxs/clk-div.c b/drivers/clk/mxs/clk-div.c
index 0a78ef380646690938c352796fad8a13b086267a..8afe1a9c15524e02937e80de9d80bc367608a867 100644
--- a/drivers/clk/mxs/clk-div.c
+++ b/drivers/clk/mxs/clk-div.c
@@ -40,12 +40,12 @@ static unsigned long clk_div_recalc_rate(struct clk_hw *hw,
 	return div->ops->recalc_rate(&div->divider.hw, parent_rate);
 }
 
-static long clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *prate)
+static int clk_div_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct clk_div *div = to_clk_div(hw);
 
-	return div->ops->round_rate(&div->divider.hw, rate, prate);
+	return div->ops->determine_rate(&div->divider.hw, req);
 }
 
 static int clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -63,7 +63,7 @@ static int clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops clk_div_ops = {
 	.recalc_rate = clk_div_recalc_rate,
-	.round_rate = clk_div_round_rate,
+	.determine_rate = clk_div_determine_rate,
 	.set_rate = clk_div_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 033/114] clk: mxs: frac: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (31 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 032/114] clk: mxs: div: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 034/114] clk: mxs: ref: " Brian Masney via B4 Relay
                   ` (87 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mxs/clk-frac.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/mxs/clk-frac.c b/drivers/clk/mxs/clk-frac.c
index bba0d840dd76c78c1eb88f4f30a9c431a40522c4..73f514fb84ffb9a680bab2711d16b282b71bf7b6 100644
--- a/drivers/clk/mxs/clk-frac.c
+++ b/drivers/clk/mxs/clk-frac.c
@@ -44,18 +44,18 @@ static unsigned long clk_frac_recalc_rate(struct clk_hw *hw,
 	return tmp_rate >> frac->width;
 }
 
-static long clk_frac_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int clk_frac_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct clk_frac *frac = to_clk_frac(hw);
-	unsigned long parent_rate = *prate;
+	unsigned long parent_rate = req->best_parent_rate;
 	u32 div;
 	u64 tmp, tmp_rate, result;
 
-	if (rate > parent_rate)
+	if (req->rate > parent_rate)
 		return -EINVAL;
 
-	tmp = rate;
+	tmp = req->rate;
 	tmp <<= frac->width;
 	do_div(tmp, parent_rate);
 	div = tmp;
@@ -67,7 +67,9 @@ static long clk_frac_round_rate(struct clk_hw *hw, unsigned long rate,
 	result = tmp_rate >> frac->width;
 	if ((result << frac->width) < tmp_rate)
 		result += 1;
-	return result;
+	req->rate = result;
+
+	return 0;
 }
 
 static int clk_frac_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -103,7 +105,7 @@ static int clk_frac_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops clk_frac_ops = {
 	.recalc_rate = clk_frac_recalc_rate,
-	.round_rate = clk_frac_round_rate,
+	.determine_rate = clk_frac_determine_rate,
 	.set_rate = clk_frac_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 034/114] clk: mxs: ref: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (32 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 033/114] clk: mxs: frac: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 035/114] clk: nuvoton: ma35d1-divider: " Brian Masney via B4 Relay
                   ` (86 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mxs/clk-ref.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/mxs/clk-ref.c b/drivers/clk/mxs/clk-ref.c
index 2297259da89ab0bce2a00536a00e1c7aa7a9729d..a99ee4cd2ece008e87bf659dec959ae51242ba72 100644
--- a/drivers/clk/mxs/clk-ref.c
+++ b/drivers/clk/mxs/clk-ref.c
@@ -57,22 +57,24 @@ static unsigned long clk_ref_recalc_rate(struct clk_hw *hw,
 	return tmp;
 }
 
-static long clk_ref_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *prate)
+static int clk_ref_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
-	unsigned long parent_rate = *prate;
+	unsigned long parent_rate = req->best_parent_rate;
 	u64 tmp = parent_rate;
 	u8 frac;
 
-	tmp = tmp * 18 + rate / 2;
-	do_div(tmp, rate);
+	tmp = tmp * 18 + req->rate / 2;
+	do_div(tmp, req->rate);
 	frac = clamp(tmp, 18, 35);
 
 	tmp = parent_rate;
 	tmp *= 18;
 	do_div(tmp, frac);
 
-	return tmp;
+	req->rate = tmp;
+
+	return 0;
 }
 
 static int clk_ref_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -104,7 +106,7 @@ static const struct clk_ops clk_ref_ops = {
 	.enable		= clk_ref_enable,
 	.disable	= clk_ref_disable,
 	.recalc_rate	= clk_ref_recalc_rate,
-	.round_rate	= clk_ref_round_rate,
+	.determine_rate = clk_ref_determine_rate,
 	.set_rate	= clk_ref_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 035/114] clk: nuvoton: ma35d1-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (33 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 034/114] clk: mxs: ref: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 036/114] clk: nuvoton: ma35d1-pll: " Brian Masney via B4 Relay
                   ` (85 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/nuvoton/clk-ma35d1-divider.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/nuvoton/clk-ma35d1-divider.c b/drivers/clk/nuvoton/clk-ma35d1-divider.c
index bb8c23d2b895ff1975165443b4bd2541e9d6e272..e39f53d5bf4578c628d34b05233c8e8da317c4d4 100644
--- a/drivers/clk/nuvoton/clk-ma35d1-divider.c
+++ b/drivers/clk/nuvoton/clk-ma35d1-divider.c
@@ -39,12 +39,16 @@ static unsigned long ma35d1_clkdiv_recalc_rate(struct clk_hw *hw, unsigned long
 				   CLK_DIVIDER_ROUND_CLOSEST, dclk->width);
 }
 
-static long ma35d1_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate)
+static int ma35d1_clkdiv_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct ma35d1_adc_clk_div *dclk = to_ma35d1_adc_clk_div(hw);
 
-	return divider_round_rate(hw, rate, prate, dclk->table,
-				  dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       dclk->table, dclk->width,
+				       CLK_DIVIDER_ROUND_CLOSEST);
+
+	return 0;
 }
 
 static int ma35d1_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
@@ -71,7 +75,7 @@ static int ma35d1_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate, unsigne
 
 static const struct clk_ops ma35d1_adc_clkdiv_ops = {
 	.recalc_rate = ma35d1_clkdiv_recalc_rate,
-	.round_rate = ma35d1_clkdiv_round_rate,
+	.determine_rate = ma35d1_clkdiv_determine_rate,
 	.set_rate = ma35d1_clkdiv_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 036/114] clk: nuvoton: ma35d1-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (34 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 035/114] clk: nuvoton: ma35d1-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 037/114] clk: nxp: lpc18xx-cgu: " Brian Masney via B4 Relay
                   ` (84 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/nuvoton/clk-ma35d1-pll.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/nuvoton/clk-ma35d1-pll.c b/drivers/clk/nuvoton/clk-ma35d1-pll.c
index ff3fb8b87c24b0fc0823cbd2e3cf311137fa56db..4620acfe47e85f7982325bb5610a23888c7a9cf2 100644
--- a/drivers/clk/nuvoton/clk-ma35d1-pll.c
+++ b/drivers/clk/nuvoton/clk-ma35d1-pll.c
@@ -244,35 +244,43 @@ static unsigned long ma35d1_clk_pll_recalc_rate(struct clk_hw *hw, unsigned long
 	return 0;
 }
 
-static long ma35d1_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				      unsigned long *parent_rate)
+static int ma35d1_clk_pll_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct ma35d1_clk_pll *pll = to_ma35d1_clk_pll(hw);
 	u32 reg_ctl[3] = { 0 };
 	unsigned long pll_freq;
 	long ret;
 
-	if (*parent_rate < PLL_FREF_MIN_FREQ || *parent_rate > PLL_FREF_MAX_FREQ)
+	if (req->best_parent_rate < PLL_FREF_MIN_FREQ || req->best_parent_rate > PLL_FREF_MAX_FREQ)
 		return -EINVAL;
 
-	ret = ma35d1_pll_find_closest(pll, rate, *parent_rate, reg_ctl, &pll_freq);
+	ret = ma35d1_pll_find_closest(pll, req->rate, req->best_parent_rate,
+				      reg_ctl, &pll_freq);
 	if (ret < 0)
 		return ret;
 
 	switch (pll->id) {
 	case CAPLL:
 		reg_ctl[0] = readl_relaxed(pll->ctl0_base);
-		pll_freq = ma35d1_calc_smic_pll_freq(reg_ctl[0], *parent_rate);
-		return pll_freq;
+		pll_freq = ma35d1_calc_smic_pll_freq(reg_ctl[0], req->best_parent_rate);
+		req->rate = pll_freq;
+
+		return 0;
 	case DDRPLL:
 	case APLL:
 	case EPLL:
 	case VPLL:
 		reg_ctl[0] = readl_relaxed(pll->ctl0_base);
 		reg_ctl[1] = readl_relaxed(pll->ctl1_base);
-		pll_freq = ma35d1_calc_pll_freq(pll->mode, reg_ctl, *parent_rate);
-		return pll_freq;
+		pll_freq = ma35d1_calc_pll_freq(pll->mode, reg_ctl, req->best_parent_rate);
+		req->rate = pll_freq;
+
+		return 0;
 	}
+
+	req->rate = 0;
+
 	return 0;
 }
 
@@ -311,12 +319,12 @@ static const struct clk_ops ma35d1_clk_pll_ops = {
 	.unprepare = ma35d1_clk_pll_unprepare,
 	.set_rate = ma35d1_clk_pll_set_rate,
 	.recalc_rate = ma35d1_clk_pll_recalc_rate,
-	.round_rate = ma35d1_clk_pll_round_rate,
+	.determine_rate = ma35d1_clk_pll_determine_rate,
 };
 
 static const struct clk_ops ma35d1_clk_fixed_pll_ops = {
 	.recalc_rate = ma35d1_clk_pll_recalc_rate,
-	.round_rate = ma35d1_clk_pll_round_rate,
+	.determine_rate = ma35d1_clk_pll_determine_rate,
 };
 
 struct clk_hw *ma35d1_reg_clk_pll(struct device *dev, u32 id, u8 u8mode, const char *name,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 037/114] clk: nxp: lpc18xx-cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (35 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 036/114] clk: nuvoton: ma35d1-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 038/114] clk: nxp: lpc32xx: " Brian Masney via B4 Relay
                   ` (83 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/nxp/clk-lpc18xx-cgu.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/nxp/clk-lpc18xx-cgu.c b/drivers/clk/nxp/clk-lpc18xx-cgu.c
index 81efa885069b2af3d2ea5d71f4db5e3d94561cc6..30e0b283ca6081abbc469f80eeeac009a3c3edaf 100644
--- a/drivers/clk/nxp/clk-lpc18xx-cgu.c
+++ b/drivers/clk/nxp/clk-lpc18xx-cgu.c
@@ -370,23 +370,25 @@ static unsigned long lpc18xx_pll0_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long lpc18xx_pll0_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int lpc18xx_pll0_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	unsigned long m;
 
-	if (*prate < rate) {
+	if (req->best_parent_rate < req->rate) {
 		pr_warn("%s: pll dividers not supported\n", __func__);
 		return -EINVAL;
 	}
 
-	m = DIV_ROUND_UP_ULL(*prate, rate * 2);
+	m = DIV_ROUND_UP_ULL(req->best_parent_rate, req->rate * 2);
 	if (m <= 0 && m > LPC18XX_PLL0_MSEL_MAX) {
-		pr_warn("%s: unable to support rate %lu\n", __func__, rate);
+		pr_warn("%s: unable to support rate %lu\n", __func__, req->rate);
 		return -EINVAL;
 	}
 
-	return 2 * *prate * m;
+	req->rate = 2 * req->best_parent_rate * m;
+
+	return 0;
 }
 
 static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -443,7 +445,7 @@ static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops lpc18xx_pll0_ops = {
 	.recalc_rate	= lpc18xx_pll0_recalc_rate,
-	.round_rate	= lpc18xx_pll0_round_rate,
+	.determine_rate = lpc18xx_pll0_determine_rate,
 	.set_rate	= lpc18xx_pll0_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 038/114] clk: nxp: lpc32xx: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (36 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 037/114] clk: nxp: lpc18xx-cgu: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 039/114] clk: pistachio: pll: " Brian Masney via B4 Relay
                   ` (82 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Note that the changes involving LPC32XX_DEFINE_PLL_OPS were done
by hand.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/nxp/clk-lpc32xx.c | 59 ++++++++++++++++++++++++-------------------
 1 file changed, 33 insertions(+), 26 deletions(-)

diff --git a/drivers/clk/nxp/clk-lpc32xx.c b/drivers/clk/nxp/clk-lpc32xx.c
index e00f270bc6aa813b395d9fddb15c6bcb2ded0936..9df8183cf24972fda3aea30166c628880af7f474 100644
--- a/drivers/clk/nxp/clk-lpc32xx.c
+++ b/drivers/clk/nxp/clk-lpc32xx.c
@@ -579,17 +579,17 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 	return regmap_update_bits(clk_regmap, clk->reg, 0x1FFFF, val);
 }
 
-static long clk_hclk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *parent_rate)
+static int clk_hclk_pll_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw);
-	u64 m_i, o = rate, i = *parent_rate, d = (u64)rate << 6;
+	u64 m_i, o = req->rate, i = req->best_parent_rate, d = (u64) req->rate << 6;
 	u64 m = 0, n = 0, p = 0;
 	int p_i, n_i;
 
-	pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), *parent_rate, rate);
+	pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), req->best_parent_rate, req->rate);
 
-	if (rate > 266500000)
+	if (req->rate > 266500000)
 		return -EINVAL;
 
 	/* Have to check all 20 possibilities to find the minimal M */
@@ -614,9 +614,9 @@ static long clk_hclk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 		}
 	}
 
-	if (d == (u64)rate << 6) {
+	if (d == (u64) req->rate << 6) {
 		pr_err("%s: %lu: no valid PLL parameters are found\n",
-		       clk_hw_get_name(hw), rate);
+		       clk_hw_get_name(hw), req->rate);
 		return -EINVAL;
 	}
 
@@ -634,22 +634,25 @@ static long clk_hclk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 
 	if (!d)
 		pr_debug("%s: %lu: found exact match: %llu/%llu/%llu\n",
-			 clk_hw_get_name(hw), rate, m, n, p);
+			 clk_hw_get_name(hw), req->rate, m, n, p);
 	else
 		pr_debug("%s: %lu: found closest: %llu/%llu/%llu - %llu\n",
-			 clk_hw_get_name(hw), rate, m, n, p, o);
+			 clk_hw_get_name(hw), req->rate, m, n, p, o);
 
-	return o;
+	req->rate = o;
+
+	return 0;
 }
 
-static long clk_usb_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				   unsigned long *parent_rate)
+static int clk_usb_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw);
 	struct clk_hw *usb_div_hw, *osc_hw;
 	u64 d_i, n_i, m, o;
 
-	pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), *parent_rate, rate);
+	pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), req->best_parent_rate,
+		 req->rate);
 
 	/*
 	 * The only supported USB clock is 48MHz, with PLL internal constraints
@@ -657,7 +660,7 @@ static long clk_usb_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 	 * and post-divider must be 4, this slightly simplifies calculation of
 	 * USB divider, USB PLL N and M parameters.
 	 */
-	if (rate != 48000000)
+	if (req->rate != 48000000)
 		return -EINVAL;
 
 	/* USB divider clock */
@@ -685,30 +688,30 @@ static long clk_usb_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 			clk->m_div = m;
 			clk->p_div = 2;
 			clk->mode = PLL_NON_INTEGER;
-			*parent_rate = div64_u64(o, d_i);
+			req->best_parent_rate = div64_u64(o, d_i);
 
-			return rate;
+			return 0;
 		}
 	}
 
 	return -EINVAL;
 }
 
-#define LPC32XX_DEFINE_PLL_OPS(_name, _rc, _sr, _rr)			\
+#define LPC32XX_DEFINE_PLL_OPS(_name, _rc, _sr, _dr)			\
 	static const struct clk_ops clk_ ##_name ## _ops = {		\
 		.enable = clk_pll_enable,				\
 		.disable = clk_pll_disable,				\
 		.is_enabled = clk_pll_is_enabled,			\
 		.recalc_rate = _rc,					\
 		.set_rate = _sr,					\
-		.round_rate = _rr,					\
+		.determine_rate = _dr,					\
 	}
 
 LPC32XX_DEFINE_PLL_OPS(pll_397x, clk_pll_397x_recalc_rate, NULL, NULL);
 LPC32XX_DEFINE_PLL_OPS(hclk_pll, clk_pll_recalc_rate,
-		       clk_pll_set_rate, clk_hclk_pll_round_rate);
+		       clk_pll_set_rate, clk_hclk_pll_determine_rate);
 LPC32XX_DEFINE_PLL_OPS(usb_pll,  clk_pll_recalc_rate,
-		       clk_pll_set_rate, clk_usb_pll_round_rate);
+		       clk_pll_set_rate, clk_usb_pll_determine_rate);
 
 static int clk_ddram_is_enabled(struct clk_hw *hw)
 {
@@ -955,8 +958,8 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw,
 				   divider->flags, divider->width);
 }
 
-static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int clk_divider_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct lpc32xx_clk_div *divider = to_lpc32xx_div(hw);
 	unsigned int bestdiv;
@@ -968,11 +971,15 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
 		bestdiv &= div_mask(divider->width);
 		bestdiv = _get_div(divider->table, bestdiv, divider->flags,
 			divider->width);
-		return DIV_ROUND_UP(*prate, bestdiv);
+		req->rate = DIV_ROUND_UP(req->best_parent_rate, bestdiv);
+
+		return 0;
 	}
 
-	return divider_round_rate(hw, rate, prate, divider->table,
-				  divider->width, divider->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       divider->table, divider->width, divider->flags);
+
+	return 0;
 }
 
 static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -991,7 +998,7 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops lpc32xx_clk_divider_ops = {
 	.recalc_rate = clk_divider_recalc_rate,
-	.round_rate = clk_divider_round_rate,
+	.determine_rate = clk_divider_determine_rate,
 	.set_rate = clk_divider_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 039/114] clk: pistachio: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (37 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 038/114] clk: nxp: lpc32xx: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 040/114] clk: scpi: " Brian Masney via B4 Relay
                   ` (81 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/pistachio/clk-pll.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/pistachio/clk-pll.c b/drivers/clk/pistachio/clk-pll.c
index 025b9df76cdbdb338b3653f8ff60b6225da27034..d05337915e2b4514d031d15ed41aa75ed1fdae2c 100644
--- a/drivers/clk/pistachio/clk-pll.c
+++ b/drivers/clk/pistachio/clk-pll.c
@@ -139,19 +139,23 @@ pll_get_params(struct pistachio_clk_pll *pll, unsigned long fref,
 	return NULL;
 }
 
-static long pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			   unsigned long *parent_rate)
+static int pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
 {
 	struct pistachio_clk_pll *pll = to_pistachio_pll(hw);
 	unsigned int i;
 
 	for (i = 0; i < pll->nr_rates; i++) {
-		if (i > 0 && pll->rates[i].fref == *parent_rate &&
-		    pll->rates[i].fout <= rate)
-			return pll->rates[i - 1].fout;
+		if (i > 0 && pll->rates[i].fref == req->best_parent_rate &&
+		    pll->rates[i].fout <= req->rate) {
+			req->rate = pll->rates[i - 1].fout;
+
+			return 0;
+		}
 	}
 
-	return pll->rates[0].fout;
+	req->rate = pll->rates[0].fout;
+
+	return 0;
 }
 
 static int pll_gf40lp_frac_enable(struct clk_hw *hw)
@@ -300,7 +304,7 @@ static const struct clk_ops pll_gf40lp_frac_ops = {
 	.disable = pll_gf40lp_frac_disable,
 	.is_enabled = pll_gf40lp_frac_is_enabled,
 	.recalc_rate = pll_gf40lp_frac_recalc_rate,
-	.round_rate = pll_round_rate,
+	.determine_rate = pll_determine_rate,
 	.set_rate = pll_gf40lp_frac_set_rate,
 };
 
@@ -432,7 +436,7 @@ static const struct clk_ops pll_gf40lp_laint_ops = {
 	.disable = pll_gf40lp_laint_disable,
 	.is_enabled = pll_gf40lp_laint_is_enabled,
 	.recalc_rate = pll_gf40lp_laint_recalc_rate,
-	.round_rate = pll_round_rate,
+	.determine_rate = pll_determine_rate,
 	.set_rate = pll_gf40lp_laint_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 040/114] clk: scpi: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (38 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 039/114] clk: pistachio: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 041/114] clk: si514: " Brian Masney via B4 Relay
                   ` (80 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-scpi.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 19d530d52e647be3337225aa7c662d8ecee9ce0f..0b592de7bdb2a07d58a867e4ab00d493927b0b53 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -32,8 +32,8 @@ static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw,
 	return clk->scpi_ops->clk_get_val(clk->id);
 }
 
-static long scpi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
+static int scpi_clk_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	/*
 	 * We can't figure out what rate it will be, so just return the
@@ -41,7 +41,7 @@ static long scpi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
 	 * after the rate is set and we'll know what rate the clock is
 	 * running at then.
 	 */
-	return rate;
+	return 0;
 }
 
 static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -54,7 +54,7 @@ static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops scpi_clk_ops = {
 	.recalc_rate = scpi_clk_recalc_rate,
-	.round_rate = scpi_clk_round_rate,
+	.determine_rate = scpi_clk_determine_rate,
 	.set_rate = scpi_clk_set_rate,
 };
 
@@ -92,12 +92,14 @@ static unsigned long scpi_dvfs_recalc_rate(struct clk_hw *hw,
 	return opp->freq;
 }
 
-static long scpi_dvfs_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *parent_rate)
+static int scpi_dvfs_determine_rate(struct clk_hw *hw,
+				    struct clk_rate_request *req)
 {
 	struct scpi_clk *clk = to_scpi_clk(hw);
 
-	return __scpi_dvfs_round_rate(clk, rate);
+	req->rate = __scpi_dvfs_round_rate(clk, req->rate);
+
+	return 0;
 }
 
 static int __scpi_find_dvfs_index(struct scpi_clk *clk, unsigned long rate)
@@ -124,7 +126,7 @@ static int scpi_dvfs_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops scpi_dvfs_ops = {
 	.recalc_rate = scpi_dvfs_recalc_rate,
-	.round_rate = scpi_dvfs_round_rate,
+	.determine_rate = scpi_dvfs_determine_rate,
 	.set_rate = scpi_dvfs_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 041/114] clk: si514: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (39 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 040/114] clk: scpi: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 042/114] clk: si521xx: " Brian Masney via B4 Relay
                   ` (79 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-si514.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-si514.c b/drivers/clk/clk-si514.c
index 1127c35ce57d70f93fb77feb6a971dae98e871d7..f61590d70575bca52d0255ba114ba6ab381e6f54 100644
--- a/drivers/clk/clk-si514.c
+++ b/drivers/clk/clk-si514.c
@@ -227,20 +227,28 @@ static unsigned long si514_recalc_rate(struct clk_hw *hw,
 	return si514_calc_rate(&settings);
 }
 
-static long si514_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int si514_determine_rate(struct clk_hw *hw,
+				struct clk_rate_request *req)
 {
 	struct clk_si514_muldiv settings;
 	int err;
 
-	if (!rate)
+	if (!req->rate) {
+		req->rate = 0;
+
 		return 0;
+	}
 
-	err = si514_calc_muldiv(&settings, rate);
-	if (err)
-		return err;
+	err = si514_calc_muldiv(&settings, req->rate);
+	if (err) {
+		req->rate = err;
 
-	return si514_calc_rate(&settings);
+		return 0;
+	}
+
+	req->rate = si514_calc_rate(&settings);
+
+	return 0;
 }
 
 /*
@@ -289,7 +297,7 @@ static const struct clk_ops si514_clk_ops = {
 	.unprepare = si514_unprepare,
 	.is_prepared = si514_is_prepared,
 	.recalc_rate = si514_recalc_rate,
-	.round_rate = si514_round_rate,
+	.determine_rate = si514_determine_rate,
 	.set_rate = si514_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 042/114] clk: si521xx: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (40 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 041/114] clk: si514: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 043/114] clk: si5341: " Brian Masney via B4 Relay
                   ` (78 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-si521xx.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-si521xx.c b/drivers/clk/clk-si521xx.c
index 4f7b74f889f1e7e9400a61f15d1e6671408bb1fc..4ed4e1a5f4f2b3b9fe063d79fc5140f1b41c4ace 100644
--- a/drivers/clk/clk-si521xx.c
+++ b/drivers/clk/clk-si521xx.c
@@ -164,15 +164,17 @@ static unsigned long si521xx_diff_recalc_rate(struct clk_hw *hw,
 	return (unsigned long)rate;
 }
 
-static long si521xx_diff_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int si521xx_diff_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	unsigned long best_parent;
 
-	best_parent = (rate / SI521XX_DIFF_MULT) * SI521XX_DIFF_DIV;
-	*prate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
+	best_parent = (req->rate / SI521XX_DIFF_MULT) * SI521XX_DIFF_DIV;
+	req->best_parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
 
-	return (*prate / SI521XX_DIFF_DIV) * SI521XX_DIFF_MULT;
+	req->rate = (req->best_parent_rate / SI521XX_DIFF_DIV) * SI521XX_DIFF_MULT;
+
+	return 0;
 }
 
 static int si521xx_diff_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -208,7 +210,7 @@ static void si521xx_diff_unprepare(struct clk_hw *hw)
 }
 
 static const struct clk_ops si521xx_diff_clk_ops = {
-	.round_rate	= si521xx_diff_round_rate,
+	.determine_rate = si521xx_diff_determine_rate,
 	.set_rate	= si521xx_diff_set_rate,
 	.recalc_rate	= si521xx_diff_recalc_rate,
 	.prepare	= si521xx_diff_prepare,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 043/114] clk: si5341: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (41 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 042/114] clk: si521xx: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 044/114] clk: si544: " Brian Masney via B4 Relay
                   ` (77 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-si5341.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-si5341.c b/drivers/clk/clk-si5341.c
index 5004888c7eca5f85a444ec6de684b8dd79635622..2499b771cd83e313eafd83cb0519b1b94da73a61 100644
--- a/drivers/clk/clk-si5341.c
+++ b/drivers/clk/clk-si5341.c
@@ -663,8 +663,8 @@ static unsigned long si5341_synth_clk_recalc_rate(struct clk_hw *hw,
 	return f;
 }
 
-static long si5341_synth_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int si5341_synth_clk_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct clk_si5341_synth *synth = to_clk_si5341_synth(hw);
 	u64 f;
@@ -672,15 +672,21 @@ static long si5341_synth_clk_round_rate(struct clk_hw *hw, unsigned long rate,
 	/* The synthesizer accuracy is such that anything in range will work */
 	f = synth->data->freq_vco;
 	do_div(f, SI5341_SYNTH_N_MAX);
-	if (rate < f)
-		return f;
+	if (req->rate < f) {
+		req->rate = f;
+
+		return 0;
+	}
 
 	f = synth->data->freq_vco;
 	do_div(f, SI5341_SYNTH_N_MIN);
-	if (rate > f)
-		return f;
+	if (req->rate > f) {
+		req->rate = f;
 
-	return rate;
+		return 0;
+	}
+
+	return 0;
 }
 
 static int si5341_synth_program(struct clk_si5341_synth *synth,
@@ -741,7 +747,7 @@ static const struct clk_ops si5341_synth_clk_ops = {
 	.prepare = si5341_synth_clk_prepare,
 	.unprepare = si5341_synth_clk_unprepare,
 	.recalc_rate = si5341_synth_clk_recalc_rate,
-	.round_rate = si5341_synth_clk_round_rate,
+	.determine_rate = si5341_synth_clk_determine_rate,
 	.set_rate = si5341_synth_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 044/114] clk: si544: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (42 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 043/114] clk: si5341: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 045/114] clk: si570: " Brian Masney via B4 Relay
                   ` (76 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-si544.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-si544.c b/drivers/clk/clk-si544.c
index ca3473efa314b44b7eff6bc3ec9eafa518e0bd9e..09c06ecec1a52a6a521428e349cbd4cf166bbea3 100644
--- a/drivers/clk/clk-si544.c
+++ b/drivers/clk/clk-si544.c
@@ -307,16 +307,16 @@ static unsigned long si544_recalc_rate(struct clk_hw *hw,
 	return si544_calc_rate(&settings);
 }
 
-static long si544_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int si544_determine_rate(struct clk_hw *hw,
+				struct clk_rate_request *req)
 {
 	struct clk_si544 *data = to_clk_si544(hw);
 
-	if (!is_valid_frequency(data, rate))
+	if (!is_valid_frequency(data, req->rate))
 		return -EINVAL;
 
 	/* The accuracy is less than 1 Hz, so any rate is possible */
-	return rate;
+	return 0;
 }
 
 /* Calculates the maximum "small" change, 950 * rate / 1000000 */
@@ -408,7 +408,7 @@ static const struct clk_ops si544_clk_ops = {
 	.unprepare = si544_unprepare,
 	.is_prepared = si544_is_prepared,
 	.recalc_rate = si544_recalc_rate,
-	.round_rate = si544_round_rate,
+	.determine_rate = si544_determine_rate,
 	.set_rate = si544_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 045/114] clk: si570: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (43 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 044/114] clk: si544: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 046/114] clk: sifive: sifive-prci: " Brian Masney via B4 Relay
                   ` (75 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-si570.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/clk-si570.c b/drivers/clk/clk-si570.c
index e97fe90443a645c905465ad37cb5490c0c096834..b0b1830dd4302f9ad92023de2e0276cd8ea02639 100644
--- a/drivers/clk/clk-si570.c
+++ b/drivers/clk/clk-si570.c
@@ -246,34 +246,40 @@ static unsigned long si570_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long si570_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int si570_determine_rate(struct clk_hw *hw,
+				struct clk_rate_request *req)
 {
 	int err;
 	u64 rfreq;
 	unsigned int n1, hs_div;
 	struct clk_si570 *data = to_clk_si570(hw);
 
-	if (!rate)
+	if (!req->rate) {
+		req->rate = 0;
+
 		return 0;
+	}
 
-	if (div64_u64(abs(rate - data->frequency) * 10000LL,
+	if (div64_u64(abs(req->rate - data->frequency) * 10000LL,
 				data->frequency) < 35) {
-		rfreq = div64_u64((data->rfreq * rate) +
-				div64_u64(data->frequency, 2), data->frequency);
+		rfreq = div64_u64((data->rfreq * req->rate) +
+				  div64_u64(data->frequency, 2),
+				  data->frequency);
 		n1 = data->n1;
 		hs_div = data->hs_div;
 
 	} else {
-		err = si570_calc_divs(rate, data, &rfreq, &n1, &hs_div);
+		err = si570_calc_divs(req->rate, data, &rfreq, &n1, &hs_div);
 		if (err) {
 			dev_err(&data->i2c_client->dev,
 					"unable to round rate\n");
+			req->rate = 0;
+
 			return 0;
 		}
 	}
 
-	return rate;
+	return 0;
 }
 
 /**
@@ -368,7 +374,7 @@ static int si570_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops si570_clk_ops = {
 	.recalc_rate = si570_recalc_rate,
-	.round_rate = si570_round_rate,
+	.determine_rate = si570_determine_rate,
 	.set_rate = si570_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 046/114] clk: sifive: sifive-prci: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (44 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 045/114] clk: si570: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 047/114] clk: sophgo: cv18xx-ip: " Brian Masney via B4 Relay
                   ` (74 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Note that the changes to the three header files were done by hand.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sifive/fu540-prci.h  |  2 +-
 drivers/clk/sifive/fu740-prci.h  |  2 +-
 drivers/clk/sifive/sifive-prci.c | 11 ++++++-----
 drivers/clk/sifive/sifive-prci.h |  4 ++--
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h
index e0173324f3c52adf128b65c02afcd94069af8ccb..d45193c210b4be658ee8c1fb81b3be612d19772f 100644
--- a/drivers/clk/sifive/fu540-prci.h
+++ b/drivers/clk/sifive/fu540-prci.h
@@ -49,7 +49,7 @@ static struct __prci_wrpll_data sifive_fu540_prci_gemgxlpll_data = {
 
 static const struct clk_ops sifive_fu540_prci_wrpll_clk_ops = {
 	.set_rate = sifive_prci_wrpll_set_rate,
-	.round_rate = sifive_prci_wrpll_round_rate,
+	.determine_rate = sifive_prci_wrpll_determine_rate,
 	.recalc_rate = sifive_prci_wrpll_recalc_rate,
 	.enable = sifive_prci_clock_enable,
 	.disable = sifive_prci_clock_disable,
diff --git a/drivers/clk/sifive/fu740-prci.h b/drivers/clk/sifive/fu740-prci.h
index f31cd30fc3951e0c8a9f9c01c7abc7b7ad39c057..c605a899d97de76a03c58b7c1209292e7acebbb0 100644
--- a/drivers/clk/sifive/fu740-prci.h
+++ b/drivers/clk/sifive/fu740-prci.h
@@ -55,7 +55,7 @@ static struct __prci_wrpll_data sifive_fu740_prci_cltxpll_data = {
 
 static const struct clk_ops sifive_fu740_prci_wrpll_clk_ops = {
 	.set_rate = sifive_prci_wrpll_set_rate,
-	.round_rate = sifive_prci_wrpll_round_rate,
+	.determine_rate = sifive_prci_wrpll_determine_rate,
 	.recalc_rate = sifive_prci_wrpll_recalc_rate,
 	.enable = sifive_prci_clock_enable,
 	.disable = sifive_prci_clock_disable,
diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
index caba0400f8a2cf97446a7722c28f6b2eb627dcf5..4d1cc7adb2b32d99a2187ca80dbdef7f90124309 100644
--- a/drivers/clk/sifive/sifive-prci.c
+++ b/drivers/clk/sifive/sifive-prci.c
@@ -183,9 +183,8 @@ unsigned long sifive_prci_wrpll_recalc_rate(struct clk_hw *hw,
 	return wrpll_calc_output_rate(&pwd->c, parent_rate);
 }
 
-long sifive_prci_wrpll_round_rate(struct clk_hw *hw,
-				  unsigned long rate,
-				  unsigned long *parent_rate)
+int sifive_prci_wrpll_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct __prci_clock *pc = clk_hw_to_prci_clock(hw);
 	struct __prci_wrpll_data *pwd = pc->pwd;
@@ -193,9 +192,11 @@ long sifive_prci_wrpll_round_rate(struct clk_hw *hw,
 
 	memcpy(&c, &pwd->c, sizeof(c));
 
-	wrpll_configure_for_rate(&c, rate, *parent_rate);
+	wrpll_configure_for_rate(&c, req->rate, req->best_parent_rate);
 
-	return wrpll_calc_output_rate(&c, *parent_rate);
+	req->rate = wrpll_calc_output_rate(&c, req->best_parent_rate);
+
+	return 0;
 }
 
 int sifive_prci_wrpll_set_rate(struct clk_hw *hw,
diff --git a/drivers/clk/sifive/sifive-prci.h b/drivers/clk/sifive/sifive-prci.h
index 91658a88af4ef6157563846399e4857ba83c8645..d74b2bddd08a0753409e0040b493bba1497593eb 100644
--- a/drivers/clk/sifive/sifive-prci.h
+++ b/drivers/clk/sifive/sifive-prci.h
@@ -291,8 +291,8 @@ void sifive_prci_hfpclkpllsel_use_hfclk(struct __prci_data *pd);
 void sifive_prci_hfpclkpllsel_use_hfpclkpll(struct __prci_data *pd);
 
 /* Linux clock framework integration */
-long sifive_prci_wrpll_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *parent_rate);
+int sifive_prci_wrpll_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req);
 int sifive_prci_wrpll_set_rate(struct clk_hw *hw, unsigned long rate,
 			       unsigned long parent_rate);
 int sifive_clk_is_enabled(struct clk_hw *hw);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 047/114] clk: sophgo: cv18xx-ip: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (45 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 046/114] clk: sifive: sifive-prci: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:47   ` Alexander Sverdlin
  2025-08-11 15:18 ` [PATCH 048/114] clk: sophgo: sg2042-clkgen: " Brian Masney via B4 Relay
                   ` (73 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sophgo/clk-cv18xx-ip.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/sophgo/clk-cv18xx-ip.c b/drivers/clk/sophgo/clk-cv18xx-ip.c
index b186e64d4813e2701b17520e544c453fc13d0e77..c2b58faf0938b7d537dc3a81aef59c549b9c9c79 100644
--- a/drivers/clk/sophgo/clk-cv18xx-ip.c
+++ b/drivers/clk/sophgo/clk-cv18xx-ip.c
@@ -45,10 +45,12 @@ static unsigned long gate_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long gate_round_rate(struct clk_hw *hw, unsigned long rate,
-			    unsigned long *parent_rate)
+static int gate_determine_rate(struct clk_hw *hw,
+			       struct clk_rate_request *req)
 {
-	return *parent_rate;
+	req->rate = req->best_parent_rate;
+
+	return 0;
 }
 
 static int gate_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -63,7 +65,7 @@ const struct clk_ops cv1800_clk_gate_ops = {
 	.is_enabled = gate_is_enabled,
 
 	.recalc_rate = gate_recalc_rate,
-	.round_rate = gate_round_rate,
+	.determine_rate = gate_determine_rate,
 	.set_rate = gate_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 048/114] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (46 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 047/114] clk: sophgo: cv18xx-ip: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:45   ` Alexander Sverdlin
  2025-08-14  8:47   ` Chen Wang
  2025-08-11 15:18 ` [PATCH 049/114] clk: spacemit: ccu_ddn: " Brian Masney via B4 Relay
                   ` (72 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sophgo/clk-sg2042-clkgen.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/sophgo/clk-sg2042-clkgen.c b/drivers/clk/sophgo/clk-sg2042-clkgen.c
index 9e61288d34f3757315702c355f2669577b29676f..1d3b1656bcf2e6655e0299e68ab39f32189744dc 100644
--- a/drivers/clk/sophgo/clk-sg2042-clkgen.c
+++ b/drivers/clk/sophgo/clk-sg2042-clkgen.c
@@ -176,9 +176,8 @@ static unsigned long sg2042_clk_divider_recalc_rate(struct clk_hw *hw,
 	return ret_rate;
 }
 
-static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
-					  unsigned long rate,
-					  unsigned long *prate)
+static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
+					     struct clk_rate_request *req)
 {
 	struct sg2042_divider_clock *divider = to_sg2042_clk_divider(hw);
 	unsigned long ret_rate;
@@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
 			bestdiv = readl(divider->reg) >> divider->shift;
 			bestdiv &= clk_div_mask(divider->width);
 		}
-		ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
+		ret_rate = DIV_ROUND_UP_ULL((u64)*&req->best_parent_rate, bestdiv);
 	} else {
-		ret_rate = divider_round_rate(hw, rate, prate, NULL,
+		ret_rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, NULL,
 					      divider->width, divider->div_flags);
 	}
 
 	pr_debug("--> %s: divider_round_rate: val = %ld\n",
 		 clk_hw_get_name(hw), ret_rate);
-	return ret_rate;
+	req->rate = ret_rate;
+
+	return 0;
 }
 
 static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
@@ -258,13 +259,13 @@ static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
 
 static const struct clk_ops sg2042_clk_divider_ops = {
 	.recalc_rate = sg2042_clk_divider_recalc_rate,
-	.round_rate = sg2042_clk_divider_round_rate,
+	.determine_rate = sg2042_clk_divider_determine_rate,
 	.set_rate = sg2042_clk_divider_set_rate,
 };
 
 static const struct clk_ops sg2042_clk_divider_ro_ops = {
 	.recalc_rate = sg2042_clk_divider_recalc_rate,
-	.round_rate = sg2042_clk_divider_round_rate,
+	.determine_rate = sg2042_clk_divider_determine_rate,
 };
 
 /*

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 049/114] clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (47 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 048/114] clk: sophgo: sg2042-clkgen: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-25  8:40   ` Yixun Lan
  2025-08-25 15:17   ` Haylen Chu
  2025-08-11 15:18 ` [PATCH 050/114] clk: spacemit: ccu_mix: " Brian Masney via B4 Relay
                   ` (71 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spacemit/ccu_ddn.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/spacemit/ccu_ddn.c b/drivers/clk/spacemit/ccu_ddn.c
index be311b045698e95a688a35858a8ac1bcfbffd2c7..02b68ea84db9bd3ecdde41f8013c48263edbd917 100644
--- a/drivers/clk/spacemit/ccu_ddn.c
+++ b/drivers/clk/spacemit/ccu_ddn.c
@@ -39,13 +39,16 @@ static unsigned long ccu_ddn_calc_best_rate(struct ccu_ddn *ddn,
 	return ccu_ddn_calc_rate(prate, *num, *den);
 }
 
-static long ccu_ddn_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *prate)
+static int ccu_ddn_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct ccu_ddn *ddn = hw_to_ccu_ddn(hw);
 	unsigned long num, den;
 
-	return ccu_ddn_calc_best_rate(ddn, rate, *prate, &num, &den);
+	req->rate = ccu_ddn_calc_best_rate(ddn, req->rate,
+					   req->best_parent_rate, &num, &den);
+
+	return 0;
 }
 
 static unsigned long ccu_ddn_recalc_rate(struct clk_hw *hw, unsigned long prate)
@@ -78,6 +81,6 @@ static int ccu_ddn_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops spacemit_ccu_ddn_ops = {
 	.recalc_rate	= ccu_ddn_recalc_rate,
-	.round_rate	= ccu_ddn_round_rate,
+	.determine_rate = ccu_ddn_determine_rate,
 	.set_rate	= ccu_ddn_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 050/114] clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (48 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 049/114] clk: spacemit: ccu_ddn: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-25  8:41   ` Yixun Lan
  2025-08-25 15:18   ` Haylen Chu
  2025-08-11 15:18 ` [PATCH 051/114] clk: spacemit: ccu_pll: " Brian Masney via B4 Relay
                   ` (70 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spacemit/ccu_mix.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/spacemit/ccu_mix.c b/drivers/clk/spacemit/ccu_mix.c
index 9b852aa61f78aed5256bfe6fc3b01932d6db6256..7b7990875372314dce131295af7f40267d0a127a 100644
--- a/drivers/clk/spacemit/ccu_mix.c
+++ b/drivers/clk/spacemit/ccu_mix.c
@@ -80,10 +80,12 @@ static int ccu_mix_trigger_fc(struct clk_hw *hw)
 					       MIX_FC_TIMEOUT_US);
 }
 
-static long ccu_factor_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
+static int ccu_factor_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
-	return ccu_factor_recalc_rate(hw, *prate);
+	req->rate = ccu_factor_recalc_rate(hw, req->best_parent_rate);
+
+	return 0;
 }
 
 static int ccu_factor_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -198,7 +200,7 @@ const struct clk_ops spacemit_ccu_gate_ops = {
 };
 
 const struct clk_ops spacemit_ccu_factor_ops = {
-	.round_rate	= ccu_factor_round_rate,
+	.determine_rate = ccu_factor_determine_rate,
 	.recalc_rate	= ccu_factor_recalc_rate,
 	.set_rate	= ccu_factor_set_rate,
 };
@@ -220,7 +222,7 @@ const struct clk_ops spacemit_ccu_factor_gate_ops = {
 	.enable		= ccu_gate_enable,
 	.is_enabled	= ccu_gate_is_enabled,
 
-	.round_rate	= ccu_factor_round_rate,
+	.determine_rate = ccu_factor_determine_rate,
 	.recalc_rate	= ccu_factor_recalc_rate,
 	.set_rate	= ccu_factor_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (49 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 050/114] clk: spacemit: ccu_mix: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-25  8:41   ` Yixun Lan
  2025-08-25 15:18   ` Haylen Chu
  2025-08-11 15:18 ` [PATCH 052/114] clk: sparx5: " Brian Masney via B4 Relay
                   ` (69 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spacemit/ccu_pll.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/spacemit/ccu_pll.c b/drivers/clk/spacemit/ccu_pll.c
index 45f540073a656c0edc341a903acc3f2405971fc9..d92f0dae65a490e9db52f25a538a518baa487ea8 100644
--- a/drivers/clk/spacemit/ccu_pll.c
+++ b/drivers/clk/spacemit/ccu_pll.c
@@ -125,12 +125,14 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
 	return entry ? entry->rate : 0;
 }
 
-static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *prate)
+static int ccu_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct ccu_pll *pll = hw_to_ccu_pll(hw);
 
-	return ccu_pll_lookup_best_rate(pll, rate)->rate;
+	req->rate = ccu_pll_lookup_best_rate(pll, req->rate)->rate;
+
+	return 0;
 }
 
 static int ccu_pll_init(struct clk_hw *hw)
@@ -152,6 +154,6 @@ const struct clk_ops spacemit_ccu_pll_ops = {
 	.disable	= ccu_pll_disable,
 	.set_rate	= ccu_pll_set_rate,
 	.recalc_rate	= ccu_pll_recalc_rate,
-	.round_rate	= ccu_pll_round_rate,
+	.determine_rate = ccu_pll_determine_rate,
 	.is_enabled	= ccu_pll_is_enabled,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 052/114] clk: sparx5: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (50 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 051/114] clk: spacemit: ccu_pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 053/114] clk: sprd: div: " Brian Masney via B4 Relay
                   ` (68 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-sparx5.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-sparx5.c b/drivers/clk/clk-sparx5.c
index 0fad0c1a01862be221b4a53b2deb9239c335479a..b2facc9c95d471ee515c439cee83ab43187ff967 100644
--- a/drivers/clk/clk-sparx5.c
+++ b/drivers/clk/clk-sparx5.c
@@ -213,19 +213,21 @@ static unsigned long s5_pll_recalc_rate(struct clk_hw *hw,
 	return conf.freq;
 }
 
-static long s5_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *parent_rate)
+static int s5_pll_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct s5_pll_conf conf;
 
-	return s5_calc_params(rate, *parent_rate, &conf);
+	req->rate = s5_calc_params(req->rate, req->best_parent_rate, &conf);
+
+	return 0;
 }
 
 static const struct clk_ops s5_pll_ops = {
 	.enable		= s5_pll_enable,
 	.disable	= s5_pll_disable,
 	.set_rate	= s5_pll_set_rate,
-	.round_rate	= s5_pll_round_rate,
+	.determine_rate = s5_pll_determine_rate,
 	.recalc_rate	= s5_pll_recalc_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 053/114] clk: sprd: div: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (51 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 052/114] clk: sparx5: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-12  9:17   ` Chunyan Zhang
  2025-08-11 15:18 ` [PATCH 054/114] clk: sprd: pll: " Brian Masney via B4 Relay
                   ` (67 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sprd/div.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/sprd/div.c b/drivers/clk/sprd/div.c
index 936782c241271832c0a1957c99cbecc287351d1b..013423881968002d29c4e9536e7cd7b944779196 100644
--- a/drivers/clk/sprd/div.c
+++ b/drivers/clk/sprd/div.c
@@ -9,13 +9,16 @@
 
 #include "div.h"
 
-static long sprd_div_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
+static int sprd_div_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct sprd_div *cd = hw_to_sprd_div(hw);
 
-	return divider_round_rate(&cd->common.hw, rate, parent_rate, NULL,
-				  cd->div.width, 0);
+	req->rate = divider_round_rate(&cd->common.hw, req->rate,
+				       &req->best_parent_rate,
+				       NULL, cd->div.width, 0);
+
+	return 0;
 }
 
 unsigned long sprd_div_helper_recalc_rate(struct sprd_clk_common *common,
@@ -75,7 +78,7 @@ static int sprd_div_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops sprd_div_ops = {
 	.recalc_rate = sprd_div_recalc_rate,
-	.round_rate = sprd_div_round_rate,
+	.determine_rate = sprd_div_determine_rate,
 	.set_rate = sprd_div_set_rate,
 };
 EXPORT_SYMBOL_GPL(sprd_div_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 054/114] clk: sprd: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (52 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 053/114] clk: sprd: div: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-12  9:16   ` Chunyan Zhang
  2025-08-11 15:18 ` [PATCH 055/114] clk: st: clkgen-fsyn: " Brian Masney via B4 Relay
                   ` (66 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sprd/pll.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/sprd/pll.c b/drivers/clk/sprd/pll.c
index 13a322b2535ac37ecb17f2c39d17d2c03532cfcb..bc6610d5fcb72faa7406ea78dca4cd9b848e9392 100644
--- a/drivers/clk/sprd/pll.c
+++ b/drivers/clk/sprd/pll.c
@@ -254,16 +254,16 @@ static int sprd_pll_clk_prepare(struct clk_hw *hw)
 	return 0;
 }
 
-static long sprd_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int sprd_pll_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
-	return rate;
+	return 0;
 }
 
 const struct clk_ops sprd_pll_ops = {
 	.prepare = sprd_pll_clk_prepare,
 	.recalc_rate = sprd_pll_recalc_rate,
-	.round_rate = sprd_pll_round_rate,
+	.determine_rate = sprd_pll_determine_rate,
 	.set_rate = sprd_pll_set_rate,
 };
 EXPORT_SYMBOL_GPL(sprd_pll_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 055/114] clk: st: clkgen-fsyn: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (53 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 054/114] clk: sprd: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 056/114] clk: st: clkgen-pll: " Brian Masney via B4 Relay
                   ` (65 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/st/clkgen-fsyn.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c
index 40df1db102a77bbe5144d42f6e05361b66634e9a..e06e7e5cc1a56192cceeea20343c292423015bbe 100644
--- a/drivers/clk/st/clkgen-fsyn.c
+++ b/drivers/clk/st/clkgen-fsyn.c
@@ -375,22 +375,21 @@ static int clk_fs660c32_vco_get_params(unsigned long input,
 	return 0;
 }
 
-static long quadfs_pll_fs660c32_round_rate(struct clk_hw *hw,
-					   unsigned long rate,
-					   unsigned long *prate)
+static int quadfs_pll_fs660c32_determine_rate(struct clk_hw *hw,
+					      struct clk_rate_request *req)
 {
 	struct stm_fs params;
 
-	if (clk_fs660c32_vco_get_params(*prate, rate, &params))
-		return rate;
+	if (clk_fs660c32_vco_get_params(req->best_parent_rate, req->rate, &params))
+		return 0;
 
-	clk_fs660c32_vco_get_rate(*prate, &params, &rate);
+	clk_fs660c32_vco_get_rate(req->best_parent_rate, &params, &req->rate);
 
 	pr_debug("%s: %s new rate %ld [ndiv=%u]\n",
 		 __func__, clk_hw_get_name(hw),
-		 rate, (unsigned int)params.ndiv);
+		 req->rate, (unsigned int)params.ndiv);
 
-	return rate;
+	return 0;
 }
 
 static int quadfs_pll_fs660c32_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -436,7 +435,7 @@ static const struct clk_ops st_quadfs_pll_c32_ops = {
 	.disable	= quadfs_pll_disable,
 	.is_enabled	= quadfs_pll_is_enabled,
 	.recalc_rate	= quadfs_pll_fs660c32_recalc_rate,
-	.round_rate	= quadfs_pll_fs660c32_round_rate,
+	.determine_rate = quadfs_pll_fs660c32_determine_rate,
 	.set_rate	= quadfs_pll_fs660c32_set_rate,
 };
 
@@ -814,19 +813,21 @@ static unsigned long quadfs_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long quadfs_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *prate)
+static int quadfs_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct stm_fs params;
 
-	rate = quadfs_find_best_rate(hw, rate, *prate, &params);
+	req->rate = quadfs_find_best_rate(hw, req->rate,
+					  req->best_parent_rate, &params);
 
 	pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",
 		 __func__, clk_hw_get_name(hw),
-		 rate, (unsigned int)params.sdiv, (unsigned int)params.mdiv,
-			 (unsigned int)params.pe, (unsigned int)params.nsdiv);
+		 req->rate, (unsigned int)params.sdiv,
+		 (unsigned int)params.mdiv,
+		 (unsigned int)params.pe, (unsigned int)params.nsdiv);
 
-	return rate;
+	return 0;
 }
 
 
@@ -873,7 +874,7 @@ static const struct clk_ops st_quadfs_ops = {
 	.enable		= quadfs_fsynth_enable,
 	.disable	= quadfs_fsynth_disable,
 	.is_enabled	= quadfs_fsynth_is_enabled,
-	.round_rate	= quadfs_round_rate,
+	.determine_rate = quadfs_determine_rate,
 	.set_rate	= quadfs_set_rate,
 	.recalc_rate	= quadfs_recalc_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 056/114] clk: st: clkgen-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (54 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 055/114] clk: st: clkgen-fsyn: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 057/114] clk: stm32f4: " Brian Masney via B4 Relay
                   ` (64 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Note that prior to running the Coccinelle:

- round_rate_stm_pll4600c28() was renamed to stm_pll4600c28_round_rate()
- round_rate_stm_pll3200c32() was renamed to stm_pll3200c32_round_rate()

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/st/clkgen-pll.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
index b36e4d8036364a126fea3afdd8b936fb93de27f2..c258ff87a17127b872fb5591503e171571866a0e 100644
--- a/drivers/clk/st/clkgen-pll.c
+++ b/drivers/clk/st/clkgen-pll.c
@@ -395,25 +395,28 @@ static unsigned long recalc_stm_pll3200c32(struct clk_hw *hw,
 	return rate;
 }
 
-static long round_rate_stm_pll3200c32(struct clk_hw *hw, unsigned long rate,
-		unsigned long *prate)
+static int stm_pll3200c32_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct stm_pll params;
 
-	if (!clk_pll3200c32_get_params(*prate, rate, &params))
-		clk_pll3200c32_get_rate(*prate, &params, &rate);
+	if (!clk_pll3200c32_get_params(req->best_parent_rate, req->rate, &params))
+		clk_pll3200c32_get_rate(req->best_parent_rate, &params,
+					&req->rate);
 	else {
 		pr_debug("%s: %s rate %ld Invalid\n", __func__,
-			 __clk_get_name(hw->clk), rate);
+			 __clk_get_name(hw->clk), req->rate);
+		req->rate = 0;
+
 		return 0;
 	}
 
 	pr_debug("%s: %s new rate %ld [ndiv=%u] [idf=%u]\n",
 		 __func__, __clk_get_name(hw->clk),
-		 rate, (unsigned int)params.ndiv,
+		 req->rate, (unsigned int)params.ndiv,
 		 (unsigned int)params.idf);
 
-	return rate;
+	return 0;
 }
 
 static int set_rate_stm_pll3200c32(struct clk_hw *hw, unsigned long rate,
@@ -549,25 +552,28 @@ static unsigned long recalc_stm_pll4600c28(struct clk_hw *hw,
 	return rate;
 }
 
-static long round_rate_stm_pll4600c28(struct clk_hw *hw, unsigned long rate,
-				      unsigned long *prate)
+static int stm_pll4600c28_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct stm_pll params;
 
-	if (!clk_pll4600c28_get_params(*prate, rate, &params)) {
-		clk_pll4600c28_get_rate(*prate, &params, &rate);
+	if (!clk_pll4600c28_get_params(req->best_parent_rate, req->rate, &params)) {
+		clk_pll4600c28_get_rate(req->best_parent_rate, &params,
+					&req->rate);
 	} else {
 		pr_debug("%s: %s rate %ld Invalid\n", __func__,
-			 __clk_get_name(hw->clk), rate);
+			 __clk_get_name(hw->clk), req->rate);
+		req->rate = 0;
+
 		return 0;
 	}
 
 	pr_debug("%s: %s new rate %ld [ndiv=%u] [idf=%u]\n",
 		 __func__, __clk_get_name(hw->clk),
-		 rate, (unsigned int)params.ndiv,
+		 req->rate, (unsigned int)params.ndiv,
 		 (unsigned int)params.idf);
 
-	return rate;
+	return 0;
 }
 
 static int set_rate_stm_pll4600c28(struct clk_hw *hw, unsigned long rate,
@@ -628,7 +634,7 @@ static const struct clk_ops stm_pll3200c32_a9_ops = {
 	.disable	= clkgen_pll_disable,
 	.is_enabled	= clkgen_pll_is_enabled,
 	.recalc_rate	= recalc_stm_pll3200c32,
-	.round_rate	= round_rate_stm_pll3200c32,
+	.determine_rate = stm_pll3200c32_determine_rate,
 	.set_rate	= set_rate_stm_pll3200c32,
 };
 
@@ -637,7 +643,7 @@ static const struct clk_ops stm_pll4600c28_ops = {
 	.disable	= clkgen_pll_disable,
 	.is_enabled	= clkgen_pll_is_enabled,
 	.recalc_rate	= recalc_stm_pll4600c28,
-	.round_rate	= round_rate_stm_pll4600c28,
+	.determine_rate = stm_pll4600c28_determine_rate,
 	.set_rate	= set_rate_stm_pll4600c28,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 057/114] clk: stm32f4: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (55 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 056/114] clk: st: clkgen-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 058/114] clk: stm32: stm32-core: " Brian Masney via B4 Relay
                   ` (63 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-stm32f4.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c
index 719cddc82ae6f8f706716e5ba91a69759c066415..b5d4d48432a0be0a416d628667893e7165caaf0a 100644
--- a/drivers/clk/clk-stm32f4.c
+++ b/drivers/clk/clk-stm32f4.c
@@ -443,8 +443,8 @@ static unsigned long clk_apb_mul_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long clk_apb_mul_round_rate(struct clk_hw *hw, unsigned long rate,
-				   unsigned long *prate)
+static int clk_apb_mul_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct clk_apb_mul *am = to_clk_apb_mul(hw);
 	unsigned long mult = 1;
@@ -453,12 +453,14 @@ static long clk_apb_mul_round_rate(struct clk_hw *hw, unsigned long rate,
 		mult = 2;
 
 	if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
-		unsigned long best_parent = rate / mult;
+		unsigned long best_parent = req->rate / mult;
 
-		*prate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
+		req->best_parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
 	}
 
-	return *prate * mult;
+	req->rate = req->best_parent_rate * mult;
+
+	return 0;
 }
 
 static int clk_apb_mul_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -474,7 +476,7 @@ static int clk_apb_mul_set_rate(struct clk_hw *hw, unsigned long rate,
 }
 
 static const struct clk_ops clk_apb_mul_factor_ops = {
-	.round_rate = clk_apb_mul_round_rate,
+	.determine_rate = clk_apb_mul_determine_rate,
 	.set_rate = clk_apb_mul_set_rate,
 	.recalc_rate = clk_apb_mul_recalc_rate,
 };
@@ -670,21 +672,23 @@ static unsigned long stm32f4_pll_recalc(struct clk_hw *hw,
 	return parent_rate * n;
 }
 
-static long stm32f4_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *prate)
+static int stm32f4_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct clk_gate *gate = to_clk_gate(hw);
 	struct stm32f4_pll *pll = to_stm32f4_pll(gate);
 	unsigned long n;
 
-	n = rate / *prate;
+	n = req->rate / req->best_parent_rate;
 
 	if (n < pll->n_start)
 		n = pll->n_start;
 	else if (n > 432)
 		n = 432;
 
-	return *prate * n;
+	req->rate = req->best_parent_rate * n;
+
+	return 0;
 }
 
 static void stm32f4_pll_set_ssc(struct clk_hw *hw, unsigned long parent_rate,
@@ -749,7 +753,7 @@ static const struct clk_ops stm32f4_pll_gate_ops = {
 	.disable	= stm32f4_pll_disable,
 	.is_enabled	= stm32f4_pll_is_enabled,
 	.recalc_rate	= stm32f4_pll_recalc,
-	.round_rate	= stm32f4_pll_round_rate,
+	.determine_rate = stm32f4_pll_determine_rate,
 	.set_rate	= stm32f4_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 058/114] clk: stm32: stm32-core: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (56 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 057/114] clk: stm32f4: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-18 12:08   ` Gabriel FERNANDEZ
  2025-08-11 15:18 ` [PATCH 059/114] clk: stm32: stm32mp1: " Brian Masney via B4 Relay
                   ` (62 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/stm32/clk-stm32-core.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c
index 933e3cde0795386c3e5e6902aa0989cf3dffc01e..72825b9c36a4d3b8ba3f7615b9026c09ffaf88d1 100644
--- a/drivers/clk/stm32/clk-stm32-core.c
+++ b/drivers/clk/stm32/clk-stm32-core.c
@@ -351,14 +351,14 @@ static int clk_stm32_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 	return ret;
 }
 
-static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-					 unsigned long *prate)
+static int clk_stm32_divider_determine_rate(struct clk_hw *hw,
+					    struct clk_rate_request *req)
 {
 	struct clk_stm32_div *div = to_clk_stm32_divider(hw);
 	const struct stm32_div_cfg *divider;
 
 	if (div->div_id == NO_STM32_DIV)
-		return rate;
+		return 0;
 
 	divider = &div->clock_data->dividers[div->div_id];
 
@@ -369,14 +369,22 @@ static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate,
 		val =  readl(div->base + divider->offset) >> divider->shift;
 		val &= clk_div_mask(divider->width);
 
-		return divider_ro_round_rate(hw, rate, prate, divider->table,
-				divider->width, divider->flags,
-				val);
+		req->rate = divider_ro_round_rate(hw, req->rate,
+						  &req->best_parent_rate,
+						  divider->table,
+						  divider->width,
+						  divider->flags, val);
+
+		return 0;
 	}
 
-	return divider_round_rate_parent(hw, clk_hw_get_parent(hw),
-					 rate, prate, divider->table,
-					 divider->width, divider->flags);
+	req->rate = divider_round_rate_parent(hw, clk_hw_get_parent(hw),
+					      req->rate,
+					      &req->best_parent_rate,
+					      divider->table,
+					      divider->width, divider->flags);
+
+	return 0;
 }
 
 static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw,
@@ -392,7 +400,7 @@ static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw,
 
 const struct clk_ops clk_stm32_divider_ops = {
 	.recalc_rate	= clk_stm32_divider_recalc_rate,
-	.round_rate	= clk_stm32_divider_round_rate,
+	.determine_rate = clk_stm32_divider_determine_rate,
 	.set_rate	= clk_stm32_divider_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 059/114] clk: stm32: stm32mp1: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (57 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 058/114] clk: stm32: stm32-core: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-18 12:09   ` Gabriel FERNANDEZ
  2025-08-11 15:18 ` [PATCH 060/114] clk: tps68470: " Brian Masney via B4 Relay
                   ` (61 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/stm32/clk-stm32mp1.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/stm32/clk-stm32mp1.c b/drivers/clk/stm32/clk-stm32mp1.c
index b8b45ed22f981df580506f3d4ca801ba11d2bab2..2d9ccd96ec98c05eb836d632bfd9903de60ba1bb 100644
--- a/drivers/clk/stm32/clk-stm32mp1.c
+++ b/drivers/clk/stm32/clk-stm32mp1.c
@@ -970,12 +970,15 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
 	return mult;
 }
 
-static long timer_ker_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *parent_rate)
+static int timer_ker_determine_rate(struct clk_hw *hw,
+				    struct clk_rate_request *req)
 {
-	unsigned long factor = __bestmult(hw, rate, *parent_rate);
+	unsigned long factor = __bestmult(hw, req->rate,
+					  req->best_parent_rate);
 
-	return *parent_rate * factor;
+	req->rate = req->best_parent_rate * factor;
+
+	return 0;
 }
 
 static int timer_ker_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -1026,7 +1029,7 @@ static unsigned long timer_ker_recalc_rate(struct clk_hw *hw,
 
 static const struct clk_ops timer_ker_ops = {
 	.recalc_rate	= timer_ker_recalc_rate,
-	.round_rate	= timer_ker_round_rate,
+	.determine_rate = timer_ker_determine_rate,
 	.set_rate	= timer_ker_set_rate,
 
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 060/114] clk: tps68470: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (58 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 059/114] clk: stm32: stm32mp1: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 061/114] clk: versaclock3: " Brian Masney via B4 Relay
                   ` (60 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-tps68470.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-tps68470.c b/drivers/clk/clk-tps68470.c
index 38f44b5b9b1b80bf5404bcafda9806a5f377ed95..9511248c6bc9849b66f6d0aff86dd657e64ab396 100644
--- a/drivers/clk/clk-tps68470.c
+++ b/drivers/clk/clk-tps68470.c
@@ -146,12 +146,14 @@ static unsigned int tps68470_clk_cfg_lookup(unsigned long rate)
 	return best_idx;
 }
 
-static long tps68470_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *parent_rate)
+static int tps68470_clk_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
-	unsigned int idx = tps68470_clk_cfg_lookup(rate);
+	unsigned int idx = tps68470_clk_cfg_lookup(req->rate);
+
+	req->rate = clk_freqs[idx].freq;
 
-	return clk_freqs[idx].freq;
+	return 0;
 }
 
 static int tps68470_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -186,7 +188,7 @@ static const struct clk_ops tps68470_clk_ops = {
 	.prepare = tps68470_clk_prepare,
 	.unprepare = tps68470_clk_unprepare,
 	.recalc_rate = tps68470_clk_recalc_rate,
-	.round_rate = tps68470_clk_round_rate,
+	.determine_rate = tps68470_clk_determine_rate,
 	.set_rate = tps68470_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 061/114] clk: versaclock3: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (59 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 060/114] clk: tps68470: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 062/114] clk: vt8500: " Brian Masney via B4 Relay
                   ` (59 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-versaclock3.c | 70 +++++++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 29 deletions(-)

diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c
index 9fe27dace1117aa9e2f29be76744cdefceea3de3..1849863dbd673f3b133b9a295dc608ea43931de6 100644
--- a/drivers/clk/clk-versaclock3.c
+++ b/drivers/clk/clk-versaclock3.c
@@ -289,22 +289,25 @@ static unsigned long vc3_pfd_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long vc3_pfd_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc3_pfd_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
 	const struct vc3_pfd_data *pfd = vc3->data;
 	unsigned long idiv;
 
 	/* PLL cannot operate with input clock above 50 MHz. */
-	if (rate > 50000000)
+	if (req->rate > 50000000)
 		return -EINVAL;
 
 	/* CLKIN within range of PLL input, feed directly to PLL. */
-	if (*parent_rate <= 50000000)
-		return *parent_rate;
+	if (req->best_parent_rate <= 50000000) {
+		req->rate = req->best_parent_rate;
 
-	idiv = DIV_ROUND_UP(*parent_rate, rate);
+		return 0;
+	}
+
+	idiv = DIV_ROUND_UP(req->best_parent_rate, req->rate);
 	if (pfd->num == VC3_PFD1 || pfd->num == VC3_PFD3) {
 		if (idiv > 63)
 			return -EINVAL;
@@ -313,7 +316,9 @@ static long vc3_pfd_round_rate(struct clk_hw *hw, unsigned long rate,
 			return -EINVAL;
 	}
 
-	return *parent_rate / idiv;
+	req->rate = req->best_parent_rate / idiv;
+
+	return 0;
 }
 
 static int vc3_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -354,7 +359,7 @@ static int vc3_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc3_pfd_ops = {
 	.recalc_rate = vc3_pfd_recalc_rate,
-	.round_rate = vc3_pfd_round_rate,
+	.determine_rate = vc3_pfd_determine_rate,
 	.set_rate = vc3_pfd_set_rate,
 };
 
@@ -385,36 +390,38 @@ static unsigned long vc3_pll_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long vc3_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc3_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
 	const struct vc3_pll_data *pll = vc3->data;
 	u64 div_frc;
 
-	if (rate < pll->vco.min)
-		rate = pll->vco.min;
-	if (rate > pll->vco.max)
-		rate = pll->vco.max;
+	if (req->rate < pll->vco.min)
+		req->rate = pll->vco.min;
+	if (req->rate > pll->vco.max)
+		req->rate = pll->vco.max;
 
-	vc3->div_int = rate / *parent_rate;
+	vc3->div_int = req->rate / req->best_parent_rate;
 
 	if (pll->num == VC3_PLL2) {
 		if (vc3->div_int > 0x7ff)
-			rate = *parent_rate * 0x7ff;
+			req->rate = req->best_parent_rate * 0x7ff;
 
 		/* Determine best fractional part, which is 16 bit wide */
-		div_frc = rate % *parent_rate;
+		div_frc = req->rate % req->best_parent_rate;
 		div_frc *= BIT(16) - 1;
 
-		vc3->div_frc = min_t(u64, div64_ul(div_frc, *parent_rate), U16_MAX);
-		rate = (*parent_rate *
-			(vc3->div_int * VC3_2_POW_16 + vc3->div_frc) / VC3_2_POW_16);
+		vc3->div_frc = min_t(u64,
+				     div64_ul(div_frc, req->best_parent_rate),
+				     U16_MAX);
+		req->rate = (req->best_parent_rate *
+			     (vc3->div_int * VC3_2_POW_16 + vc3->div_frc) / VC3_2_POW_16);
 	} else {
-		rate = *parent_rate * vc3->div_int;
+		req->rate = req->best_parent_rate * vc3->div_int;
 	}
 
-	return rate;
+	return 0;
 }
 
 static int vc3_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -441,7 +448,7 @@ static int vc3_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc3_pll_ops = {
 	.recalc_rate = vc3_pll_recalc_rate,
-	.round_rate = vc3_pll_round_rate,
+	.determine_rate = vc3_pll_determine_rate,
 	.set_rate = vc3_pll_set_rate,
 };
 
@@ -498,8 +505,8 @@ static unsigned long vc3_div_recalc_rate(struct clk_hw *hw,
 				   div_data->flags, div_data->width);
 }
 
-static long vc3_div_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc3_div_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc3_hw_data *vc3 = container_of(hw, struct vc3_hw_data, hw);
 	const struct vc3_div_data *div_data = vc3->data;
@@ -511,11 +518,16 @@ static long vc3_div_round_rate(struct clk_hw *hw, unsigned long rate,
 		bestdiv >>= div_data->shift;
 		bestdiv &= VC3_DIV_MASK(div_data->width);
 		bestdiv = vc3_get_div(div_data->table, bestdiv, div_data->flags);
-		return DIV_ROUND_UP(*parent_rate, bestdiv);
+		req->rate = DIV_ROUND_UP(req->best_parent_rate, bestdiv);
+
+		return 0;
 	}
 
-	return divider_round_rate(hw, rate, parent_rate, div_data->table,
-				  div_data->width, div_data->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       div_data->table,
+				       div_data->width, div_data->flags);
+
+	return 0;
 }
 
 static int vc3_div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -534,7 +546,7 @@ static int vc3_div_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc3_div_ops = {
 	.recalc_rate = vc3_div_recalc_rate,
-	.round_rate = vc3_div_round_rate,
+	.determine_rate = vc3_div_determine_rate,
 	.set_rate = vc3_div_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 062/114] clk: vt8500: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (60 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 061/114] clk: versaclock3: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 063/114] clk: wm831x: " Brian Masney via B4 Relay
                   ` (58 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-vt8500.c | 59 ++++++++++++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 24 deletions(-)

diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c
index 2a74a713ad5954de578f43972a6243f22dd2c0d6..eae5b3fbfb823f77e6cd9601bd221382d4eccf42 100644
--- a/drivers/clk/clk-vt8500.c
+++ b/drivers/clk/clk-vt8500.c
@@ -128,30 +128,31 @@ static unsigned long vt8500_dclk_recalc_rate(struct clk_hw *hw,
 	return parent_rate / div;
 }
 
-static long vt8500_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int vt8500_dclk_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct clk_device *cdev = to_clk_device(hw);
 	u32 divisor;
 
-	if (rate == 0)
+	if (req->rate == 0)
 		return 0;
 
-	divisor = *prate / rate;
+	divisor = req->best_parent_rate / req->rate;
 
 	/* If prate / rate would be decimal, incr the divisor */
-	if (rate * divisor < *prate)
+	if (req->rate * divisor < req->best_parent_rate)
 		divisor++;
 
 	/*
 	 * If this is a request for SDMMC we have to adjust the divisor
 	 * when >31 to use the fixed predivisor
 	 */
-	if ((cdev->div_mask == 0x3F) && (divisor > 31)) {
+	if ((cdev->div_mask == 0x3F) && (divisor > 31))
 		divisor = 64 * ((divisor / 64) + 1);
-	}
 
-	return *prate / divisor;
+	req->rate = req->best_parent_rate / divisor;
+
+	return 0;
 }
 
 static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -202,7 +203,7 @@ static const struct clk_ops vt8500_gated_clk_ops = {
 };
 
 static const struct clk_ops vt8500_divisor_clk_ops = {
-	.round_rate = vt8500_dclk_round_rate,
+	.determine_rate = vt8500_dclk_determine_rate,
 	.set_rate = vt8500_dclk_set_rate,
 	.recalc_rate = vt8500_dclk_recalc_rate,
 };
@@ -211,7 +212,7 @@ static const struct clk_ops vt8500_gated_divisor_clk_ops = {
 	.enable = vt8500_dclk_enable,
 	.disable = vt8500_dclk_disable,
 	.is_enabled = vt8500_dclk_is_enabled,
-	.round_rate = vt8500_dclk_round_rate,
+	.determine_rate = vt8500_dclk_determine_rate,
 	.set_rate = vt8500_dclk_set_rate,
 	.recalc_rate = vt8500_dclk_recalc_rate,
 };
@@ -594,8 +595,8 @@ static int vtwm_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static long vtwm_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int vtwm_pll_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct clk_pll *pll = to_clk_pll(hw);
 	u32 filter, mul, div1, div2;
@@ -604,33 +605,43 @@ static long vtwm_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 
 	switch (pll->type) {
 	case PLL_TYPE_VT8500:
-		ret = vt8500_find_pll_bits(rate, *prate, &mul, &div1);
+		ret = vt8500_find_pll_bits(req->rate, req->best_parent_rate,
+					   &mul, &div1);
 		if (!ret)
-			round_rate = VT8500_BITS_TO_FREQ(*prate, mul, div1);
+			round_rate = VT8500_BITS_TO_FREQ(req->best_parent_rate,
+							 mul, div1);
 		break;
 	case PLL_TYPE_WM8650:
-		ret = wm8650_find_pll_bits(rate, *prate, &mul, &div1, &div2);
+		ret = wm8650_find_pll_bits(req->rate, req->best_parent_rate,
+					   &mul, &div1, &div2);
 		if (!ret)
-			round_rate = WM8650_BITS_TO_FREQ(*prate, mul, div1, div2);
+			round_rate = WM8650_BITS_TO_FREQ(req->best_parent_rate,
+							 mul, div1, div2);
 		break;
 	case PLL_TYPE_WM8750:
-		ret = wm8750_find_pll_bits(rate, *prate, &filter, &mul, &div1, &div2);
+		ret = wm8750_find_pll_bits(req->rate, req->best_parent_rate,
+					   &filter, &mul, &div1, &div2);
 		if (!ret)
-			round_rate = WM8750_BITS_TO_FREQ(*prate, mul, div1, div2);
+			round_rate = WM8750_BITS_TO_FREQ(req->best_parent_rate,
+							 mul, div1, div2);
 		break;
 	case PLL_TYPE_WM8850:
-		ret = wm8850_find_pll_bits(rate, *prate, &mul, &div1, &div2);
+		ret = wm8850_find_pll_bits(req->rate, req->best_parent_rate,
+					   &mul, &div1, &div2);
 		if (!ret)
-			round_rate = WM8850_BITS_TO_FREQ(*prate, mul, div1, div2);
+			round_rate = WM8850_BITS_TO_FREQ(req->best_parent_rate,
+							 mul, div1, div2);
 		break;
 	default:
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 
 	if (ret)
-		return ret;
+		req->rate = ret;
+	else
+		req->rate = round_rate;
 
-	return round_rate;
+	return 0;
 }
 
 static unsigned long vtwm_pll_recalc_rate(struct clk_hw *hw,
@@ -665,7 +676,7 @@ static unsigned long vtwm_pll_recalc_rate(struct clk_hw *hw,
 }
 
 static const struct clk_ops vtwm_pll_ops = {
-	.round_rate = vtwm_pll_round_rate,
+	.determine_rate = vtwm_pll_determine_rate,
 	.set_rate = vtwm_pll_set_rate,
 	.recalc_rate = vtwm_pll_recalc_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 063/114] clk: wm831x: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (61 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 062/114] clk: vt8500: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-12  8:04   ` Richard Fitzgerald
  2025-08-11 15:18 ` [PATCH 064/114] clk: x86: cgu: " Brian Masney via B4 Relay
                   ` (57 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-wm831x.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c
index 34e9d4d541e25c1adf766b48333f11c2d5b219fb..263e927138c2ead84d9f154d5e0f2d7b068f1c1f 100644
--- a/drivers/clk/clk-wm831x.c
+++ b/drivers/clk/clk-wm831x.c
@@ -133,18 +133,20 @@ static unsigned long wm831x_fll_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long wm831x_fll_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *unused)
+static int wm831x_fll_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	int best = 0;
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(wm831x_fll_auto_rates); i++)
-		if (abs(wm831x_fll_auto_rates[i] - rate) <
-		    abs(wm831x_fll_auto_rates[best] - rate))
+		if (abs(wm831x_fll_auto_rates[i] - req->rate) <
+		    abs(wm831x_fll_auto_rates[best] - req->rate))
 			best = i;
 
-	return wm831x_fll_auto_rates[best];
+	req->rate = wm831x_fll_auto_rates[best];
+
+	return 0;
 }
 
 static int wm831x_fll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -214,7 +216,7 @@ static const struct clk_ops wm831x_fll_ops = {
 	.is_prepared = wm831x_fll_is_prepared,
 	.prepare = wm831x_fll_prepare,
 	.unprepare = wm831x_fll_unprepare,
-	.round_rate = wm831x_fll_round_rate,
+	.determine_rate = wm831x_fll_determine_rate,
 	.recalc_rate = wm831x_fll_recalc_rate,
 	.set_rate = wm831x_fll_set_rate,
 	.get_parent = wm831x_fll_get_parent,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 064/114] clk: x86: cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (62 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 063/114] clk: wm831x: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 065/114] clk: xgene: " Brian Masney via B4 Relay
                   ` (56 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/x86/clk-cgu.c | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/clk/x86/clk-cgu.c b/drivers/clk/x86/clk-cgu.c
index 89b53f280aee03b7838e4656eae3571f00eaa263..177e2a8f5bba354c07a524f9175e2cb51f08258a 100644
--- a/drivers/clk/x86/clk-cgu.c
+++ b/drivers/clk/x86/clk-cgu.c
@@ -132,14 +132,15 @@ lgm_clk_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
 				   divider->flags, divider->width);
 }
 
-static long
-lgm_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-			   unsigned long *prate)
+static int lgm_clk_divider_determine_rate(struct clk_hw *hw,
+					  struct clk_rate_request *req)
 {
 	struct lgm_clk_divider *divider = to_lgm_clk_divider(hw);
 
-	return divider_round_rate(hw, rate, prate, divider->table,
-				  divider->width, divider->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, divider->table,
+				       divider->width, divider->flags);
+
+	return 0;
 }
 
 static int
@@ -182,7 +183,7 @@ static void lgm_clk_divider_disable(struct clk_hw *hw)
 
 static const struct clk_ops lgm_clk_divider_ops = {
 	.recalc_rate = lgm_clk_divider_recalc_rate,
-	.round_rate = lgm_clk_divider_round_rate,
+	.determine_rate = lgm_clk_divider_determine_rate,
 	.set_rate = lgm_clk_divider_set_rate,
 	.enable = lgm_clk_divider_enable,
 	.disable = lgm_clk_divider_disable,
@@ -487,15 +488,14 @@ lgm_clk_ddiv_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static long
-lgm_clk_ddiv_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *prate)
+static int lgm_clk_ddiv_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw);
 	u32 div, ddiv1, ddiv2;
 	u64 rate64;
 
-	div = DIV_ROUND_CLOSEST_ULL((u64)*prate, rate);
+	div = DIV_ROUND_CLOSEST_ULL((u64) req->best_parent_rate, req->rate);
 
 	/* if predivide bit is enabled, modify div by factor of 2.5 */
 	if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) {
@@ -503,14 +503,17 @@ lgm_clk_ddiv_round_rate(struct clk_hw *hw, unsigned long rate,
 		div = DIV_ROUND_CLOSEST_ULL((u64)div, 5);
 	}
 
-	if (div <= 0)
-		return *prate;
+	if (div <= 0) {
+		req->rate = req->best_parent_rate;
+
+		return 0;
+	}
 
 	if (lgm_clk_get_ddiv_val(div, &ddiv1, &ddiv2) != 0)
 		if (lgm_clk_get_ddiv_val(div + 1, &ddiv1, &ddiv2) != 0)
 			return -EINVAL;
 
-	rate64 = *prate;
+	rate64 = req->best_parent_rate;
 	do_div(rate64, ddiv1);
 	do_div(rate64, ddiv2);
 
@@ -520,7 +523,9 @@ lgm_clk_ddiv_round_rate(struct clk_hw *hw, unsigned long rate,
 		rate64 = DIV_ROUND_CLOSEST_ULL(rate64, 5);
 	}
 
-	return rate64;
+	req->rate = rate64;
+
+	return 0;
 }
 
 static const struct clk_ops lgm_clk_ddiv_ops = {
@@ -528,7 +533,7 @@ static const struct clk_ops lgm_clk_ddiv_ops = {
 	.enable	= lgm_clk_ddiv_enable,
 	.disable = lgm_clk_ddiv_disable,
 	.set_rate = lgm_clk_ddiv_set_rate,
-	.round_rate = lgm_clk_ddiv_round_rate,
+	.determine_rate = lgm_clk_ddiv_determine_rate,
 };
 
 int lgm_clk_register_ddiv(struct lgm_clk_provider *ctx,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 065/114] clk: xgene: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (63 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 064/114] clk: x86: cgu: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 066/114] clk: xilinx: xlnx-clock-wizard: " Brian Masney via B4 Relay
                   ` (55 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-xgene.c | 41 ++++++++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c
index 96946a8e2854c3a3fb80c920c8e3798f39386b24..92e39f3237c2f12b65d9ef67d5848948cc2c4d8d 100644
--- a/drivers/clk/clk-xgene.c
+++ b/drivers/clk/clk-xgene.c
@@ -271,23 +271,28 @@ static unsigned long xgene_clk_pmd_recalc_rate(struct clk_hw *hw,
 	return ret;
 }
 
-static long xgene_clk_pmd_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *parent_rate)
+static int xgene_clk_pmd_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct xgene_clk_pmd *fd = to_xgene_clk_pmd(hw);
 	u64 ret, scale;
 
-	if (!rate || rate >= *parent_rate)
-		return *parent_rate;
+	if (!req->rate || req->rate >= req->best_parent_rate) {
+		req->rate = req->best_parent_rate;
+
+		return 0;
+	}
 
 	/* freq = parent_rate * scaler / denom */
-	ret = rate * fd->denom;
-	scale = DIV_ROUND_UP_ULL(ret, *parent_rate);
+	ret = req->rate * fd->denom;
+	scale = DIV_ROUND_UP_ULL(ret, req->best_parent_rate);
 
-	ret = (u64)*parent_rate * scale;
+	ret = (u64)req->best_parent_rate * scale;
 	do_div(ret, fd->denom);
 
-	return ret;
+	req->rate = ret;
+
+	return 0;
 }
 
 static int xgene_clk_pmd_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -333,7 +338,7 @@ static int xgene_clk_pmd_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops xgene_clk_pmd_ops = {
 	.recalc_rate = xgene_clk_pmd_recalc_rate,
-	.round_rate = xgene_clk_pmd_round_rate,
+	.determine_rate = xgene_clk_pmd_determine_rate,
 	.set_rate = xgene_clk_pmd_set_rate,
 };
 
@@ -593,23 +598,25 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	return parent_rate / divider_save;
 }
 
-static long xgene_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int xgene_clk_determine_rate(struct clk_hw *hw,
+				    struct clk_rate_request *req)
 {
 	struct xgene_clk *pclk = to_xgene_clk(hw);
-	unsigned long parent_rate = *prate;
+	unsigned long parent_rate = req->best_parent_rate;
 	u32 divider;
 
 	if (pclk->param.divider_reg) {
 		/* Let's compute the divider */
-		if (rate > parent_rate)
-			rate = parent_rate;
-		divider = parent_rate / rate;   /* Rounded down */
+		if (req->rate > parent_rate)
+			req->rate = parent_rate;
+		divider = parent_rate / req->rate;   /* Rounded down */
 	} else {
 		divider = 1;
 	}
 
-	return parent_rate / divider;
+	req->rate = parent_rate / divider;
+
+	return 0;
 }
 
 static const struct clk_ops xgene_clk_ops = {
@@ -618,7 +625,7 @@ static const struct clk_ops xgene_clk_ops = {
 	.is_enabled = xgene_clk_is_enabled,
 	.recalc_rate = xgene_clk_recalc_rate,
 	.set_rate = xgene_clk_set_rate,
-	.round_rate = xgene_clk_round_rate,
+	.determine_rate = xgene_clk_determine_rate,
 };
 
 static struct clk *xgene_register_clk(struct device *dev,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 066/114] clk: xilinx: xlnx-clock-wizard: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (64 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 065/114] clk: xgene: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:18 ` [PATCH 067/114] clk: xilinx: xlnx_vcu: " Brian Masney via B4 Relay
                   ` (54 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 55 ++++++++++++++++--------------
 1 file changed, 30 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
index 0295a13a811cf8e00fd49879eefc5bcf4fb89228..3ee14770212a9f241d49123b25cee7abca350194 100644
--- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
+++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
@@ -322,8 +322,8 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
 	return err;
 }
 
-static long clk_wzrd_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int clk_wzrd_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	u8 div;
 
@@ -331,9 +331,11 @@ static long clk_wzrd_round_rate(struct clk_hw *hw, unsigned long rate,
 	 * since we don't change parent rate we just round rate to closest
 	 * achievable
 	 */
-	div = DIV_ROUND_CLOSEST(*prate, rate);
+	div = DIV_ROUND_CLOSEST(req->best_parent_rate, req->rate);
 
-	return *prate / div;
+	req->rate = req->best_parent_rate / div;
+
+	return 0;
 }
 
 static int clk_wzrd_get_divisors_ver(struct clk_hw *hw, unsigned long rate,
@@ -642,14 +644,14 @@ static unsigned long clk_wzrd_recalc_rate_all_ver(struct clk_hw *hw,
 			divider->flags, divider->width);
 }
 
-static long clk_wzrd_round_rate_all(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int clk_wzrd_determine_rate_all(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
 	u32 m, d, o;
 	int err;
 
-	err = clk_wzrd_get_divisors(hw, rate, *prate);
+	err = clk_wzrd_get_divisors(hw, req->rate, req->best_parent_rate);
 	if (err)
 		return err;
 
@@ -657,19 +659,20 @@ static long clk_wzrd_round_rate_all(struct clk_hw *hw, unsigned long rate,
 	d = divider->d;
 	o = divider->o;
 
-	rate = div_u64(*prate * (m * 1000 + divider->m_frac), d * (o * 1000 + divider->o_frac));
-	return rate;
+	req->rate = div_u64(req->best_parent_rate * (m * 1000 + divider->m_frac),
+			    d * (o * 1000 + divider->o_frac));
+	return 0;
 }
 
-static long clk_wzrd_ver_round_rate_all(struct clk_hw *hw, unsigned long rate,
-					unsigned long *prate)
+static int clk_wzrd_ver_determine_rate_all(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
 	unsigned long int_freq;
 	u32 m, d, o, div, f;
 	int err;
 
-	err = clk_wzrd_get_divisors_ver(hw, rate, *prate);
+	err = clk_wzrd_get_divisors_ver(hw, req->rate, req->best_parent_rate);
 	if (err)
 		return err;
 
@@ -678,36 +681,38 @@ static long clk_wzrd_ver_round_rate_all(struct clk_hw *hw, unsigned long rate,
 	o = divider->o;
 
 	div = d * o;
-	int_freq =  divider_recalc_rate(hw, *prate * m, div, divider->table,
+	int_freq =  divider_recalc_rate(hw, req->best_parent_rate * m, div,
+					divider->table,
 					divider->flags, divider->width);
 
-	if (rate > int_freq) {
-		f = DIV_ROUND_CLOSEST_ULL(rate * WZRD_FRAC_POINTS, int_freq);
-		rate = DIV_ROUND_CLOSEST(int_freq * f, WZRD_FRAC_POINTS);
+	if (req->rate > int_freq) {
+		f = DIV_ROUND_CLOSEST_ULL(req->rate * WZRD_FRAC_POINTS,
+					  int_freq);
+		req->rate = DIV_ROUND_CLOSEST(int_freq * f, WZRD_FRAC_POINTS);
 	}
-	return rate;
+	return 0;
 }
 
 static const struct clk_ops clk_wzrd_ver_divider_ops = {
-	.round_rate = clk_wzrd_round_rate,
+	.determine_rate = clk_wzrd_determine_rate,
 	.set_rate = clk_wzrd_ver_dynamic_reconfig,
 	.recalc_rate = clk_wzrd_recalc_rate_ver,
 };
 
 static const struct clk_ops clk_wzrd_ver_div_all_ops = {
-	.round_rate = clk_wzrd_ver_round_rate_all,
+	.determine_rate = clk_wzrd_ver_determine_rate_all,
 	.set_rate = clk_wzrd_dynamic_all_ver,
 	.recalc_rate = clk_wzrd_recalc_rate_all_ver,
 };
 
 static const struct clk_ops clk_wzrd_clk_divider_ops = {
-	.round_rate = clk_wzrd_round_rate,
+	.determine_rate = clk_wzrd_determine_rate,
 	.set_rate = clk_wzrd_dynamic_reconfig,
 	.recalc_rate = clk_wzrd_recalc_rate,
 };
 
 static const struct clk_ops clk_wzrd_clk_div_all_ops = {
-	.round_rate = clk_wzrd_round_rate_all,
+	.determine_rate = clk_wzrd_determine_rate_all,
 	.set_rate = clk_wzrd_dynamic_all,
 	.recalc_rate = clk_wzrd_recalc_rate_all,
 };
@@ -769,14 +774,14 @@ static int clk_wzrd_dynamic_reconfig_f(struct clk_hw *hw, unsigned long rate,
 				WZRD_USEC_POLL, WZRD_TIMEOUT_POLL);
 }
 
-static long clk_wzrd_round_rate_f(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
+static int clk_wzrd_determine_rate_f(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
-	return rate;
+	return 0;
 }
 
 static const struct clk_ops clk_wzrd_clk_divider_ops_f = {
-	.round_rate = clk_wzrd_round_rate_f,
+	.determine_rate = clk_wzrd_determine_rate_f,
 	.set_rate = clk_wzrd_dynamic_reconfig_f,
 	.recalc_rate = clk_wzrd_recalc_ratef,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 067/114] clk: xilinx: xlnx_vcu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (65 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 066/114] clk: xilinx: xlnx-clock-wizard: " Brian Masney via B4 Relay
@ 2025-08-11 15:18 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 068/114] clk: zynqmp: divider: " Brian Masney via B4 Relay
                   ` (53 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:18 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/xilinx/xlnx_vcu.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c
index 1ded67bee06c3903b14bd32af36238ee02661b07..02699bc0f82c6b37d7d373a90160a63aa5df52a2 100644
--- a/drivers/clk/xilinx/xlnx_vcu.c
+++ b/drivers/clk/xilinx/xlnx_vcu.c
@@ -311,18 +311,21 @@ static int xvcu_pll_set_div(struct vcu_pll *pll, int div)
 	return 0;
 }
 
-static long xvcu_pll_round_rate(struct clk_hw *hw,
-				unsigned long rate, unsigned long *parent_rate)
+static int xvcu_pll_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct vcu_pll *pll = to_vcu_pll(hw);
 	unsigned int feedback_div;
 
-	rate = clamp_t(unsigned long, rate, pll->fvco_min, pll->fvco_max);
+	req->rate = clamp_t(unsigned long, req->rate, pll->fvco_min,
+			    pll->fvco_max);
 
-	feedback_div = DIV_ROUND_CLOSEST_ULL(rate, *parent_rate);
+	feedback_div = DIV_ROUND_CLOSEST_ULL(req->rate, req->best_parent_rate);
 	feedback_div = clamp_t(unsigned int, feedback_div, 25, 125);
 
-	return *parent_rate * feedback_div;
+	req->rate = req->best_parent_rate * feedback_div;
+
+	return 0;
 }
 
 static unsigned long xvcu_pll_recalc_rate(struct clk_hw *hw,
@@ -394,7 +397,7 @@ static void xvcu_pll_disable(struct clk_hw *hw)
 static const struct clk_ops vcu_pll_ops = {
 	.enable = xvcu_pll_enable,
 	.disable = xvcu_pll_disable,
-	.round_rate = xvcu_pll_round_rate,
+	.determine_rate = xvcu_pll_determine_rate,
 	.recalc_rate = xvcu_pll_recalc_rate,
 	.set_rate = xvcu_pll_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 068/114] clk: zynqmp: divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (66 preceding siblings ...)
  2025-08-11 15:18 ` [PATCH 067/114] clk: xilinx: xlnx_vcu: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 069/114] clk: zynqmp: pll: " Brian Masney via B4 Relay
                   ` (52 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/zynqmp/divider.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
index 5a00487ae408be4ffd586704859b232e934c1f6e..8470b22948252b83567925c704716a027b841562 100644
--- a/drivers/clk/zynqmp/divider.c
+++ b/drivers/clk/zynqmp/divider.c
@@ -118,9 +118,8 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
  *
  * Return: 0 on success else error+reason
  */
-static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
-					  unsigned long rate,
-					  unsigned long *prate)
+static int zynqmp_clk_divider_determine_rate(struct clk_hw *hw,
+					     struct clk_rate_request *req)
 {
 	struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw);
 	const char *clk_name = clk_hw_get_name(hw);
@@ -145,17 +144,21 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
 		if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
 			bestdiv = 1 << bestdiv;
 
-		return DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
+		req->rate = DIV_ROUND_UP_ULL((u64) req->best_parent_rate, bestdiv);
+
+		return 0;
 	}
 
 	width = fls(divider->max_div);
 
-	rate = divider_round_rate(hw, rate, prate, NULL, width, divider->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       NULL, width, divider->flags);
 
-	if (divider->is_frac && (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) && (rate % *prate))
-		*prate = rate;
+	if (divider->is_frac && (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) &&
+	    (req->rate % req->best_parent_rate))
+		req->best_parent_rate = req->rate;
 
-	return rate;
+	return 0;
 }
 
 /**
@@ -199,13 +202,13 @@ static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops zynqmp_clk_divider_ops = {
 	.recalc_rate = zynqmp_clk_divider_recalc_rate,
-	.round_rate = zynqmp_clk_divider_round_rate,
+	.determine_rate = zynqmp_clk_divider_determine_rate,
 	.set_rate = zynqmp_clk_divider_set_rate,
 };
 
 static const struct clk_ops zynqmp_clk_divider_ro_ops = {
 	.recalc_rate = zynqmp_clk_divider_recalc_rate,
-	.round_rate = zynqmp_clk_divider_round_rate,
+	.determine_rate = zynqmp_clk_divider_determine_rate,
 };
 
 /**

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 069/114] clk: zynqmp: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (67 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 068/114] clk: zynqmp: divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 070/114] clk: zynq: " Brian Masney via B4 Relay
                   ` (51 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/zynqmp/pll.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c
index 7411a7fd50acf7b718f789074598c25bec509aa1..630a3936c97c348c1d36252cb93c5551b2469969 100644
--- a/drivers/clk/zynqmp/pll.c
+++ b/drivers/clk/zynqmp/pll.c
@@ -98,29 +98,29 @@ static inline void zynqmp_pll_set_mode(struct clk_hw *hw, bool on)
  *
  * Return: Frequency closest to @rate the hardware can generate
  */
-static long zynqmp_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
+static int zynqmp_pll_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	u32 fbdiv;
 	u32 mult, div;
 
 	/* Let rate fall inside the range PS_PLL_VCO_MIN ~ PS_PLL_VCO_MAX */
-	if (rate > PS_PLL_VCO_MAX) {
-		div = DIV_ROUND_UP(rate, PS_PLL_VCO_MAX);
-		rate = rate / div;
+	if (req->rate > PS_PLL_VCO_MAX) {
+		div = DIV_ROUND_UP(req->rate, PS_PLL_VCO_MAX);
+		req->rate = req->rate / div;
 	}
-	if (rate < PS_PLL_VCO_MIN) {
-		mult = DIV_ROUND_UP(PS_PLL_VCO_MIN, rate);
-		rate = rate * mult;
+	if (req->rate < PS_PLL_VCO_MIN) {
+		mult = DIV_ROUND_UP(PS_PLL_VCO_MIN, req->rate);
+		req->rate = req->rate * mult;
 	}
 
-	fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
+	fbdiv = DIV_ROUND_CLOSEST(req->rate, req->best_parent_rate);
 	if (fbdiv < PLL_FBDIV_MIN || fbdiv > PLL_FBDIV_MAX) {
 		fbdiv = clamp_t(u32, fbdiv, PLL_FBDIV_MIN, PLL_FBDIV_MAX);
-		rate = *prate * fbdiv;
+		req->rate = req->best_parent_rate * fbdiv;
 	}
 
-	return rate;
+	return 0;
 }
 
 /**
@@ -294,7 +294,7 @@ static const struct clk_ops zynqmp_pll_ops = {
 	.enable = zynqmp_pll_enable,
 	.disable = zynqmp_pll_disable,
 	.is_enabled = zynqmp_pll_is_enabled,
-	.round_rate = zynqmp_pll_round_rate,
+	.determine_rate = zynqmp_pll_determine_rate,
 	.recalc_rate = zynqmp_pll_recalc_rate,
 	.set_rate = zynqmp_pll_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 070/114] clk: zynq: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (68 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 069/114] clk: zynqmp: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 071/114] clk: actions: owl-composite: " Brian Masney via B4 Relay
                   ` (50 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/zynq/pll.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c
index e5f8fb704df24e9c6e87854ce2c43fb86fa98cd3..5eca1c14981aceb95801cd000c6c7b30b9830696 100644
--- a/drivers/clk/zynq/pll.c
+++ b/drivers/clk/zynq/pll.c
@@ -48,18 +48,20 @@ struct zynq_pll {
  * @prate:	Clock frequency of parent clock
  * Return:	frequency closest to @rate the hardware can generate.
  */
-static long zynq_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *prate)
+static int zynq_pll_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	u32 fbdiv;
 
-	fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
+	fbdiv = DIV_ROUND_CLOSEST(req->rate, req->best_parent_rate);
 	if (fbdiv < PLL_FBDIV_MIN)
 		fbdiv = PLL_FBDIV_MIN;
 	else if (fbdiv > PLL_FBDIV_MAX)
 		fbdiv = PLL_FBDIV_MAX;
 
-	return *prate * fbdiv;
+	req->rate = req->best_parent_rate * fbdiv;
+
+	return 0;
 }
 
 /**
@@ -167,7 +169,7 @@ static const struct clk_ops zynq_pll_ops = {
 	.enable = zynq_pll_enable,
 	.disable = zynq_pll_disable,
 	.is_enabled = zynq_pll_is_enabled,
-	.round_rate = zynq_pll_round_rate,
+	.determine_rate = zynq_pll_determine_rate,
 	.recalc_rate = zynq_pll_recalc_rate
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 071/114] clk: actions: owl-composite: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (69 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 070/114] clk: zynq: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 072/114] clk: actions: owl-divider: " Brian Masney via B4 Relay
                   ` (49 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/actions/owl-composite.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/actions/owl-composite.c b/drivers/clk/actions/owl-composite.c
index 48f177f6ce9cfacda80b4809b52a24f4fcd30871..00b74f8bc4375a8f42e9b54c7bf1affe91e1074a 100644
--- a/drivers/clk/actions/owl-composite.c
+++ b/drivers/clk/actions/owl-composite.c
@@ -122,13 +122,13 @@ static int owl_comp_fact_set_rate(struct clk_hw *hw, unsigned long rate,
 					rate, parent_rate);
 }
 
-static long owl_comp_fix_fact_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *parent_rate)
+static int owl_comp_fix_fact_determine_rate(struct clk_hw *hw,
+					    struct clk_rate_request *req)
 {
 	struct owl_composite *comp = hw_to_owl_comp(hw);
 	struct clk_fixed_factor *fix_fact_hw = &comp->rate.fix_fact_hw;
 
-	return comp->fix_fact_ops->round_rate(&fix_fact_hw->hw, rate, parent_rate);
+	return comp->fix_fact_ops->determine_rate(&fix_fact_hw->hw, req);
 }
 
 static unsigned long owl_comp_fix_fact_recalc_rate(struct clk_hw *hw,
@@ -193,7 +193,7 @@ const struct clk_ops owl_comp_fix_fact_ops = {
 	.is_enabled	= owl_comp_is_enabled,
 
 	/* fix_fact_ops */
-	.round_rate	= owl_comp_fix_fact_round_rate,
+	.determine_rate = owl_comp_fix_fact_determine_rate,
 	.recalc_rate	= owl_comp_fix_fact_recalc_rate,
 	.set_rate	= owl_comp_fix_fact_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 072/114] clk: actions: owl-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (70 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 071/114] clk: actions: owl-composite: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 073/114] clk: actions: owl-factor: " Brian Masney via B4 Relay
                   ` (48 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/actions/owl-divider.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/actions/owl-divider.c b/drivers/clk/actions/owl-divider.c
index cddac00fe324aef0c2dd723df280bade9728d07d..118f1393c6780f287d26736b2547a8b43751655a 100644
--- a/drivers/clk/actions/owl-divider.c
+++ b/drivers/clk/actions/owl-divider.c
@@ -23,13 +23,16 @@ long owl_divider_helper_round_rate(struct owl_clk_common *common,
 				  div_hw->div_flags);
 }
 
-static long owl_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
+static int owl_divider_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct owl_divider *div = hw_to_owl_divider(hw);
 
-	return owl_divider_helper_round_rate(&div->common, &div->div_hw,
-					     rate, parent_rate);
+	req->rate = owl_divider_helper_round_rate(&div->common, &div->div_hw,
+						  req->rate,
+						  &req->best_parent_rate);
+
+	return 0;
 }
 
 unsigned long owl_divider_helper_recalc_rate(struct owl_clk_common *common,
@@ -89,6 +92,6 @@ static int owl_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops owl_divider_ops = {
 	.recalc_rate = owl_divider_recalc_rate,
-	.round_rate = owl_divider_round_rate,
+	.determine_rate = owl_divider_determine_rate,
 	.set_rate = owl_divider_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 073/114] clk: actions: owl-factor: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (71 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 072/114] clk: actions: owl-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 074/114] clk: actions: owl-pll: " Brian Masney via B4 Relay
                   ` (47 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/actions/owl-factor.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/actions/owl-factor.c b/drivers/clk/actions/owl-factor.c
index 64f316cf7cfcc3d05d59522b347cf4e17f80e9e2..12f41f6bacd66d9b31323b1fe41236fb4655b24f 100644
--- a/drivers/clk/actions/owl-factor.c
+++ b/drivers/clk/actions/owl-factor.c
@@ -130,14 +130,16 @@ long owl_factor_helper_round_rate(struct owl_clk_common *common,
 	return *parent_rate * mul / div;
 }
 
-static long owl_factor_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *parent_rate)
+static int owl_factor_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct owl_factor *factor = hw_to_owl_factor(hw);
 	struct owl_factor_hw *factor_hw = &factor->factor_hw;
 
-	return owl_factor_helper_round_rate(&factor->common, factor_hw,
-					rate, parent_rate);
+	req->rate = owl_factor_helper_round_rate(&factor->common, factor_hw,
+						 req->rate, &req->best_parent_rate);
+
+	return 0;
 }
 
 unsigned long owl_factor_helper_recalc_rate(struct owl_clk_common *common,
@@ -214,7 +216,7 @@ static int owl_factor_set_rate(struct clk_hw *hw, unsigned long rate,
 }
 
 const struct clk_ops owl_factor_ops = {
-	.round_rate	= owl_factor_round_rate,
+	.determine_rate = owl_factor_determine_rate,
 	.recalc_rate	= owl_factor_recalc_rate,
 	.set_rate	= owl_factor_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 074/114] clk: actions: owl-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (72 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 073/114] clk: actions: owl-factor: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 075/114] clk: apple-nco: " Brian Masney via B4 Relay
                   ` (46 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/actions/owl-pll.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/actions/owl-pll.c b/drivers/clk/actions/owl-pll.c
index 155f313986b40f15b7c426f4d49b1ed560acf9c3..869690b79cc16f05d63383b965ae5fc96deee79f 100644
--- a/drivers/clk/actions/owl-pll.c
+++ b/drivers/clk/actions/owl-pll.c
@@ -56,8 +56,8 @@ static const struct clk_pll_table *_get_pll_table(
 	return table;
 }
 
-static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int owl_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct owl_pll *pll = hw_to_owl_pll(hw);
 	struct owl_pll_hw *pll_hw = &pll->pll_hw;
@@ -65,17 +65,24 @@ static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 	u32 mul;
 
 	if (pll_hw->table) {
-		clkt = _get_pll_table(pll_hw->table, rate);
-		return clkt->rate;
+		clkt = _get_pll_table(pll_hw->table, req->rate);
+		req->rate = clkt->rate;
+
+		return 0;
 	}
 
 	/* fixed frequency */
-	if (pll_hw->width == 0)
-		return pll_hw->bfreq;
+	if (pll_hw->width == 0) {
+		req->rate = pll_hw->bfreq;
 
-	mul = owl_pll_calculate_mul(pll_hw, rate);
+		return 0;
+	}
+
+	mul = owl_pll_calculate_mul(pll_hw, req->rate);
 
-	return pll_hw->bfreq * mul;
+	req->rate = pll_hw->bfreq * mul;
+
+	return 0;
 }
 
 static unsigned long owl_pll_recalc_rate(struct clk_hw *hw,
@@ -188,7 +195,7 @@ const struct clk_ops owl_pll_ops = {
 	.enable = owl_pll_enable,
 	.disable = owl_pll_disable,
 	.is_enabled = owl_pll_is_enabled,
-	.round_rate = owl_pll_round_rate,
+	.determine_rate = owl_pll_determine_rate,
 	.recalc_rate = owl_pll_recalc_rate,
 	.set_rate = owl_pll_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 075/114] clk: apple-nco: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (73 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 074/114] clk: actions: owl-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-14 15:29   ` Janne Grunau
  2025-08-11 15:19 ` [PATCH 076/114] clk: axs10x: i2s_pll_clock: " Brian Masney via B4 Relay
                   ` (45 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-apple-nco.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-apple-nco.c b/drivers/clk/clk-apple-nco.c
index 457a48d4894128fff24d50eb7c9a3cbd7d35f245..d3ced4a0f029ec0440ff42d49d31e314fdf86846 100644
--- a/drivers/clk/clk-apple-nco.c
+++ b/drivers/clk/clk-apple-nco.c
@@ -212,13 +212,15 @@ static unsigned long applnco_recalc_rate(struct clk_hw *hw,
 			((u64) div) * incbase + inc1);
 }
 
-static long applnco_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
+static int applnco_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
-	unsigned long lo = *parent_rate / (COARSE_DIV_OFFSET + LFSR_TBLSIZE) + 1;
-	unsigned long hi = *parent_rate / COARSE_DIV_OFFSET;
+	unsigned long lo = req->best_parent_rate / (COARSE_DIV_OFFSET + LFSR_TBLSIZE) + 1;
+	unsigned long hi = req->best_parent_rate / COARSE_DIV_OFFSET;
 
-	return clamp(rate, lo, hi);
+	req->rate = clamp(req->rate, lo, hi);
+
+	return 0;
 }
 
 static int applnco_enable(struct clk_hw *hw)
@@ -246,7 +248,7 @@ static void applnco_disable(struct clk_hw *hw)
 static const struct clk_ops applnco_ops = {
 	.set_rate = applnco_set_rate,
 	.recalc_rate = applnco_recalc_rate,
-	.round_rate = applnco_round_rate,
+	.determine_rate = applnco_determine_rate,
 	.enable = applnco_enable,
 	.disable = applnco_disable,
 	.is_enabled = applnco_is_enabled,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 076/114] clk: axs10x: i2s_pll_clock: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (74 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 075/114] clk: apple-nco: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 077/114] clk: axs10x: pll_clock: " Brian Masney via B4 Relay
                   ` (44 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/axs10x/i2s_pll_clock.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/axs10x/i2s_pll_clock.c b/drivers/clk/axs10x/i2s_pll_clock.c
index 9667ce898428032f6db4070bd0e8ba92c074f277..6f3e1151b354e0a0d001b3241695f992df3b8711 100644
--- a/drivers/clk/axs10x/i2s_pll_clock.c
+++ b/drivers/clk/axs10x/i2s_pll_clock.c
@@ -108,21 +108,21 @@ static unsigned long i2s_pll_recalc_rate(struct clk_hw *hw,
 	return ((parent_rate / idiv) * fbdiv) / odiv;
 }
 
-static long i2s_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *prate)
+static int i2s_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct i2s_pll_clk *clk = to_i2s_pll_clk(hw);
-	const struct i2s_pll_cfg *pll_cfg = i2s_pll_get_cfg(*prate);
+	const struct i2s_pll_cfg *pll_cfg = i2s_pll_get_cfg(req->best_parent_rate);
 	int i;
 
 	if (!pll_cfg) {
-		dev_err(clk->dev, "invalid parent rate=%ld\n", *prate);
+		dev_err(clk->dev, "invalid parent rate=%ld\n", req->best_parent_rate);
 		return -EINVAL;
 	}
 
 	for (i = 0; pll_cfg[i].rate != 0; i++)
-		if (pll_cfg[i].rate == rate)
-			return rate;
+		if (pll_cfg[i].rate == req->rate)
+			return 0;
 
 	return -EINVAL;
 }
@@ -156,7 +156,7 @@ static int i2s_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops i2s_pll_ops = {
 	.recalc_rate = i2s_pll_recalc_rate,
-	.round_rate = i2s_pll_round_rate,
+	.determine_rate = i2s_pll_determine_rate,
 	.set_rate = i2s_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 077/114] clk: axs10x: pll_clock: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (75 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 076/114] clk: axs10x: i2s_pll_clock: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 078/114] clk: bcm: iproc-asiu: " Brian Masney via B4 Relay
                   ` (43 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/axs10x/pll_clock.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/axs10x/pll_clock.c b/drivers/clk/axs10x/pll_clock.c
index 6c7a2b62b406379279b1aab71ac0759f3c5fc64a..c7ca473ee76c83a52e924651046414f60736d542 100644
--- a/drivers/clk/axs10x/pll_clock.c
+++ b/drivers/clk/axs10x/pll_clock.c
@@ -149,8 +149,8 @@ static unsigned long axs10x_pll_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long axs10x_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
+static int axs10x_pll_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	int i;
 	long best_rate;
@@ -163,11 +163,13 @@ static long axs10x_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 	best_rate = pll_cfg[0].rate;
 
 	for (i = 1; pll_cfg[i].rate != 0; i++) {
-		if (abs(rate - pll_cfg[i].rate) < abs(rate - best_rate))
+		if (abs(req->rate - pll_cfg[i].rate) < abs(req->rate - best_rate))
 			best_rate = pll_cfg[i].rate;
 	}
 
-	return best_rate;
+	req->rate = best_rate;
+
+	return 0;
 }
 
 static int axs10x_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -208,7 +210,7 @@ static int axs10x_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops axs10x_pll_ops = {
 	.recalc_rate = axs10x_pll_recalc_rate,
-	.round_rate = axs10x_pll_round_rate,
+	.determine_rate = axs10x_pll_determine_rate,
 	.set_rate = axs10x_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 078/114] clk: bcm: iproc-asiu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (76 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 077/114] clk: axs10x: pll_clock: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 079/114] clk: bm1880: " Brian Masney via B4 Relay
                   ` (42 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/bcm/clk-iproc-asiu.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/bcm/clk-iproc-asiu.c b/drivers/clk/bcm/clk-iproc-asiu.c
index dcacf55c55ae06bc45fd5585265084075353b379..83ec13da9b2e1de9438ee4fb23b8e2e1852d59f2 100644
--- a/drivers/clk/bcm/clk-iproc-asiu.c
+++ b/drivers/clk/bcm/clk-iproc-asiu.c
@@ -98,22 +98,27 @@ static unsigned long iproc_asiu_clk_recalc_rate(struct clk_hw *hw,
 	return clk->rate;
 }
 
-static long iproc_asiu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				      unsigned long *parent_rate)
+static int iproc_asiu_clk_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	unsigned int div;
 
-	if (rate == 0 || *parent_rate == 0)
+	if (req->rate == 0 || req->best_parent_rate == 0)
 		return -EINVAL;
 
-	if (rate == *parent_rate)
-		return *parent_rate;
+	if (req->rate == req->best_parent_rate)
+		return 0;
 
-	div = DIV_ROUND_CLOSEST(*parent_rate, rate);
-	if (div < 2)
-		return *parent_rate;
+	div = DIV_ROUND_CLOSEST(req->best_parent_rate, req->rate);
+	if (div < 2) {
+		req->rate = req->best_parent_rate;
 
-	return *parent_rate / div;
+		return 0;
+	}
+
+	req->rate = req->best_parent_rate / div;
+
+	return 0;
 }
 
 static int iproc_asiu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -168,7 +173,7 @@ static const struct clk_ops iproc_asiu_ops = {
 	.enable = iproc_asiu_clk_enable,
 	.disable = iproc_asiu_clk_disable,
 	.recalc_rate = iproc_asiu_clk_recalc_rate,
-	.round_rate = iproc_asiu_clk_round_rate,
+	.determine_rate = iproc_asiu_clk_determine_rate,
 	.set_rate = iproc_asiu_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 079/114] clk: bm1880: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (77 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 078/114] clk: bcm: iproc-asiu: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-12 15:38   ` Manivannan Sadhasivam
  2025-08-11 15:19 ` [PATCH 080/114] clk: cdce706: " Brian Masney via B4 Relay
                   ` (41 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-bm1880.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk-bm1880.c b/drivers/clk/clk-bm1880.c
index 002f7360b1c6c6e3058606a0808115b48fd3147a..dac190bc6e19a6dd4be413ea52d41f74934a1aa9 100644
--- a/drivers/clk/clk-bm1880.c
+++ b/drivers/clk/clk-bm1880.c
@@ -608,8 +608,8 @@ static unsigned long bm1880_clk_div_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
-				      unsigned long *prate)
+static int bm1880_clk_div_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct bm1880_div_hw_clock *div_hw = to_bm1880_div_clk(hw);
 	struct bm1880_div_clock *div = &div_hw->div;
@@ -621,13 +621,18 @@ static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
 		val = readl(reg_addr) >> div->shift;
 		val &= clk_div_mask(div->width);
 
-		return divider_ro_round_rate(hw, rate, prate, div->table,
-					     div->width, div->flags,
-					     val);
+		req->rate = divider_ro_round_rate(hw, req->rate,
+						  &req->best_parent_rate,
+						  div->table,
+						  div->width, div->flags, val);
+
+		return 0;
 	}
 
-	return divider_round_rate(hw, rate, prate, div->table,
-				  div->width, div->flags);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       div->table, div->width, div->flags);
+
+	return 0;
 }
 
 static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -665,7 +670,7 @@ static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops bm1880_clk_div_ops = {
 	.recalc_rate = bm1880_clk_div_recalc_rate,
-	.round_rate = bm1880_clk_div_round_rate,
+	.determine_rate = bm1880_clk_div_determine_rate,
 	.set_rate = bm1880_clk_div_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 080/114] clk: cdce706: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (78 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 079/114] clk: bm1880: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 081/114] clk: hsdk-pll: " Brian Masney via B4 Relay
                   ` (40 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-cdce706.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/clk-cdce706.c b/drivers/clk/clk-cdce706.c
index d0705bb03a2aae2c2a1abc7031183ee0a9ec053e..a495d313b02f39840b4ad0242758db06f1715e28 100644
--- a/drivers/clk/clk-cdce706.c
+++ b/drivers/clk/clk-cdce706.c
@@ -183,8 +183,8 @@ static unsigned long cdce706_pll_recalc_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long cdce706_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				   unsigned long *parent_rate)
+static int cdce706_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct cdce706_hw_data *hwd = to_hw_data(hw);
 	unsigned long mul, div;
@@ -192,9 +192,9 @@ static long cdce706_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 
 	dev_dbg(&hwd->dev_data->client->dev,
 		"%s, rate: %lu, parent_rate: %lu\n",
-		__func__, rate, *parent_rate);
+		__func__, req->rate, req->best_parent_rate);
 
-	rational_best_approximation(rate, *parent_rate,
+	rational_best_approximation(req->rate, req->best_parent_rate,
 				    CDCE706_PLL_N_MAX, CDCE706_PLL_M_MAX,
 				    &mul, &div);
 	hwd->mul = mul;
@@ -204,9 +204,11 @@ static long cdce706_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 		"%s, pll: %d, mul: %lu, div: %lu\n",
 		__func__, hwd->idx, mul, div);
 
-	res = (u64)*parent_rate * hwd->mul;
+	res = (u64)req->best_parent_rate * hwd->mul;
 	do_div(res, hwd->div);
-	return res;
+	req->rate = res;
+
+	return 0;
 }
 
 static int cdce706_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -251,7 +253,7 @@ static int cdce706_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops cdce706_pll_ops = {
 	.recalc_rate = cdce706_pll_recalc_rate,
-	.round_rate = cdce706_pll_round_rate,
+	.determine_rate = cdce706_pll_determine_rate,
 	.set_rate = cdce706_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 081/114] clk: hsdk-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (79 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 080/114] clk: cdce706: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 082/114] clk: mediatek: pll: " Brian Masney via B4 Relay
                   ` (39 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-hsdk-pll.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-hsdk-pll.c b/drivers/clk/clk-hsdk-pll.c
index 921523fc26f2ece89b581006e115661575fc693a..7d56a47c2aa7f049de9de3077f861b275f8b61ca 100644
--- a/drivers/clk/clk-hsdk-pll.c
+++ b/drivers/clk/clk-hsdk-pll.c
@@ -197,8 +197,8 @@ static unsigned long hsdk_pll_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long hsdk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
+static int hsdk_pll_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	int i;
 	unsigned long best_rate;
@@ -211,13 +211,15 @@ static long hsdk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 	best_rate = pll_cfg[0].rate;
 
 	for (i = 1; pll_cfg[i].rate != 0; i++) {
-		if (abs(rate - pll_cfg[i].rate) < abs(rate - best_rate))
+		if (abs(req->rate - pll_cfg[i].rate) < abs(req->rate - best_rate))
 			best_rate = pll_cfg[i].rate;
 	}
 
 	dev_dbg(clk->dev, "chosen best rate: %lu\n", best_rate);
 
-	return best_rate;
+	req->rate = best_rate;
+
+	return 0;
 }
 
 static int hsdk_pll_comm_update_rate(struct hsdk_pll_clk *clk,
@@ -296,7 +298,7 @@ static int hsdk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops hsdk_pll_ops = {
 	.recalc_rate = hsdk_pll_recalc_rate,
-	.round_rate = hsdk_pll_round_rate,
+	.determine_rate = hsdk_pll_determine_rate,
 	.set_rate = hsdk_pll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 082/114] clk: mediatek: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (80 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 081/114] clk: hsdk-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 083/114] clk: microchip: core: " Brian Masney via B4 Relay
                   ` (38 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mediatek/clk-pll.c   | 13 ++++++++-----
 drivers/clk/mediatek/clk-pll.h   |  3 +--
 drivers/clk/mediatek/clk-pllfh.c |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c
index ce453e1718e5357e992d590fa174cbd1f061d5e1..139d3bfcf45f9ab094aa429e7b2913abaa3e29ea 100644
--- a/drivers/clk/mediatek/clk-pll.c
+++ b/drivers/clk/mediatek/clk-pll.c
@@ -200,16 +200,19 @@ unsigned long mtk_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
 	return __mtk_pll_recalc_rate(pll, parent_rate, pcw, postdiv);
 }
 
-long mtk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *prate)
+int mtk_pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
 {
 	struct mtk_clk_pll *pll = to_mtk_clk_pll(hw);
 	u32 pcw = 0;
 	int postdiv;
 
-	mtk_pll_calc_values(pll, &pcw, &postdiv, rate, *prate);
+	mtk_pll_calc_values(pll, &pcw, &postdiv, req->rate,
+			    req->best_parent_rate);
 
-	return __mtk_pll_recalc_rate(pll, *prate, pcw, postdiv);
+	req->rate = __mtk_pll_recalc_rate(pll, req->best_parent_rate, pcw,
+					  postdiv);
+
+	return 0;
 }
 
 int mtk_pll_prepare(struct clk_hw *hw)
@@ -279,7 +282,7 @@ const struct clk_ops mtk_pll_ops = {
 	.prepare	= mtk_pll_prepare,
 	.unprepare	= mtk_pll_unprepare,
 	.recalc_rate	= mtk_pll_recalc_rate,
-	.round_rate	= mtk_pll_round_rate,
+	.determine_rate = mtk_pll_determine_rate,
 	.set_rate	= mtk_pll_set_rate,
 };
 
diff --git a/drivers/clk/mediatek/clk-pll.h b/drivers/clk/mediatek/clk-pll.h
index 285c8db958b39e4cd30fe76f41a091806da9839e..670fa2e9b898c2ccb53da26e63b30552199fb6b5 100644
--- a/drivers/clk/mediatek/clk-pll.h
+++ b/drivers/clk/mediatek/clk-pll.h
@@ -96,8 +96,7 @@ void mtk_pll_calc_values(struct mtk_clk_pll *pll, u32 *pcw, u32 *postdiv,
 			 u32 freq, u32 fin);
 int mtk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 		     unsigned long parent_rate);
-long mtk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			unsigned long *prate);
+int mtk_pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req);
 
 struct clk_hw *mtk_clk_register_pll_ops(struct mtk_clk_pll *pll,
 					const struct mtk_pll_data *data,
diff --git a/drivers/clk/mediatek/clk-pllfh.c b/drivers/clk/mediatek/clk-pllfh.c
index 094ec8a26d66832d510dba94c96cb555f289ad27..83630ee07ee976bf980c8cf2dd35ea24c1b40821 100644
--- a/drivers/clk/mediatek/clk-pllfh.c
+++ b/drivers/clk/mediatek/clk-pllfh.c
@@ -42,7 +42,7 @@ static const struct clk_ops mtk_pllfh_ops = {
 	.prepare	= mtk_pll_prepare,
 	.unprepare	= mtk_pll_unprepare,
 	.recalc_rate	= mtk_pll_recalc_rate,
-	.round_rate	= mtk_pll_round_rate,
+	.determine_rate = mtk_pll_determine_rate,
 	.set_rate	= mtk_fhctl_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 083/114] clk: microchip: core: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (81 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 082/114] clk: mediatek: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 084/114] clk: mstar: msc313-cpupll: " Brian Masney via B4 Relay
                   ` (37 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/microchip/clk-core.c | 44 ++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index 6fbc6dc50ca3d9f1f0aecc5e43f4d41f23cb371a..3e03e10539c72cc28e53401093e37409c2ea3d08 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -155,11 +155,13 @@ static unsigned long pbclk_recalc_rate(struct clk_hw *hw,
 	return parent_rate / pbclk_read_pbdiv(pb);
 }
 
-static long pbclk_round_rate(struct clk_hw *hw, unsigned long rate,
-			     unsigned long *parent_rate)
+static int pbclk_determine_rate(struct clk_hw *hw,
+				struct clk_rate_request *req)
 {
-	return calc_best_divided_rate(rate, *parent_rate,
-				      PB_DIV_MAX, PB_DIV_MIN);
+	req->rate = calc_best_divided_rate(req->rate, req->best_parent_rate,
+					   PB_DIV_MAX, PB_DIV_MIN);
+
+	return 0;
 }
 
 static int pbclk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -207,7 +209,7 @@ const struct clk_ops pic32_pbclk_ops = {
 	.disable	= pbclk_disable,
 	.is_enabled	= pbclk_is_enabled,
 	.recalc_rate	= pbclk_recalc_rate,
-	.round_rate	= pbclk_round_rate,
+	.determine_rate = pbclk_determine_rate,
 	.set_rate	= pbclk_set_rate,
 };
 
@@ -372,16 +374,18 @@ static unsigned long roclk_recalc_rate(struct clk_hw *hw,
 	return roclk_calc_rate(parent_rate, rodiv, rotrim);
 }
 
-static long roclk_round_rate(struct clk_hw *hw, unsigned long rate,
-			     unsigned long *parent_rate)
+static int roclk_determine_rate(struct clk_hw *hw,
+				struct clk_rate_request *req)
 {
 	u32 rotrim, rodiv;
 
 	/* calculate dividers for new rate */
-	roclk_calc_div_trim(rate, *parent_rate, &rodiv, &rotrim);
+	roclk_calc_div_trim(req->rate, req->best_parent_rate, &rodiv, &rotrim);
 
 	/* caclulate new rate (rounding) based on new rodiv & rotrim */
-	return roclk_calc_rate(*parent_rate, rodiv, rotrim);
+	req->rate = roclk_calc_rate(req->best_parent_rate, rodiv, rotrim);
+
+	return 0;
 }
 
 static int roclk_determine_rate(struct clk_hw *hw,
@@ -665,12 +669,15 @@ static unsigned long spll_clk_recalc_rate(struct clk_hw *hw,
 	return rate64;
 }
 
-static long spll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
+static int spll_clk_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct pic32_sys_pll *pll = clkhw_to_spll(hw);
 
-	return spll_calc_mult_div(pll, rate, *parent_rate, NULL, NULL);
+	req->rate = spll_calc_mult_div(pll, req->rate, req->best_parent_rate,
+				       NULL, NULL);
+
+	return 0;
 }
 
 static int spll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -725,7 +732,7 @@ static int spll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 /* SPLL clock operation */
 const struct clk_ops pic32_spll_ops = {
 	.recalc_rate	= spll_clk_recalc_rate,
-	.round_rate	= spll_clk_round_rate,
+	.determine_rate = spll_clk_determine_rate,
 	.set_rate	= spll_clk_set_rate,
 };
 
@@ -780,10 +787,13 @@ static unsigned long sclk_get_rate(struct clk_hw *hw, unsigned long parent_rate)
 	return parent_rate / div;
 }
 
-static long sclk_round_rate(struct clk_hw *hw, unsigned long rate,
-			    unsigned long *parent_rate)
+static int sclk_determine_rate(struct clk_hw *hw,
+			       struct clk_rate_request *req)
 {
-	return calc_best_divided_rate(rate, *parent_rate, SLEW_SYSDIV, 1);
+	req->rate = calc_best_divided_rate(req->rate, req->best_parent_rate,
+					   SLEW_SYSDIV, 1);
+
+	return 0;
 }
 
 static int sclk_set_rate(struct clk_hw *hw,
@@ -909,7 +919,7 @@ static int sclk_init(struct clk_hw *hw)
 const struct clk_ops pic32_sclk_ops = {
 	.get_parent	= sclk_get_parent,
 	.set_parent	= sclk_set_parent,
-	.round_rate	= sclk_round_rate,
+	.determine_rate = sclk_determine_rate,
 	.set_rate	= sclk_set_rate,
 	.recalc_rate	= sclk_get_rate,
 	.init		= sclk_init,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 084/114] clk: mstar: msc313-cpupll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (82 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 083/114] clk: microchip: core: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-14  4:35   ` Daniel Palmer
  2025-08-11 15:19 ` [PATCH 085/114] clk: mvebu: ap-cpu-clk: " Brian Masney via B4 Relay
                   ` (36 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mstar/clk-msc313-cpupll.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/mstar/clk-msc313-cpupll.c b/drivers/clk/mstar/clk-msc313-cpupll.c
index a93e2dba09d3523199263494efd2bf6987bb4156..3e643be02fe2a79c043c1b79a5e95c869b757ba1 100644
--- a/drivers/clk/mstar/clk-msc313-cpupll.c
+++ b/drivers/clk/mstar/clk-msc313-cpupll.c
@@ -140,20 +140,22 @@ static unsigned long msc313_cpupll_recalc_rate(struct clk_hw *hw, unsigned long
 					     parent_rate);
 }
 
-static long msc313_cpupll_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *parent_rate)
+static int msc313_cpupll_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
-	u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate);
-	long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate);
+	u32 reg = msc313_cpupll_regforfrequecy(req->rate, req->best_parent_rate);
+	long rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate);
 
 	/*
 	 * This is my poor attempt at making sure the resulting
 	 * rate doesn't overshoot the requested rate.
 	 */
-	for (; rounded >= rate && reg > 0; reg--)
-		rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate);
+	for (; rounded >= req->rate && reg > 0; reg--)
+		rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate);
 
-	return rounded;
+	req->rate = rounded;
+
+	return 0;
 }
 
 static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
@@ -168,7 +170,7 @@ static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigne
 
 static const struct clk_ops msc313_cpupll_ops = {
 	.recalc_rate	= msc313_cpupll_recalc_rate,
-	.round_rate	= msc313_cpupll_round_rate,
+	.determine_rate = msc313_cpupll_determine_rate,
 	.set_rate	= msc313_cpupll_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 085/114] clk: mvebu: ap-cpu-clk: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (83 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 084/114] clk: mstar: msc313-cpupll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 086/114] clk: mvebu: armada-37xx-periph: " Brian Masney via B4 Relay
                   ` (35 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mvebu/ap-cpu-clk.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c
index 677cc351484970e8e788c832650689eb04acd08e..1e44ace7d95197b2d8b777329912bf75cd40888d 100644
--- a/drivers/clk/mvebu/ap-cpu-clk.c
+++ b/drivers/clk/mvebu/ap-cpu-clk.c
@@ -210,19 +210,21 @@ static int ap_cpu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static long ap_cpu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *parent_rate)
+static int ap_cpu_clk_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
-	int divider = *parent_rate / rate;
+	int divider = req->best_parent_rate / req->rate;
 
 	divider = min(divider, APN806_MAX_DIVIDER);
 
-	return *parent_rate / divider;
+	req->rate = req->best_parent_rate / divider;
+
+	return 0;
 }
 
 static const struct clk_ops ap_cpu_clk_ops = {
 	.recalc_rate	= ap_cpu_clk_recalc_rate,
-	.round_rate	= ap_cpu_clk_round_rate,
+	.determine_rate = ap_cpu_clk_determine_rate,
 	.set_rate	= ap_cpu_clk_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 086/114] clk: mvebu: armada-37xx-periph: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (84 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 085/114] clk: mvebu: ap-cpu-clk: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 087/114] clk: mvebu: corediv: " Brian Masney via B4 Relay
                   ` (34 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mvebu/armada-37xx-periph.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c
index 13906e31bef8691c59631e7f1940e6cab82549a6..bd0bc8e7b1e7781c6ddeff2a00aab50e57ae30e2 100644
--- a/drivers/clk/mvebu/armada-37xx-periph.c
+++ b/drivers/clk/mvebu/armada-37xx-periph.c
@@ -454,12 +454,12 @@ static unsigned long clk_pm_cpu_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_UP_ULL((u64)parent_rate, div);
 }
 
-static long clk_pm_cpu_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *parent_rate)
+static int clk_pm_cpu_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct clk_pm_cpu *pm_cpu = to_clk_pm_cpu(hw);
 	struct regmap *base = pm_cpu->nb_pm_base;
-	unsigned int div = *parent_rate / rate;
+	unsigned int div = req->best_parent_rate / req->rate;
 	unsigned int load_level;
 	/* only available when DVFS is enabled */
 	if (!armada_3700_pm_dvfs_is_enabled(base))
@@ -474,13 +474,16 @@ static long clk_pm_cpu_round_rate(struct clk_hw *hw, unsigned long rate,
 
 		val >>= offset;
 		val &= ARMADA_37XX_NB_TBG_DIV_MASK;
-		if (val == div)
+		if (val == div) {
 			/*
 			 * We found a load level matching the target
 			 * divider, switch to this load level and
 			 * return.
 			 */
-			return *parent_rate / div;
+			req->rate = req->best_parent_rate / div;
+
+			return 0;
+		}
 	}
 
 	/* We didn't find any valid divider */
@@ -600,7 +603,7 @@ static int clk_pm_cpu_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops clk_pm_cpu_ops = {
 	.get_parent = clk_pm_cpu_get_parent,
-	.round_rate = clk_pm_cpu_round_rate,
+	.determine_rate = clk_pm_cpu_determine_rate,
 	.set_rate = clk_pm_cpu_set_rate,
 	.recalc_rate = clk_pm_cpu_recalc_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 087/114] clk: mvebu: corediv: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (85 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 086/114] clk: mvebu: armada-37xx-periph: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 088/114] clk: mvebu: cpu: " Brian Masney via B4 Relay
                   ` (33 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mvebu/clk-corediv.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/mvebu/clk-corediv.c b/drivers/clk/mvebu/clk-corediv.c
index 818b175391fadb9dbfd2ea7950598741b008d0ba..628032341cbb879628f1e0219689801d26d10f7f 100644
--- a/drivers/clk/mvebu/clk-corediv.c
+++ b/drivers/clk/mvebu/clk-corediv.c
@@ -135,19 +135,21 @@ static unsigned long clk_corediv_recalc_rate(struct clk_hw *hwclk,
 	return parent_rate / div;
 }
 
-static long clk_corediv_round_rate(struct clk_hw *hwclk, unsigned long rate,
-			       unsigned long *parent_rate)
+static int clk_corediv_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	/* Valid ratio are 1:4, 1:5, 1:6 and 1:8 */
 	u32 div;
 
-	div = *parent_rate / rate;
+	div = req->best_parent_rate / req->rate;
 	if (div < 4)
 		div = 4;
 	else if (div > 6)
 		div = 8;
 
-	return *parent_rate / div;
+	req->rate = req->best_parent_rate / div;
+
+	return 0;
 }
 
 static int clk_corediv_set_rate(struct clk_hw *hwclk, unsigned long rate,
@@ -199,7 +201,7 @@ static const struct clk_corediv_soc_desc armada370_corediv_soc = {
 		.disable = clk_corediv_disable,
 		.is_enabled = clk_corediv_is_enabled,
 		.recalc_rate = clk_corediv_recalc_rate,
-		.round_rate = clk_corediv_round_rate,
+		.determine_rate = clk_corediv_determine_rate,
 		.set_rate = clk_corediv_set_rate,
 	},
 	.ratio_reload = BIT(8),
@@ -215,7 +217,7 @@ static const struct clk_corediv_soc_desc armada380_corediv_soc = {
 		.disable = clk_corediv_disable,
 		.is_enabled = clk_corediv_is_enabled,
 		.recalc_rate = clk_corediv_recalc_rate,
-		.round_rate = clk_corediv_round_rate,
+		.determine_rate = clk_corediv_determine_rate,
 		.set_rate = clk_corediv_set_rate,
 	},
 	.ratio_reload = BIT(8),
@@ -228,7 +230,7 @@ static const struct clk_corediv_soc_desc armada375_corediv_soc = {
 	.ndescs = ARRAY_SIZE(mvebu_corediv_desc),
 	.ops = {
 		.recalc_rate = clk_corediv_recalc_rate,
-		.round_rate = clk_corediv_round_rate,
+		.determine_rate = clk_corediv_determine_rate,
 		.set_rate = clk_corediv_set_rate,
 	},
 	.ratio_reload = BIT(8),
@@ -240,7 +242,7 @@ static const struct clk_corediv_soc_desc mv98dx3236_corediv_soc = {
 	.ndescs = ARRAY_SIZE(mv98dx3236_corediv_desc),
 	.ops = {
 		.recalc_rate = clk_corediv_recalc_rate,
-		.round_rate = clk_corediv_round_rate,
+		.determine_rate = clk_corediv_determine_rate,
 		.set_rate = clk_corediv_set_rate,
 	},
 	.ratio_reload = BIT(10),

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 088/114] clk: mvebu: cpu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (86 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 087/114] clk: mvebu: corediv: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 089/114] clk: mvebu: dove-divider: " Brian Masney via B4 Relay
                   ` (32 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mvebu/clk-cpu.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c
index db2b38c21304ecb8cc0bad0ff7de5a0a3c868516..0de7660e73d20b5e2fba349544001f200d859b2d 100644
--- a/drivers/clk/mvebu/clk-cpu.c
+++ b/drivers/clk/mvebu/clk-cpu.c
@@ -56,19 +56,21 @@ static unsigned long clk_cpu_recalc_rate(struct clk_hw *hwclk,
 	return parent_rate / div;
 }
 
-static long clk_cpu_round_rate(struct clk_hw *hwclk, unsigned long rate,
-			       unsigned long *parent_rate)
+static int clk_cpu_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	/* Valid ratio are 1:1, 1:2 and 1:3 */
 	u32 div;
 
-	div = *parent_rate / rate;
+	div = req->best_parent_rate / req->rate;
 	if (div == 0)
 		div = 1;
 	else if (div > 3)
 		div = 3;
 
-	return *parent_rate / div;
+	req->rate = req->best_parent_rate / div;
+
+	return 0;
 }
 
 static int clk_cpu_off_set_rate(struct clk_hw *hwclk, unsigned long rate,
@@ -159,7 +161,7 @@ static int clk_cpu_set_rate(struct clk_hw *hwclk, unsigned long rate,
 
 static const struct clk_ops cpu_ops = {
 	.recalc_rate = clk_cpu_recalc_rate,
-	.round_rate = clk_cpu_round_rate,
+	.determine_rate = clk_cpu_determine_rate,
 	.set_rate = clk_cpu_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 089/114] clk: mvebu: dove-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (87 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 088/114] clk: mvebu: cpu: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 090/114] clk: qcom: alpha-pll: " Brian Masney via B4 Relay
                   ` (31 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/mvebu/dove-divider.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/mvebu/dove-divider.c b/drivers/clk/mvebu/dove-divider.c
index 0a90452ee808b6bf2f1f9f815624b99720c3a81f..47cc49e4cd9992ce32c7215fdda42762f2caff39 100644
--- a/drivers/clk/mvebu/dove-divider.c
+++ b/drivers/clk/mvebu/dove-divider.c
@@ -108,23 +108,23 @@ static unsigned long dove_recalc_rate(struct clk_hw *hw, unsigned long parent)
 	return rate;
 }
 
-static long dove_round_rate(struct clk_hw *hw, unsigned long rate,
-			    unsigned long *parent)
+static int dove_determine_rate(struct clk_hw *hw,
+			       struct clk_rate_request *req)
 {
 	struct dove_clk *dc = to_dove_clk(hw);
-	unsigned long parent_rate = *parent;
+	unsigned long parent_rate = req->best_parent_rate;
 	int divider;
 
-	divider = dove_calc_divider(dc, rate, parent_rate, false);
+	divider = dove_calc_divider(dc, req->rate, parent_rate, false);
 	if (divider < 0)
 		return divider;
 
-	rate = DIV_ROUND_CLOSEST(parent_rate, divider);
+	req->rate = DIV_ROUND_CLOSEST(parent_rate, divider);
 
 	pr_debug("%s(): %s divider=%u parent=%lu rate=%lu\n",
-		 __func__, dc->name, divider, parent_rate, rate);
+		 __func__, dc->name, divider, parent_rate, req->rate);
 
-	return rate;
+	return 0;
 }
 
 static int dove_set_clock(struct clk_hw *hw, unsigned long rate,
@@ -154,7 +154,7 @@ static int dove_set_clock(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops dove_divider_ops = {
 	.set_rate	= dove_set_clock,
-	.round_rate	= dove_round_rate,
+	.determine_rate = dove_determine_rate,
 	.recalc_rate	= dove_recalc_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 090/114] clk: qcom: alpha-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (88 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 089/114] clk: mvebu: dove-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-12  9:13   ` Konrad Dybcio
  2025-08-11 15:19 ` [PATCH 091/114] clk: qcom: regmap-divider: " Brian Masney via B4 Relay
                   ` (30 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Note that prior to running the Coccinelle,
clk_alpha_pll_postdiv_round_ro_rate() was renamed to
clk_alpha_pll_postdiv_ro_round_rate().

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/qcom/clk-alpha-pll.c | 136 ++++++++++++++++++++++-----------------
 1 file changed, 77 insertions(+), 59 deletions(-)

diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index fec6eb376e2707deda11609fe5d0d45082048a0b..7eb2f7bee3a6164bbe38b12a572527ec79ebbb36 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -849,22 +849,25 @@ static int clk_alpha_pll_hwfsm_set_rate(struct clk_hw *hw, unsigned long rate,
 					clk_alpha_pll_hwfsm_is_enabled);
 }
 
-static long clk_alpha_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-				     unsigned long *prate)
+static int clk_alpha_pll_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
 	u32 l, alpha_width = pll_alpha_width(pll);
 	u64 a;
 	unsigned long min_freq, max_freq;
 
-	rate = alpha_pll_round_rate(rate, *prate, &l, &a, alpha_width);
-	if (!pll->vco_table || alpha_pll_find_vco(pll, rate))
-		return rate;
+	req->rate = alpha_pll_round_rate(req->rate, req->best_parent_rate, &l,
+					 &a, alpha_width);
+	if (!pll->vco_table || alpha_pll_find_vco(pll, req->rate))
+		return 0;
 
 	min_freq = pll->vco_table[0].min_freq;
 	max_freq = pll->vco_table[pll->num_vco - 1].max_freq;
 
-	return clamp(rate, min_freq, max_freq);
+	req->rate = clamp(req->rate, min_freq, max_freq);
+
+	return 0;
 }
 
 void clk_huayra_2290_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
@@ -1048,12 +1051,15 @@ static int alpha_pll_huayra_set_rate(struct clk_hw *hw, unsigned long rate,
 	return 0;
 }
 
-static long alpha_pll_huayra_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *prate)
+static int alpha_pll_huayra_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	u32 l, a;
 
-	return alpha_huayra_pll_round_rate(rate, *prate, &l, &a);
+	req->rate = alpha_huayra_pll_round_rate(req->rate,
+						req->best_parent_rate, &l, &a);
+
+	return 0;
 }
 
 static int trion_pll_is_enabled(struct clk_alpha_pll *pll,
@@ -1175,7 +1181,7 @@ const struct clk_ops clk_alpha_pll_ops = {
 	.disable = clk_alpha_pll_disable,
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.recalc_rate = clk_alpha_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_alpha_pll_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_ops);
@@ -1185,7 +1191,7 @@ const struct clk_ops clk_alpha_pll_huayra_ops = {
 	.disable = clk_alpha_pll_disable,
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.recalc_rate = alpha_pll_huayra_recalc_rate,
-	.round_rate = alpha_pll_huayra_round_rate,
+	.determine_rate = alpha_pll_huayra_determine_rate,
 	.set_rate = alpha_pll_huayra_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_huayra_ops);
@@ -1195,7 +1201,7 @@ const struct clk_ops clk_alpha_pll_hwfsm_ops = {
 	.disable = clk_alpha_pll_hwfsm_disable,
 	.is_enabled = clk_alpha_pll_hwfsm_is_enabled,
 	.recalc_rate = clk_alpha_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_alpha_pll_hwfsm_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_hwfsm_ops);
@@ -1205,7 +1211,7 @@ const struct clk_ops clk_alpha_pll_fixed_trion_ops = {
 	.disable = clk_trion_pll_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_trion_ops);
 
@@ -1240,9 +1246,8 @@ static const struct clk_div_table clk_alpha_2bit_div_table[] = {
 	{ }
 };
 
-static long
-clk_alpha_pll_postdiv_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *prate)
+static int clk_alpha_pll_postdiv_determine_rate(struct clk_hw *hw,
+						struct clk_rate_request *req)
 {
 	struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
 	const struct clk_div_table *table;
@@ -1252,13 +1257,15 @@ clk_alpha_pll_postdiv_round_rate(struct clk_hw *hw, unsigned long rate,
 	else
 		table = clk_alpha_div_table;
 
-	return divider_round_rate(hw, rate, prate, table,
-				  pll->width, CLK_DIVIDER_POWER_OF_TWO);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       table, pll->width,
+				       CLK_DIVIDER_POWER_OF_TWO);
+
+	return 0;
 }
 
-static long
-clk_alpha_pll_postdiv_round_ro_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *prate)
+static int clk_alpha_pll_postdiv_ro_determine_rate(struct clk_hw *hw,
+						   struct clk_rate_request *req)
 {
 	struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
 	u32 ctl, div;
@@ -1270,9 +1277,12 @@ clk_alpha_pll_postdiv_round_ro_rate(struct clk_hw *hw, unsigned long rate,
 	div = 1 << fls(ctl);
 
 	if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)
-		*prate = clk_hw_round_rate(clk_hw_get_parent(hw), div * rate);
+		req->best_parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw),
+							  div * req->rate);
+
+	req->rate = DIV_ROUND_UP_ULL((u64) req->best_parent_rate, div);
 
-	return DIV_ROUND_UP_ULL((u64)*prate, div);
+	return 0;
 }
 
 static int clk_alpha_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -1291,13 +1301,13 @@ static int clk_alpha_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops clk_alpha_pll_postdiv_ops = {
 	.recalc_rate = clk_alpha_pll_postdiv_recalc_rate,
-	.round_rate = clk_alpha_pll_postdiv_round_rate,
+	.determine_rate = clk_alpha_pll_postdiv_determine_rate,
 	.set_rate = clk_alpha_pll_postdiv_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_ops);
 
 const struct clk_ops clk_alpha_pll_postdiv_ro_ops = {
-	.round_rate = clk_alpha_pll_postdiv_round_ro_rate,
+	.determine_rate = clk_alpha_pll_postdiv_ro_determine_rate,
 	.recalc_rate = clk_alpha_pll_postdiv_recalc_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_ro_ops);
@@ -1542,7 +1552,7 @@ const struct clk_ops clk_alpha_pll_fabia_ops = {
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.set_rate = alpha_pll_fabia_set_rate,
 	.recalc_rate = alpha_pll_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_fabia_ops);
 
@@ -1551,7 +1561,7 @@ const struct clk_ops clk_alpha_pll_fixed_fabia_ops = {
 	.disable = alpha_pll_fabia_disable,
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.recalc_rate = alpha_pll_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_fabia_ops);
 
@@ -1602,14 +1612,16 @@ clk_trion_pll_postdiv_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
 	return (parent_rate / div);
 }
 
-static long
-clk_trion_pll_postdiv_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *prate)
+static int clk_trion_pll_postdiv_determine_rate(struct clk_hw *hw,
+						struct clk_rate_request *req)
 {
 	struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
 
-	return divider_round_rate(hw, rate, prate, pll->post_div_table,
-				  pll->width, CLK_DIVIDER_ROUND_CLOSEST);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       pll->post_div_table,
+				       pll->width, CLK_DIVIDER_ROUND_CLOSEST);
+
+	return 0;
 };
 
 static int
@@ -1635,18 +1647,21 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops clk_alpha_pll_postdiv_trion_ops = {
 	.recalc_rate = clk_trion_pll_postdiv_recalc_rate,
-	.round_rate = clk_trion_pll_postdiv_round_rate,
+	.determine_rate = clk_trion_pll_postdiv_determine_rate,
 	.set_rate = clk_trion_pll_postdiv_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_trion_ops);
 
-static long clk_alpha_pll_postdiv_fabia_round_rate(struct clk_hw *hw,
-				unsigned long rate, unsigned long *prate)
+static int clk_alpha_pll_postdiv_fabia_determine_rate(struct clk_hw *hw,
+						      struct clk_rate_request *req)
 {
 	struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
 
-	return divider_round_rate(hw, rate, prate, pll->post_div_table,
-				pll->width, CLK_DIVIDER_ROUND_CLOSEST);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       pll->post_div_table,
+				       pll->width, CLK_DIVIDER_ROUND_CLOSEST);
+
+	return 0;
 }
 
 static int clk_alpha_pll_postdiv_fabia_set_rate(struct clk_hw *hw,
@@ -1681,7 +1696,7 @@ static int clk_alpha_pll_postdiv_fabia_set_rate(struct clk_hw *hw,
 
 const struct clk_ops clk_alpha_pll_postdiv_fabia_ops = {
 	.recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_postdiv_fabia_round_rate,
+	.determine_rate = clk_alpha_pll_postdiv_fabia_determine_rate,
 	.set_rate = clk_alpha_pll_postdiv_fabia_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_fabia_ops);
@@ -1833,7 +1848,7 @@ const struct clk_ops clk_alpha_pll_trion_ops = {
 	.disable = clk_trion_pll_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = alpha_pll_trion_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_trion_ops);
@@ -1844,14 +1859,14 @@ const struct clk_ops clk_alpha_pll_lucid_ops = {
 	.disable = clk_trion_pll_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = alpha_pll_trion_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_lucid_ops);
 
 const struct clk_ops clk_alpha_pll_postdiv_lucid_ops = {
 	.recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_postdiv_fabia_round_rate,
+	.determine_rate = clk_alpha_pll_postdiv_fabia_determine_rate,
 	.set_rate = clk_alpha_pll_postdiv_fabia_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_lucid_ops);
@@ -1903,7 +1918,7 @@ const struct clk_ops clk_alpha_pll_agera_ops = {
 	.disable = clk_alpha_pll_disable,
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.recalc_rate = alpha_pll_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_alpha_pll_agera_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_agera_ops);
@@ -2119,7 +2134,7 @@ const struct clk_ops clk_alpha_pll_lucid_5lpe_ops = {
 	.disable = alpha_pll_lucid_5lpe_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = alpha_pll_lucid_5lpe_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_lucid_5lpe_ops);
@@ -2129,13 +2144,13 @@ const struct clk_ops clk_alpha_pll_fixed_lucid_5lpe_ops = {
 	.disable = alpha_pll_lucid_5lpe_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_lucid_5lpe_ops);
 
 const struct clk_ops clk_alpha_pll_postdiv_lucid_5lpe_ops = {
 	.recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_postdiv_fabia_round_rate,
+	.determine_rate = clk_alpha_pll_postdiv_fabia_determine_rate,
 	.set_rate = clk_lucid_5lpe_pll_postdiv_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_lucid_5lpe_ops);
@@ -2304,7 +2319,7 @@ const struct clk_ops clk_alpha_pll_zonda_ops = {
 	.disable = clk_zonda_pll_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_zonda_pll_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_zonda_ops);
@@ -2529,13 +2544,13 @@ const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops = {
 	.disable = alpha_pll_lucid_evo_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = alpha_pll_lucid_evo_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_lucid_evo_ops);
 
 const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops = {
 	.recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate,
-	.round_rate = clk_alpha_pll_postdiv_fabia_round_rate,
+	.determine_rate = clk_alpha_pll_postdiv_fabia_determine_rate,
 	.set_rate = clk_lucid_evo_pll_postdiv_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_lucid_evo_ops);
@@ -2546,7 +2561,7 @@ const struct clk_ops clk_alpha_pll_lucid_evo_ops = {
 	.disable = alpha_pll_lucid_evo_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = alpha_pll_lucid_evo_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = alpha_pll_lucid_5lpe_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_lucid_evo_ops);
@@ -2557,7 +2572,7 @@ const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops = {
 	.disable = alpha_pll_reset_lucid_evo_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = alpha_pll_lucid_evo_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = alpha_pll_lucid_5lpe_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_reset_lucid_evo_ops);
@@ -2732,22 +2747,25 @@ static unsigned long clk_rivian_evo_pll_recalc_rate(struct clk_hw *hw,
 	return parent_rate * l;
 }
 
-static long clk_rivian_evo_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-					  unsigned long *prate)
+static int clk_rivian_evo_pll_determine_rate(struct clk_hw *hw,
+					     struct clk_rate_request *req)
 {
 	struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
 	unsigned long min_freq, max_freq;
 	u32 l;
 	u64 a;
 
-	rate = alpha_pll_round_rate(rate, *prate, &l, &a, 0);
-	if (!pll->vco_table || alpha_pll_find_vco(pll, rate))
-		return rate;
+	req->rate = alpha_pll_round_rate(req->rate, req->best_parent_rate, &l,
+					 &a, 0);
+	if (!pll->vco_table || alpha_pll_find_vco(pll, req->rate))
+		return 0;
 
 	min_freq = pll->vco_table[0].min_freq;
 	max_freq = pll->vco_table[pll->num_vco - 1].max_freq;
 
-	return clamp(rate, min_freq, max_freq);
+	req->rate = clamp(req->rate, min_freq, max_freq);
+
+	return 0;
 }
 
 const struct clk_ops clk_alpha_pll_rivian_evo_ops = {
@@ -2755,7 +2773,7 @@ const struct clk_ops clk_alpha_pll_rivian_evo_ops = {
 	.disable = alpha_pll_lucid_5lpe_disable,
 	.is_enabled = clk_trion_pll_is_enabled,
 	.recalc_rate = clk_rivian_evo_pll_recalc_rate,
-	.round_rate = clk_rivian_evo_pll_round_rate,
+	.determine_rate = clk_rivian_evo_pll_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_rivian_evo_ops);
 
@@ -2964,7 +2982,7 @@ const struct clk_ops clk_alpha_pll_regera_ops = {
 	.disable = clk_zonda_pll_disable,
 	.is_enabled = clk_alpha_pll_is_enabled,
 	.recalc_rate = clk_trion_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_zonda_pll_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops);
@@ -3169,7 +3187,7 @@ const struct clk_ops clk_alpha_pll_slew_ops = {
 	.enable = clk_alpha_pll_slew_enable,
 	.disable = clk_alpha_pll_disable,
 	.recalc_rate = clk_alpha_pll_recalc_rate,
-	.round_rate = clk_alpha_pll_round_rate,
+	.determine_rate = clk_alpha_pll_determine_rate,
 	.set_rate = clk_alpha_pll_slew_set_rate,
 };
 EXPORT_SYMBOL(clk_alpha_pll_slew_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 091/114] clk: qcom: regmap-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (89 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 090/114] clk: qcom: alpha-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-12  9:14   ` Konrad Dybcio
  2025-08-11 15:19 ` [PATCH 092/114] clk: renesas: rzg2l-cpg: " Brian Masney via B4 Relay
                   ` (29 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Note that prior to running the Coccinelle, div_round_ro_rate() was
renamed to div_ro_round_rate().

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/qcom/clk-regmap-divider.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/qcom/clk-regmap-divider.c b/drivers/clk/qcom/clk-regmap-divider.c
index 63c9fca0d65d7436db4fe45c17d347baea922900..4f5395f0ab6d0ed8cebbb32cc231063932ba85a1 100644
--- a/drivers/clk/qcom/clk-regmap-divider.c
+++ b/drivers/clk/qcom/clk-regmap-divider.c
@@ -15,8 +15,8 @@ static inline struct clk_regmap_div *to_clk_regmap_div(struct clk_hw *hw)
 	return container_of(to_clk_regmap(hw), struct clk_regmap_div, clkr);
 }
 
-static long div_round_ro_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *prate)
+static int div_ro_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct clk_regmap_div *divider = to_clk_regmap_div(hw);
 	struct clk_regmap *clkr = &divider->clkr;
@@ -26,17 +26,24 @@ static long div_round_ro_rate(struct clk_hw *hw, unsigned long rate,
 	val >>= divider->shift;
 	val &= BIT(divider->width) - 1;
 
-	return divider_ro_round_rate(hw, rate, prate, NULL, divider->width,
-				     CLK_DIVIDER_ROUND_CLOSEST, val);
+	req->rate = divider_ro_round_rate(hw, req->rate,
+					  &req->best_parent_rate, NULL,
+					  divider->width,
+					  CLK_DIVIDER_ROUND_CLOSEST, val);
+
+	return 0;
 }
 
-static long div_round_rate(struct clk_hw *hw, unsigned long rate,
-			   unsigned long *prate)
+static int div_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
 {
 	struct clk_regmap_div *divider = to_clk_regmap_div(hw);
 
-	return divider_round_rate(hw, rate, prate, NULL, divider->width,
-				  CLK_DIVIDER_ROUND_CLOSEST);
+	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+				       NULL,
+				       divider->width,
+				       CLK_DIVIDER_ROUND_CLOSEST);
+
+	return 0;
 }
 
 static int div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -70,14 +77,14 @@ static unsigned long div_recalc_rate(struct clk_hw *hw,
 }
 
 const struct clk_ops clk_regmap_div_ops = {
-	.round_rate = div_round_rate,
+	.determine_rate = div_determine_rate,
 	.set_rate = div_set_rate,
 	.recalc_rate = div_recalc_rate,
 };
 EXPORT_SYMBOL_GPL(clk_regmap_div_ops);
 
 const struct clk_ops clk_regmap_div_ro_ops = {
-	.round_rate = div_round_ro_rate,
+	.determine_rate = div_ro_determine_rate,
 	.recalc_rate = div_recalc_rate,
 };
 EXPORT_SYMBOL_GPL(clk_regmap_div_ro_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 092/114] clk: renesas: rzg2l-cpg: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (90 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 091/114] clk: qcom: regmap-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-14 15:06   ` Geert Uytterhoeven
  2025-08-11 15:19 ` [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
                   ` (28 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/renesas/rzg2l-cpg.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index 187233302818a66a763daefdd1c982b2a6e4e71f..b508823f9723c27678aafb46eb28e3b04f011636 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -824,11 +824,10 @@ static unsigned long rzg2l_cpg_sipll5_recalc_rate(struct clk_hw *hw,
 	return pll5_rate;
 }
 
-static long rzg2l_cpg_sipll5_round_rate(struct clk_hw *hw,
-					unsigned long rate,
-					unsigned long *parent_rate)
+static int rzg2l_cpg_sipll5_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
-	return rate;
+	return 0;
 }
 
 static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
@@ -902,7 +901,7 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw,
 
 static const struct clk_ops rzg2l_cpg_sipll5_ops = {
 	.recalc_rate = rzg2l_cpg_sipll5_recalc_rate,
-	.round_rate = rzg2l_cpg_sipll5_round_rate,
+	.determine_rate = rzg2l_cpg_sipll5_determine_rate,
 	.set_rate = rzg2l_cpg_sipll5_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (91 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 092/114] clk: renesas: rzg2l-cpg: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-14 15:11   ` Geert Uytterhoeven
  2025-08-11 15:19 ` [PATCH 094/114] clk: rockchip: ddr: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (27 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

This driver implements both the determine_rate() and round_rate() clk
ops, and the round_rate() clk ops is deprecated. When both are defined,
clk_core_determine_round_nolock() from the clk core will only use the
determine_rate() clk ops, so let's remove the round_rate() clk ops since
it's unused.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/renesas/rzv2h-cpg.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c
index f468afbb54e2d192c094e0048a698664ae99bd00..58ccbae0f9046388e568f7da0b8a890dfa001c47 100644
--- a/drivers/clk/renesas/rzv2h-cpg.c
+++ b/drivers/clk/renesas/rzv2h-cpg.c
@@ -294,15 +294,6 @@ static unsigned long rzv2h_ddiv_recalc_rate(struct clk_hw *hw,
 				   divider->flags, divider->width);
 }
 
-static long rzv2h_ddiv_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *prate)
-{
-	struct clk_divider *divider = to_clk_divider(hw);
-
-	return divider_round_rate(hw, rate, prate, divider->table,
-				  divider->width, divider->flags);
-}
-
 static int rzv2h_ddiv_determine_rate(struct clk_hw *hw,
 				     struct clk_rate_request *req)
 {
@@ -359,7 +350,6 @@ static int rzv2h_ddiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops rzv2h_ddiv_clk_divider_ops = {
 	.recalc_rate = rzv2h_ddiv_recalc_rate,
-	.round_rate = rzv2h_ddiv_round_rate,
 	.determine_rate = rzv2h_ddiv_determine_rate,
 	.set_rate = rzv2h_ddiv_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 094/114] clk: rockchip: ddr: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (92 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 095/114] clk: rockchip: half-divider: " Brian Masney via B4 Relay
                   ` (26 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/rockchip/clk-ddr.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/rockchip/clk-ddr.c b/drivers/clk/rockchip/clk-ddr.c
index 86718c54e56b3ff52ee6ea9f209159de91e9da39..8866a65982a0489f1aacd546bda60af1d30278ee 100644
--- a/drivers/clk/rockchip/clk-ddr.c
+++ b/drivers/clk/rockchip/clk-ddr.c
@@ -55,17 +55,18 @@ rockchip_ddrclk_sip_recalc_rate(struct clk_hw *hw,
 	return res.a0;
 }
 
-static long rockchip_ddrclk_sip_round_rate(struct clk_hw *hw,
-					   unsigned long rate,
-					   unsigned long *prate)
+static int rockchip_ddrclk_sip_determine_rate(struct clk_hw *hw,
+					      struct clk_rate_request *req)
 {
 	struct arm_smccc_res res;
 
-	arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, rate, 0,
+	arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, req->rate, 0,
 		      ROCKCHIP_SIP_CONFIG_DRAM_ROUND_RATE,
 		      0, 0, 0, 0, &res);
 
-	return res.a0;
+	req->rate = res.a0;
+
+	return 0;
 }
 
 static u8 rockchip_ddrclk_get_parent(struct clk_hw *hw)
@@ -83,7 +84,7 @@ static u8 rockchip_ddrclk_get_parent(struct clk_hw *hw)
 static const struct clk_ops rockchip_ddrclk_sip_ops = {
 	.recalc_rate = rockchip_ddrclk_sip_recalc_rate,
 	.set_rate = rockchip_ddrclk_sip_set_rate,
-	.round_rate = rockchip_ddrclk_sip_round_rate,
+	.determine_rate = rockchip_ddrclk_sip_determine_rate,
 	.get_parent = rockchip_ddrclk_get_parent,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 095/114] clk: rockchip: half-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (93 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 094/114] clk: rockchip: ddr: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 096/114] clk: rockchip: pll: " Brian Masney via B4 Relay
                   ` (25 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/rockchip/clk-half-divider.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c
index 64f7faad2148f27099d1ace36da45207e2315a1c..e94e39442d0c0cfb9370f9386a0da16eb3c5fc5b 100644
--- a/drivers/clk/rockchip/clk-half-divider.c
+++ b/drivers/clk/rockchip/clk-half-divider.c
@@ -92,17 +92,19 @@ static int clk_half_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
 	return bestdiv;
 }
 
-static long clk_half_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *prate)
+static int clk_half_divider_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct clk_divider *divider = to_clk_divider(hw);
 	int div;
 
-	div = clk_half_divider_bestdiv(hw, rate, prate,
+	div = clk_half_divider_bestdiv(hw, req->rate, &req->best_parent_rate,
 				       divider->width,
 				       divider->flags);
 
-	return DIV_ROUND_UP_ULL(((u64)*prate * 2), div * 2 + 3);
+	req->rate = DIV_ROUND_UP_ULL(((u64) req->best_parent_rate * 2), div * 2 + 3);
+
+	return 0;
 }
 
 static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -141,7 +143,7 @@ static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops clk_half_divider_ops = {
 	.recalc_rate = clk_half_divider_recalc_rate,
-	.round_rate = clk_half_divider_round_rate,
+	.determine_rate = clk_half_divider_determine_rate,
 	.set_rate = clk_half_divider_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 096/114] clk: rockchip: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (94 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 095/114] clk: rockchip: half-divider: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 097/114] clk: rp1: " Brian Masney via B4 Relay
                   ` (24 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/rockchip/clk-pll.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
index c9d599c31923fc6a7f6a25a2296cd5853c881c60..86dba3826a77ef303c18c5a7b1ea1a54531786be 100644
--- a/drivers/clk/rockchip/clk-pll.c
+++ b/drivers/clk/rockchip/clk-pll.c
@@ -61,8 +61,8 @@ static const struct rockchip_pll_rate_table *rockchip_get_pll_settings(
 	return NULL;
 }
 
-static long rockchip_pll_round_rate(struct clk_hw *hw,
-			    unsigned long drate, unsigned long *prate)
+static int rockchip_pll_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct rockchip_clk_pll *pll = to_rockchip_clk_pll(hw);
 	const struct rockchip_pll_rate_table *rate_table = pll->rate_table;
@@ -70,12 +70,17 @@ static long rockchip_pll_round_rate(struct clk_hw *hw,
 
 	/* Assuming rate_table is in descending order */
 	for (i = 0; i < pll->rate_count; i++) {
-		if (drate >= rate_table[i].rate)
-			return rate_table[i].rate;
+		if (req->rate >= rate_table[i].rate) {
+			req->rate = rate_table[i].rate;
+
+			return 0;
+		}
 	}
 
 	/* return minimum supported value */
-	return rate_table[i - 1].rate;
+	req->rate = rate_table[i - 1].rate;
+
+	return 0;
 }
 
 /*
@@ -352,7 +357,7 @@ static const struct clk_ops rockchip_rk3036_pll_clk_norate_ops = {
 
 static const struct clk_ops rockchip_rk3036_pll_clk_ops = {
 	.recalc_rate = rockchip_rk3036_pll_recalc_rate,
-	.round_rate = rockchip_pll_round_rate,
+	.determine_rate = rockchip_pll_determine_rate,
 	.set_rate = rockchip_rk3036_pll_set_rate,
 	.enable = rockchip_rk3036_pll_enable,
 	.disable = rockchip_rk3036_pll_disable,
@@ -571,7 +576,7 @@ static const struct clk_ops rockchip_rk3066_pll_clk_norate_ops = {
 
 static const struct clk_ops rockchip_rk3066_pll_clk_ops = {
 	.recalc_rate = rockchip_rk3066_pll_recalc_rate,
-	.round_rate = rockchip_pll_round_rate,
+	.determine_rate = rockchip_pll_determine_rate,
 	.set_rate = rockchip_rk3066_pll_set_rate,
 	.enable = rockchip_rk3066_pll_enable,
 	.disable = rockchip_rk3066_pll_disable,
@@ -836,7 +841,7 @@ static const struct clk_ops rockchip_rk3399_pll_clk_norate_ops = {
 
 static const struct clk_ops rockchip_rk3399_pll_clk_ops = {
 	.recalc_rate = rockchip_rk3399_pll_recalc_rate,
-	.round_rate = rockchip_pll_round_rate,
+	.determine_rate = rockchip_pll_determine_rate,
 	.set_rate = rockchip_rk3399_pll_set_rate,
 	.enable = rockchip_rk3399_pll_enable,
 	.disable = rockchip_rk3399_pll_disable,
@@ -1036,7 +1041,7 @@ static const struct clk_ops rockchip_rk3588_pll_clk_norate_ops = {
 
 static const struct clk_ops rockchip_rk3588_pll_clk_ops = {
 	.recalc_rate = rockchip_rk3588_pll_recalc_rate,
-	.round_rate = rockchip_pll_round_rate,
+	.determine_rate = rockchip_pll_determine_rate,
 	.set_rate = rockchip_rk3588_pll_set_rate,
 	.enable = rockchip_rk3588_pll_enable,
 	.disable = rockchip_rk3588_pll_disable,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 097/114] clk: rp1: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (95 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 096/114] clk: rockchip: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 098/114] clk: samsung: cpu: " Brian Masney via B4 Relay
                   ` (23 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-rp1.c | 45 ++++++++++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 19 deletions(-)

diff --git a/drivers/clk/clk-rp1.c b/drivers/clk/clk-rp1.c
index afff90d487341cee0463e62e4066ff0eb723bd07..8d985c431d9e35a5bfe48b45a24bf26555659b7c 100644
--- a/drivers/clk/clk-rp1.c
+++ b/drivers/clk/clk-rp1.c
@@ -530,13 +530,15 @@ static unsigned long rp1_pll_core_recalc_rate(struct clk_hw *hw,
 	return calc_rate;
 }
 
-static long rp1_pll_core_round_rate(struct clk_hw *hw, unsigned long rate,
-				    unsigned long *parent_rate)
+static int rp1_pll_core_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	u32 fbdiv_int, fbdiv_frac;
 
-	return get_pll_core_divider(hw, rate, *parent_rate,
-				    &fbdiv_int, &fbdiv_frac);
+	req->rate = get_pll_core_divider(hw, req->rate, req->best_parent_rate,
+					 &fbdiv_int, &fbdiv_frac);
+
+	return 0;
 }
 
 static void get_pll_prim_dividers(unsigned long rate, unsigned long parent_rate,
@@ -614,14 +616,16 @@ static unsigned long rp1_pll_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_CLOSEST(parent_rate, prim_div1 * prim_div2);
 }
 
-static long rp1_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int rp1_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	u32 div1, div2;
 
-	get_pll_prim_dividers(rate, *parent_rate, &div1, &div2);
+	get_pll_prim_dividers(req->rate, req->best_parent_rate, &div1, &div2);
 
-	return DIV_ROUND_CLOSEST(*parent_rate, div1 * div2);
+	req->rate = DIV_ROUND_CLOSEST(req->best_parent_rate, div1 * div2);
+
+	return 0;
 }
 
 static int rp1_pll_ph_is_on(struct clk_hw *hw)
@@ -671,13 +675,15 @@ static unsigned long rp1_pll_ph_recalc_rate(struct clk_hw *hw,
 	return parent_rate / data->fixed_divider;
 }
 
-static long rp1_pll_ph_round_rate(struct clk_hw *hw, unsigned long rate,
-				  unsigned long *parent_rate)
+static int rp1_pll_ph_determine_rate(struct clk_hw *hw,
+				     struct clk_rate_request *req)
 {
 	struct rp1_clk_desc *pll_ph = container_of(hw, struct rp1_clk_desc, hw);
 	const struct rp1_pll_ph_data *data = pll_ph->data;
 
-	return *parent_rate / data->fixed_divider;
+	req->rate = req->best_parent_rate / data->fixed_divider;
+
+	return 0;
 }
 
 static int rp1_pll_divider_is_on(struct clk_hw *hw)
@@ -754,11 +760,12 @@ static unsigned long rp1_pll_divider_recalc_rate(struct clk_hw *hw,
 	return clk_divider_ops.recalc_rate(hw, parent_rate);
 }
 
-static long rp1_pll_divider_round_rate(struct clk_hw *hw,
-				       unsigned long rate,
-				       unsigned long *parent_rate)
+static int rp1_pll_divider_determine_rate(struct clk_hw *hw,
+					  struct clk_rate_request *req)
 {
-	return clk_divider_ops.round_rate(hw, rate, parent_rate);
+	req->rate = clk_divider_ops.determine_rate(hw, req);
+
+	return 0;
 }
 
 static int rp1_clock_is_on(struct clk_hw *hw)
@@ -1068,13 +1075,13 @@ static const struct clk_ops rp1_pll_core_ops = {
 	.unprepare = rp1_pll_core_off,
 	.set_rate = rp1_pll_core_set_rate,
 	.recalc_rate = rp1_pll_core_recalc_rate,
-	.round_rate = rp1_pll_core_round_rate,
+	.determine_rate = rp1_pll_core_determine_rate,
 };
 
 static const struct clk_ops rp1_pll_ops = {
 	.set_rate = rp1_pll_set_rate,
 	.recalc_rate = rp1_pll_recalc_rate,
-	.round_rate = rp1_pll_round_rate,
+	.determine_rate = rp1_pll_determine_rate,
 };
 
 static const struct clk_ops rp1_pll_ph_ops = {
@@ -1082,7 +1089,7 @@ static const struct clk_ops rp1_pll_ph_ops = {
 	.prepare = rp1_pll_ph_on,
 	.unprepare = rp1_pll_ph_off,
 	.recalc_rate = rp1_pll_ph_recalc_rate,
-	.round_rate = rp1_pll_ph_round_rate,
+	.determine_rate = rp1_pll_ph_determine_rate,
 };
 
 static const struct clk_ops rp1_pll_divider_ops = {
@@ -1091,7 +1098,7 @@ static const struct clk_ops rp1_pll_divider_ops = {
 	.unprepare = rp1_pll_divider_off,
 	.set_rate = rp1_pll_divider_set_rate,
 	.recalc_rate = rp1_pll_divider_recalc_rate,
-	.round_rate = rp1_pll_divider_round_rate,
+	.determine_rate = rp1_pll_divider_determine_rate,
 };
 
 static const struct clk_ops rp1_clk_ops = {

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 098/114] clk: samsung: cpu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (96 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 097/114] clk: rp1: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-23 16:50   ` (subset) " Krzysztof Kozlowski
  2025-08-11 15:19 ` [PATCH 099/114] clk: samsung: pll: " Brian Masney via B4 Relay
                   ` (22 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/samsung/clk-cpu.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c
index 4e1ebd8a30b1b422e33a4bb4527006e36c41666f..300f8d5d3c48d8c08fa599aad74526cd9dd822c7 100644
--- a/drivers/clk/samsung/clk-cpu.c
+++ b/drivers/clk/samsung/clk-cpu.c
@@ -567,12 +567,14 @@ static int exynos850_cpuclk_post_rate_change(struct clk_notifier_data *ndata,
 /* -------------------------------------------------------------------------- */
 
 /* Common round rate callback usable for all types of CPU clocks */
-static long exynos_cpuclk_round_rate(struct clk_hw *hw, unsigned long drate,
-				     unsigned long *prate)
+static int exynos_cpuclk_determine_rate(struct clk_hw *hw,
+					struct clk_rate_request *req)
 {
 	struct clk_hw *parent = clk_hw_get_parent(hw);
-	*prate = clk_hw_round_rate(parent, drate);
-	return *prate;
+	req->best_parent_rate = clk_hw_round_rate(parent, req->rate);
+	req->rate = req->best_parent_rate;
+
+	return 0;
 }
 
 /* Common recalc rate callback usable for all types of CPU clocks */
@@ -591,7 +593,7 @@ static unsigned long exynos_cpuclk_recalc_rate(struct clk_hw *hw,
 
 static const struct clk_ops exynos_cpuclk_clk_ops = {
 	.recalc_rate = exynos_cpuclk_recalc_rate,
-	.round_rate = exynos_cpuclk_round_rate,
+	.determine_rate = exynos_cpuclk_determine_rate,
 };
 
 /*

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 099/114] clk: samsung: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (97 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 098/114] clk: samsung: cpu: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-23 16:50   ` (subset) " Krzysztof Kozlowski
  2025-08-11 15:19 ` [PATCH 100/114] clk: sp7021: " Brian Masney via B4 Relay
                   ` (21 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/samsung/clk-pll.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c
index e4faf02b631e07dea69be0bb7d141f52fa9900ae..3c04a0388ff9c6cec5b9b5779ad0c3be2b11cf07 100644
--- a/drivers/clk/samsung/clk-pll.c
+++ b/drivers/clk/samsung/clk-pll.c
@@ -49,8 +49,8 @@ static const struct samsung_pll_rate_table *samsung_get_pll_settings(
 	return NULL;
 }
 
-static long samsung_pll_round_rate(struct clk_hw *hw,
-			unsigned long drate, unsigned long *prate)
+static int samsung_pll_determine_rate(struct clk_hw *hw,
+				      struct clk_rate_request *req)
 {
 	struct samsung_clk_pll *pll = to_clk_pll(hw);
 	const struct samsung_pll_rate_table *rate_table = pll->rate_table;
@@ -58,12 +58,17 @@ static long samsung_pll_round_rate(struct clk_hw *hw,
 
 	/* Assuming rate_table is in descending order */
 	for (i = 0; i < pll->rate_count; i++) {
-		if (drate >= rate_table[i].rate)
-			return rate_table[i].rate;
+		if (req->rate >= rate_table[i].rate) {
+			req->rate = rate_table[i].rate;
+
+			return 0;
+		}
 	}
 
 	/* return minimum supported value */
-	return rate_table[i - 1].rate;
+	req->rate = rate_table[i - 1].rate;
+
+	return 0;
 }
 
 static bool pll_early_timeout = true;
@@ -298,7 +303,7 @@ static int samsung_pll35xx_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll35xx_clk_ops = {
 	.recalc_rate = samsung_pll35xx_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll35xx_set_rate,
 	.enable = samsung_pll3xxx_enable,
 	.disable = samsung_pll3xxx_disable,
@@ -411,7 +416,7 @@ static int samsung_pll36xx_set_rate(struct clk_hw *hw, unsigned long drate,
 static const struct clk_ops samsung_pll36xx_clk_ops = {
 	.recalc_rate = samsung_pll36xx_recalc_rate,
 	.set_rate = samsung_pll36xx_set_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.enable = samsung_pll3xxx_enable,
 	.disable = samsung_pll3xxx_disable,
 };
@@ -514,7 +519,7 @@ static int samsung_pll0822x_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll0822x_clk_ops = {
 	.recalc_rate = samsung_pll0822x_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll0822x_set_rate,
 	.enable = samsung_pll3xxx_enable,
 	.disable = samsung_pll3xxx_disable,
@@ -612,7 +617,7 @@ static int samsung_pll0831x_set_rate(struct clk_hw *hw, unsigned long drate,
 static const struct clk_ops samsung_pll0831x_clk_ops = {
 	.recalc_rate = samsung_pll0831x_recalc_rate,
 	.set_rate = samsung_pll0831x_set_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.enable = samsung_pll3xxx_enable,
 	.disable = samsung_pll3xxx_disable,
 };
@@ -735,7 +740,7 @@ static int samsung_pll45xx_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll45xx_clk_ops = {
 	.recalc_rate = samsung_pll45xx_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll45xx_set_rate,
 };
 
@@ -880,7 +885,7 @@ static int samsung_pll46xx_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll46xx_clk_ops = {
 	.recalc_rate = samsung_pll46xx_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll46xx_set_rate,
 };
 
@@ -1093,7 +1098,7 @@ static int samsung_pll2550xx_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll2550xx_clk_ops = {
 	.recalc_rate = samsung_pll2550xx_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll2550xx_set_rate,
 };
 
@@ -1185,7 +1190,7 @@ static int samsung_pll2650x_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops samsung_pll2650x_clk_ops = {
 	.recalc_rate = samsung_pll2650x_recalc_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 	.set_rate = samsung_pll2650x_set_rate,
 };
 
@@ -1277,7 +1282,7 @@ static int samsung_pll2650xx_set_rate(struct clk_hw *hw, unsigned long drate,
 static const struct clk_ops samsung_pll2650xx_clk_ops = {
 	.recalc_rate = samsung_pll2650xx_recalc_rate,
 	.set_rate = samsung_pll2650xx_set_rate,
-	.round_rate = samsung_pll_round_rate,
+	.determine_rate = samsung_pll_determine_rate,
 };
 
 static const struct clk_ops samsung_pll2650xx_clk_min_ops = {

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 100/114] clk: sp7021: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (98 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 099/114] clk: samsung: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 101/114] clk: spear: aux-synth: " Brian Masney via B4 Relay
                   ` (20 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-sp7021.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/clk-sp7021.c b/drivers/clk/clk-sp7021.c
index 95d66191df4bdb3609128ea097be896ef3a1038a..445e3da50e29f931b73f05fe956d9d38affe0ca7 100644
--- a/drivers/clk/clk-sp7021.c
+++ b/drivers/clk/clk-sp7021.c
@@ -412,25 +412,27 @@ static long sp_pll_calc_div(struct sp_pll *clk, unsigned long rate)
 	return fbdiv;
 }
 
-static long sp_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *prate)
+static int sp_pll_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
 {
 	struct sp_pll *clk = to_sp_pll(hw);
 	long ret;
 
-	if (rate == *prate) {
-		ret = *prate; /* bypass */
+	if (req->rate == req->best_parent_rate) {
+		ret = req->best_parent_rate; /* bypass */
 	} else if (clk->div_width == DIV_A) {
-		ret = plla_round_rate(clk, rate);
+		ret = plla_round_rate(clk, req->rate);
 	} else if (clk->div_width == DIV_TV) {
-		ret = plltv_div(clk, rate);
+		ret = plltv_div(clk, req->rate);
 		if (ret < 0)
-			ret = *prate;
+			ret = req->best_parent_rate;
 	} else {
-		ret = sp_pll_calc_div(clk, rate) * clk->brate;
+		ret = sp_pll_calc_div(clk, req->rate) * clk->brate;
 	}
 
-	return ret;
+	req->rate = ret;
+
+	return 0;
 }
 
 static unsigned long sp_pll_recalc_rate(struct clk_hw *hw,
@@ -535,7 +537,7 @@ static const struct clk_ops sp_pll_ops = {
 	.enable = sp_pll_enable,
 	.disable = sp_pll_disable,
 	.is_enabled = sp_pll_is_enabled,
-	.round_rate = sp_pll_round_rate,
+	.determine_rate = sp_pll_determine_rate,
 	.recalc_rate = sp_pll_recalc_rate,
 	.set_rate = sp_pll_set_rate
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 101/114] clk: spear: aux-synth: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (99 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 100/114] clk: sp7021: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 102/114] clk: spear: frac-synth: " Brian Masney via B4 Relay
                   ` (19 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spear/clk-aux-synth.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c
index 637938e804f875e9416f9546bab0bd8681f00337..d0d063147af8c4f81bfa9b2a8446e1a56455fe39 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -49,14 +49,16 @@ static unsigned long aux_calc_rate(struct clk_hw *hw, unsigned long prate,
 			(rtbl[index].yscale * eq)) * 10000;
 }
 
-static long clk_aux_round_rate(struct clk_hw *hw, unsigned long drate,
-		unsigned long *prate)
+static int clk_aux_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct clk_aux *aux = to_clk_aux(hw);
 	int unused;
 
-	return clk_round_rate_index(hw, drate, *prate, aux_calc_rate,
-			aux->rtbl_cnt, &unused);
+	req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
+					 aux_calc_rate, aux->rtbl_cnt, &unused);
+
+	return 0;
 }
 
 static unsigned long clk_aux_recalc_rate(struct clk_hw *hw,
@@ -127,7 +129,7 @@ static int clk_aux_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_aux_ops = {
 	.recalc_rate = clk_aux_recalc_rate,
-	.round_rate = clk_aux_round_rate,
+	.determine_rate = clk_aux_determine_rate,
 	.set_rate = clk_aux_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 102/114] clk: spear: frac-synth: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (100 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 101/114] clk: spear: aux-synth: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 103/114] clk: spear: gpt-synth: " Brian Masney via B4 Relay
                   ` (18 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spear/clk-frac-synth.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c
index 2380df293a2c7052db6f165755ff611402ddbf91..150f051d28e0eb0574653b980396285c89943e24 100644
--- a/drivers/clk/spear/clk-frac-synth.c
+++ b/drivers/clk/spear/clk-frac-synth.c
@@ -52,14 +52,16 @@ static unsigned long frac_calc_rate(struct clk_hw *hw, unsigned long prate,
 	return prate;
 }
 
-static long clk_frac_round_rate(struct clk_hw *hw, unsigned long drate,
-		unsigned long *prate)
+static int clk_frac_determine_rate(struct clk_hw *hw,
+				   struct clk_rate_request *req)
 {
 	struct clk_frac *frac = to_clk_frac(hw);
 	int unused;
 
-	return clk_round_rate_index(hw, drate, *prate, frac_calc_rate,
-			frac->rtbl_cnt, &unused);
+	req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
+					 frac_calc_rate, frac->rtbl_cnt, &unused);
+
+	return 0;
 }
 
 static unsigned long clk_frac_recalc_rate(struct clk_hw *hw,
@@ -115,7 +117,7 @@ static int clk_frac_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_frac_ops = {
 	.recalc_rate = clk_frac_recalc_rate,
-	.round_rate = clk_frac_round_rate,
+	.determine_rate = clk_frac_determine_rate,
 	.set_rate = clk_frac_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 103/114] clk: spear: gpt-synth: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (101 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 102/114] clk: spear: frac-synth: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 104/114] clk: spear: vco-pll: " Brian Masney via B4 Relay
                   ` (17 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spear/clk-gpt-synth.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c
index 4ef747c2abbb0374bec6d6541fa6b8b8904e6c08..cf9659dc9073cba903a0e2a9cef9629ae7f97022 100644
--- a/drivers/clk/spear/clk-gpt-synth.c
+++ b/drivers/clk/spear/clk-gpt-synth.c
@@ -39,14 +39,16 @@ static unsigned long gpt_calc_rate(struct clk_hw *hw, unsigned long prate,
 	return prate;
 }
 
-static long clk_gpt_round_rate(struct clk_hw *hw, unsigned long drate,
-		unsigned long *prate)
+static int clk_gpt_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct clk_gpt *gpt = to_clk_gpt(hw);
 	int unused;
 
-	return clk_round_rate_index(hw, drate, *prate, gpt_calc_rate,
-			gpt->rtbl_cnt, &unused);
+	req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
+					 gpt_calc_rate, gpt->rtbl_cnt, &unused);
+
+	return 0;
 }
 
 static unsigned long clk_gpt_recalc_rate(struct clk_hw *hw,
@@ -104,7 +106,7 @@ static int clk_gpt_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_gpt_ops = {
 	.recalc_rate = clk_gpt_recalc_rate,
-	.round_rate = clk_gpt_round_rate,
+	.determine_rate = clk_gpt_determine_rate,
 	.set_rate = clk_gpt_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 104/114] clk: spear: vco-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (102 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 103/114] clk: spear: gpt-synth: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 105/114] clk: ux500: prcmu: " Brian Masney via B4 Relay
                   ` (16 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/spear/clk-vco-pll.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c
index 348eeab0a906bfc3b6291e723a23e26d5eb142dc..723a6eb677540cd643caa02a91307cdd2f842aca 100644
--- a/drivers/clk/spear/clk-vco-pll.c
+++ b/drivers/clk/spear/clk-vco-pll.c
@@ -110,12 +110,15 @@ static long clk_pll_round_rate_index(struct clk_hw *hw, unsigned long drate,
 	return rate;
 }
 
-static long clk_pll_round_rate(struct clk_hw *hw, unsigned long drate,
-				unsigned long *prate)
+static int clk_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	int unused;
 
-	return clk_pll_round_rate_index(hw, drate, prate, &unused);
+	req->rate = clk_pll_round_rate_index(hw, req->rate,
+					     &req->best_parent_rate, &unused);
+
+	return 0;
 }
 
 static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, unsigned long
@@ -164,7 +167,7 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_pll_ops = {
 	.recalc_rate = clk_pll_recalc_rate,
-	.round_rate = clk_pll_round_rate,
+	.determine_rate = clk_pll_determine_rate,
 	.set_rate = clk_pll_set_rate,
 };
 
@@ -176,14 +179,16 @@ static inline unsigned long vco_calc_rate(struct clk_hw *hw,
 	return pll_calc_rate(vco->rtbl, prate, index, NULL);
 }
 
-static long clk_vco_round_rate(struct clk_hw *hw, unsigned long drate,
-		unsigned long *prate)
+static int clk_vco_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct clk_vco *vco = to_clk_vco(hw);
 	int unused;
 
-	return clk_round_rate_index(hw, drate, *prate, vco_calc_rate,
-			vco->rtbl_cnt, &unused);
+	req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
+					 vco_calc_rate, vco->rtbl_cnt, &unused);
+
+	return 0;
 }
 
 static unsigned long clk_vco_recalc_rate(struct clk_hw *hw,
@@ -265,7 +270,7 @@ static int clk_vco_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_vco_ops = {
 	.recalc_rate = clk_vco_recalc_rate,
-	.round_rate = clk_vco_round_rate,
+	.determine_rate = clk_vco_determine_rate,
 	.set_rate = clk_vco_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 105/114] clk: ux500: prcmu: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (103 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 104/114] clk: spear: vco-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-19  9:47   ` Linus Walleij
  2025-08-11 15:19 ` [PATCH 106/114] clk: versaclock5: " Brian Masney via B4 Relay
                   ` (15 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/ux500/clk-prcmu.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
index 5cbf24c94606081b0ec18c8aaa201ef89b54edf0..f775e18acd468d91cc2d6cf7a289bb722d614141 100644
--- a/drivers/clk/ux500/clk-prcmu.c
+++ b/drivers/clk/ux500/clk-prcmu.c
@@ -53,11 +53,13 @@ static unsigned long clk_prcmu_recalc_rate(struct clk_hw *hw,
 	return prcmu_clock_rate(clk->cg_sel);
 }
 
-static long clk_prcmu_round_rate(struct clk_hw *hw, unsigned long rate,
-				 unsigned long *parent_rate)
+static int clk_prcmu_determine_rate(struct clk_hw *hw,
+				    struct clk_rate_request *req)
 {
 	struct clk_prcmu *clk = to_clk_prcmu(hw);
-	return prcmu_round_clock_rate(clk->cg_sel, rate);
+	req->rate = prcmu_round_clock_rate(clk->cg_sel, req->rate);
+
+	return 0;
 }
 
 static int clk_prcmu_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -157,7 +159,7 @@ static const struct clk_ops clk_prcmu_scalable_ops = {
 	.prepare = clk_prcmu_prepare,
 	.unprepare = clk_prcmu_unprepare,
 	.recalc_rate = clk_prcmu_recalc_rate,
-	.round_rate = clk_prcmu_round_rate,
+	.determine_rate = clk_prcmu_determine_rate,
 	.set_rate = clk_prcmu_set_rate,
 };
 
@@ -169,7 +171,7 @@ static const struct clk_ops clk_prcmu_gate_ops = {
 
 static const struct clk_ops clk_prcmu_scalable_rate_ops = {
 	.recalc_rate = clk_prcmu_recalc_rate,
-	.round_rate = clk_prcmu_round_rate,
+	.determine_rate = clk_prcmu_determine_rate,
 	.set_rate = clk_prcmu_set_rate,
 };
 
@@ -187,7 +189,7 @@ static const struct clk_ops clk_prcmu_opp_volt_scalable_ops = {
 	.prepare = clk_prcmu_opp_volt_prepare,
 	.unprepare = clk_prcmu_opp_volt_unprepare,
 	.recalc_rate = clk_prcmu_recalc_rate,
-	.round_rate = clk_prcmu_round_rate,
+	.determine_rate = clk_prcmu_determine_rate,
 	.set_rate = clk_prcmu_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 106/114] clk: versaclock5: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (104 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 105/114] clk: ux500: prcmu: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-13  9:07   ` Luca Ceresoli
  2025-08-11 15:19 ` [PATCH 107/114] clk: versaclock7: " Brian Masney via B4 Relay
                   ` (14 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-versaclock5.c | 71 ++++++++++++++++++++++++-------------------
 1 file changed, 40 insertions(+), 31 deletions(-)

diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
index 4200022d20846038f02e191042da2a188c392402..57228e88e81dc6f2af955a82a3275430e46c0920 100644
--- a/drivers/clk/clk-versaclock5.c
+++ b/drivers/clk/clk-versaclock5.c
@@ -304,11 +304,11 @@ static unsigned long vc5_dbl_recalc_rate(struct clk_hw *hw,
 	return parent_rate;
 }
 
-static long vc5_dbl_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc5_dbl_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
-	if ((*parent_rate == rate) || ((*parent_rate * 2) == rate))
-		return rate;
+	if ((req->best_parent_rate == req->rate) || ((req->best_parent_rate * 2) == req->rate))
+		return 0;
 	else
 		return -EINVAL;
 }
@@ -332,7 +332,7 @@ static int vc5_dbl_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc5_dbl_ops = {
 	.recalc_rate	= vc5_dbl_recalc_rate,
-	.round_rate	= vc5_dbl_round_rate,
+	.determine_rate = vc5_dbl_determine_rate,
 	.set_rate	= vc5_dbl_set_rate,
 };
 
@@ -363,24 +363,29 @@ static unsigned long vc5_pfd_recalc_rate(struct clk_hw *hw,
 		return parent_rate / VC5_REF_DIVIDER_REF_DIV(div);
 }
 
-static long vc5_pfd_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc5_pfd_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	unsigned long idiv;
 
 	/* PLL cannot operate with input clock above 50 MHz. */
-	if (rate > 50000000)
+	if (req->rate > 50000000)
 		return -EINVAL;
 
 	/* CLKIN within range of PLL input, feed directly to PLL. */
-	if (*parent_rate <= 50000000)
-		return *parent_rate;
+	if (req->best_parent_rate <= 50000000) {
+		req->rate = req->best_parent_rate;
+
+		return 0;
+	}
 
-	idiv = DIV_ROUND_UP(*parent_rate, rate);
+	idiv = DIV_ROUND_UP(req->best_parent_rate, req->rate);
 	if (idiv > 127)
 		return -EINVAL;
 
-	return *parent_rate / idiv;
+	req->rate = req->best_parent_rate / idiv;
+
+	return 0;
 }
 
 static int vc5_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -420,7 +425,7 @@ static int vc5_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc5_pfd_ops = {
 	.recalc_rate	= vc5_pfd_recalc_rate,
-	.round_rate	= vc5_pfd_round_rate,
+	.determine_rate = vc5_pfd_determine_rate,
 	.set_rate	= vc5_pfd_set_rate,
 };
 
@@ -444,30 +449,32 @@ static unsigned long vc5_pll_recalc_rate(struct clk_hw *hw,
 	return (parent_rate * div_int) + ((parent_rate * div_frc) >> 24);
 }
 
-static long vc5_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc5_pll_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc5_hw_data *hwdata = container_of(hw, struct vc5_hw_data, hw);
 	struct vc5_driver_data *vc5 = hwdata->vc5;
 	u32 div_int;
 	u64 div_frc;
 
-	rate = clamp(rate, VC5_PLL_VCO_MIN, vc5->chip_info->vco_max);
+	req->rate = clamp(req->rate, VC5_PLL_VCO_MIN, vc5->chip_info->vco_max);
 
 	/* Determine integer part, which is 12 bit wide */
-	div_int = rate / *parent_rate;
+	div_int = req->rate / req->best_parent_rate;
 	if (div_int > 0xfff)
-		rate = *parent_rate * 0xfff;
+		req->rate = req->best_parent_rate * 0xfff;
 
 	/* Determine best fractional part, which is 24 bit wide */
-	div_frc = rate % *parent_rate;
+	div_frc = req->rate % req->best_parent_rate;
 	div_frc *= BIT(24) - 1;
-	do_div(div_frc, *parent_rate);
+	do_div(div_frc, req->best_parent_rate);
 
 	hwdata->div_int = div_int;
 	hwdata->div_frc = (u32)div_frc;
 
-	return (*parent_rate * div_int) + ((*parent_rate * div_frc) >> 24);
+	req->rate = (req->best_parent_rate * div_int) + ((req->best_parent_rate * div_frc) >> 24);
+
+	return 0;
 }
 
 static int vc5_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -488,7 +495,7 @@ static int vc5_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc5_pll_ops = {
 	.recalc_rate	= vc5_pll_recalc_rate,
-	.round_rate	= vc5_pll_round_rate,
+	.determine_rate = vc5_pll_determine_rate,
 	.set_rate	= vc5_pll_set_rate,
 };
 
@@ -520,17 +527,17 @@ static unsigned long vc5_fod_recalc_rate(struct clk_hw *hw,
 	return div64_u64((u64)f_in << 24ULL, ((u64)div_int << 24ULL) + div_frc);
 }
 
-static long vc5_fod_round_rate(struct clk_hw *hw, unsigned long rate,
-			       unsigned long *parent_rate)
+static int vc5_fod_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc5_hw_data *hwdata = container_of(hw, struct vc5_hw_data, hw);
 	/* VCO frequency is divided by two before entering FOD */
-	u32 f_in = *parent_rate / 2;
+	u32 f_in = req->best_parent_rate / 2;
 	u32 div_int;
 	u64 div_frc;
 
 	/* Determine integer part, which is 12 bit wide */
-	div_int = f_in / rate;
+	div_int = f_in / req->rate;
 	/*
 	 * WARNING: The clock chip does not output signal if the integer part
 	 *          of the divider is 0xfff and fractional part is non-zero.
@@ -538,18 +545,20 @@ static long vc5_fod_round_rate(struct clk_hw *hw, unsigned long rate,
 	 */
 	if (div_int > 0xffe) {
 		div_int = 0xffe;
-		rate = f_in / div_int;
+		req->rate = f_in / div_int;
 	}
 
 	/* Determine best fractional part, which is 30 bit wide */
-	div_frc = f_in % rate;
+	div_frc = f_in % req->rate;
 	div_frc <<= 24;
-	do_div(div_frc, rate);
+	do_div(div_frc, req->rate);
 
 	hwdata->div_int = div_int;
 	hwdata->div_frc = (u32)div_frc;
 
-	return div64_u64((u64)f_in << 24ULL, ((u64)div_int << 24ULL) + div_frc);
+	req->rate = div64_u64((u64)f_in << 24ULL, ((u64)div_int << 24ULL) + div_frc);
+
+	return 0;
 }
 
 static int vc5_fod_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -589,7 +598,7 @@ static int vc5_fod_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vc5_fod_ops = {
 	.recalc_rate	= vc5_fod_recalc_rate,
-	.round_rate	= vc5_fod_round_rate,
+	.determine_rate = vc5_fod_determine_rate,
 	.set_rate	= vc5_fod_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 107/114] clk: versaclock7: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (105 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 106/114] clk: versaclock5: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:19 ` [PATCH 108/114] clk: versatile: icst: " Brian Masney via B4 Relay
                   ` (13 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-versaclock7.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c
index 483285b30c13d90117850458998b8fd6136574b8..adcc603e32593121f7e760e62e77a06a976672e7 100644
--- a/drivers/clk/clk-versaclock7.c
+++ b/drivers/clk/clk-versaclock7.c
@@ -900,17 +900,18 @@ static unsigned long vc7_fod_recalc_rate(struct clk_hw *hw, unsigned long parent
 	return fod_rate;
 }
 
-static long vc7_fod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate)
+static int vc7_fod_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc7_fod_data *fod = container_of(hw, struct vc7_fod_data, hw);
 	unsigned long fod_rate;
 
 	pr_debug("%s - %s: requested rate: %lu, parent_rate: %lu\n",
-		 __func__, clk_hw_get_name(hw), rate, *parent_rate);
+		 __func__, clk_hw_get_name(hw), req->rate, req->best_parent_rate);
 
-	vc7_calc_fod_divider(rate, *parent_rate,
+	vc7_calc_fod_divider(req->rate, req->best_parent_rate,
 			     &fod->fod_1st_int, &fod->fod_2nd_int, &fod->fod_frac);
-	fod_rate = vc7_calc_fod_2nd_stage_rate(*parent_rate, fod->fod_1st_int,
+	fod_rate = vc7_calc_fod_2nd_stage_rate(req->best_parent_rate, fod->fod_1st_int,
 					       fod->fod_2nd_int, fod->fod_frac);
 
 	pr_debug("%s - %s: fod_1st_int: %u, fod_2nd_int: %u, fod_frac: %llu\n",
@@ -918,7 +919,9 @@ static long vc7_fod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned l
 		 fod->fod_1st_int, fod->fod_2nd_int, fod->fod_frac);
 	pr_debug("%s - %s rate: %lu\n", __func__, clk_hw_get_name(hw), fod_rate);
 
-	return fod_rate;
+	req->rate = fod_rate;
+
+	return 0;
 }
 
 static int vc7_fod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
@@ -952,7 +955,7 @@ static int vc7_fod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long
 
 static const struct clk_ops vc7_fod_ops = {
 	.recalc_rate = vc7_fod_recalc_rate,
-	.round_rate = vc7_fod_round_rate,
+	.determine_rate = vc7_fod_determine_rate,
 	.set_rate = vc7_fod_set_rate,
 };
 
@@ -978,21 +981,24 @@ static unsigned long vc7_iod_recalc_rate(struct clk_hw *hw, unsigned long parent
 	return iod_rate;
 }
 
-static long vc7_iod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate)
+static int vc7_iod_determine_rate(struct clk_hw *hw,
+				  struct clk_rate_request *req)
 {
 	struct vc7_iod_data *iod = container_of(hw, struct vc7_iod_data, hw);
 	unsigned long iod_rate;
 
 	pr_debug("%s - %s: requested rate: %lu, parent_rate: %lu\n",
-		 __func__, clk_hw_get_name(hw), rate, *parent_rate);
+		 __func__, clk_hw_get_name(hw), req->rate, req->best_parent_rate);
 
-	vc7_calc_iod_divider(rate, *parent_rate, &iod->iod_int);
-	iod_rate = div64_u64(*parent_rate, iod->iod_int);
+	vc7_calc_iod_divider(req->rate, req->best_parent_rate, &iod->iod_int);
+	iod_rate = div64_u64(req->best_parent_rate, iod->iod_int);
 
 	pr_debug("%s - %s: iod_int: %u\n", __func__, clk_hw_get_name(hw), iod->iod_int);
 	pr_debug("%s - %s rate: %ld\n", __func__, clk_hw_get_name(hw), iod_rate);
 
-	return iod_rate;
+	req->rate = iod_rate;
+
+	return 0;
 }
 
 static int vc7_iod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
@@ -1023,7 +1029,7 @@ static int vc7_iod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long
 
 static const struct clk_ops vc7_iod_ops = {
 	.recalc_rate = vc7_iod_recalc_rate,
-	.round_rate = vc7_iod_round_rate,
+	.determine_rate = vc7_iod_determine_rate,
 	.set_rate = vc7_iod_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 108/114] clk: versatile: icst: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (106 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 107/114] clk: versaclock7: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-19  9:47   ` Linus Walleij
  2025-08-11 15:19 ` [PATCH 109/114] clk: versatile: vexpress-osc: " Brian Masney via B4 Relay
                   ` (12 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/versatile/clk-icst.c | 72 +++++++++++++++++++++++++---------------
 1 file changed, 45 insertions(+), 27 deletions(-)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index b69c3fbdfbce66876d5b1d4faaf4050759e44561..86ca04ad9fab0334f7b051377db709338a1f7244 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -234,39 +234,51 @@ static unsigned long icst_recalc_rate(struct clk_hw *hw,
 	return icst->rate;
 }
 
-static long icst_round_rate(struct clk_hw *hw, unsigned long rate,
-			    unsigned long *prate)
+static int icst_determine_rate(struct clk_hw *hw,
+			       struct clk_rate_request *req)
 {
 	struct clk_icst *icst = to_icst(hw);
 	struct icst_vco vco;
 
 	if (icst->ctype == ICST_INTEGRATOR_AP_CM ||
 	    icst->ctype == ICST_INTEGRATOR_CP_CM_CORE) {
-		if (rate <= 12000000)
-			return 12000000;
-		if (rate >= 160000000)
-			return 160000000;
-		/* Slam to closest megahertz */
-		return DIV_ROUND_CLOSEST(rate, 1000000) * 1000000;
+		if (req->rate <= 12000000)
+			req->rate = 12000000;
+		else if (req->rate >= 160000000)
+			req->rate = 160000000;
+		else {
+			/* Slam to closest megahertz */
+			req->rate = DIV_ROUND_CLOSEST(req->rate, 1000000) * 1000000;
+		}
+
+		return 0;
 	}
 
 	if (icst->ctype == ICST_INTEGRATOR_CP_CM_MEM) {
-		if (rate <= 6000000)
-			return 6000000;
-		if (rate >= 66000000)
-			return 66000000;
-		/* Slam to closest 0.5 megahertz */
-		return DIV_ROUND_CLOSEST(rate, 500000) * 500000;
+		if (req->rate <= 6000000)
+			req->rate = 6000000;
+		else if (req->rate >= 66000000)
+			req->rate = 66000000;
+		else {
+			/* Slam to closest 0.5 megahertz */
+			req->rate = DIV_ROUND_CLOSEST(req->rate, 500000) * 500000;
+		}
+
+		return 0;
 	}
 
 	if (icst->ctype == ICST_INTEGRATOR_AP_SYS) {
 		/* Divides between 3 and 50 MHz in steps of 0.25 MHz */
-		if (rate <= 3000000)
-			return 3000000;
-		if (rate >= 50000000)
-			return 5000000;
-		/* Slam to closest 0.25 MHz */
-		return DIV_ROUND_CLOSEST(rate, 250000) * 250000;
+		if (req->rate <= 3000000)
+			req->rate = 3000000;
+		else if (req->rate >= 50000000)
+			req->rate = 5000000;
+		else {
+			/* Slam to closest 0.25 MHz */
+			req->rate = DIV_ROUND_CLOSEST(req->rate, 250000) * 250000;
+		}
+
+		return 0;
 	}
 
 	if (icst->ctype == ICST_INTEGRATOR_AP_PCI) {
@@ -274,14 +286,20 @@ static long icst_round_rate(struct clk_hw *hw, unsigned long rate,
 		 * If we're below or less than halfway from 25 to 33 MHz
 		 * select 25 MHz
 		 */
-		if (rate <= 25000000 || rate < 29000000)
-			return 25000000;
-		/* Else just return the default frequency */
-		return 33000000;
+		if (req->rate <= 25000000 || req->rate < 29000000)
+			req->rate = 25000000;
+		else {
+			/* Else just return the default frequency */
+			req->rate = 33000000;
+		}
+
+		return 0;
 	}
 
-	vco = icst_hz_to_vco(icst->params, rate);
-	return icst_hz(icst->params, vco);
+	vco = icst_hz_to_vco(icst->params, req->rate);
+	req->rate = icst_hz(icst->params, vco);
+
+	return 0;
 }
 
 static int icst_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -329,7 +347,7 @@ static int icst_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops icst_ops = {
 	.recalc_rate = icst_recalc_rate,
-	.round_rate = icst_round_rate,
+	.determine_rate = icst_determine_rate,
 	.set_rate = icst_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 109/114] clk: versatile: vexpress-osc: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (107 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 108/114] clk: versatile: icst: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-19  9:49   ` Linus Walleij
  2025-08-11 15:19 ` [PATCH 110/114] clk: visconti: pll: " Brian Masney via B4 Relay
                   ` (11 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/versatile/clk-vexpress-osc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index c385ca2f4a744dff3c3e4cf30add2e80718075ad..9adbf5c33bd1cadab0968134ddee1d1061f61239 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -33,18 +33,18 @@ static unsigned long vexpress_osc_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long vexpress_osc_round_rate(struct clk_hw *hw, unsigned long rate,
-		unsigned long *parent_rate)
+static int vexpress_osc_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct vexpress_osc *osc = to_vexpress_osc(hw);
 
-	if (osc->rate_min && rate < osc->rate_min)
-		rate = osc->rate_min;
+	if (osc->rate_min && req->rate < osc->rate_min)
+		req->rate = osc->rate_min;
 
-	if (osc->rate_max && rate > osc->rate_max)
-		rate = osc->rate_max;
+	if (osc->rate_max && req->rate > osc->rate_max)
+		req->rate = osc->rate_max;
 
-	return rate;
+	return 0;
 }
 
 static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -57,7 +57,7 @@ static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vexpress_osc_ops = {
 	.recalc_rate = vexpress_osc_recalc_rate,
-	.round_rate = vexpress_osc_round_rate,
+	.determine_rate = vexpress_osc_determine_rate,
 	.set_rate = vexpress_osc_set_rate,
 };
 

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 110/114] clk: visconti: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (108 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 109/114] clk: versatile: vexpress-osc: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-18  0:48   ` nobuhiro1.iwamatsu
  2025-08-11 15:19 ` [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
                   ` (10 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/visconti/pll.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c
index 8ca1bad61864204027b7aff9020f1cb9e7d198d3..681721d8503203de9ac49ac3207e121bb5bf2163 100644
--- a/drivers/clk/visconti/pll.c
+++ b/drivers/clk/visconti/pll.c
@@ -100,8 +100,8 @@ static unsigned long visconti_get_pll_rate_from_data(struct visconti_pll *pll,
 	return rate_table[0].rate;
 }
 
-static long visconti_pll_round_rate(struct clk_hw *hw,
-				    unsigned long rate, unsigned long *prate)
+static int visconti_pll_determine_rate(struct clk_hw *hw,
+				       struct clk_rate_request *req)
 {
 	struct visconti_pll *pll = to_visconti_pll(hw);
 	const struct visconti_pll_rate_table *rate_table = pll->rate_table;
@@ -109,11 +109,16 @@ static long visconti_pll_round_rate(struct clk_hw *hw,
 
 	/* Assuming rate_table is in descending order */
 	for (i = 0; i < pll->rate_count; i++)
-		if (rate >= rate_table[i].rate)
-			return rate_table[i].rate;
+		if (req->rate >= rate_table[i].rate) {
+			req->rate = rate_table[i].rate;
+
+			return 0;
+		}
 
 	/* return minimum supported value */
-	return rate_table[i - 1].rate;
+	req->rate = rate_table[i - 1].rate;
+
+	return 0;
 }
 
 static unsigned long visconti_pll_recalc_rate(struct clk_hw *hw,
@@ -232,7 +237,7 @@ static const struct clk_ops visconti_pll_ops = {
 	.enable = visconti_pll_enable,
 	.disable = visconti_pll_disable,
 	.is_enabled = visconti_pll_is_enabled,
-	.round_rate = visconti_pll_round_rate,
+	.determine_rate = visconti_pll_determine_rate,
 	.recalc_rate = visconti_pll_recalc_rate,
 	.set_rate = visconti_pll_set_rate,
 };

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (109 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 110/114] clk: visconti: pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 16:02   ` Alexander Sverdlin
  2025-08-14 15:10   ` Geert Uytterhoeven
  2025-08-11 15:19 ` [PATCH 112/114] clk: scmi: " Brian Masney via B4 Relay
                   ` (9 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

This driver implements both the determine_rate() and round_rate() clk
ops, and the round_rate() clk ops is deprecated. When both are defined,
clk_core_determine_round_nolock() from the clk core will only use the
determine_rate() clk ops. Also all clk drivers that directly calls
divider's round_rate() have been migrated over to determine_rate(). So
let's remove the round_rate() clk ops.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-divider.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index c1f426b8a5043cb5a1de08e1da385928ec54a2ed..2601b6155afb7391c6a0ffb91c58fa66cde98197 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -431,27 +431,6 @@ long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
 }
 EXPORT_SYMBOL_GPL(divider_ro_round_rate_parent);
 
-static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
-{
-	struct clk_divider *divider = to_clk_divider(hw);
-
-	/* if read only, just return current value */
-	if (divider->flags & CLK_DIVIDER_READ_ONLY) {
-		u32 val;
-
-		val = clk_div_readl(divider) >> divider->shift;
-		val &= clk_div_mask(divider->width);
-
-		return divider_ro_round_rate(hw, rate, prate, divider->table,
-					     divider->width, divider->flags,
-					     val);
-	}
-
-	return divider_round_rate(hw, rate, prate, divider->table,
-				  divider->width, divider->flags);
-}
-
 static int clk_divider_determine_rate(struct clk_hw *hw,
 				      struct clk_rate_request *req)
 {
@@ -527,7 +506,6 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops clk_divider_ops = {
 	.recalc_rate = clk_divider_recalc_rate,
-	.round_rate = clk_divider_round_rate,
 	.determine_rate = clk_divider_determine_rate,
 	.set_rate = clk_divider_set_rate,
 };
@@ -535,7 +513,6 @@ EXPORT_SYMBOL_GPL(clk_divider_ops);
 
 const struct clk_ops clk_divider_ro_ops = {
 	.recalc_rate = clk_divider_recalc_rate,
-	.round_rate = clk_divider_round_rate,
 	.determine_rate = clk_divider_determine_rate,
 };
 EXPORT_SYMBOL_GPL(clk_divider_ro_ops);

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (110 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:38   ` Alexander Sverdlin
  2025-08-27  7:09   ` Peng Fan
  2025-08-11 15:19 ` [PATCH 113/114] clk: sophgo: sg2042-pll: " Brian Masney via B4 Relay
                   ` (8 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

This driver implements both the determine_rate() and round_rate() clk
ops, and the round_rate() clk ops is deprecated. When both are defined,
clk_core_determine_round_nolock() from the clk core will only use the
determine_rate() clk ops, so let's remove the round_rate() clk ops since
it's unused.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-scmi.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644
--- a/drivers/clk/clk-scmi.c
+++ b/drivers/clk/clk-scmi.c
@@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *parent_rate)
-{
-	u64 fmin, fmax, ftmp;
-	struct scmi_clk *clk = to_scmi_clk(hw);
-
-	/*
-	 * We can't figure out what rate it will be, so just return the
-	 * rate back to the caller. scmi_clk_recalc_rate() will be called
-	 * after the rate is set and we'll know what rate the clock is
-	 * running at then.
-	 */
-	if (clk->info->rate_discrete)
-		return rate;
-
-	fmin = clk->info->range.min_rate;
-	fmax = clk->info->range.max_rate;
-	if (rate <= fmin)
-		return fmin;
-	else if (rate >= fmax)
-		return fmax;
-
-	ftmp = rate - fmin;
-	ftmp += clk->info->range.step_size - 1; /* to round up */
-	do_div(ftmp, clk->info->range.step_size);
-
-	return ftmp * clk->info->range.step_size + fmin;
-}
-
 static int scmi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 			     unsigned long parent_rate)
 {
@@ -300,7 +271,6 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key)
 
 	/* Rate ops */
 	ops->recalc_rate = scmi_clk_recalc_rate;
-	ops->round_rate = scmi_clk_round_rate;
 	ops->determine_rate = scmi_clk_determine_rate;
 	if (feats_key & BIT(SCMI_CLK_RATE_CTRL_SUPPORTED))
 		ops->set_rate = scmi_clk_set_rate;

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 113/114] clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (111 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 112/114] clk: scmi: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:36   ` Alexander Sverdlin
  2025-08-14  8:46   ` Chen Wang
  2025-08-11 15:19 ` [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops Brian Masney via B4 Relay
                   ` (7 subsequent siblings)
  120 siblings, 2 replies; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

This driver implements both the determine_rate() and round_rate() clk
ops, and the round_rate() clk ops is deprecated. When both are defined,
clk_core_determine_round_nolock() from the clk core will only use the
determine_rate() clk ops, so let's remove the round_rate() clk ops since
it's unused.

The implementation of sg2042_clk_pll_determine_rate() calls
sg2042_clk_pll_round_rate(), so this folds the two into a single
function.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/sophgo/clk-sg2042-pll.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c
index e5fb0bb7ac4f97616f3b472fcab45e5729eb653e..b2cbd50ac73c7538b1acbca517f4259cba885fcc 100644
--- a/drivers/clk/sophgo/clk-sg2042-pll.c
+++ b/drivers/clk/sophgo/clk-sg2042-pll.c
@@ -346,37 +346,30 @@ static unsigned long sg2042_clk_pll_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static long sg2042_clk_pll_round_rate(struct clk_hw *hw,
-				      unsigned long req_rate,
-				      unsigned long *prate)
+static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
+					 struct clk_rate_request *req)
 {
 	struct sg2042_pll_ctrl pctrl_table;
 	unsigned int value;
 	long proper_rate;
 	int ret;
 
-	ret = sg2042_get_pll_ctl_setting(&pctrl_table, req_rate, *prate);
+	ret = sg2042_get_pll_ctl_setting(&pctrl_table,
+					 min(req->rate, req->max_rate),
+					 req->best_parent_rate);
 	if (ret) {
 		proper_rate = 0;
 		goto out;
 	}
 
 	value = sg2042_pll_ctrl_encode(&pctrl_table);
-	proper_rate = (long)sg2042_pll_recalc_rate(value, *prate);
+	proper_rate = (long)sg2042_pll_recalc_rate(value, req->best_parent_rate);
 
 out:
 	pr_debug("--> %s: pll_round_rate: val = %ld\n",
 		 clk_hw_get_name(hw), proper_rate);
-	return proper_rate;
-}
+	req->rate = proper_rate;
 
-static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
-					 struct clk_rate_request *req)
-{
-	req->rate = sg2042_clk_pll_round_rate(hw, min(req->rate, req->max_rate),
-					      &req->best_parent_rate);
-	pr_debug("--> %s: pll_determine_rate: val = %ld\n",
-		 clk_hw_get_name(hw), req->rate);
 	return 0;
 }
 
@@ -417,14 +410,13 @@ static int sg2042_clk_pll_set_rate(struct clk_hw *hw,
 
 static const struct clk_ops sg2042_clk_pll_ops = {
 	.recalc_rate = sg2042_clk_pll_recalc_rate,
-	.round_rate = sg2042_clk_pll_round_rate,
 	.determine_rate = sg2042_clk_pll_determine_rate,
 	.set_rate = sg2042_clk_pll_set_rate,
 };
 
 static const struct clk_ops sg2042_clk_pll_ro_ops = {
 	.recalc_rate = sg2042_clk_pll_recalc_rate,
-	.round_rate = sg2042_clk_pll_round_rate,
+	.determine_rate = sg2042_clk_pll_determine_rate,
 };
 
 /*

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (112 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 113/114] clk: sophgo: sg2042-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:19 ` Brian Masney via B4 Relay
  2025-08-11 15:37   ` Alexander Sverdlin
  2025-08-11 16:00 ` [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Manivannan Sadhasivam
                   ` (6 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Brian Masney via B4 Relay @ 2025-08-11 15:19 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc,
	Brian Masney

From: Brian Masney <bmasney@redhat.com>

This driver implements both the determine_rate() and round_rate() clk
ops, and the round_rate() clk ops is deprecated. When both are defined,
clk_core_determine_round_nolock() from the clk core will only use the
determine_rate() clk ops. Also all clk drivers that directly calls
fixed-factor's round_rate() have been migrated over to determine_rate().
So let's remove the round_rate() clk ops.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/clk/clk-fixed-factor.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 79b9a8c57d4b84be990955d8bc3159b818f38d50..de658c9e4c5386a7a8d22074322577e0e9efd2b8 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -47,21 +47,6 @@ static int clk_factor_determine_rate(struct clk_hw *hw,
 	return 0;
 }
 
-static long clk_factor_round_rate(struct clk_hw *hw, unsigned long rate,
-				unsigned long *prate)
-{
-	struct clk_fixed_factor *fix = to_clk_fixed_factor(hw);
-
-	if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
-		unsigned long best_parent;
-
-		best_parent = (rate / fix->mult) * fix->div;
-		*prate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
-	}
-
-	return (*prate / fix->div) * fix->mult;
-}
-
 static int clk_factor_set_rate(struct clk_hw *hw, unsigned long rate,
 				unsigned long parent_rate)
 {
@@ -87,7 +72,6 @@ static unsigned long clk_factor_recalc_accuracy(struct clk_hw *hw,
 
 const struct clk_ops clk_fixed_factor_ops = {
 	.determine_rate = clk_factor_determine_rate,
-	.round_rate = clk_factor_round_rate,
 	.set_rate = clk_factor_set_rate,
 	.recalc_rate = clk_factor_recalc_rate,
 	.recalc_accuracy = clk_factor_recalc_accuracy,

-- 
2.50.1



^ permalink raw reply related	[flat|nested] 172+ messages in thread

* Re: [PATCH 113/114] clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 113/114] clk: sophgo: sg2042-pll: " Brian Masney via B4 Relay
@ 2025-08-11 15:36   ` Alexander Sverdlin
  2025-08-14  8:46   ` Chen Wang
  1 sibling, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:36 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian!

On Mon, 2025-08-11 at 11:19 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops, so let's remove the round_rate() clk ops since
> it's unused.
> 
> The implementation of sg2042_clk_pll_determine_rate() calls
> sg2042_clk_pll_round_rate(), so this folds the two into a single
> function.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/sophgo/clk-sg2042-pll.c | 24 ++++++++----------------
>  1 file changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c
> index e5fb0bb7ac4f97616f3b472fcab45e5729eb653e..b2cbd50ac73c7538b1acbca517f4259cba885fcc 100644
> --- a/drivers/clk/sophgo/clk-sg2042-pll.c
> +++ b/drivers/clk/sophgo/clk-sg2042-pll.c
> @@ -346,37 +346,30 @@ static unsigned long sg2042_clk_pll_recalc_rate(struct clk_hw *hw,
>  	return rate;
>  }
>  
> -static long sg2042_clk_pll_round_rate(struct clk_hw *hw,
> -				      unsigned long req_rate,
> -				      unsigned long *prate)
> +static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
> +					 struct clk_rate_request *req)
>  {
>  	struct sg2042_pll_ctrl pctrl_table;
>  	unsigned int value;
>  	long proper_rate;
>  	int ret;
>  
> -	ret = sg2042_get_pll_ctl_setting(&pctrl_table, req_rate, *prate);
> +	ret = sg2042_get_pll_ctl_setting(&pctrl_table,
> +					 min(req->rate, req->max_rate),
> +					 req->best_parent_rate);
>  	if (ret) {
>  		proper_rate = 0;
>  		goto out;
>  	}
>  
>  	value = sg2042_pll_ctrl_encode(&pctrl_table);
> -	proper_rate = (long)sg2042_pll_recalc_rate(value, *prate);
> +	proper_rate = (long)sg2042_pll_recalc_rate(value, req->best_parent_rate);
>  
>  out:
>  	pr_debug("--> %s: pll_round_rate: val = %ld\n",
                          ^^^^^^^^^^^^^^
Now that round_rate has gone, should the above become "pll_determine_rate"?

>  		 clk_hw_get_name(hw), proper_rate);
> -	return proper_rate;
> -}
> +	req->rate = proper_rate;
>  
> -static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
> -					 struct clk_rate_request *req)
> -{
> -	req->rate = sg2042_clk_pll_round_rate(hw, min(req->rate, req->max_rate),
> -					      &req->best_parent_rate);
> -	pr_debug("--> %s: pll_determine_rate: val = %ld\n",
> -		 clk_hw_get_name(hw), req->rate);
>  	return 0;
>  }
>  
> @@ -417,14 +410,13 @@ static int sg2042_clk_pll_set_rate(struct clk_hw *hw,
>  
>  static const struct clk_ops sg2042_clk_pll_ops = {
>  	.recalc_rate = sg2042_clk_pll_recalc_rate,
> -	.round_rate = sg2042_clk_pll_round_rate,
>  	.determine_rate = sg2042_clk_pll_determine_rate,
>  	.set_rate = sg2042_clk_pll_set_rate,
>  };
>  
>  static const struct clk_ops sg2042_clk_pll_ro_ops = {
>  	.recalc_rate = sg2042_clk_pll_recalc_rate,
> -	.round_rate = sg2042_clk_pll_round_rate,
> +	.determine_rate = sg2042_clk_pll_determine_rate,
>  };

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops
  2025-08-11 15:19 ` [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops Brian Masney via B4 Relay
@ 2025-08-11 15:37   ` Alexander Sverdlin
  0 siblings, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:37 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian!

On Mon, 2025-08-11 at 11:19 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops. Also all clk drivers that directly calls
> fixed-factor's round_rate() have been migrated over to determine_rate().
> So let's remove the round_rate() clk ops.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/clk-fixed-factor.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
> index 79b9a8c57d4b84be990955d8bc3159b818f38d50..de658c9e4c5386a7a8d22074322577e0e9efd2b8 100644
> --- a/drivers/clk/clk-fixed-factor.c
> +++ b/drivers/clk/clk-fixed-factor.c
> @@ -47,21 +47,6 @@ static int clk_factor_determine_rate(struct clk_hw *hw,
>  	return 0;
>  }
>  
> -static long clk_factor_round_rate(struct clk_hw *hw, unsigned long rate,
> -				unsigned long *prate)
> -{
> -	struct clk_fixed_factor *fix = to_clk_fixed_factor(hw);
> -
> -	if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
> -		unsigned long best_parent;
> -
> -		best_parent = (rate / fix->mult) * fix->div;
> -		*prate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
> -	}
> -
> -	return (*prate / fix->div) * fix->mult;
> -}
> -
>  static int clk_factor_set_rate(struct clk_hw *hw, unsigned long rate,
>  				unsigned long parent_rate)
>  {
> @@ -87,7 +72,6 @@ static unsigned long clk_factor_recalc_accuracy(struct clk_hw *hw,
>  
>  const struct clk_ops clk_fixed_factor_ops = {
>  	.determine_rate = clk_factor_determine_rate,
> -	.round_rate = clk_factor_round_rate,
>  	.set_rate = clk_factor_set_rate,
>  	.recalc_rate = clk_factor_recalc_rate,
>  	.recalc_accuracy = clk_factor_recalc_accuracy,

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 112/114] clk: scmi: " Brian Masney via B4 Relay
@ 2025-08-11 15:38   ` Alexander Sverdlin
  2025-08-27  7:09   ` Peng Fan
  1 sibling, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:38 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:19 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops, so let's remove the round_rate() clk ops since
> it's unused.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/clk-scmi.c | 30 ------------------------------
>  1 file changed, 30 deletions(-)
> 
> diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644
> --- a/drivers/clk/clk-scmi.c
> +++ b/drivers/clk/clk-scmi.c
> @@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw,
>  	return rate;
>  }
>  
> -static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> -				unsigned long *parent_rate)
> -{
> -	u64 fmin, fmax, ftmp;
> -	struct scmi_clk *clk = to_scmi_clk(hw);
> -
> -	/*
> -	 * We can't figure out what rate it will be, so just return the
> -	 * rate back to the caller. scmi_clk_recalc_rate() will be called
> -	 * after the rate is set and we'll know what rate the clock is
> -	 * running at then.
> -	 */
> -	if (clk->info->rate_discrete)
> -		return rate;
> -
> -	fmin = clk->info->range.min_rate;
> -	fmax = clk->info->range.max_rate;
> -	if (rate <= fmin)
> -		return fmin;
> -	else if (rate >= fmax)
> -		return fmax;
> -
> -	ftmp = rate - fmin;
> -	ftmp += clk->info->range.step_size - 1; /* to round up */
> -	do_div(ftmp, clk->info->range.step_size);
> -
> -	return ftmp * clk->info->range.step_size + fmin;
> -}
> -
>  static int scmi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
>  			     unsigned long parent_rate)
>  {
> @@ -300,7 +271,6 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key)
>  
>  	/* Rate ops */
>  	ops->recalc_rate = scmi_clk_recalc_rate;
> -	ops->round_rate = scmi_clk_round_rate;
>  	ops->determine_rate = scmi_clk_determine_rate;
>  	if (feats_key & BIT(SCMI_CLK_RATE_CTRL_SUPPORTED))
>  		ops->set_rate = scmi_clk_set_rate;

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 048/114] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 048/114] clk: sophgo: sg2042-clkgen: " Brian Masney via B4 Relay
@ 2025-08-11 15:45   ` Alexander Sverdlin
  2025-08-11 15:57     ` Brian Masney
  2025-08-14  8:47   ` Chen Wang
  1 sibling, 1 reply; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:45 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:18 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/sophgo/clk-sg2042-clkgen.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/sophgo/clk-sg2042-clkgen.c b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> index 9e61288d34f3757315702c355f2669577b29676f..1d3b1656bcf2e6655e0299e68ab39f32189744dc 100644
> --- a/drivers/clk/sophgo/clk-sg2042-clkgen.c
> +++ b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> @@ -176,9 +176,8 @@ static unsigned long sg2042_clk_divider_recalc_rate(struct clk_hw *hw,
>  	return ret_rate;
>  }
>  
> -static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> -					  unsigned long rate,
> -					  unsigned long *prate)
> +static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
> +					     struct clk_rate_request *req)
>  {
>  	struct sg2042_divider_clock *divider = to_sg2042_clk_divider(hw);
>  	unsigned long ret_rate;
> @@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
>  			bestdiv = readl(divider->reg) >> divider->shift;
>  			bestdiv &= clk_div_mask(divider->width);
>  		}
> -		ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
> +		ret_rate = DIV_ROUND_UP_ULL((u64)*&req->best_parent_rate, bestdiv);
                                                 ^^
May "*&" be redundand?


>  	} else {
> -		ret_rate = divider_round_rate(hw, rate, prate, NULL,
> +		ret_rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, NULL,
>  					      divider->width, divider->div_flags);
>  	}
>  
>  	pr_debug("--> %s: divider_round_rate: val = %ld\n",
>  		 clk_hw_get_name(hw), ret_rate);
> -	return ret_rate;
> +	req->rate = ret_rate;
> +
> +	return 0;
>  }
>  
>  static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
> @@ -258,13 +259,13 @@ static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
>  
>  static const struct clk_ops sg2042_clk_divider_ops = {
>  	.recalc_rate = sg2042_clk_divider_recalc_rate,
> -	.round_rate = sg2042_clk_divider_round_rate,
> +	.determine_rate = sg2042_clk_divider_determine_rate,
>  	.set_rate = sg2042_clk_divider_set_rate,
>  };
>  
>  static const struct clk_ops sg2042_clk_divider_ro_ops = {
>  	.recalc_rate = sg2042_clk_divider_recalc_rate,
> -	.round_rate = sg2042_clk_divider_round_rate,
> +	.determine_rate = sg2042_clk_divider_determine_rate,
>  };

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 047/114] clk: sophgo: cv18xx-ip: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 047/114] clk: sophgo: cv18xx-ip: " Brian Masney via B4 Relay
@ 2025-08-11 15:47   ` Alexander Sverdlin
  0 siblings, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:47 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:18 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/sophgo/clk-cv18xx-ip.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/sophgo/clk-cv18xx-ip.c b/drivers/clk/sophgo/clk-cv18xx-ip.c
> index b186e64d4813e2701b17520e544c453fc13d0e77..c2b58faf0938b7d537dc3a81aef59c549b9c9c79 100644
> --- a/drivers/clk/sophgo/clk-cv18xx-ip.c
> +++ b/drivers/clk/sophgo/clk-cv18xx-ip.c
> @@ -45,10 +45,12 @@ static unsigned long gate_recalc_rate(struct clk_hw *hw,
>  	return parent_rate;
>  }
>  
> -static long gate_round_rate(struct clk_hw *hw, unsigned long rate,
> -			    unsigned long *parent_rate)
> +static int gate_determine_rate(struct clk_hw *hw,
> +			       struct clk_rate_request *req)
>  {
> -	return *parent_rate;
> +	req->rate = req->best_parent_rate;
> +
> +	return 0;
>  }
>  
>  static int gate_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -63,7 +65,7 @@ const struct clk_ops cv1800_clk_gate_ops = {
>  	.is_enabled = gate_is_enabled,
>  
>  	.recalc_rate = gate_recalc_rate,
> -	.round_rate = gate_round_rate,
> +	.determine_rate = gate_determine_rate,
>  	.set_rate = gate_set_rate,
>  };

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 014/114] clk: ep93xx: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 014/114] clk: ep93xx: " Brian Masney via B4 Relay
@ 2025-08-11 15:50   ` Alexander Sverdlin
  0 siblings, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:50 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:18 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/clk-ep93xx.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/clk-ep93xx.c b/drivers/clk/clk-ep93xx.c
> index 4bd8d6ecf6a2bde26287e4e949b062a5660139e6..b081ef920e250dd99134af6845c443ee11266da8 100644
> --- a/drivers/clk/clk-ep93xx.c
> +++ b/drivers/clk/clk-ep93xx.c
> @@ -389,23 +389,25 @@ static unsigned long ep93xx_div_recalc_rate(struct clk_hw *hw,
>  	return DIV_ROUND_CLOSEST(parent_rate, clk->div[index]);
>  }
>  
> -static long ep93xx_div_round_rate(struct clk_hw *hw, unsigned long rate,
> -				   unsigned long *parent_rate)
> +static int ep93xx_div_determine_rate(struct clk_hw *hw,
> +				     struct clk_rate_request *req)
>  {
>  	struct ep93xx_clk *clk = ep93xx_clk_from(hw);
>  	unsigned long best = 0, now;
>  	unsigned int i;
>  
>  	for (i = 0; i < clk->num_div; i++) {
> -		if ((rate * clk->div[i]) == *parent_rate)
> -			return rate;
> +		if (req->rate * clk->div[i] == req->best_parent_rate)
> +			return 0;
>  
> -		now = DIV_ROUND_CLOSEST(*parent_rate, clk->div[i]);
> -		if (!best || is_best(rate, now, best))
> +		now = DIV_ROUND_CLOSEST(req->best_parent_rate, clk->div[i]);
> +		if (!best || is_best(req->rate, now, best))
>  			best = now;
>  	}
>  
> -	return best;
> +	req->rate = best;
> +
> +	return 0;
>  }
>  
>  static int ep93xx_div_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -437,7 +439,7 @@ static const struct clk_ops ep93xx_div_ops = {
>  	.disable = ep93xx_clk_disable,
>  	.is_enabled = ep93xx_clk_is_enabled,
>  	.recalc_rate = ep93xx_div_recalc_rate,
> -	.round_rate = ep93xx_div_round_rate,
> +	.determine_rate = ep93xx_div_determine_rate,
>  	.set_rate = ep93xx_div_set_rate,
>  };

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 048/114] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
  2025-08-11 15:45   ` Alexander Sverdlin
@ 2025-08-11 15:57     ` Brian Masney
  0 siblings, 0 replies; 172+ messages in thread
From: Brian Masney @ 2025-08-11 15:57 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 05:45:57PM +0200, Alexander Sverdlin wrote:
> On Mon, 2025-08-11 at 11:18 -0400, Brian Masney via B4 Relay wrote:
> > @@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> >  			bestdiv = readl(divider->reg) >> divider->shift;
> >  			bestdiv &= clk_div_mask(divider->width);
> >  		}
> > -		ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
> > +		ret_rate = DIV_ROUND_UP_ULL((u64)*&req->best_parent_rate, bestdiv);
>                                                  ^^
> May "*&" be redundand?

Yes, I agree that needs dropped and something I missed when I cleaned
things up by hand. I verified that this is the only case in this series,
and all of the other series that I referenced on the cover letter, where
this occurred.

My Coccinelle semantic patch has a case when the parent rate is
dereferenced, and I'm not sure why that wasn't converted here since it
works elsewhere.

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

I'll wait a few weeks to send out a v2 to hopefully let big chunks of
this series get merged so that I don't have to send out 114 patches
again for a v2.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 001/114] clk: at91: peripheral: fix return value
  2025-08-11 15:17 ` [PATCH 001/114] clk: at91: peripheral: fix return value Brian Masney via B4 Relay
@ 2025-08-11 15:59   ` Alexander Sverdlin
  0 siblings, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 15:59 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:17 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> determine_rate() is expected to return an error code, or 0 on success.
> clk_sam9x5_peripheral_determine_rate() has a branch that returns the
> parent rate on a certain case. This is the behavior of round_rate(),
> so let's go ahead and fix this by setting req->rate.
> 
> Fixes: b4c115c76184f ("clk: at91: clk-peripheral: add support for changeable parent rate")
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/at91/clk-peripheral.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
> index c173a44c800aa8cc6970c266995f4a60b0a38554..629f050a855aaebfd1a03ff87c2b016cd2284a5a 100644
> --- a/drivers/clk/at91/clk-peripheral.c
> +++ b/drivers/clk/at91/clk-peripheral.c
> @@ -279,8 +279,11 @@ static int clk_sam9x5_peripheral_determine_rate(struct clk_hw *hw,
>  	long best_diff = LONG_MIN;
>  	u32 shift;
>  
> -	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max)
> -		return parent_rate;
> +	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max) {
> +		req->rate = parent_rate;
> +
> +		return 0;
> +	}
>  
>  	/* Fist step: check the available dividers. */
>  	for (shift = 0; shift <= PERIPHERAL_MAX_SHIFT; shift++) {

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (113 preceding siblings ...)
  2025-08-11 15:19 ` [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops Brian Masney via B4 Relay
@ 2025-08-11 16:00 ` Manivannan Sadhasivam
  2025-08-12 10:39 ` Brian Masney
                   ` (5 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Manivannan Sadhasivam @ 2025-08-11 16:00 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber, Sven Peter,
	Janne Grunau, Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev,
	Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Max Filippov, Matthias Brugger, AngeloGioacchino Del Regno,
	Daniel Palmer, Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:17:52AM GMT, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> - Patch 1 to clk/at91/peripheral is a bug fix for a return value.
> 
> - Patch 2 to clk/at91/peripheral wasn't straight forward like the other
>   drivers, so I'm explicitly calling this one out separately.
> 
> - Patch 3 adds a determine_rate() op and keeps the round_rate() in place
>   since this is needed by drivers/clk/actions/owl-composite.c and keeps
>   the tree bisectable. The deprecated round_rate() op is dropped in patch
>   113.
> 
> - Patches 4-70 are for drivers where there is no clk submaintainer
>   listed in the MAINTAINERS file. Patch 19 includes a minor fix so that
>   Coccinelle can be ran against a particular source file.
> 
> - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
>   for the driver.
> 
> - Patches 111-114 are for drivers that implement both round_rate() and
>   determine_rate(), so the round_rate() implementation is dropped.
> 
> Once all of my conversion patches across the various trees in the kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be merged
> before we can remove round_rate() from the core.
> 

Please do not CC all reviewers/maintainers of individual clock controller
drivers to all patches, but only to the respective clock controller patches.
It just spams our inbox. CCing all of us in the cover letter is fine though.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate()
  2025-08-11 15:17 ` [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 16:00   ` Alexander Sverdlin
  0 siblings, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 16:00 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:17 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> This driver already has a clk_sam9x5_peripheral_determine_rate()
> implementation, however it can change the parent rate. The existing
> round rate does not have this functionality. I could add a check
> for CLK_SET_RATE_PARENT, and combine the two functions, however there
> are some other minor differences in the two implementations. I don't
> have access to this particular hardware. I believe that they could
> be combined, however it would need to be tested on real hardware.
> So, let's play it safe and convert the existing round rate
> implementation to ensure that the driver keeps the same functionality
> as before.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/at91/clk-peripheral.c | 41 +++++++++++++++++++++++----------------
>  1 file changed, 24 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
> index 629f050a855aaebfd1a03ff87c2b016cd2284a5a..e700f40fd87f9327365f250366f7f7bde01f5987 100644
> --- a/drivers/clk/at91/clk-peripheral.c
> +++ b/drivers/clk/at91/clk-peripheral.c
> @@ -335,50 +335,57 @@ static int clk_sam9x5_peripheral_determine_rate(struct clk_hw *hw,
>  	return 0;
>  }
>  
> -static long clk_sam9x5_peripheral_round_rate(struct clk_hw *hw,
> -					     unsigned long rate,
> -					     unsigned long *parent_rate)
> +static int clk_sam9x5_peripheral_no_parent_determine_rate(struct clk_hw *hw,
> +							  struct clk_rate_request *req)
>  {
>  	int shift = 0;
>  	unsigned long best_rate;
>  	unsigned long best_diff;
> -	unsigned long cur_rate = *parent_rate;
> +	unsigned long cur_rate = req->best_parent_rate;
>  	unsigned long cur_diff;
>  	struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw);
>  
> -	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max)
> -		return *parent_rate;
> +	if (periph->id < PERIPHERAL_ID_MIN || !periph->range.max) {
> +		req->rate = req->best_parent_rate;
> +
> +		return 0;
> +	}
>  
>  	if (periph->range.max) {
>  		for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
> -			cur_rate = *parent_rate >> shift;
> +			cur_rate = req->best_parent_rate >> shift;
>  			if (cur_rate <= periph->range.max)
>  				break;
>  		}
>  	}
>  
> -	if (rate >= cur_rate)
> -		return cur_rate;
> +	if (req->rate >= cur_rate) {
> +		req->rate = cur_rate;
> +
> +		return 0;
> +	}
>  
> -	best_diff = cur_rate - rate;
> +	best_diff = cur_rate - req->rate;
>  	best_rate = cur_rate;
>  	for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
> -		cur_rate = *parent_rate >> shift;
> -		if (cur_rate < rate)
> -			cur_diff = rate - cur_rate;
> +		cur_rate = req->best_parent_rate >> shift;
> +		if (cur_rate < req->rate)
> +			cur_diff = req->rate - cur_rate;
>  		else
> -			cur_diff = cur_rate - rate;
> +			cur_diff = cur_rate - req->rate;
>  
>  		if (cur_diff < best_diff) {
>  			best_diff = cur_diff;
>  			best_rate = cur_rate;
>  		}
>  
> -		if (!best_diff || cur_rate < rate)
> +		if (!best_diff || cur_rate < req->rate)
>  			break;
>  	}
>  
> -	return best_rate;
> +	req->rate = best_rate;
> +
> +	return 0;
>  }
>  
>  static int clk_sam9x5_peripheral_set_rate(struct clk_hw *hw,
> @@ -430,7 +437,7 @@ static const struct clk_ops sam9x5_peripheral_ops = {
>  	.disable = clk_sam9x5_peripheral_disable,
>  	.is_enabled = clk_sam9x5_peripheral_is_enabled,
>  	.recalc_rate = clk_sam9x5_peripheral_recalc_rate,
> -	.round_rate = clk_sam9x5_peripheral_round_rate,
> +	.determine_rate = clk_sam9x5_peripheral_no_parent_determine_rate,
>  	.set_rate = clk_sam9x5_peripheral_set_rate,
>  	.save_context = clk_sam9x5_peripheral_save_context,
>  	.restore_context = clk_sam9x5_peripheral_restore_context,

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
@ 2025-08-11 16:02   ` Alexander Sverdlin
  2025-08-14 15:10   ` Geert Uytterhoeven
  1 sibling, 0 replies; 172+ messages in thread
From: Alexander Sverdlin @ 2025-08-11 16:02 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 2025-08-11 at 11:19 -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops. Also all clk drivers that directly calls
> divider's round_rate() have been migrated over to determine_rate(). So
> let's remove the round_rate() clk ops.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/clk/clk-divider.c | 23 -----------------------
>  1 file changed, 23 deletions(-)
> 
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index c1f426b8a5043cb5a1de08e1da385928ec54a2ed..2601b6155afb7391c6a0ffb91c58fa66cde98197 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -431,27 +431,6 @@ long divider_ro_round_rate_parent(struct clk_hw *hw, struct clk_hw *parent,
>  }
>  EXPORT_SYMBOL_GPL(divider_ro_round_rate_parent);
>  
> -static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
> -				unsigned long *prate)
> -{
> -	struct clk_divider *divider = to_clk_divider(hw);
> -
> -	/* if read only, just return current value */
> -	if (divider->flags & CLK_DIVIDER_READ_ONLY) {
> -		u32 val;
> -
> -		val = clk_div_readl(divider) >> divider->shift;
> -		val &= clk_div_mask(divider->width);
> -
> -		return divider_ro_round_rate(hw, rate, prate, divider->table,
> -					     divider->width, divider->flags,
> -					     val);
> -	}
> -
> -	return divider_round_rate(hw, rate, prate, divider->table,
> -				  divider->width, divider->flags);
> -}
> -
>  static int clk_divider_determine_rate(struct clk_hw *hw,
>  				      struct clk_rate_request *req)
>  {
> @@ -527,7 +506,6 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  const struct clk_ops clk_divider_ops = {
>  	.recalc_rate = clk_divider_recalc_rate,
> -	.round_rate = clk_divider_round_rate,
>  	.determine_rate = clk_divider_determine_rate,
>  	.set_rate = clk_divider_set_rate,
>  };
> @@ -535,7 +513,6 @@ EXPORT_SYMBOL_GPL(clk_divider_ops);
>  
>  const struct clk_ops clk_divider_ro_ops = {
>  	.recalc_rate = clk_divider_recalc_rate,
> -	.round_rate = clk_divider_round_rate,
>  	.determine_rate = clk_divider_determine_rate,
>  };
>  EXPORT_SYMBOL_GPL(clk_divider_ro_ops);

-- 
Alexander Sverdlin.

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 063/114] clk: wm831x: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 063/114] clk: wm831x: " Brian Masney via B4 Relay
@ 2025-08-12  8:04   ` Richard Fitzgerald
  0 siblings, 0 replies; 172+ messages in thread
From: Richard Fitzgerald @ 2025-08-12  8:04 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On 11/8/25 16:18, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>   drivers/clk/clk-wm831x.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 090/114] clk: qcom: alpha-pll: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 090/114] clk: qcom: alpha-pll: " Brian Masney via B4 Relay
@ 2025-08-12  9:13   ` Konrad Dybcio
  0 siblings, 0 replies; 172+ messages in thread
From: Konrad Dybcio @ 2025-08-12  9:13 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On 8/11/25 5:19 PM, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Note that prior to running the Coccinelle,
> clk_alpha_pll_postdiv_round_ro_rate() was renamed to
> clk_alpha_pll_postdiv_ro_round_rate().
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---

[...]

> +	req->rate = DIV_ROUND_UP_ULL((u64) req->best_parent_rate, div);

space after typecast is 'eeeh'

but the rest looks good

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 091/114] clk: qcom: regmap-divider: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 091/114] clk: qcom: regmap-divider: " Brian Masney via B4 Relay
@ 2025-08-12  9:14   ` Konrad Dybcio
  0 siblings, 0 replies; 172+ messages in thread
From: Konrad Dybcio @ 2025-08-12  9:14 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On 8/11/25 5:19 PM, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Note that prior to running the Coccinelle, div_round_ro_rate() was
> renamed to div_ro_round_rate().
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 054/114] clk: sprd: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 054/114] clk: sprd: pll: " Brian Masney via B4 Relay
@ 2025-08-12  9:16   ` Chunyan Zhang
  0 siblings, 0 replies; 172+ messages in thread
From: Chunyan Zhang @ 2025-08-12  9:16 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 11 Aug 2025 at 23:18, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
>
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>

> ---
>  drivers/clk/sprd/pll.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/sprd/pll.c b/drivers/clk/sprd/pll.c
> index 13a322b2535ac37ecb17f2c39d17d2c03532cfcb..bc6610d5fcb72faa7406ea78dca4cd9b848e9392 100644
> --- a/drivers/clk/sprd/pll.c
> +++ b/drivers/clk/sprd/pll.c
> @@ -254,16 +254,16 @@ static int sprd_pll_clk_prepare(struct clk_hw *hw)
>         return 0;
>  }
>
> -static long sprd_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> -                               unsigned long *prate)
> +static int sprd_pll_determine_rate(struct clk_hw *hw,
> +                                  struct clk_rate_request *req)
>  {
> -       return rate;
> +       return 0;
>  }
>
>  const struct clk_ops sprd_pll_ops = {
>         .prepare = sprd_pll_clk_prepare,
>         .recalc_rate = sprd_pll_recalc_rate,
> -       .round_rate = sprd_pll_round_rate,
> +       .determine_rate = sprd_pll_determine_rate,
>         .set_rate = sprd_pll_set_rate,
>  };
>  EXPORT_SYMBOL_GPL(sprd_pll_ops);
>
> --
> 2.50.1
>
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 053/114] clk: sprd: div: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 053/114] clk: sprd: div: " Brian Masney via B4 Relay
@ 2025-08-12  9:17   ` Chunyan Zhang
  0 siblings, 0 replies; 172+ messages in thread
From: Chunyan Zhang @ 2025-08-12  9:17 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, 11 Aug 2025 at 23:18, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
>
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>

> ---
>  drivers/clk/sprd/div.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/sprd/div.c b/drivers/clk/sprd/div.c
> index 936782c241271832c0a1957c99cbecc287351d1b..013423881968002d29c4e9536e7cd7b944779196 100644
> --- a/drivers/clk/sprd/div.c
> +++ b/drivers/clk/sprd/div.c
> @@ -9,13 +9,16 @@
>
>  #include "div.h"
>
> -static long sprd_div_round_rate(struct clk_hw *hw, unsigned long rate,
> -                               unsigned long *parent_rate)
> +static int sprd_div_determine_rate(struct clk_hw *hw,
> +                                  struct clk_rate_request *req)
>  {
>         struct sprd_div *cd = hw_to_sprd_div(hw);
>
> -       return divider_round_rate(&cd->common.hw, rate, parent_rate, NULL,
> -                                 cd->div.width, 0);
> +       req->rate = divider_round_rate(&cd->common.hw, req->rate,
> +                                      &req->best_parent_rate,
> +                                      NULL, cd->div.width, 0);
> +
> +       return 0;
>  }
>
>  unsigned long sprd_div_helper_recalc_rate(struct sprd_clk_common *common,
> @@ -75,7 +78,7 @@ static int sprd_div_set_rate(struct clk_hw *hw, unsigned long rate,
>
>  const struct clk_ops sprd_div_ops = {
>         .recalc_rate = sprd_div_recalc_rate,
> -       .round_rate = sprd_div_round_rate,
> +       .determine_rate = sprd_div_determine_rate,
>         .set_rate = sprd_div_set_rate,
>  };
>  EXPORT_SYMBOL_GPL(sprd_div_ops);
>
> --
> 2.50.1
>
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (114 preceding siblings ...)
  2025-08-11 16:00 ` [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Manivannan Sadhasivam
@ 2025-08-12 10:39 ` Brian Masney
  2025-08-12 13:39 ` Icenowy Zheng
                   ` (4 subsequent siblings)
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney @ 2025-08-12 10:39 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:17:52AM -0400, Brian Masney via B4 Relay wrote:
> Once all of my conversion patches across the various trees in the kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be merged
> before we can remove round_rate() from the core.
> 
> - arm32 (3): https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
> - clk/tegra (6): https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
> - clk/ti (7): https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
> - clocksource (1): https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
> - drm (9): https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
> - drm/msm (7): https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
> - i2c (1): https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
> - media (4): https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
> - mips (1): https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
> - net (1): https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
> - peci (1): https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
> - phy (9): https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
> - pmdomain (1): https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
> - tty (1): https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/

Konrad noticed on patch 90 the space after the cast. I thought I fixed
all of those by hand, but apparently not. I looked through this series
(and the others above) with `grep "u64) "` and `grep "long) "`, and found
4 other cases.

Patch 38: clk: nxp: lpc32xx: convert from round_rate() to determine_rate()
Patch 64: clk: x86: cgu: convert from round_rate() to determine_rate()
Patch 68: clk: zynqmp: divider: convert from round_rate() to determine_rate()
Patch 95: clk: rockchip: half-divider: convert from round_rate() to determine_rate()

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (115 preceding siblings ...)
  2025-08-12 10:39 ` Brian Masney
@ 2025-08-12 13:39 ` Icenowy Zheng
  2025-08-12 13:53   ` Brian Masney
  2025-08-22  6:31 ` Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Icenowy Zheng @ 2025-08-12 13:39 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

在 2025-08-11星期一的 11:17 -0400,Brian Masney via B4 Relay写道:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> - Patch 1 to clk/at91/peripheral is a bug fix for a return value.
> 
> - Patch 2 to clk/at91/peripheral wasn't straight forward like the
> other
>   drivers, so I'm explicitly calling this one out separately.
> 
> - Patch 3 adds a determine_rate() op and keeps the round_rate() in
> place
>   since this is needed by drivers/clk/actions/owl-composite.c and
> keeps
>   the tree bisectable. The deprecated round_rate() op is dropped in
> patch
>   113.
> 
> - Patches 4-70 are for drivers where there is no clk submaintainer
>   listed in the MAINTAINERS file. Patch 19 includes a minor fix so
> that
>   Coccinelle can be ran against a particular source file.
> 
> - Patches 71-110 are for drivers where this is an entry in
> MAINTAINERS
>   for the driver.
> 
> - Patches 111-114 are for drivers that implement both round_rate()
> and
>   determine_rate(), so the round_rate() implementation is dropped.

I was doing a patch to add divider setting support to clk-th1520-ap
driver and sent patch now, should I remove round_rate from the next
revision and just keep determine_rate? Is it safe to do this even if
this patchset is not merged?

In addition, will the clk_round_rate() API exported to other subsystems
be affected?

> 
> Once all of my conversion patches across the various trees in the
> kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be
> merged
> before we can remove round_rate() from the core.
> 
> - arm32 (3):
> https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
> - clk/tegra (6):
> https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
> - clk/ti (7):
> https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
> - clocksource (1):
> https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
> - drm (9):
> https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
> - drm/msm (7):
> https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
> - i2c (1):
> https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
> - media (4):
> https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
> - mips (1):
> https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
> - net (1):
> https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
> - peci (1):
> https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
> - phy (9):
> https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
> - pmdomain (1):
> https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
> - tty (1):
> https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/
> 
> Coccinelle semantic patch:
> 
>     virtual patch
> 
>     // Look up the current name of the round_rate function
>     @ has_round_rate @
>     identifier round_rate_name =~ ".*_round_rate";
>     identifier hw_param, rate_param, parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>         ...
>     }
> 
>     // Rename the route_rate function name to determine_rate()
>     @ script:python generate_name depends on has_round_rate @
>     round_rate_name << has_round_rate.round_rate_name;
>     new_name;
>     @@
> 
>     coccinelle.new_name = round_rate_name.replace("_round_rate",
> "_determine_rate")
> 
>     // Change rate to req->rate; also change occurrences of 'return
> XXX'.
>     @ chg_rate depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     identifier ERR =~ "E.*";
>     expression E;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     (
>     -return -ERR;
>     +return -ERR;
>     |
>     - return rate_param;
>     + return 0;
>     |
>     - return E;
>     + req->rate = E;
>     +
>     + return 0;
>     |
>     - rate_param
>     + req->rate
>     )
>     ...>
>     }
> 
>     // Coccinelle only transforms the first occurrence of the rate
> parameter
>     // Run a second time. FIXME: Is there a better way to do this?
>     @ chg_rate2 depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     - rate_param
>     + req->rate
>     ...>
>     }
> 
>     // Change parent_rate to req->best_parent_rate
>     @ chg_parent_rate depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     (
>     - *parent_rate_param
>     + req->best_parent_rate
>     |
>     - parent_rate_param
>     + &req->best_parent_rate
>     )
>     ...>
>     }
> 
>     // Convert the function definition from round_rate() to
> determine_rate()
>     @ func_definition depends on chg_rate @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     identifier generate_name.new_name;
>     @@
> 
>     - long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>     -               unsigned long *parent_rate_param)
>     + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
>     {
>         ...
>     }
> 
>     // Update the ops from round_rate() to determine_rate()
>     @ ops depends on func_definition @
>     identifier has_round_rate.round_rate_name;
>     identifier generate_name.new_name;
>     @@
> 
>     {
>         ...,
>     -   .round_rate = round_rate_name,
>     +   .determine_rate = new_name,
>         ...,
>     }
> 
> Note that I used coccinelle 1.2 instead of 1.3 since the newer
> version
> adds unnecessary braces as described in this post.
> https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
> Brian Masney (114):
>       clk: at91: peripheral: fix return value
>       clk: at91: peripheral: convert from round_rate() to
> determine_rate()
>       clk: fixed-factor: add determine_rate() ops
>       clk: at91: audio-pll: convert from round_rate() to
> determine_rate()
>       clk: at91: h32mx: convert from round_rate() to determine_rate()
>       clk: at91: pll: convert from round_rate() to determine_rate()
>       clk: at91: plldiv: convert from round_rate() to
> determine_rate()
>       clk: at91: sam9x60-pll: convert from round_rate() to
> determine_rate()
>       clk: at91: usb: convert from round_rate() to determine_rate()
>       clk: baikal-t1: ccu-div: convert from round_rate() to
> determine_rate()
>       clk: baikal-t1: ccu-pll: convert from round_rate() to
> determine_rate()
>       clk: cdce925: convert from round_rate() to determine_rate()
>       clk: cs2000-cp: convert from round_rate() to determine_rate()
>       clk: ep93xx: convert from round_rate() to determine_rate()
>       clk: fractional-divider: convert from round_rate() to
> determine_rate()
>       clk: gemini: convert from round_rate() to determine_rate()
>       clk: highbank: convert from round_rate() to determine_rate()
>       clk: hisilicon: clkdivider-hi6220: convert from round_rate() to
> determine_rate()
>       clk: hisilicon: hi3660-stub: move comma from declaration of
> DEFINE_CLK_STUB()
>       clk: hisilicon: hi3660-stub: convert from round_rate() to
> determine_rate()
>       clk: hisilicon: hi6220-stub: convert from round_rate() to
> determine_rate()
>       clk: ingenic: cgu: convert from round_rate() to
> determine_rate()
>       clk: ingenic: jz4780-cgu: convert from round_rate() to
> determine_rate()
>       clk: ingenic: x1000-cgu: convert from round_rate() to
> determine_rate()
>       clk: lmk04832: convert from round_rate() to determine_rate()
>       clk: loongson1: convert from round_rate() to determine_rate()
>       clk: max9485: convert from round_rate() to determine_rate()
>       clk: milbeaut: convert from round_rate() to determine_rate()
>       clk: mmp: audio: convert from round_rate() to determine_rate()
>       clk: mmp: frac: convert from round_rate() to determine_rate()
>       clk: multiplier: convert from round_rate() to determine_rate()
>       clk: mxs: div: convert from round_rate() to determine_rate()
>       clk: mxs: frac: convert from round_rate() to determine_rate()
>       clk: mxs: ref: convert from round_rate() to determine_rate()
>       clk: nuvoton: ma35d1-divider: convert from round_rate() to
> determine_rate()
>       clk: nuvoton: ma35d1-pll: convert from round_rate() to
> determine_rate()
>       clk: nxp: lpc18xx-cgu: convert from round_rate() to
> determine_rate()
>       clk: nxp: lpc32xx: convert from round_rate() to
> determine_rate()
>       clk: pistachio: pll: convert from round_rate() to
> determine_rate()
>       clk: scpi: convert from round_rate() to determine_rate()
>       clk: si514: convert from round_rate() to determine_rate()
>       clk: si521xx: convert from round_rate() to determine_rate()
>       clk: si5341: convert from round_rate() to determine_rate()
>       clk: si544: convert from round_rate() to determine_rate()
>       clk: si570: convert from round_rate() to determine_rate()
>       clk: sifive: sifive-prci: convert from round_rate() to
> determine_rate()
>       clk: sophgo: cv18xx-ip: convert from round_rate() to
> determine_rate()
>       clk: sophgo: sg2042-clkgen: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_ddn: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_mix: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_pll: convert from round_rate() to
> determine_rate()
>       clk: sparx5: convert from round_rate() to determine_rate()
>       clk: sprd: div: convert from round_rate() to determine_rate()
>       clk: sprd: pll: convert from round_rate() to determine_rate()
>       clk: st: clkgen-fsyn: convert from round_rate() to
> determine_rate()
>       clk: st: clkgen-pll: convert from round_rate() to
> determine_rate()
>       clk: stm32f4: convert from round_rate() to determine_rate()
>       clk: stm32: stm32-core: convert from round_rate() to
> determine_rate()
>       clk: stm32: stm32mp1: convert from round_rate() to
> determine_rate()
>       clk: tps68470: convert from round_rate() to determine_rate()
>       clk: versaclock3: convert from round_rate() to determine_rate()
>       clk: vt8500: convert from round_rate() to determine_rate()
>       clk: wm831x: convert from round_rate() to determine_rate()
>       clk: x86: cgu: convert from round_rate() to determine_rate()
>       clk: xgene: convert from round_rate() to determine_rate()
>       clk: xilinx: xlnx-clock-wizard: convert from round_rate() to
> determine_rate()
>       clk: xilinx: xlnx_vcu: convert from round_rate() to
> determine_rate()
>       clk: zynqmp: divider: convert from round_rate() to
> determine_rate()
>       clk: zynqmp: pll: convert from round_rate() to determine_rate()
>       clk: zynq: pll: convert from round_rate() to determine_rate()
>       clk: actions: owl-composite: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-divider: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-factor: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-pll: convert from round_rate() to
> determine_rate()
>       clk: apple-nco: convert from round_rate() to determine_rate()
>       clk: axs10x: i2s_pll_clock: convert from round_rate() to
> determine_rate()
>       clk: axs10x: pll_clock: convert from round_rate() to
> determine_rate()
>       clk: bcm: iproc-asiu: convert from round_rate() to
> determine_rate()
>       clk: bm1880: convert from round_rate() to determine_rate()
>       clk: cdce706: convert from round_rate() to determine_rate()
>       clk: hsdk-pll: convert from round_rate() to determine_rate()
>       clk: mediatek: pll: convert from round_rate() to
> determine_rate()
>       clk: microchip: core: convert from round_rate() to
> determine_rate()
>       clk: mstar: msc313-cpupll: convert from round_rate() to
> determine_rate()
>       clk: mvebu: ap-cpu-clk: convert from round_rate() to
> determine_rate()
>       clk: mvebu: armada-37xx-periph: convert from round_rate() to
> determine_rate()
>       clk: mvebu: corediv: convert from round_rate() to
> determine_rate()
>       clk: mvebu: cpu: convert from round_rate() to determine_rate()
>       clk: mvebu: dove-divider: convert from round_rate() to
> determine_rate()
>       clk: qcom: alpha-pll: convert from round_rate() to
> determine_rate()
>       clk: qcom: regmap-divider: convert from round_rate() to
> determine_rate()
>       clk: renesas: rzg2l-cpg: convert from round_rate() to
> determine_rate()
>       clk: renesas: rzv2h-cpg: remove round_rate() in favor of
> determine_rate()
>       clk: rockchip: ddr: convert from round_rate() to
> determine_rate()
>       clk: rockchip: half-divider: convert from round_rate() to
> determine_rate()
>       clk: rockchip: pll: convert from round_rate() to
> determine_rate()
>       clk: rp1: convert from round_rate() to determine_rate()
>       clk: samsung: cpu: convert from round_rate() to
> determine_rate()
>       clk: samsung: pll: convert from round_rate() to
> determine_rate()
>       clk: sp7021: convert from round_rate() to determine_rate()
>       clk: spear: aux-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: frac-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: gpt-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: vco-pll: convert from round_rate() to
> determine_rate()
>       clk: ux500: prcmu: convert from round_rate() to
> determine_rate()
>       clk: versaclock5: convert from round_rate() to determine_rate()
>       clk: versaclock7: convert from round_rate() to determine_rate()
>       clk: versatile: icst: convert from round_rate() to
> determine_rate()
>       clk: versatile: vexpress-osc: convert from round_rate() to
> determine_rate()
>       clk: visconti: pll: convert from round_rate() to
> determine_rate()
>       clk: divider: remove round_rate() in favor of determine_rate()
>       clk: scmi: remove round_rate() in favor of determine_rate()
>       clk: sophgo: sg2042-pll: remove round_rate() in favor of
> determine_rate()
>       clk: fixed-factor: drop round_rate() clk ops
> 
>  drivers/clk/actions/owl-composite.c        |   8 +-
>  drivers/clk/actions/owl-divider.c          |  13 +--
>  drivers/clk/actions/owl-factor.c           |  12 +--
>  drivers/clk/actions/owl-pll.c              |  25 ++++--
>  drivers/clk/at91/clk-audio-pll.c           |  42 +++++----
>  drivers/clk/at91/clk-h32mx.c               |  33 ++++---
>  drivers/clk/at91/clk-peripheral.c          |  48 ++++++----
>  drivers/clk/at91/clk-pll.c                 |  12 +--
>  drivers/clk/at91/clk-plldiv.c              |  34 +++++---
>  drivers/clk/at91/clk-sam9x60-pll.c         |  29 +++---
>  drivers/clk/at91/clk-usb.c                 |  20 +++--
>  drivers/clk/axs10x/i2s_pll_clock.c         |  14 +--
>  drivers/clk/axs10x/pll_clock.c             |  12 +--
>  drivers/clk/baikal-t1/ccu-div.c            |  27 +++---
>  drivers/clk/baikal-t1/ccu-pll.c            |  14 +--
>  drivers/clk/bcm/clk-iproc-asiu.c           |  25 +++---
>  drivers/clk/clk-apple-nco.c                |  14 +--
>  drivers/clk/clk-bm1880.c                   |  21 +++--
>  drivers/clk/clk-cdce706.c                  |  16 ++--
>  drivers/clk/clk-cdce925.c                  |  50 ++++++-----
>  drivers/clk/clk-cs2000-cp.c                |  14 +--
>  drivers/clk/clk-divider.c                  |  23 -----
>  drivers/clk/clk-ep93xx.c                   |  18 ++--
>  drivers/clk/clk-fixed-factor.c             |  16 ++--
>  drivers/clk/clk-fractional-divider.c       |  25 ++++--
>  drivers/clk/clk-gemini.c                   |  15 ++--
>  drivers/clk/clk-highbank.c                 |  26 +++---
>  drivers/clk/clk-hsdk-pll.c                 |  12 +--
>  drivers/clk/clk-lmk04832.c                 |  53 ++++++-----
>  drivers/clk/clk-loongson1.c                |  12 +--
>  drivers/clk/clk-max9485.c                  |  27 +++---
>  drivers/clk/clk-milbeaut.c                 |  22 +++--
>  drivers/clk/clk-multiplier.c               |  12 +--
>  drivers/clk/clk-rp1.c                      |  45 ++++++----
>  drivers/clk/clk-scmi.c                     |  30 -------
>  drivers/clk/clk-scpi.c                     |  18 ++--
>  drivers/clk/clk-si514.c                    |  24 +++--
>  drivers/clk/clk-si521xx.c                  |  14 +--
>  drivers/clk/clk-si5341.c                   |  22 +++--
>  drivers/clk/clk-si544.c                    |  10 +--
>  drivers/clk/clk-si570.c                    |  24 +++--
>  drivers/clk/clk-sp7021.c                   |  22 ++---
>  drivers/clk/clk-sparx5.c                   |  10 ++-
>  drivers/clk/clk-stm32f4.c                  |  26 +++---
>  drivers/clk/clk-tps68470.c                 |  12 +--
>  drivers/clk/clk-versaclock3.c              |  70 +++++++++------
>  drivers/clk/clk-versaclock5.c              |  71 ++++++++-------
>  drivers/clk/clk-versaclock7.c              |  30 ++++---
>  drivers/clk/clk-vt8500.c                   |  59 ++++++++-----
>  drivers/clk/clk-wm831x.c                   |  14 +--
>  drivers/clk/clk-xgene.c                    |  41 +++++----
>  drivers/clk/hisilicon/clk-hi3660-stub.c    |  18 ++--
>  drivers/clk/hisilicon/clk-hi6220-stub.c    |  12 +--
>  drivers/clk/hisilicon/clkdivider-hi6220.c  |  12 +--
>  drivers/clk/ingenic/cgu.c                  |  12 +--
>  drivers/clk/ingenic/jz4780-cgu.c           |  24 ++---
>  drivers/clk/ingenic/x1000-cgu.c            |  19 ++--
>  drivers/clk/mediatek/clk-pll.c             |  13 +--
>  drivers/clk/mediatek/clk-pll.h             |   3 +-
>  drivers/clk/mediatek/clk-pllfh.c           |   2 +-
>  drivers/clk/microchip/clk-core.c           |  44 ++++++----
>  drivers/clk/mmp/clk-audio.c                |  18 ++--
>  drivers/clk/mmp/clk-frac.c                 |  27 +++---
>  drivers/clk/mstar/clk-msc313-cpupll.c      |  18 ++--
>  drivers/clk/mvebu/ap-cpu-clk.c             |  12 +--
>  drivers/clk/mvebu/armada-37xx-periph.c     |  15 ++--
>  drivers/clk/mvebu/clk-corediv.c            |  18 ++--
>  drivers/clk/mvebu/clk-cpu.c                |  12 +--
>  drivers/clk/mvebu/dove-divider.c           |  16 ++--
>  drivers/clk/mxs/clk-div.c                  |   8 +-
>  drivers/clk/mxs/clk-frac.c                 |  16 ++--
>  drivers/clk/mxs/clk-ref.c                  |  16 ++--
>  drivers/clk/nuvoton/clk-ma35d1-divider.c   |  12 ++-
>  drivers/clk/nuvoton/clk-ma35d1-pll.c       |  28 +++---
>  drivers/clk/nxp/clk-lpc18xx-cgu.c          |  16 ++--
>  drivers/clk/nxp/clk-lpc32xx.c              |  59 +++++++------
>  drivers/clk/pistachio/clk-pll.c            |  20 +++--
>  drivers/clk/qcom/clk-alpha-pll.c           | 136 ++++++++++++++++---
> ----------
>  drivers/clk/qcom/clk-regmap-divider.c      |  27 +++---
>  drivers/clk/renesas/rzg2l-cpg.c            |   9 +-
>  drivers/clk/renesas/rzv2h-cpg.c            |  10 ---
>  drivers/clk/rockchip/clk-ddr.c             |  13 +--
>  drivers/clk/rockchip/clk-half-divider.c    |  12 +--
>  drivers/clk/rockchip/clk-pll.c             |  23 +++--
>  drivers/clk/samsung/clk-cpu.c              |  12 +--
>  drivers/clk/samsung/clk-pll.c              |  33 ++++---
>  drivers/clk/sifive/fu540-prci.h            |   2 +-
>  drivers/clk/sifive/fu740-prci.h            |   2 +-
>  drivers/clk/sifive/sifive-prci.c           |  11 +--
>  drivers/clk/sifive/sifive-prci.h           |   4 +-
>  drivers/clk/sophgo/clk-cv18xx-ip.c         |  10 ++-
>  drivers/clk/sophgo/clk-sg2042-clkgen.c     |  17 ++--
>  drivers/clk/sophgo/clk-sg2042-pll.c        |  24 ++---
>  drivers/clk/spacemit/ccu_ddn.c             |  11 ++-
>  drivers/clk/spacemit/ccu_mix.c             |  12 +--
>  drivers/clk/spacemit/ccu_pll.c             |  10 ++-
>  drivers/clk/spear/clk-aux-synth.c          |  12 +--
>  drivers/clk/spear/clk-frac-synth.c         |  12 +--
>  drivers/clk/spear/clk-gpt-synth.c          |  12 +--
>  drivers/clk/spear/clk-vco-pll.c            |  23 +++--
>  drivers/clk/sprd/div.c                     |  13 +--
>  drivers/clk/sprd/pll.c                     |   8 +-
>  drivers/clk/st/clkgen-fsyn.c               |  33 +++----
>  drivers/clk/st/clkgen-pll.c                |  38 ++++----
>  drivers/clk/stm32/clk-stm32-core.c         |  28 +++---
>  drivers/clk/stm32/clk-stm32mp1.c           |  13 +--
>  drivers/clk/ux500/clk-prcmu.c              |  14 +--
>  drivers/clk/versatile/clk-icst.c           |  72 +++++++++------
>  drivers/clk/versatile/clk-vexpress-osc.c   |  16 ++--
>  drivers/clk/visconti/pll.c                 |  17 ++--
>  drivers/clk/x86/clk-cgu.c                  |  35 ++++----
>  drivers/clk/xilinx/clk-xlnx-clock-wizard.c |  55 ++++++------
>  drivers/clk/xilinx/xlnx_vcu.c              |  15 ++--
>  drivers/clk/zynq/pll.c                     |  12 +--
>  drivers/clk/zynqmp/divider.c               |  23 ++---
>  drivers/clk/zynqmp/pll.c                   |  24 ++---
>  116 files changed, 1477 insertions(+), 1132 deletions(-)
> ---
> base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
> change-id: 20250729-clk-for-stephen-round-rate-5a88ebdf8da6
> 
> Best regards,


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-12 13:39 ` Icenowy Zheng
@ 2025-08-12 13:53   ` Brian Masney
  0 siblings, 0 replies; 172+ messages in thread
From: Brian Masney @ 2025-08-12 13:53 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Tue, Aug 12, 2025 at 09:39:45PM +0800, Icenowy Zheng wrote:
> I was doing a patch to add divider setting support to clk-th1520-ap
> driver and sent patch now, should I remove round_rate from the next
> revision and just keep determine_rate? Is it safe to do this even if
> this patchset is not merged?

Yes, you only need to implement the determine_rate() clk op. Please
remove any references to the round_rate() clk op from your driver. If
you implement both, then only the determine_rate() clk op is actually
used by the clk core.

> In addition, will the clk_round_rate() API exported to other subsystems
> be affected?

No, that will stay as is, and with the same name. The underlying
implementation in the clk core uses the determine_rate() clk op.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 079/114] clk: bm1880: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 079/114] clk: bm1880: " Brian Masney via B4 Relay
@ 2025-08-12 15:38   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 172+ messages in thread
From: Manivannan Sadhasivam @ 2025-08-12 15:38 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber, Sven Peter,
	Janne Grunau, Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev,
	Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Max Filippov, Matthias Brugger, AngeloGioacchino Del Regno,
	Daniel Palmer, Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:19:11AM GMT, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 

Once this patch gets merged, the 'Coccinelle semantic patch on the cover letter
of this series' becomes irrelevant. I'd suggest to either include the script
here or do not mention it at all.

- Mani

> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/clk-bm1880.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/clk-bm1880.c b/drivers/clk/clk-bm1880.c
> index 002f7360b1c6c6e3058606a0808115b48fd3147a..dac190bc6e19a6dd4be413ea52d41f74934a1aa9 100644
> --- a/drivers/clk/clk-bm1880.c
> +++ b/drivers/clk/clk-bm1880.c
> @@ -608,8 +608,8 @@ static unsigned long bm1880_clk_div_recalc_rate(struct clk_hw *hw,
>  	return rate;
>  }
>  
> -static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
> -				      unsigned long *prate)
> +static int bm1880_clk_div_determine_rate(struct clk_hw *hw,
> +					 struct clk_rate_request *req)
>  {
>  	struct bm1880_div_hw_clock *div_hw = to_bm1880_div_clk(hw);
>  	struct bm1880_div_clock *div = &div_hw->div;
> @@ -621,13 +621,18 @@ static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
>  		val = readl(reg_addr) >> div->shift;
>  		val &= clk_div_mask(div->width);
>  
> -		return divider_ro_round_rate(hw, rate, prate, div->table,
> -					     div->width, div->flags,
> -					     val);
> +		req->rate = divider_ro_round_rate(hw, req->rate,
> +						  &req->best_parent_rate,
> +						  div->table,
> +						  div->width, div->flags, val);
> +
> +		return 0;
>  	}
>  
> -	return divider_round_rate(hw, rate, prate, div->table,
> -				  div->width, div->flags);
> +	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
> +				       div->table, div->width, div->flags);
> +
> +	return 0;
>  }
>  
>  static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -665,7 +670,7 @@ static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  static const struct clk_ops bm1880_clk_div_ops = {
>  	.recalc_rate = bm1880_clk_div_recalc_rate,
> -	.round_rate = bm1880_clk_div_round_rate,
> +	.determine_rate = bm1880_clk_div_determine_rate,
>  	.set_rate = bm1880_clk_div_set_rate,
>  };
>  
> 
> -- 
> 2.50.1
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 106/114] clk: versaclock5: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 106/114] clk: versaclock5: " Brian Masney via B4 Relay
@ 2025-08-13  9:07   ` Luca Ceresoli
  0 siblings, 0 replies; 172+ messages in thread
From: Luca Ceresoli @ 2025-08-13  9:07 UTC (permalink / raw)
  To: Brian Masney via B4 Relay
  Cc: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, 11 Aug 2025 11:19:38 -0400
Brian Masney via B4 Relay <devnull+bmasney.redhat.com@kernel.org> wrote:

> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 084/114] clk: mstar: msc313-cpupll: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 084/114] clk: mstar: msc313-cpupll: " Brian Masney via B4 Relay
@ 2025-08-14  4:35   ` Daniel Palmer
  0 siblings, 0 replies; 172+ messages in thread
From: Daniel Palmer @ 2025-08-14  4:35 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Romain Perier,
	Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Bjorn Andersson, Geert Uytterhoeven, Heiko Stuebner,
	Andrea della Porta, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

Hi Brian,

On Tue, 12 Aug 2025 at 00:18, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
>
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/mstar/clk-msc313-cpupll.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/mstar/clk-msc313-cpupll.c b/drivers/clk/mstar/clk-msc313-cpupll.c
> index a93e2dba09d3523199263494efd2bf6987bb4156..3e643be02fe2a79c043c1b79a5e95c869b757ba1 100644
> --- a/drivers/clk/mstar/clk-msc313-cpupll.c
> +++ b/drivers/clk/mstar/clk-msc313-cpupll.c
> @@ -140,20 +140,22 @@ static unsigned long msc313_cpupll_recalc_rate(struct clk_hw *hw, unsigned long
>                                              parent_rate);
>  }
>
> -static long msc313_cpupll_round_rate(struct clk_hw *hw, unsigned long rate,
> -                                    unsigned long *parent_rate)
> +static int msc313_cpupll_determine_rate(struct clk_hw *hw,
> +                                       struct clk_rate_request *req)
>  {
> -       u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate);
> -       long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate);
> +       u32 reg = msc313_cpupll_regforfrequecy(req->rate, req->best_parent_rate);
> +       long rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate);
>
>         /*
>          * This is my poor attempt at making sure the resulting
>          * rate doesn't overshoot the requested rate.
>          */
> -       for (; rounded >= rate && reg > 0; reg--)
> -               rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate);
> +       for (; rounded >= req->rate && reg > 0; reg--)
> +               rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate);
>
> -       return rounded;
> +       req->rate = rounded;
> +
> +       return 0;
>  }
>
>  static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
> @@ -168,7 +170,7 @@ static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigne
>
>  static const struct clk_ops msc313_cpupll_ops = {
>         .recalc_rate    = msc313_cpupll_recalc_rate,
> -       .round_rate     = msc313_cpupll_round_rate,
> +       .determine_rate = msc313_cpupll_determine_rate,
>         .set_rate       = msc313_cpupll_set_rate,
>  };
>
>
> --
> 2.50.1
>
>

Only visually inspected but seems correct.

Reviewed-by: Daniel Palmer <daniel@thingy.jp>

Thanks,

Daniel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 113/114] clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 113/114] clk: sophgo: sg2042-pll: " Brian Masney via B4 Relay
  2025-08-11 15:36   ` Alexander Sverdlin
@ 2025-08-14  8:46   ` Chen Wang
  1 sibling, 0 replies; 172+ messages in thread
From: Chen Wang @ 2025-08-14  8:46 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On 8/11/2025 11:19 PM, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops, so let's remove the round_rate() clk ops since
> it's unused.
>
> The implementation of sg2042_clk_pll_determine_rate() calls
> sg2042_clk_pll_round_rate(), so this folds the two into a single
> function.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Chen Wang <unicorn_wang@outlook.com>

Same comment as Alex. I will test this out after you send out v2.

Thanks,

Chen

> ---
>   drivers/clk/sophgo/clk-sg2042-pll.c | 24 ++++++++----------------
>   1 file changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c
> index e5fb0bb7ac4f97616f3b472fcab45e5729eb653e..b2cbd50ac73c7538b1acbca517f4259cba885fcc 100644
> --- a/drivers/clk/sophgo/clk-sg2042-pll.c
> +++ b/drivers/clk/sophgo/clk-sg2042-pll.c
> @@ -346,37 +346,30 @@ static unsigned long sg2042_clk_pll_recalc_rate(struct clk_hw *hw,
>   	return rate;
>   }
>   
> -static long sg2042_clk_pll_round_rate(struct clk_hw *hw,
> -				      unsigned long req_rate,
> -				      unsigned long *prate)
> +static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
> +					 struct clk_rate_request *req)
>   {
>   	struct sg2042_pll_ctrl pctrl_table;
>   	unsigned int value;
>   	long proper_rate;
>   	int ret;
>   
> -	ret = sg2042_get_pll_ctl_setting(&pctrl_table, req_rate, *prate);
> +	ret = sg2042_get_pll_ctl_setting(&pctrl_table,
> +					 min(req->rate, req->max_rate),
> +					 req->best_parent_rate);
>   	if (ret) {
>   		proper_rate = 0;
>   		goto out;
>   	}
>   
>   	value = sg2042_pll_ctrl_encode(&pctrl_table);
> -	proper_rate = (long)sg2042_pll_recalc_rate(value, *prate);
> +	proper_rate = (long)sg2042_pll_recalc_rate(value, req->best_parent_rate);
>   
>   out:
>   	pr_debug("--> %s: pll_round_rate: val = %ld\n",
>   		 clk_hw_get_name(hw), proper_rate);
> -	return proper_rate;
> -}
> +	req->rate = proper_rate;
>   
> -static int sg2042_clk_pll_determine_rate(struct clk_hw *hw,
> -					 struct clk_rate_request *req)
> -{
> -	req->rate = sg2042_clk_pll_round_rate(hw, min(req->rate, req->max_rate),
> -					      &req->best_parent_rate);
> -	pr_debug("--> %s: pll_determine_rate: val = %ld\n",
> -		 clk_hw_get_name(hw), req->rate);
>   	return 0;
>   }
>   
> @@ -417,14 +410,13 @@ static int sg2042_clk_pll_set_rate(struct clk_hw *hw,
>   
>   static const struct clk_ops sg2042_clk_pll_ops = {
>   	.recalc_rate = sg2042_clk_pll_recalc_rate,
> -	.round_rate = sg2042_clk_pll_round_rate,
>   	.determine_rate = sg2042_clk_pll_determine_rate,
>   	.set_rate = sg2042_clk_pll_set_rate,
>   };
>   
>   static const struct clk_ops sg2042_clk_pll_ro_ops = {
>   	.recalc_rate = sg2042_clk_pll_recalc_rate,
> -	.round_rate = sg2042_clk_pll_round_rate,
> +	.determine_rate = sg2042_clk_pll_determine_rate,
>   };
>   
>   /*
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 048/114] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 048/114] clk: sophgo: sg2042-clkgen: " Brian Masney via B4 Relay
  2025-08-11 15:45   ` Alexander Sverdlin
@ 2025-08-14  8:47   ` Chen Wang
  1 sibling, 0 replies; 172+ messages in thread
From: Chen Wang @ 2025-08-14  8:47 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On 8/11/2025 11:18 PM, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Chen Wang <unicorn_wang@outlook.com>

Same comment as Alex. I will test this out after you send out v2.

Thanks,

Chen

> ---
>   drivers/clk/sophgo/clk-sg2042-clkgen.c | 17 +++++++++--------
>   1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/sophgo/clk-sg2042-clkgen.c b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> index 9e61288d34f3757315702c355f2669577b29676f..1d3b1656bcf2e6655e0299e68ab39f32189744dc 100644
> --- a/drivers/clk/sophgo/clk-sg2042-clkgen.c
> +++ b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> @@ -176,9 +176,8 @@ static unsigned long sg2042_clk_divider_recalc_rate(struct clk_hw *hw,
>   	return ret_rate;
>   }
>   
> -static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> -					  unsigned long rate,
> -					  unsigned long *prate)
> +static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
> +					     struct clk_rate_request *req)
>   {
>   	struct sg2042_divider_clock *divider = to_sg2042_clk_divider(hw);
>   	unsigned long ret_rate;
> @@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
>   			bestdiv = readl(divider->reg) >> divider->shift;
>   			bestdiv &= clk_div_mask(divider->width);
>   		}
> -		ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
> +		ret_rate = DIV_ROUND_UP_ULL((u64)*&req->best_parent_rate, bestdiv);
>   	} else {
> -		ret_rate = divider_round_rate(hw, rate, prate, NULL,
> +		ret_rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, NULL,
>   					      divider->width, divider->div_flags);
>   	}
>   
>   	pr_debug("--> %s: divider_round_rate: val = %ld\n",
>   		 clk_hw_get_name(hw), ret_rate);
> -	return ret_rate;
> +	req->rate = ret_rate;
> +
> +	return 0;
>   }
>   
>   static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
> @@ -258,13 +259,13 @@ static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
>   
>   static const struct clk_ops sg2042_clk_divider_ops = {
>   	.recalc_rate = sg2042_clk_divider_recalc_rate,
> -	.round_rate = sg2042_clk_divider_round_rate,
> +	.determine_rate = sg2042_clk_divider_determine_rate,
>   	.set_rate = sg2042_clk_divider_set_rate,
>   };
>   
>   static const struct clk_ops sg2042_clk_divider_ro_ops = {
>   	.recalc_rate = sg2042_clk_divider_recalc_rate,
> -	.round_rate = sg2042_clk_divider_round_rate,
> +	.determine_rate = sg2042_clk_divider_determine_rate,
>   };
>   
>   /*
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 092/114] clk: renesas: rzg2l-cpg: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 092/114] clk: renesas: rzg2l-cpg: " Brian Masney via B4 Relay
@ 2025-08-14 15:06   ` Geert Uytterhoeven
  0 siblings, 0 replies; 172+ messages in thread
From: Geert Uytterhoeven @ 2025-08-14 15:06 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Heiko Stuebner,
	Andrea della Porta, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, 11 Aug 2025 at 17:19, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk for v6.18.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
  2025-08-11 16:02   ` Alexander Sverdlin
@ 2025-08-14 15:10   ` Geert Uytterhoeven
  1 sibling, 0 replies; 172+ messages in thread
From: Geert Uytterhoeven @ 2025-08-14 15:10 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Heiko Stuebner,
	Andrea della Porta, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, 11 Aug 2025 at 17:19, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops. Also all clk drivers that directly calls
> divider's round_rate() have been migrated over to determine_rate(). So
> let's remove the round_rate() clk ops.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
@ 2025-08-14 15:11   ` Geert Uytterhoeven
  0 siblings, 0 replies; 172+ messages in thread
From: Geert Uytterhoeven @ 2025-08-14 15:11 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Heiko Stuebner,
	Andrea della Porta, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, 11 Aug 2025 at 17:18, Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> This driver implements both the determine_rate() and round_rate() clk
> ops, and the round_rate() clk ops is deprecated. When both are defined,
> clk_core_determine_round_nolock() from the clk core will only use the
> determine_rate() clk ops, so let's remove the round_rate() clk ops since
> it's unused.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk for v6.18.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 075/114] clk: apple-nco: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 075/114] clk: apple-nco: " Brian Masney via B4 Relay
@ 2025-08-14 15:29   ` Janne Grunau
  0 siblings, 0 replies; 172+ messages in thread
From: Janne Grunau @ 2025-08-14 15:29 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:19:07AM -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/clk-apple-nco.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)

Reviewed-by: Janne Grunau <j@jannau.net>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* RE: [PATCH 110/114] clk: visconti: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 110/114] clk: visconti: pll: " Brian Masney via B4 Relay
@ 2025-08-18  0:48   ` nobuhiro1.iwamatsu
  0 siblings, 0 replies; 172+ messages in thread
From: nobuhiro1.iwamatsu @ 2025-08-18  0:48 UTC (permalink / raw)
  To: bmasney, mturquette, sboyd, sudeep.holla, cristian.marussi,
	unicorn_wang, inochiama, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, paul, keguang.zhang, sugaya.taichi, orito.takao,
	shawnguo, s.hauer, kernel, festevam, ychuang3, schung, vz,
	piotr.wojtaszczyk, paul.walmsley, samuel.holland, dlan,
	Steen.Hegelund, daniel.machon, UNGLinuxDriver, orsonzhai,
	baolin.wang, zhang.lyra, mcoquelin.stm32, alexandre.torgue,
	michal.simek, mripard, afaerber, mani, sven, j, alyssa, neal,
	Eugeniy.Paltsev, rjui, sbranden, bcm-kernel-feedback-list,
	jcmvbkbc, matthias.bgg, angelogioacchino.delregno, daniel,
	romain.perier, andrew, gregory.clement, sebastian.hesselbarth,
	andersson, geert+renesas, heiko, andrea.porta, krzk, s.nawrocki,
	cw00.choi, alim.akhtar, qinjian, vireshk, ulf.hansson,
	luca.ceresoli, alexander.helms.jy, linus.walleij, liviu.dudau,
	lpieralisi
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

> Subject: [PATCH 110/114] clk: visconti: pll: convert from round_rate() to
> determine_rate()
> 
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch on the
> cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

> ---
>  drivers/clk/visconti/pll.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c index
> 8ca1bad61864204027b7aff9020f1cb9e7d198d3..681721d8503203de9ac49ac32
> 07e121bb5bf2163 100644
> --- a/drivers/clk/visconti/pll.c
> +++ b/drivers/clk/visconti/pll.c
> @@ -100,8 +100,8 @@ static unsigned long
> visconti_get_pll_rate_from_data(struct visconti_pll *pll,
>  	return rate_table[0].rate;
>  }
> 
> -static long visconti_pll_round_rate(struct clk_hw *hw,
> -				    unsigned long rate, unsigned long *prate)
> +static int visconti_pll_determine_rate(struct clk_hw *hw,
> +				       struct clk_rate_request *req)
>  {
>  	struct visconti_pll *pll = to_visconti_pll(hw);
>  	const struct visconti_pll_rate_table *rate_table = pll->rate_table; @@
> -109,11 +109,16 @@ static long visconti_pll_round_rate(struct clk_hw *hw,
> 
>  	/* Assuming rate_table is in descending order */
>  	for (i = 0; i < pll->rate_count; i++)
> -		if (rate >= rate_table[i].rate)
> -			return rate_table[i].rate;
> +		if (req->rate >= rate_table[i].rate) {
> +			req->rate = rate_table[i].rate;
> +
> +			return 0;
> +		}
> 
>  	/* return minimum supported value */
> -	return rate_table[i - 1].rate;
> +	req->rate = rate_table[i - 1].rate;
> +
> +	return 0;
>  }
> 
>  static unsigned long visconti_pll_recalc_rate(struct clk_hw *hw, @@ -232,7
> +237,7 @@ static const struct clk_ops visconti_pll_ops = {
>  	.enable = visconti_pll_enable,
>  	.disable = visconti_pll_disable,
>  	.is_enabled = visconti_pll_is_enabled,
> -	.round_rate = visconti_pll_round_rate,
> +	.determine_rate = visconti_pll_determine_rate,
>  	.recalc_rate = visconti_pll_recalc_rate,
>  	.set_rate = visconti_pll_set_rate,
>  };
> 
> --
> 2.50.1


Best regards,
  Nobuhiro

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 058/114] clk: stm32: stm32-core: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 058/114] clk: stm32: stm32-core: " Brian Masney via B4 Relay
@ 2025-08-18 12:08   ` Gabriel FERNANDEZ
  0 siblings, 0 replies; 172+ messages in thread
From: Gabriel FERNANDEZ @ 2025-08-18 12:08 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On 8/11/25 17:18, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>

> ---
>   drivers/clk/stm32/clk-stm32-core.c | 28 ++++++++++++++++++----------
>   1 file changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c
> index 933e3cde0795386c3e5e6902aa0989cf3dffc01e..72825b9c36a4d3b8ba3f7615b9026c09ffaf88d1 100644
> --- a/drivers/clk/stm32/clk-stm32-core.c
> +++ b/drivers/clk/stm32/clk-stm32-core.c
> @@ -351,14 +351,14 @@ static int clk_stm32_divider_set_rate(struct clk_hw *hw, unsigned long rate,
>   	return ret;
>   }
>   
> -static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate,
> -					 unsigned long *prate)
> +static int clk_stm32_divider_determine_rate(struct clk_hw *hw,
> +					    struct clk_rate_request *req)
>   {
>   	struct clk_stm32_div *div = to_clk_stm32_divider(hw);
>   	const struct stm32_div_cfg *divider;
>   
>   	if (div->div_id == NO_STM32_DIV)
> -		return rate;
> +		return 0;
>   
>   	divider = &div->clock_data->dividers[div->div_id];
>   
> @@ -369,14 +369,22 @@ static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate,
>   		val =  readl(div->base + divider->offset) >> divider->shift;
>   		val &= clk_div_mask(divider->width);
>   
> -		return divider_ro_round_rate(hw, rate, prate, divider->table,
> -				divider->width, divider->flags,
> -				val);
> +		req->rate = divider_ro_round_rate(hw, req->rate,
> +						  &req->best_parent_rate,
> +						  divider->table,
> +						  divider->width,
> +						  divider->flags, val);
> +
> +		return 0;
>   	}
>   
> -	return divider_round_rate_parent(hw, clk_hw_get_parent(hw),
> -					 rate, prate, divider->table,
> -					 divider->width, divider->flags);
> +	req->rate = divider_round_rate_parent(hw, clk_hw_get_parent(hw),
> +					      req->rate,
> +					      &req->best_parent_rate,
> +					      divider->table,
> +					      divider->width, divider->flags);
> +
> +	return 0;
>   }
>   
>   static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw,
> @@ -392,7 +400,7 @@ static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw,
>   
>   const struct clk_ops clk_stm32_divider_ops = {
>   	.recalc_rate	= clk_stm32_divider_recalc_rate,
> -	.round_rate	= clk_stm32_divider_round_rate,
> +	.determine_rate = clk_stm32_divider_determine_rate,
>   	.set_rate	= clk_stm32_divider_set_rate,
>   };
>   
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 059/114] clk: stm32: stm32mp1: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 059/114] clk: stm32: stm32mp1: " Brian Masney via B4 Relay
@ 2025-08-18 12:09   ` Gabriel FERNANDEZ
  0 siblings, 0 replies; 172+ messages in thread
From: Gabriel FERNANDEZ @ 2025-08-18 12:09 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On 8/11/25 17:18, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>

> ---
>   drivers/clk/stm32/clk-stm32mp1.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/stm32/clk-stm32mp1.c b/drivers/clk/stm32/clk-stm32mp1.c
> index b8b45ed22f981df580506f3d4ca801ba11d2bab2..2d9ccd96ec98c05eb836d632bfd9903de60ba1bb 100644
> --- a/drivers/clk/stm32/clk-stm32mp1.c
> +++ b/drivers/clk/stm32/clk-stm32mp1.c
> @@ -970,12 +970,15 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
>   	return mult;
>   }
>   
> -static long timer_ker_round_rate(struct clk_hw *hw, unsigned long rate,
> -				 unsigned long *parent_rate)
> +static int timer_ker_determine_rate(struct clk_hw *hw,
> +				    struct clk_rate_request *req)
>   {
> -	unsigned long factor = __bestmult(hw, rate, *parent_rate);
> +	unsigned long factor = __bestmult(hw, req->rate,
> +					  req->best_parent_rate);
>   
> -	return *parent_rate * factor;
> +	req->rate = req->best_parent_rate * factor;
> +
> +	return 0;
>   }
>   
>   static int timer_ker_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -1026,7 +1029,7 @@ static unsigned long timer_ker_recalc_rate(struct clk_hw *hw,
>   
>   static const struct clk_ops timer_ker_ops = {
>   	.recalc_rate	= timer_ker_recalc_rate,
> -	.round_rate	= timer_ker_round_rate,
> +	.determine_rate = timer_ker_determine_rate,
>   	.set_rate	= timer_ker_set_rate,
>   
>   };
>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 016/114] clk: gemini: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 016/114] clk: gemini: " Brian Masney via B4 Relay
@ 2025-08-19  9:46   ` Linus Walleij
  0 siblings, 0 replies; 172+ messages in thread
From: Linus Walleij @ 2025-08-19  9:46 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 5:18 PM Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:

> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 105/114] clk: ux500: prcmu: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 105/114] clk: ux500: prcmu: " Brian Masney via B4 Relay
@ 2025-08-19  9:47   ` Linus Walleij
  0 siblings, 0 replies; 172+ messages in thread
From: Linus Walleij @ 2025-08-19  9:47 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 5:19 PM Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:

> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 108/114] clk: versatile: icst: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 108/114] clk: versatile: icst: " Brian Masney via B4 Relay
@ 2025-08-19  9:47   ` Linus Walleij
  0 siblings, 0 replies; 172+ messages in thread
From: Linus Walleij @ 2025-08-19  9:47 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 5:19 PM Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:

> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 109/114] clk: versatile: vexpress-osc: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 109/114] clk: versatile: vexpress-osc: " Brian Masney via B4 Relay
@ 2025-08-19  9:49   ` Linus Walleij
  0 siblings, 0 replies; 172+ messages in thread
From: Linus Walleij @ 2025-08-19  9:49 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 5:21 PM Brian Masney via B4 Relay
<devnull+bmasney.redhat.com@kernel.org> wrote:

> From: Brian Masney <bmasney@redhat.com>
>
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (116 preceding siblings ...)
  2025-08-12 13:39 ` Icenowy Zheng
@ 2025-08-22  6:31 ` Krzysztof Kozlowski
  2025-08-22 11:32   ` Brian Masney
  2025-08-23 16:48 ` Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  120 siblings, 1 reply; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-22  6:31 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.

This is going to create huge conflicts and I did not find here any
merging strategy.

What do you expect from us here?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-22  6:31 ` Krzysztof Kozlowski
@ 2025-08-22 11:32   ` Brian Masney
  2025-08-22 12:23     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 172+ messages in thread
From: Brian Masney @ 2025-08-22 11:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

Hi Krzysztof (and Stephen),

On Fri, Aug 22, 2025 at 08:31:08AM +0200, Krzysztof Kozlowski wrote:
> On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> > The round_rate() clk ops is deprecated in the clk framework in favor
> > of the determine_rate() clk ops, so let's go ahead and convert the
> > various clk drivers using the Coccinelle semantic patch posted below.
> > I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This is going to create huge conflicts and I did not find here any
> merging strategy.
> 
> What do you expect from us here?

That's a good question. You are right that there's a handful of drivers
where this will create a merge conflict with some other work that's been
posted this development cycle due to other unrelated changes. I suspect
the majority of these will still apply cleanly.

This series doesn't remove round_rate from the clk core, and I'll post
that change once everything else has been merged across the tree. I've
been trying to catch any new round_rate implementations that are posted
in review.

7 of the 114 patches in this series needs a v2 with a minor fix. I see
several paths forward to merging this. It's ultimately up to Stephen how
he wants to proceed.

- I send Stephen a PULL request with all of these patches with the minor
  cleanups to the 7 patches. Depending on the timing, Stephen can merge
  the other work first, and I deal with cleaning up the merge conflicts.
  Or he can if he prefers to instead.

- Stephen applies everyone else's work first to his tree, and then the
  good 107 patches in this series. He skips anything that doesn't apply
  due to other people's work and I follow up with a smaller series.

I would prefer to not to have to post a v2 114 patch series if
possible.

If I don't hear back from Stephen about how he wants to proceed, then
I'm planning to send him a PULL request the week of Sep 1st.

Does this sound good? I'm open to other suggestions.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-22 11:32   ` Brian Masney
@ 2025-08-22 12:23     ` Krzysztof Kozlowski
  2025-08-22 13:09       ` Brian Masney
  0 siblings, 1 reply; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-22 12:23 UTC (permalink / raw)
  To: Brian Masney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On 22/08/2025 13:32, Brian Masney wrote:
> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> several paths forward to merging this. It's ultimately up to Stephen how
> he wants to proceed.
> 
> - I send Stephen a PULL request with all of these patches with the minor
>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
>   the other work first, and I deal with cleaning up the merge conflicts.
>   Or he can if he prefers to instead.
> 
> - Stephen applies everyone else's work first to his tree, and then the
>   good 107 patches in this series. He skips anything that doesn't apply
>   due to other people's work and I follow up with a smaller series.

Both cause cross tree merge conflicts. Anyway, please document clearly
the dependencies between patches.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-22 12:23     ` Krzysztof Kozlowski
@ 2025-08-22 13:09       ` Brian Masney
  2025-08-23 16:43         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 172+ messages in thread
From: Brian Masney @ 2025-08-22 13:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
> On 22/08/2025 13:32, Brian Masney wrote:
> > 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> > several paths forward to merging this. It's ultimately up to Stephen how
> > he wants to proceed.
> > 
> > - I send Stephen a PULL request with all of these patches with the minor
> >   cleanups to the 7 patches. Depending on the timing, Stephen can merge
> >   the other work first, and I deal with cleaning up the merge conflicts.
> >   Or he can if he prefers to instead.
> > 
> > - Stephen applies everyone else's work first to his tree, and then the
> >   good 107 patches in this series. He skips anything that doesn't apply
> >   due to other people's work and I follow up with a smaller series.
> 
> Both cause cross tree merge conflicts. Anyway, please document clearly
> the dependencies between patches.

This series only touches drivers/clk, so it shouldn't cause any issues
with other subsystems, unless there's a topic branch somewhere, or I'm
missing something?

There are some drivers under drivers/clk/ where there is an entry in the
MAINTAINERS file that's not Stephen, although it wasn't clear to me if
all of those people will send PULL requests to Stephen. I described on
the cover how how the series was broken up.

  - Patches 4-70 are for drivers where there is no clk submaintainer
  - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
    (for drivers/clk)

For the clk subdirectories that had say more than 3 patches, I sent
those off as separate patch series. The ones in this series have an
entry in MAINTAINERS only have a few patches for each maintainer.

As for patch dependencies, patches 111 (clk/divider) and
114 (clk/fixed-factor) should go in last. It doesn't matter the order
everything else goes in.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-22 13:09       ` Brian Masney
@ 2025-08-23 16:43         ` Krzysztof Kozlowski
  2025-09-01  9:49           ` Geert Uytterhoeven
  0 siblings, 1 reply; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-23 16:43 UTC (permalink / raw)
  To: Brian Masney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On 22/08/2025 15:09, Brian Masney wrote:
> On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
>> On 22/08/2025 13:32, Brian Masney wrote:
>>> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
>>> several paths forward to merging this. It's ultimately up to Stephen how
>>> he wants to proceed.
>>>
>>> - I send Stephen a PULL request with all of these patches with the minor
>>>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
>>>   the other work first, and I deal with cleaning up the merge conflicts.
>>>   Or he can if he prefers to instead.
>>>
>>> - Stephen applies everyone else's work first to his tree, and then the
>>>   good 107 patches in this series. He skips anything that doesn't apply
>>>   due to other people's work and I follow up with a smaller series.
>>
>> Both cause cross tree merge conflicts. Anyway, please document clearly
>> the dependencies between patches.
> 
> This series only touches drivers/clk, so it shouldn't cause any issues
> with other subsystems, unless there's a topic branch somewhere, or I'm
> missing something?

Individual maintainers handle subdirectories.

> 
> There are some drivers under drivers/clk/ where there is an entry in the
> MAINTAINERS file that's not Stephen, although it wasn't clear to me if
> all of those people will send PULL requests to Stephen. I described on
> the cover how how the series was broken up.
> 
>   - Patches 4-70 are for drivers where there is no clk submaintainer
>   - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
>     (for drivers/clk)

It's hidden between multiple other descriptions of patches, so I really
would not think that this means that it is okay by individual maintainer
to take the patch.

This really should be the one most important part of the cover letter
for something like this.
..

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (117 preceding siblings ...)
  2025-08-22  6:31 ` Krzysztof Kozlowski
@ 2025-08-23 16:48 ` Krzysztof Kozlowski
  2025-08-25 22:23 ` (subset) " Yixun Lan
  2025-08-29  0:47 ` Brian Masney
  120 siblings, 0 replies; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-23 16:48 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
@Stephen,

There will be dependencies/conflicts for Samsung, so I will take the two
Samsung patches. Let me know if you disagree.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: (subset) [PATCH 098/114] clk: samsung: cpu: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 098/114] clk: samsung: cpu: " Brian Masney via B4 Relay
@ 2025-08-23 16:50   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-23 16:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	Brian Masney
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On Mon, 11 Aug 2025 11:19:30 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> 

Applied, thanks!

[098/114] clk: samsung: cpu: convert from round_rate() to determine_rate()
          https://git.kernel.org/krzk/linux/c/05c58c9415d1369387aedd28518fd0fdaeabd178

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: (subset) [PATCH 099/114] clk: samsung: pll: convert from round_rate() to determine_rate()
  2025-08-11 15:19 ` [PATCH 099/114] clk: samsung: pll: " Brian Masney via B4 Relay
@ 2025-08-23 16:50   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 172+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-23 16:50 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	Brian Masney
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On Mon, 11 Aug 2025 11:19:31 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> 

Applied, thanks!

[099/114] clk: samsung: pll: convert from round_rate() to determine_rate()
          https://git.kernel.org/krzk/linux/c/e278e39b014d789fb670695d422ff33c3ef56040

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 049/114] clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 049/114] clk: spacemit: ccu_ddn: " Brian Masney via B4 Relay
@ 2025-08-25  8:40   ` Yixun Lan
  2025-08-25 15:17   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Yixun Lan @ 2025-08-25  8:40 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian,

  Thanks for doing this

  I will give my rb to 49-51 for SpacemiT, and here we face same
issue as Krzysztof did for samsung, to avoid potential conflicts
we will route the clk patches through SpacemiT SoC tree..

On 11:18 Mon 11 Aug     , Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Yixun Lan <dlan@kernel.org>

> ---
>  drivers/clk/spacemit/ccu_ddn.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/spacemit/ccu_ddn.c b/drivers/clk/spacemit/ccu_ddn.c
> index be311b045698e95a688a35858a8ac1bcfbffd2c7..02b68ea84db9bd3ecdde41f8013c48263edbd917 100644
> --- a/drivers/clk/spacemit/ccu_ddn.c
> +++ b/drivers/clk/spacemit/ccu_ddn.c
> @@ -39,13 +39,16 @@ static unsigned long ccu_ddn_calc_best_rate(struct ccu_ddn *ddn,
>  	return ccu_ddn_calc_rate(prate, *num, *den);
>  }
>  
> -static long ccu_ddn_round_rate(struct clk_hw *hw, unsigned long rate,
> -			       unsigned long *prate)
> +static int ccu_ddn_determine_rate(struct clk_hw *hw,
> +				  struct clk_rate_request *req)
>  {
>  	struct ccu_ddn *ddn = hw_to_ccu_ddn(hw);
>  	unsigned long num, den;
>  
> -	return ccu_ddn_calc_best_rate(ddn, rate, *prate, &num, &den);
> +	req->rate = ccu_ddn_calc_best_rate(ddn, req->rate,
> +					   req->best_parent_rate, &num, &den);
> +
> +	return 0;
>  }
>  
>  static unsigned long ccu_ddn_recalc_rate(struct clk_hw *hw, unsigned long prate)
> @@ -78,6 +81,6 @@ static int ccu_ddn_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  const struct clk_ops spacemit_ccu_ddn_ops = {
>  	.recalc_rate	= ccu_ddn_recalc_rate,
> -	.round_rate	= ccu_ddn_round_rate,
> +	.determine_rate = ccu_ddn_determine_rate,
>  	.set_rate	= ccu_ddn_set_rate,
>  };
> 
> -- 
> 2.50.1
> 
> 

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 050/114] clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 050/114] clk: spacemit: ccu_mix: " Brian Masney via B4 Relay
@ 2025-08-25  8:41   ` Yixun Lan
  2025-08-25 15:18   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Yixun Lan @ 2025-08-25  8:41 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian,

On 11:18 Mon 11 Aug     , Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Yixun Lan <dlan@kernel.org>
> ---
>  drivers/clk/spacemit/ccu_mix.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/spacemit/ccu_mix.c b/drivers/clk/spacemit/ccu_mix.c
> index 9b852aa61f78aed5256bfe6fc3b01932d6db6256..7b7990875372314dce131295af7f40267d0a127a 100644
> --- a/drivers/clk/spacemit/ccu_mix.c
> +++ b/drivers/clk/spacemit/ccu_mix.c
> @@ -80,10 +80,12 @@ static int ccu_mix_trigger_fc(struct clk_hw *hw)
>  					       MIX_FC_TIMEOUT_US);
>  }
>  
> -static long ccu_factor_round_rate(struct clk_hw *hw, unsigned long rate,
> -				  unsigned long *prate)
> +static int ccu_factor_determine_rate(struct clk_hw *hw,
> +				     struct clk_rate_request *req)
>  {
> -	return ccu_factor_recalc_rate(hw, *prate);
> +	req->rate = ccu_factor_recalc_rate(hw, req->best_parent_rate);
> +
> +	return 0;
>  }
>  
>  static int ccu_factor_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -198,7 +200,7 @@ const struct clk_ops spacemit_ccu_gate_ops = {
>  };
>  
>  const struct clk_ops spacemit_ccu_factor_ops = {
> -	.round_rate	= ccu_factor_round_rate,
> +	.determine_rate = ccu_factor_determine_rate,
>  	.recalc_rate	= ccu_factor_recalc_rate,
>  	.set_rate	= ccu_factor_set_rate,
>  };
> @@ -220,7 +222,7 @@ const struct clk_ops spacemit_ccu_factor_gate_ops = {
>  	.enable		= ccu_gate_enable,
>  	.is_enabled	= ccu_gate_is_enabled,
>  
> -	.round_rate	= ccu_factor_round_rate,
> +	.determine_rate = ccu_factor_determine_rate,
>  	.recalc_rate	= ccu_factor_recalc_rate,
>  	.set_rate	= ccu_factor_set_rate,
>  };
> 
> -- 
> 2.50.1
> 
> 

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 051/114] clk: spacemit: ccu_pll: " Brian Masney via B4 Relay
@ 2025-08-25  8:41   ` Yixun Lan
  2025-08-25 15:18   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Yixun Lan @ 2025-08-25  8:41 UTC (permalink / raw)
  To: bmasney
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian,

On 11:18 Mon 11 Aug     , Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Yixun Lan <dlan@kernel.org>
> ---
>  drivers/clk/spacemit/ccu_pll.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/spacemit/ccu_pll.c b/drivers/clk/spacemit/ccu_pll.c
> index 45f540073a656c0edc341a903acc3f2405971fc9..d92f0dae65a490e9db52f25a538a518baa487ea8 100644
> --- a/drivers/clk/spacemit/ccu_pll.c
> +++ b/drivers/clk/spacemit/ccu_pll.c
> @@ -125,12 +125,14 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
>  	return entry ? entry->rate : 0;
>  }
>  
> -static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> -			       unsigned long *prate)
> +static int ccu_pll_determine_rate(struct clk_hw *hw,
> +				  struct clk_rate_request *req)
>  {
>  	struct ccu_pll *pll = hw_to_ccu_pll(hw);
>  
> -	return ccu_pll_lookup_best_rate(pll, rate)->rate;
> +	req->rate = ccu_pll_lookup_best_rate(pll, req->rate)->rate;
> +
> +	return 0;
>  }
>  
>  static int ccu_pll_init(struct clk_hw *hw)
> @@ -152,6 +154,6 @@ const struct clk_ops spacemit_ccu_pll_ops = {
>  	.disable	= ccu_pll_disable,
>  	.set_rate	= ccu_pll_set_rate,
>  	.recalc_rate	= ccu_pll_recalc_rate,
> -	.round_rate	= ccu_pll_round_rate,
> +	.determine_rate = ccu_pll_determine_rate,
>  	.is_enabled	= ccu_pll_is_enabled,
>  };
> 
> -- 
> 2.50.1
> 
> 

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 049/114] clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 049/114] clk: spacemit: ccu_ddn: " Brian Masney via B4 Relay
  2025-08-25  8:40   ` Yixun Lan
@ 2025-08-25 15:17   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Haylen Chu @ 2025-08-25 15:17 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:18:41AM -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/spacemit/ccu_ddn.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Reviewed-by: Haylen Chu <heylenay@4d2.org>

Thanks for cleaning it up, I should have done this when submitting the
driver.

Best regards,
Haylen Chu

> diff --git a/drivers/clk/spacemit/ccu_ddn.c b/drivers/clk/spacemit/ccu_ddn.c
> index be311b045698e95a688a35858a8ac1bcfbffd2c7..02b68ea84db9bd3ecdde41f8013c48263edbd917 100644
> --- a/drivers/clk/spacemit/ccu_ddn.c
> +++ b/drivers/clk/spacemit/ccu_ddn.c
> @@ -39,13 +39,16 @@ static unsigned long ccu_ddn_calc_best_rate(struct ccu_ddn *ddn,
>  	return ccu_ddn_calc_rate(prate, *num, *den);
>  }
>  
> -static long ccu_ddn_round_rate(struct clk_hw *hw, unsigned long rate,
> -			       unsigned long *prate)
> +static int ccu_ddn_determine_rate(struct clk_hw *hw,
> +				  struct clk_rate_request *req)
>  {
>  	struct ccu_ddn *ddn = hw_to_ccu_ddn(hw);
>  	unsigned long num, den;
>  
> -	return ccu_ddn_calc_best_rate(ddn, rate, *prate, &num, &den);
> +	req->rate = ccu_ddn_calc_best_rate(ddn, req->rate,
> +					   req->best_parent_rate, &num, &den);
> +
> +	return 0;
>  }
>  
>  static unsigned long ccu_ddn_recalc_rate(struct clk_hw *hw, unsigned long prate)
> @@ -78,6 +81,6 @@ static int ccu_ddn_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  const struct clk_ops spacemit_ccu_ddn_ops = {
>  	.recalc_rate	= ccu_ddn_recalc_rate,
> -	.round_rate	= ccu_ddn_round_rate,
> +	.determine_rate = ccu_ddn_determine_rate,
>  	.set_rate	= ccu_ddn_set_rate,
>  };
> 
> -- 
> 2.50.1
> 
> 

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 050/114] clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 050/114] clk: spacemit: ccu_mix: " Brian Masney via B4 Relay
  2025-08-25  8:41   ` Yixun Lan
@ 2025-08-25 15:18   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Haylen Chu @ 2025-08-25 15:18 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:18:42AM -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/spacemit/ccu_mix.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)

Reviewed-by: Haylen Chu <heylenay@4d2.org>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 051/114] clk: spacemit: ccu_pll: " Brian Masney via B4 Relay
  2025-08-25  8:41   ` Yixun Lan
@ 2025-08-25 15:18   ` Haylen Chu
  1 sibling, 0 replies; 172+ messages in thread
From: Haylen Chu @ 2025-08-25 15:18 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:18:43AM -0400, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/clk/spacemit/ccu_pll.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Reviewed-by: Haylen Chu <heylenay@4d2.org>

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: (subset) [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (118 preceding siblings ...)
  2025-08-23 16:48 ` Krzysztof Kozlowski
@ 2025-08-25 22:23 ` Yixun Lan
  2025-08-29  0:47 ` Brian Masney
  120 siblings, 0 replies; 172+ messages in thread
From: Yixun Lan @ 2025-08-25 22:23 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	Brian Masney
  Cc: Yixun Lan, linux-clk, linux-kernel, arm-scmi, linux-arm-kernel,
	sophgo, linux-mips, imx, linux-riscv, spacemit, linux-stm32,
	patches, linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc


On Mon, 11 Aug 2025 11:17:52 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> [...]

Thanks, Applied to SpacemiT's SoC tree at "k1/clk-for-6.18" branch

[049/114] clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/b4a7b0d2c4485d11d37dec721709660f3967efcf
[050/114] clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/56737edda7db58549550776092da12fe03600399
[051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/d02c71cba7bba453d233a49497412ddbf2d44871

Best regards,
-- 
Yixun Lan


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate()
  2025-08-11 15:19 ` [PATCH 112/114] clk: scmi: " Brian Masney via B4 Relay
  2025-08-11 15:38   ` Alexander Sverdlin
@ 2025-08-27  7:09   ` Peng Fan
  2025-08-27 13:13     ` Brian Masney
  1 sibling, 1 reply; 172+ messages in thread
From: Peng Fan @ 2025-08-27  7:09 UTC (permalink / raw)
  To: bmasney, Sudeep Holla, Cristian Marussi
  Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian, Sudeep, Cristian

On Mon, Aug 11, 2025 at 11:19:44AM -0400, Brian Masney via B4 Relay wrote:
>From: Brian Masney <bmasney@redhat.com>
>
>This driver implements both the determine_rate() and round_rate() clk
>ops, and the round_rate() clk ops is deprecated. When both are defined,
>clk_core_determine_round_nolock() from the clk core will only use the
>determine_rate() clk ops, so let's remove the round_rate() clk ops since
>it's unused.
>
>Signed-off-by: Brian Masney <bmasney@redhat.com>
>---
> drivers/clk/clk-scmi.c | 30 ------------------------------
> 1 file changed, 30 deletions(-)
>
>diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
>index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644
>--- a/drivers/clk/clk-scmi.c
>+++ b/drivers/clk/clk-scmi.c
>@@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw,
> 	return rate;
> }
> 
>-static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
>-				unsigned long *parent_rate)
>-{

I see the point of round_rate is not used if determine_rate is there.
But reading the code of round_rate, It might be better to rename
scmi_clk_round_rate to scmi_clk_determine_rate.

Anyway, need Sudeep and Cristian to comment.

Thanks,
Peng

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate()
  2025-08-27  7:09   ` Peng Fan
@ 2025-08-27 13:13     ` Brian Masney
  2025-08-27 13:49       ` Sudeep Holla
  0 siblings, 1 reply; 172+ messages in thread
From: Brian Masney @ 2025-08-27 13:13 UTC (permalink / raw)
  To: Peng Fan
  Cc: Sudeep Holla, Cristian Marussi, Michael Turquette, Stephen Boyd,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Wed, Aug 27, 2025 at 03:09:33PM +0800, Peng Fan wrote:
> Hi Brian, Sudeep, Cristian
> 
> On Mon, Aug 11, 2025 at 11:19:44AM -0400, Brian Masney via B4 Relay wrote:
> >From: Brian Masney <bmasney@redhat.com>
> >
> >This driver implements both the determine_rate() and round_rate() clk
> >ops, and the round_rate() clk ops is deprecated. When both are defined,
> >clk_core_determine_round_nolock() from the clk core will only use the
> >determine_rate() clk ops, so let's remove the round_rate() clk ops since
> >it's unused.
> >
> >Signed-off-by: Brian Masney <bmasney@redhat.com>
> >---
> > drivers/clk/clk-scmi.c | 30 ------------------------------
> > 1 file changed, 30 deletions(-)
> >
> >diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> >index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644
> >--- a/drivers/clk/clk-scmi.c
> >+++ b/drivers/clk/clk-scmi.c
> >@@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw,
> > 	return rate;
> > }
> > 
> >-static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> >-				unsigned long *parent_rate)
> >-{
> 
> I see the point of round_rate is not used if determine_rate is there.
> But reading the code of round_rate, It might be better to rename
> scmi_clk_round_rate to scmi_clk_determine_rate.
> 
> Anyway, need Sudeep and Cristian to comment.

In this case, yes the round_rate implementation is filled out, whereas
the determine_rate lets the firmware handle it, and
scmi_clk_recalc_rate() will later populate the rate the clock is running
at.

I can convert round_rate over to determine_rate in this case, however it
would be a change to what's there now, and risks a regression. Here's
the relevant code from drivers/clk/clk.c where the determine_rate and
round_rate ops are called:

    static int clk_core_determine_round_nolock(struct clk_core *core,
                                               struct clk_rate_request *req)
    {
    	...
            if (clk_core_rate_is_protected(core)) {
                    req->rate = core->rate;
            } else if (core->ops->determine_rate) {
                    return core->ops->determine_rate(core->hw, req);
            } else if (core->ops->round_rate) {
                    rate = core->ops->round_rate(core->hw, req->rate,
                                                 &req->best_parent_rate);
    	...

If Sudeep / Cristian want the round rate converted to determine rate in
this driver, then I can do that in a v2.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 112/114] clk: scmi: remove round_rate() in favor of determine_rate()
  2025-08-27 13:13     ` Brian Masney
@ 2025-08-27 13:49       ` Sudeep Holla
  0 siblings, 0 replies; 172+ messages in thread
From: Sudeep Holla @ 2025-08-27 13:49 UTC (permalink / raw)
  To: Brian Masney
  Cc: Peng Fan, Sudeep Holla, Cristian Marussi, Michael Turquette,
	Stephen Boyd, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu,
	linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Wed, Aug 27, 2025 at 09:13:17AM -0400, Brian Masney wrote:
> On Wed, Aug 27, 2025 at 03:09:33PM +0800, Peng Fan wrote:
> > Hi Brian, Sudeep, Cristian
> > 
> > On Mon, Aug 11, 2025 at 11:19:44AM -0400, Brian Masney via B4 Relay wrote:
> > >From: Brian Masney <bmasney@redhat.com>
> > >
> > >This driver implements both the determine_rate() and round_rate() clk
> > >ops, and the round_rate() clk ops is deprecated. When both are defined,
> > >clk_core_determine_round_nolock() from the clk core will only use the
> > >determine_rate() clk ops, so let's remove the round_rate() clk ops since
> > >it's unused.
> > >
> > >Signed-off-by: Brian Masney <bmasney@redhat.com>
> > >---
> > > drivers/clk/clk-scmi.c | 30 ------------------------------
> > > 1 file changed, 30 deletions(-)
> > >
> > >diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> > >index d2408403283fc72f0cf902e65f4c08bcbc7b4b0b..6c6ddb92e7cf6a0cfac2c7e19c0f15f777bb8c51 100644
> > >--- a/drivers/clk/clk-scmi.c
> > >+++ b/drivers/clk/clk-scmi.c
> > >@@ -54,35 +54,6 @@ static unsigned long scmi_clk_recalc_rate(struct clk_hw *hw,
> > > 	return rate;
> > > }
> > > 
> > >-static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> > >-				unsigned long *parent_rate)
> > >-{
> > 
> > I see the point of round_rate is not used if determine_rate is there.
> > But reading the code of round_rate, It might be better to rename
> > scmi_clk_round_rate to scmi_clk_determine_rate.
> > 
> > Anyway, need Sudeep and Cristian to comment.
> 
> In this case, yes the round_rate implementation is filled out, whereas
> the determine_rate lets the firmware handle it, and
> scmi_clk_recalc_rate() will later populate the rate the clock is running
> at.
> 
> I can convert round_rate over to determine_rate in this case, however it
> would be a change to what's there now, and risks a regression. Here's
> the relevant code from drivers/clk/clk.c where the determine_rate and
> round_rate ops are called:

I am inclined towards this. Determine rate was added recently when the
clock parent support was added IIUC, so I don't think it should regress
anything.

> 
>     static int clk_core_determine_round_nolock(struct clk_core *core,
>                                                struct clk_rate_request *req)
>     {
>     	...
>             if (clk_core_rate_is_protected(core)) {
>                     req->rate = core->rate;
>             } else if (core->ops->determine_rate) {
>                     return core->ops->determine_rate(core->hw, req);
>             } else if (core->ops->round_rate) {
>                     rate = core->ops->round_rate(core->hw, req->rate,
>                                                  &req->best_parent_rate);
>     	...
> 
> If Sudeep / Cristian want the round rate converted to determine rate in
> this driver, then I can do that in a v2.
> 

Yes please. Also please post it independent if it doesn't have to be in
the series. To many in cc and lots of patches to respin all.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
                   ` (119 preceding siblings ...)
  2025-08-25 22:23 ` (subset) " Yixun Lan
@ 2025-08-29  0:47 ` Brian Masney
  120 siblings, 0 replies; 172+ messages in thread
From: Brian Masney @ 2025-08-29  0:47 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
	Chen Wang, Inochi Amaoto, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Paul Cercueil, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

On Mon, Aug 11, 2025 at 11:17:52AM -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.

I posted a v2 patch series with 8 patches from this series that needed a
v2 to:

https://lore.kernel.org/linux-clk/20250828-clk-round-rate-v2-v1-0-b97ec8ba6cc4@redhat.com/T/

Sorry I didn't put PATCH v2 in the subject. I noticed as soon as it
started to send.

In summary, it fixes one merge conflict introduced in linux-next, remove
one case of &*, fix a comment, and removes unnecessary space after a
cast on 5 patches.

There are currently 7 patches from this series that's currently in
linux-next (renesas, spacemit, samsung). 

The relevant remaining 99 patches from this series waiting to be merged
can be grabbed with this command:

b4 am --add-link \
	--cherry-pick 1-37,39-47,52-63,65-67,69-89,91-91,94-94,96-96,100-112,114-114 \
	20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com

There's no dependencies with the other series.

Brian


^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
  2025-08-23 16:43         ` Krzysztof Kozlowski
@ 2025-09-01  9:49           ` Geert Uytterhoeven
  0 siblings, 0 replies; 172+ messages in thread
From: Geert Uytterhoeven @ 2025-09-01  9:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Brian Masney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Paul Cercueil, Keguang Zhang,
	Taichi Sugaya, Takao Orito, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Jacky Huang,
	Shan-Chun Hung, Vladimir Zapolskiy, Piotr Wojtaszczyk,
	Paul Walmsley, Samuel Holland, Yixun Lan, Steen Hegelund,
	Daniel Machon, UNGLinuxDriver, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Michal Simek,
	Maxime Ripard, Andreas Färber, Manivannan Sadhasivam,
	Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Eugeniy Paltsev, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Qin Jian, Viresh Kumar, Ulf Hansson,
	Luca Ceresoli, Alex Helms, Linus Walleij, Liviu Dudau,
	Lorenzo Pieralisi, Nobuhiro Iwamatsu, linux-clk, linux-kernel,
	arm-scmi, linux-arm-kernel, sophgo, linux-mips, imx, linux-riscv,
	spacemit, linux-stm32, patches, linux-actions, asahi,
	linux-mediatek, linux-arm-msm, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, soc

On Sat, 23 Aug 2025 at 18:43, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On 22/08/2025 15:09, Brian Masney wrote:
> > On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
> >> On 22/08/2025 13:32, Brian Masney wrote:
> >>> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> >>> several paths forward to merging this. It's ultimately up to Stephen how
> >>> he wants to proceed.
> >>>
> >>> - I send Stephen a PULL request with all of these patches with the minor
> >>>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
> >>>   the other work first, and I deal with cleaning up the merge conflicts.
> >>>   Or he can if he prefers to instead.
> >>>
> >>> - Stephen applies everyone else's work first to his tree, and then the
> >>>   good 107 patches in this series. He skips anything that doesn't apply
> >>>   due to other people's work and I follow up with a smaller series.
> >>
> >> Both cause cross tree merge conflicts. Anyway, please document clearly
> >> the dependencies between patches.
> >
> > This series only touches drivers/clk, so it shouldn't cause any issues
> > with other subsystems, unless there's a topic branch somewhere, or I'm
> > missing something?
>
> Individual maintainers handle subdirectories.

FWI(still)W, I have taken the Renesas SoC-specific patches through
the renesas-clk tree...

> > There are some drivers under drivers/clk/ where there is an entry in the
> > MAINTAINERS file that's not Stephen, although it wasn't clear to me if
> > all of those people will send PULL requests to Stephen. I described on
> > the cover how how the series was broken up.
> >
> >   - Patches 4-70 are for drivers where there is no clk submaintainer
> >   - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
> >     (for drivers/clk)
>
> It's hidden between multiple other descriptions of patches, so I really
> would not think that this means that it is okay by individual maintainer
> to take the patch.
>
> This really should be the one most important part of the cover letter
> for something like this.
> ..

It was indeed rather implicit:

   "Once all of my conversion patches across the various trees in the kernel
    have been merged, I will post a small series that removes the
    round_rate() op from the clk core and the documentation. Here's the
    other patch series that are currently in flight that need to be merged
    before we can remove round_rate() from the core. [...]"

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 022/114] clk: ingenic: cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 022/114] clk: ingenic: cgu: " Brian Masney via B4 Relay
@ 2025-09-03 19:18   ` Paul Cercueil
  0 siblings, 0 replies; 172+ messages in thread
From: Paul Cercueil @ 2025-09-03 19:18 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd, Sudeep Holla,
	Cristian Marussi, Chen Wang, Inochi Amaoto, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Keguang Zhang, Taichi Sugaya,
	Takao Orito, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Jacky Huang, Shan-Chun Hung, Vladimir Zapolskiy,
	Piotr Wojtaszczyk, Paul Walmsley, Samuel Holland, Yixun Lan,
	Steen Hegelund, Daniel Machon, UNGLinuxDriver, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Maxime Coquelin, Alexandre Torgue,
	Michal Simek, Maxime Ripard, Andreas Färber,
	Manivannan Sadhasivam, Sven Peter, Janne Grunau,
	Alyssa Rosenzweig, Neal Gompa, Eugeniy Paltsev, Ray Jui,
	Scott Branden, Broadcom internal kernel review list, Max Filippov,
	Matthias Brugger, AngeloGioacchino Del Regno, Daniel Palmer,
	Romain Perier, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Bjorn Andersson, Geert Uytterhoeven,
	Heiko Stuebner, Andrea della Porta, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Qin Jian,
	Viresh Kumar, Ulf Hansson, Luca Ceresoli, Alex Helms,
	Linus Walleij, Liviu Dudau, Lorenzo Pieralisi, Nobuhiro Iwamatsu
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Hi Brian,

Le lundi 11 août 2025 à 11:18 -0400, Brian Masney via B4 Relay a
écrit :
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/clk/ingenic/cgu.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c
> index
> 0c9c8344ad1103b13337a26e14b0d5d5c340d705..91e7ac0cc3342e3552acb9d2ec0
> 0865a5234ad4f 100644
> --- a/drivers/clk/ingenic/cgu.c
> +++ b/drivers/clk/ingenic/cgu.c
> @@ -174,14 +174,16 @@ ingenic_pll_calc(const struct
> ingenic_cgu_clk_info *clk_info,
>  		n * od);
>  }
>  
> -static long
> -ingenic_pll_round_rate(struct clk_hw *hw, unsigned long req_rate,
> -		       unsigned long *prate)
> +static int ingenic_pll_determine_rate(struct clk_hw *hw,
> +				      struct clk_rate_request *req)
>  {
>  	struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
>  	const struct ingenic_cgu_clk_info *clk_info =
> to_clk_info(ingenic_clk);
>  
> -	return ingenic_pll_calc(clk_info, req_rate, *prate, NULL,
> NULL, NULL);
> +	req->rate = ingenic_pll_calc(clk_info, req->rate, req-
> >best_parent_rate,
> +				     NULL, NULL, NULL);
> +
> +	return 0;
>  }
>  
>  static inline int ingenic_pll_check_stable(struct ingenic_cgu *cgu,
> @@ -317,7 +319,7 @@ static int ingenic_pll_is_enabled(struct clk_hw
> *hw)
>  
>  static const struct clk_ops ingenic_pll_ops = {
>  	.recalc_rate = ingenic_pll_recalc_rate,
> -	.round_rate = ingenic_pll_round_rate,
> +	.determine_rate = ingenic_pll_determine_rate,
>  	.set_rate = ingenic_pll_set_rate,
>  
>  	.enable = ingenic_pll_enable,

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH 024/114] clk: ingenic: x1000-cgu: convert from round_rate() to determine_rate()
  2025-08-11 15:18 ` [PATCH 024/114] clk: ingenic: x1000-cgu: " Brian Masney via B4 Relay
@ 2025-09-03 19:20   ` Paul Cercueil
  0 siblings, 0 replies; 172+ messages in thread
From: Paul Cercueil @ 2025-09-03 19:20 UTC (permalink / raw)
  To: bmasney, Michael Turquette, Stephen Boyd
  Cc: linux-clk, linux-kernel, arm-scmi, linux-arm-kernel, sophgo,
	linux-mips, imx, linux-riscv, spacemit, linux-stm32, patches,
	linux-actions, asahi, linux-mediatek, linux-arm-msm,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc, soc

Le lundi 11 août 2025 à 11:18 -0400, Brian Masney via B4 Relay a
écrit :
> From: Brian Masney <bmasney@redhat.com>
> 
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>

Reviewed-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/clk/ingenic/x1000-cgu.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/clk/ingenic/x1000-cgu.c
> b/drivers/clk/ingenic/x1000-cgu.c
> index
> feb03eed4fe8c8f617ef98254a522d72d452ac17..d80886caf393309a0c908c06fb5
> aa8b59aced127 100644
> --- a/drivers/clk/ingenic/x1000-cgu.c
> +++ b/drivers/clk/ingenic/x1000-cgu.c
> @@ -84,16 +84,17 @@ static unsigned long
> x1000_otg_phy_recalc_rate(struct clk_hw *hw,
>  	return parent_rate;
>  }
>  
> -static long x1000_otg_phy_round_rate(struct clk_hw *hw, unsigned
> long req_rate,
> -				      unsigned long *parent_rate)
> +static int x1000_otg_phy_determine_rate(struct clk_hw *hw,
> +					struct clk_rate_request
> *req)
>  {
> -	if (req_rate < 18000000)
> -		return 12000000;
> -
> -	if (req_rate < 36000000)
> -		return 24000000;
> +	if (req->rate < 18000000)
> +		req->rate = 12000000;
> +	else if (req->rate < 36000000)
> +		req->rate = 24000000;
> +	else
> +		req->rate = 48000000;
>  
> -	return 48000000;
> +	return 0;
>  }
>  
>  static int x1000_otg_phy_set_rate(struct clk_hw *hw, unsigned long
> req_rate,
> @@ -161,7 +162,7 @@ static int x1000_usb_phy_is_enabled(struct clk_hw
> *hw)
>  
>  static const struct clk_ops x1000_otg_phy_ops = {
>  	.recalc_rate = x1000_otg_phy_recalc_rate,
> -	.round_rate = x1000_otg_phy_round_rate,
> +	.determine_rate = x1000_otg_phy_determine_rate,
>  	.set_rate = x1000_otg_phy_set_rate,
>  
>  	.enable		= x1000_usb_phy_enable,

^ permalink raw reply	[flat|nested] 172+ messages in thread

end of thread, other threads:[~2025-09-03 19:20 UTC | newest]

Thread overview: 172+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 15:17 [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney via B4 Relay
2025-08-11 15:17 ` [PATCH 001/114] clk: at91: peripheral: fix return value Brian Masney via B4 Relay
2025-08-11 15:59   ` Alexander Sverdlin
2025-08-11 15:17 ` [PATCH 002/114] clk: at91: peripheral: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
2025-08-11 16:00   ` Alexander Sverdlin
2025-08-11 15:17 ` [PATCH 003/114] clk: fixed-factor: add determine_rate() ops Brian Masney via B4 Relay
2025-08-11 15:17 ` [PATCH 004/114] clk: at91: audio-pll: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
2025-08-11 15:17 ` [PATCH 005/114] clk: at91: h32mx: " Brian Masney via B4 Relay
2025-08-11 15:17 ` [PATCH 006/114] clk: at91: pll: " Brian Masney via B4 Relay
2025-08-11 15:17 ` [PATCH 007/114] clk: at91: plldiv: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 008/114] clk: at91: sam9x60-pll: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 009/114] clk: at91: usb: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 010/114] clk: baikal-t1: ccu-div: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 011/114] clk: baikal-t1: ccu-pll: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 012/114] clk: cdce925: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 013/114] clk: cs2000-cp: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 014/114] clk: ep93xx: " Brian Masney via B4 Relay
2025-08-11 15:50   ` Alexander Sverdlin
2025-08-11 15:18 ` [PATCH 015/114] clk: fractional-divider: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 016/114] clk: gemini: " Brian Masney via B4 Relay
2025-08-19  9:46   ` Linus Walleij
2025-08-11 15:18 ` [PATCH 017/114] clk: highbank: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 018/114] clk: hisilicon: clkdivider-hi6220: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 019/114] clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB() Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 020/114] clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 021/114] clk: hisilicon: hi6220-stub: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 022/114] clk: ingenic: cgu: " Brian Masney via B4 Relay
2025-09-03 19:18   ` Paul Cercueil
2025-08-11 15:18 ` [PATCH 023/114] clk: ingenic: jz4780-cgu: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 024/114] clk: ingenic: x1000-cgu: " Brian Masney via B4 Relay
2025-09-03 19:20   ` Paul Cercueil
2025-08-11 15:18 ` [PATCH 025/114] clk: lmk04832: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 026/114] clk: loongson1: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 027/114] clk: max9485: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 028/114] clk: milbeaut: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 029/114] clk: mmp: audio: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 030/114] clk: mmp: frac: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 031/114] clk: multiplier: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 032/114] clk: mxs: div: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 033/114] clk: mxs: frac: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 034/114] clk: mxs: ref: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 035/114] clk: nuvoton: ma35d1-divider: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 036/114] clk: nuvoton: ma35d1-pll: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 037/114] clk: nxp: lpc18xx-cgu: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 038/114] clk: nxp: lpc32xx: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 039/114] clk: pistachio: pll: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 040/114] clk: scpi: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 041/114] clk: si514: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 042/114] clk: si521xx: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 043/114] clk: si5341: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 044/114] clk: si544: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 045/114] clk: si570: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 046/114] clk: sifive: sifive-prci: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 047/114] clk: sophgo: cv18xx-ip: " Brian Masney via B4 Relay
2025-08-11 15:47   ` Alexander Sverdlin
2025-08-11 15:18 ` [PATCH 048/114] clk: sophgo: sg2042-clkgen: " Brian Masney via B4 Relay
2025-08-11 15:45   ` Alexander Sverdlin
2025-08-11 15:57     ` Brian Masney
2025-08-14  8:47   ` Chen Wang
2025-08-11 15:18 ` [PATCH 049/114] clk: spacemit: ccu_ddn: " Brian Masney via B4 Relay
2025-08-25  8:40   ` Yixun Lan
2025-08-25 15:17   ` Haylen Chu
2025-08-11 15:18 ` [PATCH 050/114] clk: spacemit: ccu_mix: " Brian Masney via B4 Relay
2025-08-25  8:41   ` Yixun Lan
2025-08-25 15:18   ` Haylen Chu
2025-08-11 15:18 ` [PATCH 051/114] clk: spacemit: ccu_pll: " Brian Masney via B4 Relay
2025-08-25  8:41   ` Yixun Lan
2025-08-25 15:18   ` Haylen Chu
2025-08-11 15:18 ` [PATCH 052/114] clk: sparx5: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 053/114] clk: sprd: div: " Brian Masney via B4 Relay
2025-08-12  9:17   ` Chunyan Zhang
2025-08-11 15:18 ` [PATCH 054/114] clk: sprd: pll: " Brian Masney via B4 Relay
2025-08-12  9:16   ` Chunyan Zhang
2025-08-11 15:18 ` [PATCH 055/114] clk: st: clkgen-fsyn: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 056/114] clk: st: clkgen-pll: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 057/114] clk: stm32f4: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 058/114] clk: stm32: stm32-core: " Brian Masney via B4 Relay
2025-08-18 12:08   ` Gabriel FERNANDEZ
2025-08-11 15:18 ` [PATCH 059/114] clk: stm32: stm32mp1: " Brian Masney via B4 Relay
2025-08-18 12:09   ` Gabriel FERNANDEZ
2025-08-11 15:18 ` [PATCH 060/114] clk: tps68470: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 061/114] clk: versaclock3: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 062/114] clk: vt8500: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 063/114] clk: wm831x: " Brian Masney via B4 Relay
2025-08-12  8:04   ` Richard Fitzgerald
2025-08-11 15:18 ` [PATCH 064/114] clk: x86: cgu: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 065/114] clk: xgene: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 066/114] clk: xilinx: xlnx-clock-wizard: " Brian Masney via B4 Relay
2025-08-11 15:18 ` [PATCH 067/114] clk: xilinx: xlnx_vcu: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 068/114] clk: zynqmp: divider: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 069/114] clk: zynqmp: pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 070/114] clk: zynq: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 071/114] clk: actions: owl-composite: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 072/114] clk: actions: owl-divider: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 073/114] clk: actions: owl-factor: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 074/114] clk: actions: owl-pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 075/114] clk: apple-nco: " Brian Masney via B4 Relay
2025-08-14 15:29   ` Janne Grunau
2025-08-11 15:19 ` [PATCH 076/114] clk: axs10x: i2s_pll_clock: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 077/114] clk: axs10x: pll_clock: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 078/114] clk: bcm: iproc-asiu: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 079/114] clk: bm1880: " Brian Masney via B4 Relay
2025-08-12 15:38   ` Manivannan Sadhasivam
2025-08-11 15:19 ` [PATCH 080/114] clk: cdce706: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 081/114] clk: hsdk-pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 082/114] clk: mediatek: pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 083/114] clk: microchip: core: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 084/114] clk: mstar: msc313-cpupll: " Brian Masney via B4 Relay
2025-08-14  4:35   ` Daniel Palmer
2025-08-11 15:19 ` [PATCH 085/114] clk: mvebu: ap-cpu-clk: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 086/114] clk: mvebu: armada-37xx-periph: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 087/114] clk: mvebu: corediv: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 088/114] clk: mvebu: cpu: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 089/114] clk: mvebu: dove-divider: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 090/114] clk: qcom: alpha-pll: " Brian Masney via B4 Relay
2025-08-12  9:13   ` Konrad Dybcio
2025-08-11 15:19 ` [PATCH 091/114] clk: qcom: regmap-divider: " Brian Masney via B4 Relay
2025-08-12  9:14   ` Konrad Dybcio
2025-08-11 15:19 ` [PATCH 092/114] clk: renesas: rzg2l-cpg: " Brian Masney via B4 Relay
2025-08-14 15:06   ` Geert Uytterhoeven
2025-08-11 15:19 ` [PATCH 093/114] clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
2025-08-14 15:11   ` Geert Uytterhoeven
2025-08-11 15:19 ` [PATCH 094/114] clk: rockchip: ddr: convert from round_rate() to determine_rate() Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 095/114] clk: rockchip: half-divider: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 096/114] clk: rockchip: pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 097/114] clk: rp1: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 098/114] clk: samsung: cpu: " Brian Masney via B4 Relay
2025-08-23 16:50   ` (subset) " Krzysztof Kozlowski
2025-08-11 15:19 ` [PATCH 099/114] clk: samsung: pll: " Brian Masney via B4 Relay
2025-08-23 16:50   ` (subset) " Krzysztof Kozlowski
2025-08-11 15:19 ` [PATCH 100/114] clk: sp7021: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 101/114] clk: spear: aux-synth: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 102/114] clk: spear: frac-synth: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 103/114] clk: spear: gpt-synth: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 104/114] clk: spear: vco-pll: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 105/114] clk: ux500: prcmu: " Brian Masney via B4 Relay
2025-08-19  9:47   ` Linus Walleij
2025-08-11 15:19 ` [PATCH 106/114] clk: versaclock5: " Brian Masney via B4 Relay
2025-08-13  9:07   ` Luca Ceresoli
2025-08-11 15:19 ` [PATCH 107/114] clk: versaclock7: " Brian Masney via B4 Relay
2025-08-11 15:19 ` [PATCH 108/114] clk: versatile: icst: " Brian Masney via B4 Relay
2025-08-19  9:47   ` Linus Walleij
2025-08-11 15:19 ` [PATCH 109/114] clk: versatile: vexpress-osc: " Brian Masney via B4 Relay
2025-08-19  9:49   ` Linus Walleij
2025-08-11 15:19 ` [PATCH 110/114] clk: visconti: pll: " Brian Masney via B4 Relay
2025-08-18  0:48   ` nobuhiro1.iwamatsu
2025-08-11 15:19 ` [PATCH 111/114] clk: divider: remove round_rate() in favor of determine_rate() Brian Masney via B4 Relay
2025-08-11 16:02   ` Alexander Sverdlin
2025-08-14 15:10   ` Geert Uytterhoeven
2025-08-11 15:19 ` [PATCH 112/114] clk: scmi: " Brian Masney via B4 Relay
2025-08-11 15:38   ` Alexander Sverdlin
2025-08-27  7:09   ` Peng Fan
2025-08-27 13:13     ` Brian Masney
2025-08-27 13:49       ` Sudeep Holla
2025-08-11 15:19 ` [PATCH 113/114] clk: sophgo: sg2042-pll: " Brian Masney via B4 Relay
2025-08-11 15:36   ` Alexander Sverdlin
2025-08-14  8:46   ` Chen Wang
2025-08-11 15:19 ` [PATCH 114/114] clk: fixed-factor: drop round_rate() clk ops Brian Masney via B4 Relay
2025-08-11 15:37   ` Alexander Sverdlin
2025-08-11 16:00 ` [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate() Manivannan Sadhasivam
2025-08-12 10:39 ` Brian Masney
2025-08-12 13:39 ` Icenowy Zheng
2025-08-12 13:53   ` Brian Masney
2025-08-22  6:31 ` Krzysztof Kozlowski
2025-08-22 11:32   ` Brian Masney
2025-08-22 12:23     ` Krzysztof Kozlowski
2025-08-22 13:09       ` Brian Masney
2025-08-23 16:43         ` Krzysztof Kozlowski
2025-09-01  9:49           ` Geert Uytterhoeven
2025-08-23 16:48 ` Krzysztof Kozlowski
2025-08-25 22:23 ` (subset) " Yixun Lan
2025-08-29  0:47 ` Brian Masney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).