Skip to content

Commit f2a7328

Browse files
Elaine Zhangrkhuangtao
authored andcommitted
Revert "clk: rockchip: fix up the freq overshoot"
This reverts commit c64eb75. This commit make i2s clk setting error when integer divider switching integer divider. Change-Id: I927d6995d7b215fd412e147dff6a64c8fc4e2211 Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
1 parent ca74123 commit f2a7328

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • drivers/clk/rockchip

drivers/clk/rockchip/clk.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct rockchip_clk_frac {
122122
const struct clk_ops *mux_ops;
123123
int mux_frac_idx;
124124

125+
bool rate_change_remuxed;
125126
int rate_change_idx;
126127
};
127128

@@ -142,6 +143,18 @@ static int rockchip_clk_frac_notifier_cb(struct notifier_block *nb,
142143
frac->rate_change_idx = frac->mux_ops->get_parent(&frac_mux->hw);
143144
if (frac->rate_change_idx != frac->mux_frac_idx) {
144145
frac->mux_ops->set_parent(&frac_mux->hw, frac->mux_frac_idx);
146+
frac->rate_change_remuxed = 1;
147+
}
148+
} else if (event == POST_RATE_CHANGE) {
149+
/*
150+
* The POST_RATE_CHANGE notifier runs directly after the
151+
* divider clock is set in clk_change_rate, so we'll have
152+
* remuxed back to the original parent before clk_change_rate
153+
* reaches the mux itself.
154+
*/
155+
if (frac->rate_change_remuxed) {
156+
frac->mux_ops->set_parent(&frac_mux->hw, frac->rate_change_idx);
157+
frac->rate_change_remuxed = 0;
145158
}
146159
}
147160

0 commit comments

Comments
 (0)