From 5fe4a509cc68873ab728563ec379a55b9d2c494d Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Tue, 20 Oct 2020 11:51:41 +0530 Subject: [PATCH] soc: swr-mstr: Enable device wakeup only for tx macro At bootup device wakeup enable is called for all masters causing issue for wsa on lahaina. This is because wsa supports interrupts on lahaina. Thus enable device wakeup only for tx master. Change-Id: Ia53df31427e54d5fd981cd650e1b0f06cb2d47b5 Signed-off-by: Vatsal Bucha --- soc/swr-mstr-ctrl.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index 6e9b7c1eec01..9361e018c979 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -2866,8 +2866,14 @@ static int swrm_probe(struct platform_device *pdev) if (ret) dev_dbg(swrm->dev, "%s: swrm irq wakeup capable not defined\n", __func__); - if (swrm->swr_irq_wakeup_capable) + if (swrm->swr_irq_wakeup_capable) { irq_set_irq_wake(swrm->irq, 1); + ret = device_init_wakeup(swrm->dev, true); + if (ret) + dev_info(swrm->dev, + "%s: Device wakeup init failed: %d\n", + __func__, ret); + } ret = swr_register_master(&swrm->master); if (ret) { dev_err(&pdev->dev, "%s: error adding swr master\n", __func__); @@ -2921,12 +2927,6 @@ static int swrm_probe(struct platform_device *pdev) &swrm_debug_dump_ops); } #endif - ret = device_init_wakeup(swrm->dev, true); - if (ret) { - dev_err(swrm->dev, "Device wakeup init failed: %d\n", ret); - goto err_irq_wakeup_fail; - } - pm_runtime_set_autosuspend_delay(&pdev->dev, auto_suspend_timer); pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_active(&pdev->dev); @@ -2938,10 +2938,9 @@ static int swrm_probe(struct platform_device *pdev) msm_aud_evt_register_client(&swrm->event_notifier); return 0; -err_irq_wakeup_fail: - device_init_wakeup(swrm->dev, false); err_mstr_init_fail: swr_unregister_master(&swrm->master); + device_init_wakeup(swrm->dev, false); err_mstr_fail: if (swrm->reg_irq) { swrm->reg_irq(swrm->handle, swr_mstr_interrupt, @@ -2982,8 +2981,10 @@ static int swrm_remove(struct platform_device *pdev) irqd_set_trigger_type( irq_get_irq_data(swrm->irq), IRQ_TYPE_NONE); - if (swrm->swr_irq_wakeup_capable) + if (swrm->swr_irq_wakeup_capable) { irq_set_irq_wake(swrm->irq, 0); + device_init_wakeup(swrm->dev, false); + } free_irq(swrm->irq, swrm); } else if (swrm->wake_irq > 0) { free_irq(swrm->wake_irq, swrm); @@ -2993,7 +2994,6 @@ static int swrm_remove(struct platform_device *pdev) pm_runtime_set_suspended(&pdev->dev); swr_unregister_master(&swrm->master); msm_aud_evt_unregister_client(&swrm->event_notifier); - device_init_wakeup(swrm->dev, false); mutex_destroy(&swrm->irq_lock); mutex_destroy(&swrm->mlock); mutex_destroy(&swrm->reslock);