Merge "soc: qcom: configure ipcc interrupt as wakeup capable"

This commit is contained in:
qctecmdr 2019-09-04 16:41:19 -07:00 • committed by Gerrit - the friendly Code Review server
commit 26c6b391bd

View file

@ -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);