diff options
| author | Hardik Kantilal Patel <hkpatel@codeaurora.org> | 2016-10-18 19:02:39 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-31 21:53:16 -0700 |
| commit | 34ff7dcb573a3dfff65b71bf25a3343ed0bb86f6 (patch) | |
| tree | e8bb84f0ebe2d915c3a14f3be1b30b9777fd22f3 | |
| parent | 8da670f12ed3ab718bbfd77095b97d509706d794 (diff) | |
qcacld-3.0: Add PLD API to get QMI support info
Call ICNSS API to get QMI support info and based on this
information later WLAN host driver decide to allocate 1 MB
Memory for MSA region or not.
CRs-Fixed: 1081443
Change-Id: I1ae0f3a0c92ded2df8e8c710be1faab6fde5cc10
| -rw-r--r-- | core/pld/inc/pld_common.h | 2 | ||||
| -rw-r--r-- | core/pld/src/pld_common.c | 31 | ||||
| -rw-r--r-- | core/pld/src/pld_snoc.h | 8 |
3 files changed, 41 insertions, 0 deletions
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 5d24f7949753..20f62cb2e913 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -380,4 +380,6 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num); +int pld_is_qmi_disable(struct device *dev); + #endif diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index da6e7dfabddb..b94473ef3894 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1574,3 +1574,34 @@ uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num) *num = 0; return NULL; } + +/** + * pld_is_qmi_disable() - Check QMI support is present or not + * @dev: device + * + * Return: 1 QMI is not supported + * 0 QMI is supported + * Non zero failure code for errors + */ +int pld_is_qmi_disable(struct device *dev) +{ + int ret = 0; + enum pld_bus_type type = pld_get_bus_type(dev); + + switch (type) { + case PLD_BUS_TYPE_SNOC: + ret = pld_snoc_is_qmi_disable(); + break; + case PLD_BUS_TYPE_PCIE: + case PLD_BUS_TYPE_SDIO: + pr_err("Not supported on type %d\n", type); + ret = -EINVAL; + break; + default: + pr_err("Invalid device type %d\n", type); + ret = -EINVAL; + break; + } + + return ret; +} diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index 9c8a53b8a889..a57511a9f6f0 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -135,6 +135,10 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return 0; } +static inline int pld_snoc_is_qmi_disable(void) +{ + return 0; +} #else int pld_snoc_register_driver(void); void pld_snoc_unregister_driver(void); @@ -223,5 +227,9 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return icnss_socinfo_get_serial_number(dev); } +static inline int pld_snoc_is_qmi_disable(void) +{ + return icnss_is_qmi_disable(); +} #endif #endif |
