Browse Source

icnss2: Add code to pass device configs to wlan host driver

Add code to pass device configs to wlan host driver.

Change-Id: I977fc564914f9fbdabc0004eff4c5c2f14a1fc7c
Signed-off-by: Sandeep Singh <[email protected]>
Sandeep Singh 3 years ago
parent
commit
9c8339eabe
3 changed files with 27 additions and 0 deletions
  1. 21 0
      icnss2/main.c
  2. 1 0
      icnss2/main.h
  3. 5 0
      inc/icnss2.h

+ 21 - 0
icnss2/main.c

@@ -409,6 +409,17 @@ bool icnss_is_fw_down(void)
 }
 EXPORT_SYMBOL(icnss_is_fw_down);
 
+unsigned long icnss_get_device_config(void)
+{
+	struct icnss_priv *priv = icnss_get_plat_priv();
+
+	if (!priv)
+		return 0;
+
+	return priv->device_config;
+}
+EXPORT_SYMBOL(icnss_get_device_config);
+
 bool icnss_is_rejuvenate(void)
 {
 	if (!penv)
@@ -4078,6 +4089,14 @@ static void icnss_init_control_params(struct icnss_priv *priv)
 		priv->ctrl_params.bdf_type = ICNSS_BDF_BIN;
 }
 
+static void icnss_read_device_configs(struct icnss_priv *priv)
+{
+	if (of_property_read_bool(priv->pdev->dev.of_node,
+				  "wlan-ipa-disabled")) {
+		set_bit(ICNSS_IPA_DISABLED, &priv->device_config);
+	}
+}
+
 static inline void icnss_runtime_pm_init(struct icnss_priv *priv)
 {
 	pm_runtime_get_sync(&priv->pdev->dev);
@@ -4161,6 +4180,8 @@ static int icnss_probe(struct platform_device *pdev)
 
 	icnss_init_control_params(priv);
 
+	icnss_read_device_configs(priv);
+
 	ret = icnss_resource_parse(priv);
 	if (ret)
 		goto out_reset_drvdata;

+ 1 - 0
icnss2/main.h

@@ -473,6 +473,7 @@ struct icnss_priv {
 	uint32_t fw_soc_wake_ack_irq;
 	char foundry_name;
 	bool bdf_download_support;
+	unsigned long device_config;
 };
 
 struct icnss_reg_info {

+ 5 - 0
inc/icnss2.h

@@ -24,6 +24,10 @@ enum icnss_uevent {
 	ICNSS_UEVENT_SMMU_FAULT,
 };
 
+enum icnss_device_config {
+	ICNSS_IPA_DISABLED,
+};
+
 struct icnss_uevent_hang_data {
 	void *hang_event_data;
 	uint16_t hang_event_data_len;
@@ -204,4 +208,5 @@ extern int icnss_prevent_l1(struct device *dev);
 extern void icnss_allow_l1(struct device *dev);
 extern int icnss_get_mhi_state(struct device *dev);
 extern int icnss_is_pci_ep_awake(struct device *dev);
+extern unsigned long icnss_get_device_config(void);
 #endif /* _ICNSS_WLAN_H_ */