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

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

Merge "clk: Add support to enumerate frequencies" into msm-4.9

parents 2c0c2cb9 08d7924e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2329,6 +2329,21 @@ int clk_set_flags(struct clk *clk, unsigned long flags)
}
EXPORT_SYMBOL_GPL(clk_set_flags);

unsigned long clk_list_frequency(struct clk *clk, unsigned int index)
{
	int ret = 0;

	if (!clk || !clk->core->ops->list_rate)
		return -EINVAL;

	clk_prepare_lock();
	ret = clk->core->ops->list_rate(clk->core->hw, index, ULONG_MAX);
	clk_prepare_unlock();

	return ret;
}
EXPORT_SYMBOL_GPL(clk_list_frequency);

/***        debugfs support        ***/

#ifdef CONFIG_DEBUG_FS
+10 −0
Original line number Diff line number Diff line
@@ -430,6 +430,16 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
 */
int clk_set_flags(struct clk *clk, unsigned long flags);

/**
 * clk_list_frequnecy - enumerate supported frequencies
 * @clk: clock source
 * @index: identify frequency to list
 *
 * Returns a non-negative integer frequency for success
 * or negative errno in case of failure.
 */
unsigned long clk_list_frequency(struct clk *clk, unsigned int index);

#else /* !CONFIG_HAVE_CLK */

static inline struct clk *clk_get(struct device *dev, const char *id)