Lines Matching full:ipa

13 #include "ipa.h"
18 * DOC: IPA Clocking
20 * The "IPA Clock" manages both the IPA core clock and the interconnects
21 * (buses) the IPA depends on as a single logical entity. A reference count
26 * all buses at a fixed average and peak bandwidth. As more advanced IPA
29 * An IPA clock reference must be held for any access to IPA hardware.
45 * struct ipa_clock - IPA clocking information
48 * @core: IPA core clock
75 /* Initialize interconnects required for IPA operation */
114 static int ipa_interconnect_enable(struct ipa *ipa) in ipa_interconnect_enable() argument
116 struct ipa_clock *clock = ipa->clock; in ipa_interconnect_enable()
142 static int ipa_interconnect_disable(struct ipa *ipa) in ipa_interconnect_disable() argument
144 struct ipa_clock *clock = ipa->clock; in ipa_interconnect_disable()
169 /* Turn on IPA clocks, including interconnects */
170 static int ipa_clock_enable(struct ipa *ipa) in ipa_clock_enable() argument
174 ret = ipa_interconnect_enable(ipa); in ipa_clock_enable()
178 ret = clk_prepare_enable(ipa->clock->core); in ipa_clock_enable()
180 ipa_interconnect_disable(ipa); in ipa_clock_enable()
186 static void ipa_clock_disable(struct ipa *ipa) in ipa_clock_disable() argument
188 clk_disable_unprepare(ipa->clock->core); in ipa_clock_disable()
189 (void)ipa_interconnect_disable(ipa); in ipa_clock_disable()
192 /* Get an IPA clock reference, but only if the reference count is
196 bool ipa_clock_get_additional(struct ipa *ipa) in ipa_clock_get_additional() argument
198 return refcount_inc_not_zero(&ipa->clock->count); in ipa_clock_get_additional()
201 /* Get an IPA clock reference. If the reference count is non-zero, it is
203 * under protection of the mutex, and if appropriate the IPA clock
209 void ipa_clock_get(struct ipa *ipa) in ipa_clock_get() argument
211 struct ipa_clock *clock = ipa->clock; in ipa_clock_get()
215 if (ipa_clock_get_additional(ipa)) in ipa_clock_get()
222 if (ipa_clock_get_additional(ipa)) in ipa_clock_get()
225 ret = ipa_clock_enable(ipa); in ipa_clock_get()
227 dev_err(&ipa->pdev->dev, "error %d enabling IPA clock\n", ret); in ipa_clock_get()
237 /* Attempt to remove an IPA clock reference. If this represents the
238 * last reference, disable the IPA clock under protection of the mutex.
240 void ipa_clock_put(struct ipa *ipa) in ipa_clock_put() argument
242 struct ipa_clock *clock = ipa->clock; in ipa_clock_put()
248 ipa_clock_disable(ipa); in ipa_clock_put()
253 /* Return the current IPA core clock rate */
254 u32 ipa_clock_rate(struct ipa *ipa) in ipa_clock_rate() argument
256 return ipa->clock ? (u32)clk_get_rate(ipa->clock->core) : 0; in ipa_clock_rate()
259 /* Initialize IPA clocking */