Просмотр исходного кода

qcacld-3.0: Provide PLD API for getting IRQ number

Provide PLD API of getting IRQ number for a given CE ID.

Change-Id: Icd293993e84ab4daa98430db231b8b73e082cd29
CRs-Fixed: 1047259
Yuanyuan Liu 8 лет назад
Родитель
Сommit
f2ee05f167
4 измененных файлов с 42 добавлено и 0 удалено
  1. 1 0
      core/pld/inc/pld_common.h
  2. 24 0
      core/pld/src/pld_common.c
  3. 12 0
      core/pld/src/pld_snoc.c
  4. 5 0
      core/pld/src/pld_snoc.h

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

@@ -376,6 +376,7 @@ void pld_enable_irq(struct device *dev, unsigned int ce_id);
 void pld_disable_irq(struct device *dev, unsigned int ce_id);
 int pld_get_soc_info(struct device *dev, struct pld_soc_info *info);
 int pld_get_ce_id(struct device *dev, int irq);
+int pld_get_irq(struct device *dev, int ce_id);
 void pld_lock_pm_sem(struct device *dev);
 void pld_release_pm_sem(struct device *dev);
 int pld_power_on(struct device *dev);

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

@@ -1271,6 +1271,30 @@ int pld_get_ce_id(struct device *dev, int irq)
 	return ret;
 }
 
+/**
+ * pld_get_irq() - Get IRQ number for given CE ID
+ * @dev: device
+ * @ce_id: CE ID
+ *
+ * Return: IRQ number
+ */
+int pld_get_irq(struct device *dev, int ce_id)
+{
+	int ret = 0;
+
+	switch (pld_get_bus_type(dev)) {
+	case PLD_BUS_TYPE_SNOC:
+		ret = pld_snoc_get_irq(ce_id);
+		break;
+	case PLD_BUS_TYPE_PCIE:
+	default:
+		ret = -EINVAL;
+		break;
+	}
+
+	return ret;
+}
+
 /**
  * pld_lock_pm_sem() - Lock PM semaphore
  * @dev: device

+ 12 - 0
core/pld/src/pld_snoc.c

@@ -381,4 +381,16 @@ int pld_snoc_power_off(struct device *dev)
 {
 	return icnss_power_off(dev);
 }
+
+/**
+ * pld_snoc_get_irq() - Get IRQ number for given CE ID
+ * @ce_id: CE ID
+ *
+ * Return: IRQ number
+ */
+int pld_snoc_get_irq(int ce_id)
+{
+	return icnss_get_irq(ce_id);
+}
+
 #endif

+ 5 - 0
core/pld/src/pld_snoc.h

@@ -83,6 +83,10 @@ static inline int pld_snoc_power_off(struct device *dev)
 {
 	return 0;
 }
+static inline int pld_snoc_get_irq(int ce_id)
+{
+	return 0;
+}
 #else
 int pld_snoc_register_driver(void);
 void pld_snoc_unregister_driver(void);
@@ -99,6 +103,7 @@ void pld_snoc_disable_irq(unsigned int ce_id);
 int pld_snoc_get_ce_id(int irq);
 int pld_snoc_power_on(struct device *dev);
 int pld_snoc_power_off(struct device *dev);
+int pld_snoc_get_irq(int ce_id);
 #endif
 
 #endif