Преглед изворни кода

qcacld-3.0: Add API to get SOC information in PLD for PCIe

Add API to call platform driver function in order to get SOC related
information for in PLD for PCIe.

Change-Id: Ieec098575b874e6d15ae45ef6000767ade7d459f
CRs-fixed: 1082183
Yue Ma пре 8 година
родитељ
комит
cd24386e22
3 измењених фајлова са 33 додато и 0 уклоњено
  1. 1 0
      core/pld/src/pld_common.c
  2. 26 0
      core/pld/src/pld_pcie.c
  3. 6 0
      core/pld/src/pld_pcie.h

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

@@ -1213,6 +1213,7 @@ int pld_get_soc_info(struct device *dev, struct pld_soc_info *info)
 		ret = pld_snoc_get_soc_info(info);
 		break;
 	case PLD_BUS_TYPE_PCIE:
+		ret = pld_pcie_get_soc_info(dev, info);
 		break;
 	case PLD_BUS_TYPE_SDIO:
 		break;

+ 26 - 0
core/pld/src/pld_pcie.c

@@ -494,6 +494,32 @@ int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
 	return 0;
 }
 
+/**
+ * pld_pcie_get_soc_info() - Get SOC information
+ * @info: buffer to SOC information
+ *
+ * Return SOC info to the buffer.
+ *
+ * Return: 0 for success
+ *         Non zero failure code for errors
+ */
+int pld_pcie_get_soc_info(struct device *dev, struct pld_soc_info *info)
+{
+	int ret = 0;
+	struct cnss_soc_info cnss_info;
+
+	if (info == NULL)
+		return -ENODEV;
+
+	ret = cnss_get_soc_info(dev, &cnss_info);
+	if (ret)
+		return ret;
+
+	memcpy(info, &cnss_info, sizeof(*info));
+
+	return 0;
+}
+
 /**
  * pld_pcie_set_driver_status() - Set driver status
  * @status: driver status

+ 6 - 0
core/pld/src/pld_pcie.h

@@ -199,6 +199,11 @@ static inline int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
 {
 	return 0;
 }
+static inline int pld_pcie_get_soc_info(struct device *dev,
+					struct pld_soc_info *info)
+{
+	return 0;
+}
 static inline void pld_pcie_set_driver_status(enum pld_driver_status status)
 {
 	return;
@@ -256,6 +261,7 @@ static inline void pld_pcie_get_msi_address(struct device *dev,
 int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
 				     u32 target_type, u32 target_version);
 int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);
+int pld_pcie_get_soc_info(struct device *dev, struct pld_soc_info *info);
 void pld_pcie_set_driver_status(enum pld_driver_status status);
 
 static inline void pld_pcie_link_down(void)