Sfoglia il codice sorgente

qcacld-3.0: Provide chip version to platform driver

Add chip version info in driver structure, platform driver
can use this info to decide whether accept this registration or not.

Change-Id: I37ba897954147ad75515f88e7ff35417e5de39e4
CRs-Fixed: 3125766
Kai Liu 3 anni fa
parent
commit
4ca1fafe71
4 ha cambiato i file con 21 aggiunte e 1 eliminazioni
  1. 4 0
      Kbuild
  2. 3 0
      configs/kiwi_defconfig
  3. 3 0
      configs/kiwi_v2_defconfig
  4. 11 1
      core/pld/src/pld_pcie.c

+ 4 - 0
Kbuild

@@ -4318,6 +4318,10 @@ ccflags-$(CONFIG_IPA_WDI3_TX_TWO_PIPES) += -DIPA_WDI3_TX_TWO_PIPES
 
 cppflags-$(CONFIG_DP_TX_TRACKING) += -DDP_TX_TRACKING
 
+ifdef CONFIG_CHIP_VERSION
+cppflags-y += -DCHIP_VERSION=$(CONFIG_CHIP_VERSION)
+endif
+
 KBUILD_CPPFLAGS += $(cppflags-y)
 
 # Currently, for versions of gcc which support it, the kernel Makefile

+ 3 - 0
configs/kiwi_defconfig

@@ -13,3 +13,6 @@ CONFIG_WLAN_FEATURE_11BE_MLO := y
 
 #BMISS offload max vdev config
 CONFIG_CFG_BMISS_OFFLOAD_MAX_VDEV := 4
+
+#Chip version
+CONFIG_CHIP_VERSION := 1

+ 3 - 0
configs/kiwi_v2_defconfig

@@ -14,3 +14,6 @@ CONFIG_WLAN_FEATURE_11BE_MLO := y
 
 #BMISS offload max vdev config
 CONFIG_CFG_BMISS_OFFLOAD_MAX_VDEV := 4
+
+#Chip version
+CONFIG_CHIP_VERSION := 2

+ 11 - 1
core/pld/src/pld_pcie.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -43,6 +43,13 @@
 #define CE_COUNT_MAX 8
 #endif
 
+#if defined(CONFIG_PLD_PCIE_CNSS) && \
+	(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
+#ifndef CHIP_VERSION
+#define CHIP_VERSION CNSS_CHIP_VER_ANY
+#endif
+#endif
+
 /**
  * pld_pcie_probe() - Probe function for PCIE platform driver
  * @pdev: PCIE device
@@ -719,6 +726,9 @@ struct cnss_wlan_driver pld_pcie_ops = {
 #ifdef FEATURE_WLAN_FULL_POWER_DOWN_SUPPORT
 	.suspend_mode = &pld_pcie_suspend_mode,
 #endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
+	.chip_version = CHIP_VERSION,
+#endif
 };
 
 /**