From 711009936df180cdfcd8321998b22131698e8771 Mon Sep 17 00:00:00 2001 From: Prasad Sodagudi Date: Fri, 26 Jul 2019 05:39:00 -0700 Subject: [PATCH] soc: qcom: configure ipcc interrupt as wakeup capable Configure the IPCC summary IRQ as wakeup capable interrupt. IPCC interrupt needs to wake up the device from low power modes when wakeup capable event is generated from remote subsystem. Change-Id: Iaffefc6ef68743c7de11062c39e2b1453c58b9a1 Signed-off-by: Prasad Sodagudi [eberman@codeaurora.org: Resolve merge conflicts] Signed-off-by: Elliot Berman --- drivers/soc/qcom/qcom_ipcc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/soc/qcom/qcom_ipcc.c b/drivers/soc/qcom/qcom_ipcc.c index 93eb287a3c91..a9f6a46efbcd 100644 --- a/drivers/soc/qcom/qcom_ipcc.c +++ b/drivers/soc/qcom/qcom_ipcc.c @@ -32,6 +32,7 @@ * @chans: The mailbox clients' channel array (created dynamically) * @base: Base address of the IPCC frame associated to APPS * @dev: Device associated with this instance + * @irq: Summary irq */ struct ipcc_protocol_data { struct irq_domain *irq_domain; @@ -40,6 +41,7 @@ struct ipcc_protocol_data { void __iomem *base; struct device *dev; int num_chans; + int irq; }; /** @@ -305,7 +307,7 @@ static int qcom_ipcc_probe(struct platform_device *pdev) struct ipcc_protocol_data *proto_data; struct resource *res; static int id; - int ret, irq; + int ret; char *name; proto_data = devm_kzalloc(&pdev->dev, sizeof(*proto_data), GFP_KERNEL); @@ -330,10 +332,10 @@ static int qcom_ipcc_probe(struct platform_device *pdev) if (!name) return -ENOMEM; - irq = platform_get_irq(pdev, 0); - if (irq < 0) { + proto_data->irq = platform_get_irq(pdev, 0); + if (proto_data->irq < 0) { dev_err(&pdev->dev, "Failed to get the IRQ\n"); - return irq; + return proto_data->irq; } /* Perform a SW reset on this client's protocol state */ @@ -353,13 +355,14 @@ static int qcom_ipcc_probe(struct platform_device *pdev) goto err_mbox; } - ret = devm_request_irq(&pdev->dev, irq, qcom_ipcc_irq_fn, + ret = devm_request_irq(&pdev->dev, proto_data->irq, qcom_ipcc_irq_fn, IRQF_TRIGGER_HIGH, name, proto_data); if (ret < 0) { dev_err(&pdev->dev, "Failed to register the irq: %d\n", ret); goto err_req_irq; } + enable_irq_wake(proto_data->irq); platform_set_drvdata(pdev, proto_data); return 0; @@ -376,6 +379,7 @@ static int qcom_ipcc_remove(struct platform_device *pdev) { struct ipcc_protocol_data *proto_data = platform_get_drvdata(pdev); + disable_irq_wake(proto_data->irq); if (proto_data->num_chans) mbox_controller_unregister(&proto_data->mbox); irq_dispose_all_tree_mappings(proto_data->irq_domain);