Преглед на файлове

icnss2: Add support to configure WLAN_EN_DELAY

Add support to configure WLAN_EN_DELAY using sysfs.
When temperature detected is less than threshold
configure WLAN_EN_DELAY value from sysfs if it is
greater than default WLAN_EN_DELAY value.

Change-Id: I94ac0c6bb3bd2bc2da122d3cf1215b8fe964159f
CRs-Fixed: 3230892
Naman Padhiar преди 2 години
родител
ревизия
4d21b48025
променени са 2 файла, в които са добавени 13 реда и са изтрити 2 реда
  1. 12 2
      icnss2/main.c
  2. 1 0
      icnss2/main.h

+ 12 - 2
icnss2/main.c

@@ -777,6 +777,16 @@ retry:
 	icnss_pr_dbg("smem state, Entry: %s", icnss_smp2p_str[smp2p_entry]);
 }
 
+static inline
+void icnss_set_wlan_en_delay(struct icnss_priv *priv)
+{
+	if (priv->wlan_en_delay_ms_user > WLAN_EN_DELAY) {
+		priv->wlan_en_delay_ms = priv->wlan_en_delay_ms_user;
+	} else {
+		priv->wlan_en_delay_ms = WLAN_EN_DELAY;
+	}
+}
+
 static int icnss_driver_event_server_arrive(struct icnss_priv *priv,
 						 void *data)
 {
@@ -818,7 +828,7 @@ static int icnss_driver_event_server_arrive(struct icnss_priv *priv,
 		if (!icnss_get_temperature(priv, &temp)) {
 			icnss_pr_dbg("Temperature: %d\n", temp);
 			if (temp < WLAN_EN_TEMP_THRESHOLD)
-				priv->wlan_en_delay_ms = WLAN_EN_DELAY;
+				icnss_set_wlan_en_delay(priv);
 		}
 
 		ret = wlfw_host_cap_send_sync(priv);
@@ -3712,7 +3722,7 @@ static ssize_t wlan_en_delay_store(struct device *dev,
 	}
 
 	icnss_pr_dbg("WLAN_EN delay: %dms", wlan_en_delay);
-	priv->wlan_en_delay_ms = wlan_en_delay;
+	priv->wlan_en_delay_ms_user = wlan_en_delay;
 
 	return count;
 }

+ 1 - 0
icnss2/main.h

@@ -476,6 +476,7 @@ struct icnss_priv {
 	struct mbox_client mbox_client_data;
 	struct mbox_chan *mbox_chan;
 	u32 wlan_en_delay_ms;
+	u32 wlan_en_delay_ms_user;
 	struct class *icnss_ramdump_class;
 	dev_t icnss_ramdump_dev;
 	struct completion smp2p_soc_wake_wait;