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

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

Merge "clk: qcom: Add parent list to clock structure"

parents 00638d38 3de56173
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -21,18 +21,6 @@

/* ==================== Mux clock ==================== */

int parent_to_src_sel(struct clk_src *parents, int num_parents, struct clk *p)
{
	int i;

	for (i = 0; i < num_parents; i++) {
		if (parents[i].src == p)
			return parents[i].sel;
	}

	return -EINVAL;
}

static int mux_parent_to_src_sel(struct mux_clk *mux, struct clk *p)
{
	return parent_to_src_sel(mux->parents, mux->num_parents, p);
+26 −1
Original line number Diff line number Diff line
@@ -586,6 +586,25 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate)
}
EXPORT_SYMBOL(clk_set_max_rate);

int parent_to_src_sel(struct clk_src *parents, int num_parents, struct clk *p)
{
	int i;

	for (i = 0; i < num_parents; i++) {
		if (parents[i].src == p)
			return parents[i].sel;
	}

	return -EINVAL;
}
EXPORT_SYMBOL(parent_to_src_sel);

int clk_get_parent_sel(struct clk *c, struct clk *parent)
{
	return parent_to_src_sel(c->parents, c->num_parents, parent);
}
EXPORT_SYMBOL(clk_get_parent_sel);

int clk_set_parent(struct clk *clk, struct clk *parent)
{
	int rc = 0;
@@ -673,7 +692,7 @@ static int __handoff_clk(struct clk *clk)
{
	enum handoff state = HANDOFF_DISABLED_CLK;
	struct handoff_clk *h = NULL;
	int rc;
	int rc, i;

	if (clk == NULL || clk->flags & CLKFLAG_INIT_DONE ||
	    clk->flags & CLKFLAG_SKIP_HANDOFF)
@@ -705,6 +724,12 @@ static int __handoff_clk(struct clk *clk)
	if (rc)
		goto err;

	for (i = 0; i < clk->num_parents; i++) {
		rc = __handoff_clk(clk->parents[i].src);
		if (rc)
			goto err;
	}

	if (clk->ops->handoff)
		state = clk->ops->handoff(clk);

+2 −0
Original line number Diff line number Diff line
@@ -172,6 +172,8 @@ struct clk {
	int num_fmax;
	unsigned long rate;
	struct clk *parent;
	struct clk_src *parents;
	unsigned int num_parents;

	struct list_head children;
	struct list_head siblings;
+11 −0
Original line number Diff line number Diff line
@@ -36,6 +36,11 @@ enum clk_reset_action {
	CLK_RESET_ASSERT	= 1
};

struct clk_src {
	struct clk *src;
	int sel;
};

/* Rate is maximum clock rate in Hz */
int clk_set_max_rate(struct clk *clk, unsigned long rate);

@@ -45,4 +50,10 @@ int clk_reset(struct clk *clk, enum clk_reset_action action);
/* Set clock-specific configuration parameters */
int clk_set_flags(struct clk *clk, unsigned long flags);

/* returns the mux selection index associated with a particular parent */
int parent_to_src_sel(struct clk_src *parents, int num_parents, struct clk *p);

/* returns the mux selection index associated with a particular parent */
int clk_get_parent_sel(struct clk *c, struct clk *parent);

#endif
+0 −7
Original line number Diff line number Diff line
@@ -27,11 +27,6 @@ struct fixed_clk {

/* ==================== Mux clock ==================== */

struct clk_src {
	struct clk *src;
	int sel;
};

struct mux_clk;

struct clk_mux_ops {
@@ -82,8 +77,6 @@ static inline struct mux_clk *to_mux_clk(struct clk *c)
	return container_of(c, struct mux_clk, c);
}

int parent_to_src_sel(struct clk_src *parents, int num_parents, struct clk *p);

extern struct clk_ops clk_ops_gen_mux;

/* ==================== Divider clock ==================== */