Selaa lähdekoodia

asoc: codecs: Enable LPM for power supplies

Enable Low Power Mode for the power supplies while
going to suspend mode on wsa883x and wcd9378.

Change-Id: I133c1b791bcd8b53cf79650d7347d5889da29491
Signed-off-by: Sarath Varma Ganapathiraju <[email protected]>
Sarath Varma Ganapathiraju 1 vuosi sitten
vanhempi
sitoutus
af4dffc575
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 4 1
      asoc/codecs/wcd9378/wcd9378.c
  2. 5 2
      asoc/codecs/wsa883x/wsa883x.c

+ 4 - 1
asoc/codecs/wcd9378/wcd9378.c

@@ -4652,7 +4652,10 @@ static int wcd9378_suspend(struct device *dev)
 		}
 		clear_bit(ALLOW_BUCK_DISABLE, &wcd9378->status_mask);
 	}
-	if (wcd9378->dapm_bias_off) {
+	if (wcd9378->dapm_bias_off ||
+		(wcd9378->component &&
+		(snd_soc_component_get_bias_level(wcd9378->component) ==
+			SND_SOC_BIAS_OFF))) {
 		msm_cdc_set_supplies_lpm_mode(wcd9378->dev,
 					      wcd9378->supplies,
 					      pdata->regulator,

+ 5 - 2
asoc/codecs/wsa883x/wsa883x.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -2031,7 +2031,10 @@ static int wsa883x_swr_suspend(struct device *dev)
 		return -EINVAL;
 	}
 	dev_dbg(dev, "%s: system suspend\n", __func__);
-	if (wsa883x->dapm_bias_off) {
+	if (wsa883x->dapm_bias_off ||
+		(wsa883x->component &&
+		(snd_soc_component_get_bias_level(wsa883x->component) ==
+			SND_SOC_BIAS_OFF))) {
 		msm_cdc_set_supplies_lpm_mode(dev, wsa883x->supplies,
 					wsa883x->regulator,
 					wsa883x->num_supplies,