Browse Source

qcacld-3.0: add pld API for disable_irq()

When the SRNG IRQs are disabled during suspend, it is
required to disable the interrupts and wait for interrupts
that are pending to complete. Adding a pld/pfrm API to disable
irq synchronously.

CRs-Fixed: 2908685
Change-Id: Ia1f17d54cbe08e8dc101c0ecc2ddee9275712659
Manikanta Pubbisetty 4 years ago
parent
commit
1e1ff6bc94
2 changed files with 44 additions and 1 deletions
  1. 15 1
      core/pld/inc/pld_common.h
  2. 29 0
      core/pld/src/pld_common.c

+ 15 - 1
core/pld/inc/pld_common.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -846,6 +846,15 @@ void pld_srng_enable_irq(struct device *dev, int irq);
  */
 void pld_srng_disable_irq(struct device *dev, int irq);
 
+/**
+ * pld_srng_disable_irq_sync() - Synchronouus disable IRQ for SRNG
+ * @dev: device
+ * @irq: IRQ number
+ *
+ * Return: void
+ */
+void pld_srng_disable_irq_sync(struct device *dev, int irq);
+
 /**
  * pld_pci_read_config_word() - Read PCI config
  * @pdev: pci device
@@ -989,6 +998,11 @@ static inline void pfrm_disable_irq_nosync(struct device *dev, int irq)
 	pld_srng_disable_irq(dev, irq);
 }
 
+static inline void pfrm_disable_irq(struct device *dev, int irq)
+{
+	pld_srng_disable_irq_sync(dev, irq);
+}
+
 static inline int pfrm_read_config_word(struct pci_dev *pdev, int offset,
 					uint16_t *val)
 {

+ 29 - 0
core/pld/src/pld_common.c

@@ -2241,6 +2241,35 @@ void pld_srng_disable_irq(struct device *dev, int irq)
 	}
 }
 
+/**
+ * pld_srng_disable_irq_sync() - Synchronouus disable IRQ for SRNG
+ * @dev: device
+ * @irq: IRQ number
+ *
+ * Return: void
+ */
+void pld_srng_disable_irq_sync(struct device *dev, int irq)
+{
+	switch (pld_get_bus_type(dev)) {
+	case PLD_BUS_TYPE_SNOC:
+	case PLD_BUS_TYPE_SNOC_FW_SIM:
+		break;
+	case PLD_BUS_TYPE_PCIE_FW_SIM:
+	case PLD_BUS_TYPE_IPCI_FW_SIM:
+		pld_pcie_fw_sim_disable_irq(dev, irq);
+		break;
+	case PLD_BUS_TYPE_PCIE:
+	case PLD_BUS_TYPE_IPCI:
+		disable_irq(irq);
+		break;
+	case PLD_BUS_TYPE_SDIO:
+		break;
+	default:
+		pr_err("Invalid device type\n");
+		break;
+	}
+}
+
 /**
  * pld_pci_read_config_word() - Read PCI config
  * @pdev: pci device