diff options
| author | Christian Marangi <[email protected]> | 2024-06-28 19:40:47 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-08-01 15:32:18 -0600 |
| commit | bf6ba78143e988178848e13a2c0b0c7db41c9bb7 (patch) | |
| tree | d65278969d13115da97b96cdbf5dbc036d1a0ad8 | |
| parent | ed908c486827536a36aa236bb622a90408603e57 (diff) | |
clk: mediatek: return XTAL rate for infrasys get_mux_rate
We currently return 0 if XTAL rate is requested in get_mux_rate. This
deviates from what is done in get_factor_rate and is totally wrong as it
can cause unwanted results (division by 0 crash)
For infrasys that makes use of CLK_XTAL, assume xtal_rate to be defined
in clk_tree and return the rate when BYPASS_XTAL is not enabled with
clk ID 0 index parents.
Signed-off-by: Christian Marangi <[email protected]>
| -rw-r--r-- | drivers/clk/mediatek/clk-mtk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 3977f38bf51..6d4506ddc4a 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -377,7 +377,7 @@ static ulong mtk_infrasys_get_mux_rate(struct clk *clk, u32 off) break; } } - return 0; + return priv->tree->xtal_rate; } static ulong mtk_topckgen_get_rate(struct clk *clk) |
