Commit e308a27c authored by Brian Masney's avatar Brian Masney Committed by Andi Shyti
Browse files

i2c: busses: bcm2835: convert from round_rate() to determine_rate()



The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate().

Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251016-i2c-round-rate-resend-v1-1-96dd1d725e8f@redhat.com
parent 4cdcdbe5
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -137,12 +137,14 @@ static int clk_bcm2835_i2c_set_rate(struct clk_hw *hw, unsigned long rate,
	return 0;
}

static long clk_bcm2835_i2c_round_rate(struct clk_hw *hw, unsigned long rate,
				unsigned long *parent_rate)
static int clk_bcm2835_i2c_determine_rate(struct clk_hw *hw,
					  struct clk_rate_request *req)
{
	u32 divider = clk_bcm2835_i2c_calc_divider(rate, *parent_rate);
	u32 divider = clk_bcm2835_i2c_calc_divider(req->rate, req->best_parent_rate);

	return DIV_ROUND_UP(*parent_rate, divider);
	req->rate = DIV_ROUND_UP(req->best_parent_rate, divider);

	return 0;
}

static unsigned long clk_bcm2835_i2c_recalc_rate(struct clk_hw *hw,
@@ -156,7 +158,7 @@ static unsigned long clk_bcm2835_i2c_recalc_rate(struct clk_hw *hw,

static const struct clk_ops clk_bcm2835_i2c_ops = {
	.set_rate = clk_bcm2835_i2c_set_rate,
	.round_rate = clk_bcm2835_i2c_round_rate,
	.determine_rate = clk_bcm2835_i2c_determine_rate,
	.recalc_rate = clk_bcm2835_i2c_recalc_rate,
};