Lines Matching refs:ipa
159 static int ipa_interconnect_enable(struct ipa *ipa) in ipa_interconnect_enable() argument
162 struct ipa_power *power = ipa->power; in ipa_interconnect_enable()
172 dev_err(&ipa->pdev->dev, in ipa_interconnect_enable()
190 static int ipa_interconnect_disable(struct ipa *ipa) in ipa_interconnect_disable() argument
193 struct ipa_power *power = ipa->power; in ipa_interconnect_disable()
194 struct device *dev = &ipa->pdev->dev; in ipa_interconnect_disable()
217 static int ipa_power_enable(struct ipa *ipa) in ipa_power_enable() argument
221 ret = ipa_interconnect_enable(ipa); in ipa_power_enable()
225 ret = clk_prepare_enable(ipa->power->core); in ipa_power_enable()
227 dev_err(&ipa->pdev->dev, "error %d enabling core clock\n", ret); in ipa_power_enable()
228 (void)ipa_interconnect_disable(ipa); in ipa_power_enable()
235 static int ipa_power_disable(struct ipa *ipa) in ipa_power_disable() argument
237 clk_disable_unprepare(ipa->power->core); in ipa_power_disable()
239 return ipa_interconnect_disable(ipa); in ipa_power_disable()
244 struct ipa *ipa = dev_get_drvdata(dev); in ipa_runtime_suspend() local
247 if (ipa->setup_complete) { in ipa_runtime_suspend()
248 __clear_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags); in ipa_runtime_suspend()
249 ipa_endpoint_suspend(ipa); in ipa_runtime_suspend()
250 gsi_suspend(&ipa->gsi); in ipa_runtime_suspend()
253 return ipa_power_disable(ipa); in ipa_runtime_suspend()
258 struct ipa *ipa = dev_get_drvdata(dev); in ipa_runtime_resume() local
261 ret = ipa_power_enable(ipa); in ipa_runtime_resume()
266 if (ipa->setup_complete) { in ipa_runtime_resume()
267 gsi_resume(&ipa->gsi); in ipa_runtime_resume()
268 ipa_endpoint_resume(ipa); in ipa_runtime_resume()
276 struct ipa *ipa = dev_get_drvdata(dev); in ipa_suspend() local
278 __set_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); in ipa_suspend()
289 ipa_interrupt_irq_disable(ipa); in ipa_suspend()
296 struct ipa *ipa = dev_get_drvdata(dev); in ipa_resume() local
301 __clear_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); in ipa_resume()
307 ipa_interrupt_irq_enable(ipa); in ipa_resume()
313 u32 ipa_core_clock_rate(struct ipa *ipa) in ipa_core_clock_rate() argument
315 return ipa->power ? (u32)clk_get_rate(ipa->power->core) : 0; in ipa_core_clock_rate()
328 static void ipa_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id) in ipa_suspend_handler() argument
334 if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags)) in ipa_suspend_handler()
335 if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags)) in ipa_suspend_handler()
336 pm_wakeup_dev_event(&ipa->pdev->dev, 0, true); in ipa_suspend_handler()
339 ipa_interrupt_suspend_clear_all(ipa->interrupt); in ipa_suspend_handler()
365 void ipa_power_modem_queue_stop(struct ipa *ipa) in ipa_power_modem_queue_stop() argument
367 struct ipa_power *power = ipa->power; in ipa_power_modem_queue_stop()
373 netif_stop_queue(ipa->modem_netdev); in ipa_power_modem_queue_stop()
385 void ipa_power_modem_queue_wake(struct ipa *ipa) in ipa_power_modem_queue_wake() argument
387 struct ipa_power *power = ipa->power; in ipa_power_modem_queue_wake()
394 netif_wake_queue(ipa->modem_netdev); in ipa_power_modem_queue_wake()
401 void ipa_power_modem_queue_active(struct ipa *ipa) in ipa_power_modem_queue_active() argument
403 clear_bit(IPA_POWER_FLAG_STARTED, ipa->power->flags); in ipa_power_modem_queue_active()
429 void ipa_power_retention(struct ipa *ipa, bool enable) in ipa_power_retention() argument
432 struct ipa_power *power = ipa->power; in ipa_power_retention()
447 int ipa_power_setup(struct ipa *ipa) in ipa_power_setup() argument
451 ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND, in ipa_power_setup()
454 ret = device_init_wakeup(&ipa->pdev->dev, true); in ipa_power_setup()
456 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); in ipa_power_setup()
461 void ipa_power_teardown(struct ipa *ipa) in ipa_power_teardown() argument
463 (void)device_init_wakeup(&ipa->pdev->dev, false); in ipa_power_teardown()
464 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); in ipa_power_teardown()