浏览代码

qcacld-3.0: Add PLD API to get QMI support info

Call ICNSS API to get QMI support info and based on this
information later WLAN host driver decide to allocate 1 MB
Memory for MSA region or not.

CRs-Fixed: 1081443
Change-Id: I1ae0f3a0c92ded2df8e8c710be1faab6fde5cc10
Hardik Kantilal Patel 8 年之前
父节点
当前提交
9689e93310
共有 3 个文件被更改,包括 41 次插入0 次删除
  1. 2 0
      core/pld/inc/pld_common.h
  2. 31 0
      core/pld/src/pld_common.c
  3. 8 0
      core/pld/src/pld_snoc.h

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

@@ -380,4 +380,6 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr,
 		 uint32_t *iova_addr, size_t size);
 unsigned int pld_socinfo_get_serial_number(struct device *dev);
 uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num);
+int pld_is_qmi_disable(struct device *dev);
+
 #endif

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

@@ -1574,3 +1574,34 @@ uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num)
 	*num = 0;
 	return NULL;
 }
+
+/**
+ * pld_is_qmi_disable() - Check QMI support is present or not
+ * @dev: device
+ *
+ *  Return: 1 QMI is not supported
+ *          0 QMI is supported
+ *          Non zero failure code for errors
+ */
+int pld_is_qmi_disable(struct device *dev)
+{
+	int ret = 0;
+	enum pld_bus_type type = pld_get_bus_type(dev);
+
+	switch (type) {
+	case PLD_BUS_TYPE_SNOC:
+		ret = pld_snoc_is_qmi_disable();
+		break;
+	case PLD_BUS_TYPE_PCIE:
+	case PLD_BUS_TYPE_SDIO:
+		pr_err("Not supported on type %d\n", type);
+		ret = -EINVAL;
+		break;
+	default:
+		pr_err("Invalid device type %d\n", type);
+		ret = -EINVAL;
+		break;
+	}
+
+	return ret;
+}

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

@@ -135,6 +135,10 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev)
 {
 	return 0;
 }
+static inline int pld_snoc_is_qmi_disable(void)
+{
+	return 0;
+}
 #else
 int pld_snoc_register_driver(void);
 void pld_snoc_unregister_driver(void);
@@ -223,5 +227,9 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev)
 {
 	return icnss_socinfo_get_serial_number(dev);
 }
+static inline int pld_snoc_is_qmi_disable(void)
+{
+	return icnss_is_qmi_disable();
+}
 #endif
 #endif