diff options
| -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 |
