OSDN Git Service

icnss: Add support for disabling vbatt notification
authorYuanyuan Liu <yuanliu@codeaurora.org>
Thu, 22 Sep 2016 23:34:43 +0000 (16:34 -0700)
committerYuanyuan Liu <yuanliu@codeaurora.org>
Thu, 29 Sep 2016 20:51:08 +0000 (13:51 -0700)
ICNSS monitors runtime phone power. When phone power
crosses either high or low threshold, ICNSS sends
vbatt notification to WLAN FW. FW then should vote for
different regulator power mode based on the notification.
Add support for disabling this feature and disable it
for now until WLAN FW support voting for different
regulator power mode.

CRs-Fixed: 1070294
Change-Id: I63241a198040122fcc4f26b728795e39822dbdc8
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
drivers/soc/qcom/icnss.c

index 583856e..38445e7 100644 (file)
@@ -244,9 +244,10 @@ enum icnss_debug_quirks {
        RECOVERY_DISABLE,
        SSR_ONLY,
        PDR_ONLY,
+       VBATT_DISABLE,
 };
 
-#define ICNSS_QUIRKS_DEFAULT           0
+#define ICNSS_QUIRKS_DEFAULT           BIT(VBATT_DISABLE)
 
 unsigned long quirks = ICNSS_QUIRKS_DEFAULT;
 module_param(quirks, ulong, 0600);
@@ -755,6 +756,9 @@ static int icnss_init_vph_monitor(struct icnss_priv *priv)
 {
        int ret = 0;
 
+       if (test_bit(VBATT_DISABLE, &quirks))
+               goto out;
+
        ret = icnss_get_phone_power(priv, &priv->vph_pwr);
        if (ret)
                goto out;
@@ -2288,7 +2292,7 @@ static int icnss_driver_event_server_exit(void *data)
 
        icnss_pr_info("QMI Service Disconnected: 0x%lx\n", penv->state);
 
-       if (penv->adc_tm_dev)
+       if (!test_bit(VBATT_DISABLE, &quirks) && penv->adc_tm_dev)
                qpnp_adc_tm_disable_chan_meas(penv->adc_tm_dev,
                                              &penv->vph_monitor_params);