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

Commit 6f522a66 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: hdmi-codec: rate limit the debug print messages



Triggering fast ON/OFF HDMI events, it may so
happen that cable status might be set to true,
but hdmi panel power set to false. In this case
hdmi audio info channel setup would fail and
user-space continuously does re-try causing excessive
logging coming from hw_params(). Rate limit the logging
to avoid any watchdog related issues.

Change-Id: I0b9335aba8dfe1d47ce07c595aa02c5c3e687754
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent c83f0a3b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -123,12 +123,12 @@ static int msm_hdmi_audio_codec_rx_dai_hw_params(
			dev_get_drvdata(dai->codec->dev);

	if (IS_ERR_VALUE(msm_hdmi_audio_codec_return_value)) {
		dev_err(dai->dev,
		dev_err_ratelimited(dai->dev,
			"%s() HDMI core is not ready (ret val = %d)\n",
			__func__, msm_hdmi_audio_codec_return_value);
		return msm_hdmi_audio_codec_return_value;
	} else if (!msm_hdmi_audio_codec_return_value) {
		dev_err(dai->dev,
		dev_err_ratelimited(dai->dev,
			"%s() HDMI cable is not connected (ret val = %d)\n",
			__func__, msm_hdmi_audio_codec_return_value);
		return -ENODEV;
@@ -172,8 +172,9 @@ static int msm_hdmi_audio_codec_rx_dai_hw_params(
			params_rate(params), num_channels,
			channel_allocation, level_shift, down_mix);
	if (IS_ERR_VALUE(rc)) {
		dev_err(dai->dev,
			"%s() HDMI core is not ready\n", __func__);
		dev_err_ratelimited(dai->dev,
			"%s() HDMI core is not ready, rc: %d\n",
			__func__, rc);
	}

	return rc;