net: ipa: enable wakeup in ipa_power_setup()

Move the call to enable the IPA interrupt as a wakeup interrupt into
ipa_power_setup(), disable it in ipa_power_teardown().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Alex Elder 2021-08-12 14:50:30 -05:00 коммит произвёл David S. Miller
Родитель 8db102a6f4
Коммит d430fe4bac
3 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

@ -310,14 +310,23 @@ static void ipa_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id)
ipa_interrupt_suspend_clear_all(ipa->interrupt); ipa_interrupt_suspend_clear_all(ipa->interrupt);
} }
void ipa_power_setup(struct ipa *ipa) int ipa_power_setup(struct ipa *ipa)
{ {
int ret;
ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND, ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND,
ipa_suspend_handler); ipa_suspend_handler);
ret = device_init_wakeup(&ipa->pdev->dev, true);
if (ret)
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
return ret;
} }
void ipa_power_teardown(struct ipa *ipa) void ipa_power_teardown(struct ipa *ipa)
{ {
(void)device_init_wakeup(&ipa->pdev->dev, false);
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND); ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
} }

Просмотреть файл

@ -25,8 +25,10 @@ u32 ipa_clock_rate(struct ipa *ipa);
/** /**
* ipa_power_setup() - Set up IPA power management * ipa_power_setup() - Set up IPA power management
* @ipa: IPA pointer * @ipa: IPA pointer
*
* Return: 0 if successful, or a negative error code
*/ */
void ipa_power_setup(struct ipa *ipa); int ipa_power_setup(struct ipa *ipa);
/** /**
* ipa_power_teardown() - Inverse of ipa_power_setup() * ipa_power_teardown() - Inverse of ipa_power_setup()

Просмотреть файл

@ -101,9 +101,7 @@ int ipa_setup(struct ipa *ipa)
if (ret) if (ret)
return ret; return ret;
ipa_power_setup(ipa); ret = ipa_power_setup(ipa);
ret = device_init_wakeup(dev, true);
if (ret) if (ret)
goto err_gsi_teardown; goto err_gsi_teardown;
@ -154,7 +152,6 @@ err_command_disable:
err_endpoint_teardown: err_endpoint_teardown:
ipa_endpoint_teardown(ipa); ipa_endpoint_teardown(ipa);
ipa_power_teardown(ipa); ipa_power_teardown(ipa);
(void)device_init_wakeup(dev, false);
err_gsi_teardown: err_gsi_teardown:
gsi_teardown(&ipa->gsi); gsi_teardown(&ipa->gsi);
@ -181,7 +178,6 @@ static void ipa_teardown(struct ipa *ipa)
ipa_endpoint_disable_one(command_endpoint); ipa_endpoint_disable_one(command_endpoint);
ipa_endpoint_teardown(ipa); ipa_endpoint_teardown(ipa);
ipa_power_teardown(ipa); ipa_power_teardown(ipa);
(void)device_init_wakeup(&ipa->pdev->dev, false);
gsi_teardown(&ipa->gsi); gsi_teardown(&ipa->gsi);
} }