Unverified Commit 9160ca46 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge tag 'clk-divider-round-rate-v6.20-v2' of https://github.com/masneyb/linux into clk-divider

Pull divider_round_rate() and friends removal series from Brian Masney:

Here's a series that lays the groundwork to rid of the deprecated APIs
divider_round_rate(), divider_round_rate_parent(), and
divider_ro_round_rate_parent() since these functions are just wrappers
for the determine_rate variant.

We need to wait for some other changes to land in Linus's tree via the
phy tree before we can actually remove these functions. We should be
able to do that during the next development cycle.

Note that when I converted some of these drivers from round_rate to
determine_rate, this was mistakenly converted to the following in some
cases:

    req->rate = divider_round_rate(...)

This is invalid in the case when an error occurs since it can set the
rate to a negative value. So this series fixes those bugs and removes
the deprecated APIs all in one go.

Note that this also contains a clk-specific change to
drivers/rtc/rtc-ac100.c, and that patch carrys an Acked-by from
Alexandre.

* tag 'clk-divider-round-rate-v6.20-v2' of https://github.com/masneyb/linux:
  rtc: ac100: convert from divider_round_rate() to divider_determine_rate()
  clk: zynqmp: divider: convert from divider_round_rate() to divider_determine_rate()
  clk: x86: cgu: convert from divider_round_rate() to divider_determine_rate()
  clk: versaclock3: convert from divider_round_rate() to divider_determine_rate()
  clk: stm32: stm32-core: convert from divider_round_rate_parent() to divider_determine_rate()
  clk: stm32: stm32-core: convert from divider_ro_round_rate() to divider_ro_determine_rate()
  clk: sprd: div: convert from divider_round_rate() to divider_determine_rate()
  clk: sophgo: sg2042-clkgen: convert from divider_round_rate() to divider_determine_rate()
  clk: nxp: lpc32xx: convert from divider_round_rate() to divider_determine_rate()
  clk: nuvoton: ma35d1-divider: convert from divider_round_rate() to divider_determine_rate()
  clk: milbeaut: convert from divider_round_rate() to divider_determine_rate()
  clk: milbeaut: convert from divider_ro_round_rate() to divider_ro_determine_rate()
  clk: loongson1: convert from divider_round_rate() to divider_determine_rate()
  clk: hisilicon: clkdivider-hi6220: convert from divider_round_rate() to divider_determine_rate()
  clk: bm1880: convert from divider_round_rate() to divider_determine_rate()
  clk: bm1880: convert from divider_ro_round_rate() to divider_ro_determine_rate()
  clk: actions: owl-divider: convert from divider_round_rate() to divider_determine_rate()
  clk: actions: owl-composite: convert from owl_divider_helper_round_rate() to divider_determine_rate()
  clk: sunxi-ng: convert from divider_round_rate_parent() to divider_determine_rate()
  clk: sophgo: cv18xx-ip: convert from divider_round_rate() to divider_determine_rate()
parents 8f0b4cce ed806240
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -57,15 +57,10 @@ static int owl_comp_div_determine_rate(struct clk_hw *hw,
				       struct clk_rate_request *req)
{
	struct owl_composite *comp = hw_to_owl_comp(hw);
	long rate;
	struct owl_divider_hw *div = &comp->rate.div_hw;

	rate = owl_divider_helper_round_rate(&comp->common, &comp->rate.div_hw,
					     req->rate, &req->best_parent_rate);
	if (rate < 0)
		return rate;

	req->rate = rate;
	return 0;
	return divider_determine_rate(&comp->common.hw, req, div->table,
				      div->width, div->div_flags);
}

static unsigned long owl_comp_div_recalc_rate(struct clk_hw *hw,
+2 −15
Original line number Diff line number Diff line
@@ -13,26 +13,13 @@

#include "owl-divider.h"

long owl_divider_helper_round_rate(struct owl_clk_common *common,
				const struct owl_divider_hw *div_hw,
				unsigned long rate,
				unsigned long *parent_rate)
{
	return divider_round_rate(&common->hw, rate, parent_rate,
				  div_hw->table, div_hw->width,
				  div_hw->div_flags);
}

static int owl_divider_determine_rate(struct clk_hw *hw,
				      struct clk_rate_request *req)
{
	struct owl_divider *div = hw_to_owl_divider(hw);

	req->rate = owl_divider_helper_round_rate(&div->common, &div->div_hw,
						  req->rate,
						  &req->best_parent_rate);

	return 0;
	return divider_determine_rate(hw, req, div->div_hw.table,
				      div->div_hw.width, div->div_hw.div_flags);
}

unsigned long owl_divider_helper_recalc_rate(struct owl_clk_common *common,
+0 −5
Original line number Diff line number Diff line
@@ -56,11 +56,6 @@ static inline struct owl_divider *hw_to_owl_divider(struct clk_hw *hw)
	return container_of(common, struct owl_divider, common);
}

long owl_divider_helper_round_rate(struct owl_clk_common *common,
				const struct owl_divider_hw *div_hw,
				unsigned long rate,
				unsigned long *parent_rate);

unsigned long owl_divider_helper_recalc_rate(struct owl_clk_common *common,
					 const struct owl_divider_hw *div_hw,
					 unsigned long parent_rate);
+3 −10
Original line number Diff line number Diff line
@@ -621,18 +621,11 @@ static int bm1880_clk_div_determine_rate(struct clk_hw *hw,
		val = readl(reg_addr) >> div->shift;
		val &= clk_div_mask(div->width);

		req->rate = divider_ro_round_rate(hw, req->rate,
						  &req->best_parent_rate,
						  div->table,
		return divider_ro_determine_rate(hw, req, div->table,
						 div->width, div->flags, val);

		return 0;
	}

	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
				       div->table, div->width, div->flags);

	return 0;
	return divider_determine_rate(hw, req, div->table, div->width, div->flags);
}

static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
+1 −4
Original line number Diff line number Diff line
@@ -99,10 +99,7 @@ static int ls1x_divider_determine_rate(struct clk_hw *hw,
	struct ls1x_clk *ls1x_clk = to_ls1x_clk(hw);
	const struct ls1x_clk_div_data *d = ls1x_clk->data;

	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
				       d->table, d->width, d->flags);

	return 0;
	return divider_determine_rate(hw, req, d->table, d->width, d->flags);
}

static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate,
Loading