Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98d5b80c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: clock-generic: Add support for recursive set parent to mux_clk"

parents e93ff160 b7a7e662
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -39,9 +39,24 @@ static int mux_set_parent(struct clk *c, struct clk *p)
	struct mux_clk *mux = to_mux_clk(c);
	int sel = parent_to_src_sel(mux, p);
	struct clk *old_parent;
	int rc = 0;
	int rc = 0, i;
	unsigned long flags;

	if (sel < 0 && mux->rec_set_par) {
		for (i = 0; i < mux->num_parents; i++) {
			rc = clk_set_parent(mux->parents[i].src, p);
			if (!rc) {
				sel = mux->parents[i].sel;
				/*
				 * This is necessary to ensure prepare/enable
				 * counts get propagated correctly.
				 */
				p = mux->parents[i].src;
				break;
			}
		}
	}

	if (sel < 0)
		return sel;

+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ struct mux_clk {
	struct clk	*safe_parent;
	int		safe_sel;
	struct clk_mux_ops *ops;
	/* Recursively search for the requested parent. */
	bool		rec_set_par;

	/* Fields not used by helper function. */
	void *const __iomem *base;