Commit 78b348f3 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: introduce ipa_clock_rate()

Create a new function that returns the current rate of the IPA core
clock.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cd8700e4
......@@ -256,6 +256,12 @@ void ipa_clock_put(struct ipa *ipa)
mutex_unlock(&clock->mutex);
}
/* Return the current IPA core clock rate */
u32 ipa_clock_rate(struct ipa *ipa)
{
return ipa->clock ? (u32)clk_get_rate(ipa->clock->core) : 0;
}
/* Initialize IPA clocking */
struct ipa_clock *ipa_clock_init(struct device *dev)
{
......
......@@ -10,6 +10,14 @@ struct device;
struct ipa;
/**
* ipa_clock_rate() - Return the current IPA core clock rate
* @ipa: IPA structure
*
* Return: The current clock rate (in Hz), or 0.
*/
u32 ipa_clock_rate(struct ipa *ipa);
/**
* ipa_clock_init() - Initialize IPA clocking
* @dev: IPA device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment