diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 907f62934b..15683781bb 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -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 @@ -129,20 +129,7 @@ static inline void hal_reg_write_result_check(struct hal_soc *hal_soc, } } -#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) && \ - !defined(QCA_WIFI_KIWI) -static inline void hal_lock_reg_access(struct hal_soc *soc, - unsigned long *flags) -{ - qdf_spin_lock_irqsave(&soc->register_access_lock); -} - -static inline void hal_unlock_reg_access(struct hal_soc *soc, - unsigned long *flags) -{ - qdf_spin_unlock_irqrestore(&soc->register_access_lock); -} -#else +#ifdef WINDOW_REG_PLD_LOCK_ENABLE static inline void hal_lock_reg_access(struct hal_soc *soc, unsigned long *flags) { @@ -154,6 +141,18 @@ static inline void hal_unlock_reg_access(struct hal_soc *soc, { pld_unlock_reg_window(soc->qdf_dev->dev, flags); } +#else +static inline void hal_lock_reg_access(struct hal_soc *soc, + unsigned long *flags) +{ + qdf_spin_lock_irqsave(&soc->register_access_lock); +} + +static inline void hal_unlock_reg_access(struct hal_soc *soc, + unsigned long *flags) +{ + qdf_spin_unlock_irqrestore(&soc->register_access_lock); +} #endif #ifdef PCIE_REG_WINDOW_LOCAL_NO_CACHE diff --git a/hif/src/hif_io32.h b/hif/src/hif_io32.h index 6cd3b1b146..cb62e72957 100644 --- a/hif/src/hif_io32.h +++ b/hif/src/hif_io32.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2015-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 @@ -207,7 +207,7 @@ void hif_select_window_confirm(struct hif_pci_softc *sc, uint32_t offset) } #endif /* PCIE_REG_WINDOW_LOCAL_NO_CACHE */ -#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) +#ifdef WINDOW_REG_PLD_LOCK_ENABLE /** * hif_lock_reg_access() - Lock window register access spinlock * @sc: HIF handle @@ -220,7 +220,7 @@ void hif_select_window_confirm(struct hif_pci_softc *sc, uint32_t offset) static inline void hif_lock_reg_access(struct hif_pci_softc *sc, unsigned long *flags) { - qdf_spin_lock_irqsave(&sc->register_access_lock); + pld_lock_reg_window(sc->dev, flags); } /** @@ -235,19 +235,19 @@ static inline void hif_lock_reg_access(struct hif_pci_softc *sc, static inline void hif_unlock_reg_access(struct hif_pci_softc *sc, unsigned long *flags) { - qdf_spin_unlock_irqrestore(&sc->register_access_lock); + pld_unlock_reg_window(sc->dev, flags); } #else static inline void hif_lock_reg_access(struct hif_pci_softc *sc, unsigned long *flags) { - pld_lock_reg_window(sc->dev, flags); + qdf_spin_lock_irqsave(&sc->register_access_lock); } static inline void hif_unlock_reg_access(struct hif_pci_softc *sc, unsigned long *flags) { - pld_unlock_reg_window(sc->dev, flags); + qdf_spin_unlock_irqrestore(&sc->register_access_lock); } #endif