wifi: ath12k: Move hw_init invocation to target-specific probe

Relocate hw_init call from the shared probe path to target-specific
probe implementations. Handle Wi-Fi 7 initialization entirely within
its corresponding target-specific file.
Improve modularity by decoupling hardware-dependent initialization from
common probe logic. Support broader effort to separate shared and
target-specific code paths.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Kiran Venkatappa <quic_kiranv@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20250812-ath12k-mod-v1-9-8c9b0eb9335d@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Kiran Venkatappa 2025-08-12 22:39:35 +05:30 committed by Jeff Johnson
parent 387b587a86
commit 83cd89a955
6 changed files with 31 additions and 10 deletions

View File

@ -11,6 +11,7 @@
#include "ahb_wifi7.h"
#include "debug.h"
#include "hif.h"
#include "hw_wifi7.h"
static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {
{ .compatible = "qcom,ipq5332-wifi",
@ -26,6 +27,7 @@ static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
struct ath12k_ahb *ab_ahb;
enum ath12k_hw_rev hw_rev;
struct ath12k_base *ab;
int ret;
ab = platform_get_drvdata(pdev);
ab_ahb = ath12k_ab_to_ahb(ab);
@ -42,6 +44,12 @@ static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
ab->target_mem_mode = ATH12K_QMI_MEMORY_MODE_DEFAULT;
ab->hw_rev = hw_rev;
ret = ath12k_wifi7_hw_init(ab);
if (ret) {
ath12k_err(ab, "WiFi-7 hw_init for AHB failed: %d\n", ret);
return ret;
}
return 0;
}

View File

@ -1744,13 +1744,6 @@ enum ath12k_qmi_mem_mode ath12k_core_get_memory_mode(struct ath12k_base *ab)
int ath12k_core_pre_init(struct ath12k_base *ab)
{
const struct ath12k_mem_profile_based_param *param;
int ret;
ret = ath12k_hw_init(ab);
if (ret) {
ath12k_err(ab, "failed to init hw params: %d\n", ret);
return ret;
}
param = &ath12k_mem_profile_based_param[ab->target_mem_mode];
ab->profile_param = param;

View File

@ -377,6 +377,4 @@ static inline const char *ath12k_bd_ie_type_str(enum ath12k_bd_ie_type type)
return "unknown";
}
int ath12k_hw_init(struct ath12k_base *ab);
#endif

View File

@ -13,6 +13,7 @@
#include "ce.h"
#include "ce_wifi7.h"
#include "hw.h"
#include "hw_wifi7.h"
#include "mhi.h"
#include "dp_rx.h"
#include "peer.h"
@ -1030,7 +1031,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
},
};
int ath12k_hw_init(struct ath12k_base *ab)
int ath12k_wifi7_hw_init(struct ath12k_base *ab)
{
const struct ath12k_hw_params *hw_params = NULL;
int i;

View File

@ -0,0 +1,13 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#ifndef ATH12K_WIFI7_HW_H
#define ATH12K_WIFI7_HW_H
struct ath12k_base;
int ath12k_wifi7_hw_init(struct ath12k_base *ab);
#endif /* ATH12K_WIFI7_HW_H */

View File

@ -11,6 +11,7 @@
#include "core.h"
#include "hif.h"
#include "mhi.h"
#include "hw_wifi7.h"
#define QCN9274_DEVICE_ID 0x1109
#define WCN7850_DEVICE_ID 0x1107
@ -84,6 +85,7 @@ static int ath12k_wifi7_pci_probe(struct pci_dev *pdev,
u32 soc_hw_version_major, soc_hw_version_minor;
struct ath12k_pci *ab_pci;
struct ath12k_base *ab;
int ret;
ab = pci_get_drvdata(pdev);
if (!ab)
@ -143,6 +145,12 @@ static int ath12k_wifi7_pci_probe(struct pci_dev *pdev,
return -EOPNOTSUPP;
}
ret = ath12k_wifi7_hw_init(ab);
if (ret) {
dev_err(&pdev->dev, "WiFi-7 hw_init for PCI failed: %d\n", ret);
return ret;
}
return 0;
}