Prechádzať zdrojové kódy

ASoC: va-macro: Do not register for event listener for shima

As shima has hw conn to get inband interrupt while lpi enabled,
there is no need to register for event listener via afe.
Skip register for event listener for shima.

Change-Id: Ib15ae005a6920d0b2a584a86e896880bda21052e
Signed-off-by: Vatsal Bucha <[email protected]>
Vatsal Bucha 4 rokov pred
rodič
commit
01274e5268
1 zmenil súbory, kde vykonal 19 pridanie a 1 odobranie
  1. 19 1
      asoc/codecs/bolero/va-macro.c

+ 19 - 1
asoc/codecs/bolero/va-macro.c

@@ -173,6 +173,7 @@ struct va_macro_priv {
 	bool lpi_enable;
 	bool register_event_listener;
 	int dec_mode[VA_MACRO_NUM_DECIMATORS];
+	int disable_afe_wakeup_event_listener;
 };
 
 static bool va_macro_get_data(struct snd_soc_component *component,
@@ -435,7 +436,8 @@ static int va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
 					"%s: lpass audio hw enable failed\n",
 					__func__);
 		}
-		if (va_priv->lpi_enable) {
+		if (va_priv->lpi_enable &&
+		    !va_priv->disable_afe_wakeup_event_listener) {
 			bolero_register_event_listener(component, true);
 			va_priv->register_event_listener = true;
 		}
@@ -2995,7 +2997,10 @@ static int va_macro_probe(struct platform_device *pdev)
 	u32 default_clk_id = 0;
 	struct clk *lpass_audio_hw_vote = NULL;
 	u32 is_used_va_swr_gpio = 0;
+	u32 disable_afe_wakeup_event_listener = 0;
 	const char *is_used_va_swr_gpio_dt = "qcom,is-used-swr-gpio";
+	const char *disable_afe_wakeup_event_listener_dt =
+			"qcom,disable-afe-wakeup-event-listener";
 
 	va_priv = devm_kzalloc(&pdev->dev, sizeof(struct va_macro_priv),
 			    GFP_KERNEL);
@@ -3037,6 +3042,19 @@ static int va_macro_probe(struct platform_device *pdev)
 			is_used_va_swr_gpio = 0;
 		}
 	}
+
+	if (of_find_property(pdev->dev.of_node,
+			     disable_afe_wakeup_event_listener_dt, NULL)) {
+		ret = of_property_read_u32(pdev->dev.of_node,
+					   disable_afe_wakeup_event_listener_dt,
+					   &disable_afe_wakeup_event_listener);
+		if (ret)
+			dev_dbg(&pdev->dev, "%s: error reading %s in dt\n",
+				__func__, disable_afe_wakeup_event_listener_dt);
+	}
+	va_priv->disable_afe_wakeup_event_listener =
+			disable_afe_wakeup_event_listener;
+
 	va_priv->va_swr_gpio_p = of_parse_phandle(pdev->dev.of_node,
 					"qcom,va-swr-gpios", 0);
 	if (!va_priv->va_swr_gpio_p && is_used_va_swr_gpio) {