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

qcacmn: Add API to get the cluster ID for a cpu

Kernel 6.0 and above has deprecated the use of
topology_physical_package_id() and instead of this
API topology_cluster_id() needs to be used to get
the cluster ID of a given CPU.

Add QDF abstraction API for topology_cluster_id().

Change-Id: I4ca555c016730afc6cac2a4bf55d9f48c6f4cae0
CRs-Fixed: 3488031
Rakesh Pillai 2 лет назад
Родитель
Сommit
5b087aa295
1 измененных файлов с 18 добавлено и 1 удалено
  1. 18 1
      qdf/linux/src/i_qdf_dev.h

+ 18 - 1
qdf/linux/src/i_qdf_dev.h

@@ -122,6 +122,7 @@ __qdf_dev_set_irq_affinity(uint32_t irnum, struct qdf_cpu_mask *cpmask)
 	return qdf_status_from_os_return(ret);
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
 /**
  * __qdf_topology_physical_package_id() - API to retrieve the
  * cluster info
@@ -130,12 +131,28 @@ __qdf_dev_set_irq_affinity(uint32_t irnum, struct qdf_cpu_mask *cpmask)
  * This function returns the cluster information for give cpu
  * core
  *
- * Return: 1 for perf and 0 for non-perf cluster
+ * Return: Cluster ID of the CPU
+ */
+static inline int __qdf_topology_physical_package_id(unsigned int cpu)
+{
+	return topology_cluster_id(cpu);
+}
+#else
+/**
+ * __qdf_topology_physical_package_id() - API to retrieve the
+ * cluster info
+ * @cpu: cpu core
+ *
+ * This function returns the cluster information for give cpu
+ * core
+ *
+ * Return: Cluster ID of the CPU
  */
 static inline int __qdf_topology_physical_package_id(unsigned int cpu)
 {
 	return topology_physical_package_id(cpu);
 }
+#endif
 
 /**
  * __qdf_cpumask_subset() - API to check for subset in cpumasks