Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5bb8d32 authored by Venkat Sudhir's avatar Venkat Sudhir Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9320: Fix DAPM timeout when accesing MAD calibration



request_firmware called by MAD configuration requires
user space daemon to locate MAD codec calibration data.
When system is in suspend state either due to sleep or
user space daemon not ready or filesystem is down then
it needs be up briefly before accesing the codec
calibration data. This change fixes the accesing the
codec calibration data by codec when in suspend state.

Crs-Fixed: 609223
Change-Id: Id2d87363276619c9bd841ee335dc92c58bcc27c0
Signed-off-by: default avatarVenkat Sudhir <vsudhir@codeaurora.org>
parent d3e85426
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@
#include <linux/pm_runtime.h>
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/pm_qos.h>
#include <soc/qcom/pm.h>
#include "wcd9320.h"
#include "wcd9xxx-resmgr.h"
#include "wcd9xxx-common.h"
@@ -450,6 +452,7 @@ struct taiko_priv {
	 * end of impedance measurement
	 */
	struct list_head reg_save_restore;
	struct pm_qos_request pm_qos_req;
};

static const u32 comp_shift[] = {
@@ -2785,8 +2788,12 @@ static int taiko_codec_config_mad(struct snd_soc_codec *codec)
	const struct firmware *fw;
	struct mad_audio_cal *mad_cal;
	const char *filename = TAIKO_MAD_AUDIO_FIRMWARE_PATH;
	struct taiko_priv *taiko = snd_soc_codec_get_drvdata(codec);

	pr_debug("%s: enter\n", __func__);
	/* wakeup for codec calibration access */
	pm_qos_update_request(&taiko->pm_qos_req,
			      msm_cpuidle_get_deep_idle_latency());
	ret = request_firmware(&fw, filename, codec->dev);
	if (ret != 0) {
		pr_err("Failed to acquire MAD firwmare data %s: %d\n", filename,
@@ -2856,7 +2863,8 @@ static int taiko_codec_config_mad(struct snd_soc_codec *codec)

	release_firmware(fw);
	pr_debug("%s: leave ret %d\n", __func__, ret);

	pm_qos_update_request(&taiko->pm_qos_req,
			      PM_QOS_DEFAULT_VALUE);
	return ret;
}