return -EAGAIN;
}
-/* Get an IPA clock reference. If the reference count is non-zero, it is
- * incremented and return is immediate. Otherwise the IPA clock is
- * enabled.
- */
-int ipa_clock_get(struct ipa *ipa)
-{
- return pm_runtime_get_sync(&ipa->pdev->dev);
-}
-
-/* Attempt to remove an IPA clock reference. If this represents the
- * last reference, disable the IPA clock.
- */
-int ipa_clock_put(struct ipa *ipa)
-{
- return pm_runtime_put(&ipa->pdev->dev);
-}
-
static int ipa_suspend(struct device *dev)
{
struct ipa *ipa = dev_get_drvdata(dev);
*/
void ipa_clock_exit(struct ipa_clock *clock);
-/**
- * ipa_clock_get() - Get an IPA clock reference
- * @ipa: IPA pointer
- *
- * Return: 0 if clock started, 1 if clock already running, or a negative
- * error code
- *
- * This call blocks if this is the first reference. A reference is
- * taken even if an error occurs starting the IPA clock.
- */
-int ipa_clock_get(struct ipa *ipa);
-
-/**
- * ipa_clock_put() - Drop an IPA clock reference
- * @ipa: IPA pointer
- *
- * Return: 0 if successful, or a negative error code
- *
- * This drops a clock reference. If the last reference is being dropped,
- * the clock is stopped and RX endpoints are suspended. This call will
- * not block unless the last reference is dropped.
- */
-int ipa_clock_put(struct ipa *ipa);
-
#endif /* _IPA_CLOCK_H_ */
#include <linux/types.h>
#include <linux/interrupt.h>
+#include <linux/pm_runtime.h>
#include "ipa.h"
-#include "ipa_clock.h"
#include "ipa_reg.h"
#include "ipa_endpoint.h"
#include "ipa_interrupt.h"
struct ipa_interrupt *interrupt = dev_id;
struct ipa *ipa = interrupt->ipa;
u32 enabled = interrupt->enabled;
+ struct device *dev;
u32 pending;
u32 offset;
u32 mask;
int ret;
- ret = ipa_clock_get(ipa);
+ dev = &ipa->pdev->dev;
+ ret = pm_runtime_get_sync(dev);
if (WARN_ON(ret < 0))
- goto out_clock_put;
+ goto out_power_put;
/* The status register indicates which conditions are present,
* including conditions whose interrupt is not enabled. Handle
/* If any disabled interrupts are pending, clear them */
if (pending) {
- struct device *dev = &ipa->pdev->dev;
-
dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n",
pending);
offset = ipa_reg_irq_clr_offset(ipa->version);
iowrite32(pending, ipa->reg_virt + offset);
}
-out_clock_put:
- (void)ipa_clock_put(ipa);
+out_power_put:
+ (void)pm_runtime_put(dev);
return IRQ_HANDLED;
}