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
This commit is contained in:
Manikanta Pubbisetty
2021-03-25 23:34:56 +05:30
committed by snandini
parent 91ad5d2e01
commit 1e1ff6bc94
2 changed files with 44 additions and 1 deletions

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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); 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 * pld_pci_read_config_word() - Read PCI config
* @pdev: pci device * @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); 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, static inline int pfrm_read_config_word(struct pci_dev *pdev, int offset,
uint16_t *val) uint16_t *val)
{ {

View File

@@ -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 * pld_pci_read_config_word() - Read PCI config
* @pdev: pci device * @pdev: pci device