Loading drivers/clk/qcom/clock-generic.c +16 −1 Original line number Diff line number Diff line Loading @@ -98,12 +98,27 @@ static int mux_set_rate(struct clk *c, unsigned long rate) unsigned long new_par_curr_rate; unsigned long flags; for (i = 0; i < mux->num_parents; i++) { /* * Check if one of the possible parents is already at the requested * rate. */ for (i = 0; i < mux->num_parents && mux->try_get_rate; i++) { if (mux->parents[i].src->rate == rate) { new_parent = mux->parents[i].src; break; } } if (new_parent == c->parent && rate == c->rate) return 0; for (i = 0; i < mux->num_parents && !new_parent; i++) { if (clk_round_rate(mux->parents[i].src, rate) == rate) { new_parent = mux->parents[i].src; break; } } if (new_parent == NULL) return -EINVAL; Loading include/linux/clk/msm-clock-generic.h +6 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,12 @@ struct mux_clk { struct clk *safe_parent; int safe_sel; unsigned long safe_freq; /* * Before attempting a clk_round_rate on available sources, attempt a * clk_get_rate on all those sources. If one of them is already at the * necessary rate, that source will be used. */ bool try_get_rate; struct clk_mux_ops *ops; /* Fields not used by helper function. */ Loading Loading
drivers/clk/qcom/clock-generic.c +16 −1 Original line number Diff line number Diff line Loading @@ -98,12 +98,27 @@ static int mux_set_rate(struct clk *c, unsigned long rate) unsigned long new_par_curr_rate; unsigned long flags; for (i = 0; i < mux->num_parents; i++) { /* * Check if one of the possible parents is already at the requested * rate. */ for (i = 0; i < mux->num_parents && mux->try_get_rate; i++) { if (mux->parents[i].src->rate == rate) { new_parent = mux->parents[i].src; break; } } if (new_parent == c->parent && rate == c->rate) return 0; for (i = 0; i < mux->num_parents && !new_parent; i++) { if (clk_round_rate(mux->parents[i].src, rate) == rate) { new_parent = mux->parents[i].src; break; } } if (new_parent == NULL) return -EINVAL; Loading
include/linux/clk/msm-clock-generic.h +6 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,12 @@ struct mux_clk { struct clk *safe_parent; int safe_sel; unsigned long safe_freq; /* * Before attempting a clk_round_rate on available sources, attempt a * clk_get_rate on all those sources. If one of them is already at the * necessary rate, that source will be used. */ bool try_get_rate; struct clk_mux_ops *ops; /* Fields not used by helper function. */ Loading