asoc: codecs: Replace dev_err/info with ratelimit prints
replace all dev(pr)_err/info logs that could potentially flood kernel logs with ratelimit functions dev_err_ratelimited and dev_info_ratelimited Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
Este commit está contenido en:
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -916,20 +917,20 @@ static bool lpass_cdc_rx_macro_get_data(struct snd_soc_component *component,
|
||||
*rx_dev = lpass_cdc_get_device_ptr(component->dev, RX_MACRO);
|
||||
|
||||
if (!(*rx_dev)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: null device for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
*rx_priv = dev_get_drvdata((*rx_dev));
|
||||
if (!(*rx_priv)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: priv is null for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(*rx_priv)->component) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: rx_priv component is not initialized!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
@@ -1014,7 +1015,7 @@ static int lpass_cdc_rx_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai
|
||||
int_1_mix1_inp = port;
|
||||
if ((int_1_mix1_inp < LPASS_CDC_RX_MACRO_RX0) ||
|
||||
(int_1_mix1_inp > LPASS_CDC_RX_MACRO_PORTS_MAX)) {
|
||||
pr_err("%s: Invalid RX port, Dai ID is %d\n",
|
||||
pr_err_ratelimited("%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1077,7 +1078,7 @@ static int lpass_cdc_rx_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai,
|
||||
int_2_inp = port;
|
||||
if ((int_2_inp < LPASS_CDC_RX_MACRO_RX0) ||
|
||||
(int_2_inp > LPASS_CDC_RX_MACRO_PORTS_MAX)) {
|
||||
pr_err("%s: Invalid RX port, Dai ID is %d\n",
|
||||
pr_err_ratelimited("%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1179,7 +1180,7 @@ static int lpass_cdc_rx_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
case SNDRV_PCM_STREAM_PLAYBACK:
|
||||
ret = lpass_cdc_rx_macro_set_interpolator_rate(dai, params_rate(params));
|
||||
if (ret) {
|
||||
pr_err("%s: cannot set sample rate: %u\n",
|
||||
pr_err_ratelimited("%s: cannot set sample rate: %u\n",
|
||||
__func__, params_rate(params));
|
||||
return ret;
|
||||
}
|
||||
@@ -1272,7 +1273,7 @@ static int lpass_cdc_rx_macro_get_channel_map(struct snd_soc_dai *dai,
|
||||
*tx_num = cnt;
|
||||
break;
|
||||
default:
|
||||
dev_err(rx_dev, "%s: Invalid AIF\n", __func__);
|
||||
dev_err_ratelimited(rx_dev, "%s: Invalid AIF\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1340,7 +1341,7 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1354,7 +1355,7 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
rx_priv->clk_id = RX_CORE_CLK;
|
||||
ret = lpass_cdc_rx_macro_core_vote(rx_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx request core vote failed\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
@@ -1365,7 +1366,7 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
true);
|
||||
lpass_cdc_rx_macro_core_vote(rx_priv, false);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx request clock enable failed\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
@@ -1392,7 +1393,7 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
rx_priv->rx_mclk_users++;
|
||||
} else {
|
||||
if (rx_priv->rx_mclk_users <= 0) {
|
||||
dev_err(rx_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
rx_priv->rx_mclk_users = 0;
|
||||
goto exit;
|
||||
@@ -1415,7 +1416,7 @@ static int lpass_cdc_rx_macro_mclk_enable(
|
||||
false);
|
||||
ret = lpass_cdc_rx_macro_core_vote(rx_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx request core vote failed\n",
|
||||
__func__);
|
||||
}
|
||||
@@ -1467,7 +1468,7 @@ static int lpass_cdc_rx_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
ret = lpass_cdc_rx_macro_mclk_enable(rx_priv, 0, true);
|
||||
break;
|
||||
default:
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -1535,7 +1536,7 @@ static int lpass_cdc_rx_macro_event_handler(struct snd_soc_component *component,
|
||||
case LPASS_CDC_MACRO_EVT_PRE_SSR_UP:
|
||||
ret = lpass_cdc_rx_macro_core_vote(rx_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx request core vote failed\n",
|
||||
__func__);
|
||||
break;
|
||||
@@ -1756,7 +1757,7 @@ static int lpass_cdc_rx_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
|
||||
return -EINVAL;
|
||||
|
||||
if (w->shift >= INTERP_MAX) {
|
||||
dev_err(component->dev, "%s: Invalid Interpolator value %d for name %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid Interpolator value %d for name %s\n",
|
||||
__func__, w->shift, w->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1844,7 +1845,7 @@ static int lpass_cdc_rx_macro_enable_main_path(struct snd_soc_dapm_widget *w,
|
||||
dev_dbg(component->dev, "%s %d %s\n", __func__, event, w->name);
|
||||
|
||||
if (w->shift >= INTERP_MAX) {
|
||||
dev_err(component->dev, "%s: Invalid Interpolator value %d for name %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid Interpolator value %d for name %s\n",
|
||||
__func__, w->shift, w->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2273,11 +2274,11 @@ static int lpass_cdc_rx_macro_mux_put(struct snd_kcontrol *kcontrol,
|
||||
aif_rst = rx_priv->rx_port_value[widget->shift];
|
||||
if (!rx_port_value) {
|
||||
if (aif_rst == 0) {
|
||||
dev_err(rx_dev, "%s:AIF reset already\n", __func__);
|
||||
dev_err_ratelimited(rx_dev, "%s:AIF reset already\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
if (aif_rst > RX_MACRO_AIF4_PB) {
|
||||
dev_err(rx_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
dev_err_ratelimited(rx_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2303,7 +2304,7 @@ static int lpass_cdc_rx_macro_mux_put(struct snd_kcontrol *kcontrol,
|
||||
rx_priv->active_ch_cnt[rx_port_value]++;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s:Invalid AIF_ID for LPASS_CDC_RX_MACRO MUX %d\n",
|
||||
__func__, rx_port_value);
|
||||
goto err;
|
||||
@@ -2652,7 +2653,7 @@ static int lpass_cdc_rx_macro_enable_vbat(struct snd_soc_dapm_widget *w,
|
||||
LPASS_CDC_RX_BCL_VBAT_PATH_CTL, 0x10, 0x00);
|
||||
break;
|
||||
default:
|
||||
dev_err(rx_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
dev_err_ratelimited(rx_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -2749,7 +2750,7 @@ static int lpass_cdc_rx_macro_enable_interp_clk(struct snd_soc_component *compon
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -2884,7 +2885,7 @@ static void lpass_cdc_rx_macro_restore_iir_coeff(struct lpass_cdc_rx_macro_priv
|
||||
struct regmap *regmap = dev_get_regmap(rx_priv->dev->parent, NULL);
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3200,7 +3201,7 @@ static int lpass_cdc_rx_macro_fir_filter_enable_get(struct snd_kcontrol *kcontro
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3221,7 +3222,7 @@ static int lpass_cdc_rx_macro_fir_filter_enable_put(struct snd_kcontrol *kcontro
|
||||
int ret = 0;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3321,7 +3322,7 @@ static int lpass_cdc_rx_macro_fir_audio_mixer_get(struct snd_kcontrol *kcontrol,
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3329,12 +3330,14 @@ static int lpass_cdc_rx_macro_fir_audio_mixer_get(struct snd_kcontrol *kcontrol,
|
||||
return -EINVAL;
|
||||
|
||||
if (path_idx >= FIR_PATH_MAX) {
|
||||
dev_err(rx_priv->dev, "%s: path_idx:%d is invalid\n", __func__, path_idx);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: path_idx:%d is invalid\n",
|
||||
__func__, path_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (grp_idx >= GRP_MAX) {
|
||||
dev_err(rx_priv->dev, "%s: grp_idx:%d is invalid\n", __func__, grp_idx);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: grp_idx:%d is invalid\n",
|
||||
__func__, grp_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3377,7 +3380,7 @@ static int set_fir_filter_coeff(struct snd_soc_component *component,
|
||||
fir_ctl_addr = LPASS_CDC_RX_RX1_RX_FIR_CTL;
|
||||
break;
|
||||
default:
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: inavlid FIR ID: %d\n", __func__, path_idx);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
@@ -3425,7 +3428,7 @@ static int set_fir_filter_coeff(struct snd_soc_component *component,
|
||||
|
||||
num_coeff_grp = rx_priv->num_fir_coeff[path_idx][grp_idx];
|
||||
if (num_coeff_grp > max_coeff_num) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: inavlid number of RX_FIR coefficients:%d"
|
||||
" in path:%d, group:%d\n",
|
||||
__func__, num_coeff_grp, path_idx, grp_idx);
|
||||
@@ -3544,7 +3547,7 @@ static int lpass_cdc_rx_macro_fir_audio_mixer_put(struct snd_kcontrol *kcontrol,
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3552,12 +3555,14 @@ static int lpass_cdc_rx_macro_fir_audio_mixer_put(struct snd_kcontrol *kcontrol,
|
||||
return -EINVAL;
|
||||
|
||||
if (path_idx >= FIR_PATH_MAX) {
|
||||
dev_err(rx_priv->dev,"%s: path_idx:%d is invalid\n", __func__, path_idx);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: path_idx:%d is invalid\n",
|
||||
__func__, path_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (grp_idx >= GRP_MAX) {
|
||||
dev_err(rx_priv->dev,"%s: grp_idx:%d is invalid\n", __func__, grp_idx);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: grp_idx:%d is invalid\n",
|
||||
__func__, grp_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3581,7 +3586,7 @@ static int lpass_cdc_rx_macro_fir_audio_mixer_put(struct snd_kcontrol *kcontrol,
|
||||
__func__, path_idx, grp_idx, num_coeff_grp);
|
||||
|
||||
if (num_coeff_grp > LPASS_CDC_RX_MACRO_FIR_COEFF_MAX) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: inavlid number of RX_FIR coefficients:%d in path:%d, group:%d\n",
|
||||
__func__, num_coeff_grp, path_idx, grp_idx);
|
||||
rx_priv->num_fir_coeff[path_idx][grp_idx] = 0;
|
||||
@@ -3623,7 +3628,7 @@ static int lpass_cdc_rx_macro_fir_coeff_num_get(struct snd_kcontrol *kcontrol,
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3631,7 +3636,8 @@ static int lpass_cdc_rx_macro_fir_coeff_num_get(struct snd_kcontrol *kcontrol,
|
||||
return -EINVAL;
|
||||
|
||||
if (path_idx >= FIR_PATH_MAX) {
|
||||
dev_err(rx_priv->dev,"%s: path_idx:%d is invalid\n", __func__, path_idx);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: path_idx:%d is invalid\n",
|
||||
__func__, path_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3654,7 +3660,7 @@ static int lpass_cdc_rx_macro_fir_coeff_num_put(struct snd_kcontrol *kcontrol,
|
||||
unsigned int grp_idx, stored_total_num;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3662,7 +3668,7 @@ static int lpass_cdc_rx_macro_fir_coeff_num_put(struct snd_kcontrol *kcontrol,
|
||||
return -EINVAL;
|
||||
|
||||
if (fir_total_coeff_num > LPASS_CDC_RX_MACRO_FIR_COEFF_MAX * GRP_MAX) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: inavlid total number of RX_FIR coefficients:%d"
|
||||
" in path:%d\n",
|
||||
__func__, fir_total_coeff_num, path_idx);
|
||||
@@ -3846,7 +3852,7 @@ static int lpass_cdc_rx_macro_enable_echo(struct snd_soc_dapm_widget *w,
|
||||
ec_tx = (val & 0x0f) - 1;
|
||||
|
||||
if (ec_tx < 0 || (ec_tx >= LPASS_CDC_RX_MACRO_EC_MUX_MAX)) {
|
||||
dev_err(rx_dev, "%s: EC mix control not set correctly\n",
|
||||
dev_err_ratelimited(rx_dev, "%s: EC mix control not set correctly\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -4340,7 +4346,7 @@ static int lpass_cdc_rx_macro_core_vote(void *handle, bool enable)
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = (struct lpass_cdc_rx_macro_priv *) handle;
|
||||
|
||||
if (rx_priv == NULL) {
|
||||
pr_err("%s: rx priv data is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: rx priv data is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (enable) {
|
||||
@@ -4363,7 +4369,7 @@ static int rx_swrm_clock(void *handle, bool enable)
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(rx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -4379,7 +4385,7 @@ static int rx_swrm_clock(void *handle, bool enable)
|
||||
ret = msm_cdc_pinctrl_select_active_state(
|
||||
rx_priv->rx_swr_gpio_p);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx swr pinctrl enable failed\n",
|
||||
__func__);
|
||||
pm_runtime_mark_last_busy(rx_priv->dev);
|
||||
@@ -4390,7 +4396,7 @@ static int rx_swrm_clock(void *handle, bool enable)
|
||||
if (ret < 0) {
|
||||
msm_cdc_pinctrl_select_sleep_state(
|
||||
rx_priv->rx_swr_gpio_p);
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx request clock enable failed\n",
|
||||
__func__);
|
||||
pm_runtime_mark_last_busy(rx_priv->dev);
|
||||
@@ -4415,7 +4421,7 @@ static int rx_swrm_clock(void *handle, bool enable)
|
||||
rx_priv->swr_clk_users++;
|
||||
} else {
|
||||
if (rx_priv->swr_clk_users <= 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx swrm clock users already reset\n",
|
||||
__func__);
|
||||
rx_priv->swr_clk_users = 0;
|
||||
@@ -4430,7 +4436,7 @@ static int rx_swrm_clock(void *handle, bool enable)
|
||||
ret = msm_cdc_pinctrl_select_sleep_state(
|
||||
rx_priv->rx_swr_gpio_p);
|
||||
if (ret < 0) {
|
||||
dev_err(rx_priv->dev,
|
||||
dev_err_ratelimited(rx_priv->dev,
|
||||
"%s: rx swr pinctrl disable failed\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
@@ -4460,7 +4466,7 @@ int lpass_cdc_rx_set_fir_capability(struct snd_soc_component *component, bool ca
|
||||
struct lpass_cdc_rx_macro_priv *rx_priv = NULL;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: component is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -155,20 +156,20 @@ static bool lpass_cdc_tx_macro_get_data(struct snd_soc_component *component,
|
||||
{
|
||||
*tx_dev = lpass_cdc_get_device_ptr(component->dev, TX_MACRO);
|
||||
if (!(*tx_dev)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: null device for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
*tx_priv = dev_get_drvdata((*tx_dev));
|
||||
if (!(*tx_priv)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: priv is null for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(*tx_priv)->component) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: tx_priv->component not initialized!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
@@ -184,7 +185,7 @@ static int lpass_cdc_tx_macro_mclk_enable(
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(tx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(tx_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -220,7 +221,7 @@ static int lpass_cdc_tx_macro_mclk_enable(
|
||||
tx_priv->tx_mclk_users++;
|
||||
} else {
|
||||
if (tx_priv->tx_mclk_users <= 0) {
|
||||
dev_err(tx_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(tx_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
tx_priv->tx_mclk_users = 0;
|
||||
goto exit;
|
||||
@@ -285,7 +286,7 @@ static int lpass_cdc_tx_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
ret = lpass_cdc_tx_macro_mclk_enable(tx_priv, 0);
|
||||
break;
|
||||
default:
|
||||
dev_err(tx_priv->dev,
|
||||
dev_err_ratelimited(tx_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -505,7 +506,7 @@ static int lpass_cdc_tx_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
|
||||
mic_sel_reg = LPASS_CDC_TX7_TX_PATH_CFG0;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: e->reg: 0x%x not expected\n",
|
||||
dev_err_ratelimited(component->dev, "%s: e->reg: 0x%x not expected\n",
|
||||
__func__, e->reg);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -612,21 +613,21 @@ static inline int lpass_cdc_tx_macro_path_get(const char *wname,
|
||||
|
||||
path_name = strsep(&widget_name, " ");
|
||||
if (!path_name) {
|
||||
pr_err("%s: Invalid widget name = %s\n",
|
||||
pr_err_ratelimited("%s: Invalid widget name = %s\n",
|
||||
__func__, widget_name);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
path_num_char = strpbrk(path_name, "01234567");
|
||||
if (!path_num_char) {
|
||||
pr_err("%s: tx path index not found\n",
|
||||
pr_err_ratelimited("%s: tx path index not found\n",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
ret = kstrtouint(path_num_char, 10, path_num);
|
||||
if (ret < 0)
|
||||
pr_err("%s: Invalid tx path = %s\n",
|
||||
pr_err_ratelimited("%s: Invalid tx path = %s\n",
|
||||
__func__, w_name);
|
||||
|
||||
err:
|
||||
@@ -1112,7 +1113,7 @@ static int lpass_cdc_tx_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
tx_fs_rate = 7;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: Invalid TX sample rate: %d\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid TX sample rate: %d\n",
|
||||
__func__, params_rate(params));
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1126,7 +1127,7 @@ static int lpass_cdc_tx_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
snd_soc_component_update_bits(component, tx_fs_reg,
|
||||
0x0F, tx_fs_rate);
|
||||
} else {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: ERROR: Invalid decimator: %d\n",
|
||||
__func__, decimator);
|
||||
return -EINVAL;
|
||||
@@ -1154,7 +1155,7 @@ static int lpass_cdc_tx_macro_get_channel_map(struct snd_soc_dai *dai,
|
||||
*tx_num = tx_priv->active_ch_cnt[dai->id];
|
||||
break;
|
||||
default:
|
||||
dev_err(tx_dev, "%s: Invalid AIF\n", __func__);
|
||||
dev_err_ratelimited(tx_dev, "%s: Invalid AIF\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
@@ -51,15 +52,15 @@ static int regmap_bus_read(void *context, const void *reg, size_t reg_size,
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is NULL\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is NULL\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
if (!reg || !val) {
|
||||
dev_err(dev, "%s: reg or val is NULL\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: reg or val is NULL\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
if (reg_size != REG_BYTES) {
|
||||
dev_err(dev, "%s: register size %zd bytes, not supported\n",
|
||||
dev_err_ratelimited(dev, "%s: register size %zd bytes, not supported\n",
|
||||
__func__, reg_size);
|
||||
return ret;
|
||||
}
|
||||
@@ -101,15 +102,15 @@ static int regmap_bus_gather_write(void *context,
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is NULL\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is NULL\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
if (!reg || !val) {
|
||||
dev_err(dev, "%s: reg or val is NULL\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: reg or val is NULL\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
if (reg_size != REG_BYTES) {
|
||||
dev_err(dev, "%s: register size %zd bytes, not supported\n",
|
||||
dev_err_ratelimited(dev, "%s: register size %zd bytes, not supported\n",
|
||||
__func__, reg_size);
|
||||
return ret;
|
||||
}
|
||||
@@ -146,7 +147,7 @@ static int regmap_bus_write(void *context, const void *data, size_t count)
|
||||
return -EINVAL;
|
||||
|
||||
if (count < REG_BYTES) {
|
||||
dev_err(dev, "%s: count %zd bytes < %d, not supported\n",
|
||||
dev_err_ratelimited(dev, "%s: count %zd bytes < %d, not supported\n",
|
||||
__func__, count, REG_BYTES);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -185,13 +186,13 @@ static bool lpass_cdc_va_macro_get_data(struct snd_soc_component *component,
|
||||
{
|
||||
*va_dev = lpass_cdc_get_device_ptr(component->dev, VA_MACRO);
|
||||
if (!(*va_dev)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: null device for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
*va_priv = dev_get_drvdata((*va_dev));
|
||||
if (!(*va_priv) || !(*va_priv)->component) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: priv is null for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
@@ -223,7 +224,7 @@ static int lpass_cdc_va_macro_mclk_enable(
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(va_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(va_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ static int lpass_cdc_va_macro_mclk_enable(
|
||||
if (mclk_enable) {
|
||||
ret = lpass_cdc_va_macro_core_vote(va_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request core vote failed\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
@@ -245,7 +246,7 @@ static int lpass_cdc_va_macro_mclk_enable(
|
||||
true);
|
||||
lpass_cdc_va_macro_core_vote(va_priv, false);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request clock en failed\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
@@ -261,7 +262,7 @@ static int lpass_cdc_va_macro_mclk_enable(
|
||||
va_priv->va_mclk_users++;
|
||||
} else {
|
||||
if (va_priv->va_mclk_users <= 0) {
|
||||
dev_err(va_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(va_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
va_priv->va_mclk_users = 0;
|
||||
goto exit;
|
||||
@@ -271,7 +272,7 @@ static int lpass_cdc_va_macro_mclk_enable(
|
||||
false);
|
||||
ret = lpass_cdc_va_macro_core_vote(va_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request core vote failed\n",
|
||||
__func__);
|
||||
}
|
||||
@@ -315,7 +316,7 @@ static int lpass_cdc_va_macro_event_handler(struct snd_soc_component *component,
|
||||
retry_cnt--;
|
||||
}
|
||||
if (retry_cnt == 0)
|
||||
dev_err(va_dev,
|
||||
dev_err_ratelimited(va_dev,
|
||||
"%s: va_mclk_users non-zero, SSR fail!!\n",
|
||||
__func__);
|
||||
break;
|
||||
@@ -323,7 +324,7 @@ static int lpass_cdc_va_macro_event_handler(struct snd_soc_component *component,
|
||||
/* enable&disable VA_CORE_CLK to reset GFMUX reg */
|
||||
ret = lpass_cdc_va_macro_core_vote(va_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request core vote failed\n",
|
||||
__func__);
|
||||
break;
|
||||
@@ -442,7 +443,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
||||
va_priv->tx_clk_status) {
|
||||
ret = lpass_cdc_va_macro_core_vote(va_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request core vote failed\n",
|
||||
__func__);
|
||||
break;
|
||||
@@ -482,7 +483,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
||||
TX_CORE_CLK,
|
||||
true);
|
||||
if (ret) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: request clock TX_CLK enable failed\n",
|
||||
__func__);
|
||||
if (va_priv->dev_up)
|
||||
@@ -490,7 +491,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
ret = lpass_cdc_va_macro_core_vote(va_priv, true);
|
||||
if (ret < 0) {
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: va request core vote failed\n",
|
||||
__func__);
|
||||
if (va_priv->dev_up)
|
||||
@@ -502,7 +503,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
||||
false);
|
||||
lpass_cdc_va_macro_core_vote(va_priv, false);
|
||||
if (ret) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: request clock VA_CLK disable failed\n",
|
||||
__func__);
|
||||
if (va_priv->dev_up)
|
||||
@@ -516,7 +517,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -594,7 +595,7 @@ static int lpass_cdc_va_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -737,7 +738,7 @@ static int lpass_cdc_va_macro_core_vote(void *handle, bool enable)
|
||||
(struct lpass_cdc_va_macro_priv *) handle;
|
||||
|
||||
if (va_priv == NULL) {
|
||||
pr_err("%s: va priv data is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: va priv data is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
trace_printk("%s, enter: enable %d\n", __func__, enable);
|
||||
@@ -764,7 +765,7 @@ static int lpass_cdc_va_macro_swrm_clock(void *handle, bool enable)
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(va_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(va_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1001,7 +1002,7 @@ static int lpass_cdc_va_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
|
||||
mic_sel_reg = LPASS_CDC_VA_TX3_TX_PATH_CFG0;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: e->reg: 0x%x not expected\n",
|
||||
dev_err_ratelimited(component->dev, "%s: e->reg: 0x%x not expected\n",
|
||||
__func__, e->reg);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1377,7 +1378,7 @@ static int lpass_cdc_va_macro_enable_tx(struct snd_soc_dapm_widget *w,
|
||||
va_priv->dapm_tx_clk_status++;
|
||||
break;
|
||||
default:
|
||||
dev_err(va_priv->dev,
|
||||
dev_err_ratelimited(va_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
@@ -1400,7 +1401,7 @@ static int lpass_cdc_va_macro_enable_micbias(struct snd_soc_dapm_widget *w,
|
||||
return -EINVAL;
|
||||
|
||||
if (!va_priv->micb_supply) {
|
||||
dev_err(va_dev,
|
||||
dev_err_ratelimited(va_dev,
|
||||
"%s:regulator not provided in dtsi\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1412,20 +1413,20 @@ static int lpass_cdc_va_macro_enable_micbias(struct snd_soc_dapm_widget *w,
|
||||
va_priv->micb_voltage,
|
||||
va_priv->micb_voltage);
|
||||
if (ret) {
|
||||
dev_err(va_dev, "%s: Setting voltage failed, err = %d\n",
|
||||
dev_err_ratelimited(va_dev, "%s: Setting voltage failed, err = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
ret = regulator_set_load(va_priv->micb_supply,
|
||||
va_priv->micb_current);
|
||||
if (ret) {
|
||||
dev_err(va_dev, "%s: Setting current failed, err = %d\n",
|
||||
dev_err_ratelimited(va_dev, "%s: Setting current failed, err = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
ret = regulator_enable(va_priv->micb_supply);
|
||||
if (ret) {
|
||||
dev_err(va_dev, "%s: regulator enable failed, err = %d\n",
|
||||
dev_err_ratelimited(va_dev, "%s: regulator enable failed, err = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -1441,7 +1442,7 @@ static int lpass_cdc_va_macro_enable_micbias(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
ret = regulator_disable(va_priv->micb_supply);
|
||||
if (ret) {
|
||||
dev_err(va_dev, "%s: regulator disable failed, err = %d\n",
|
||||
dev_err_ratelimited(va_dev, "%s: regulator disable failed, err = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -1470,21 +1471,21 @@ static inline int lpass_cdc_va_macro_path_get(const char *wname,
|
||||
|
||||
path_name = strsep(&widget_name, " ");
|
||||
if (!path_name) {
|
||||
pr_err("%s: Invalid widget name = %s\n",
|
||||
pr_err_ratelimited("%s: Invalid widget name = %s\n",
|
||||
__func__, widget_name);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
path_num_char = strpbrk(path_name, "01234567");
|
||||
if (!path_num_char) {
|
||||
pr_err("%s: va path index not found\n",
|
||||
pr_err_ratelimited("%s: va path index not found\n",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
ret = kstrtouint(path_num_char, 10, path_num);
|
||||
if (ret < 0)
|
||||
pr_err("%s: Invalid tx path = %s\n",
|
||||
pr_err_ratelimited("%s: Invalid tx path = %s\n",
|
||||
__func__, w_name);
|
||||
|
||||
err:
|
||||
@@ -1585,7 +1586,7 @@ static int lpass_cdc_va_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
tx_fs_rate = 7;
|
||||
break;
|
||||
default:
|
||||
dev_err(va_dev, "%s: Invalid TX sample rate: %d\n",
|
||||
dev_err_ratelimited(va_dev, "%s: Invalid TX sample rate: %d\n",
|
||||
__func__, params_rate(params));
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1599,7 +1600,7 @@ static int lpass_cdc_va_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
snd_soc_component_update_bits(component, tx_fs_reg,
|
||||
0x0F, tx_fs_rate);
|
||||
} else {
|
||||
dev_err(va_dev,
|
||||
dev_err_ratelimited(va_dev,
|
||||
"%s: ERROR: Invalid decimator: %d\n",
|
||||
__func__, decimator);
|
||||
return -EINVAL;
|
||||
@@ -1628,7 +1629,7 @@ static int lpass_cdc_va_macro_get_channel_map(struct snd_soc_dai *dai,
|
||||
*tx_num = va_priv->active_ch_cnt[dai->id];
|
||||
break;
|
||||
default:
|
||||
dev_err(va_dev, "%s: Invalid AIF\n", __func__);
|
||||
dev_err_ratelimited(va_dev, "%s: Invalid AIF\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -516,13 +516,13 @@ static bool lpass_cdc_wsa_macro_get_data(struct snd_soc_component *component,
|
||||
*wsa_dev = lpass_cdc_get_device_ptr(component->dev,
|
||||
WSA_MACRO);
|
||||
if (!(*wsa_dev)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: null device for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
*wsa_priv = dev_get_drvdata((*wsa_dev));
|
||||
if (!(*wsa_priv) || !(*wsa_priv)->component) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: priv is null for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ static int lpass_cdc_wsa_macro_set_prim_interpolator_rate(struct snd_soc_dai *da
|
||||
int_1_mix1_inp = port;
|
||||
if ((int_1_mix1_inp < LPASS_CDC_WSA_MACRO_RX0) ||
|
||||
(int_1_mix1_inp > LPASS_CDC_WSA_MACRO_RX_MIX1)) {
|
||||
dev_err(wsa_dev,
|
||||
dev_err_ratelimited(wsa_dev,
|
||||
"%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
@@ -647,7 +647,7 @@ static int lpass_cdc_wsa_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai
|
||||
int_2_inp = port;
|
||||
if ((int_2_inp < LPASS_CDC_WSA_MACRO_RX0) ||
|
||||
(int_2_inp > LPASS_CDC_WSA_MACRO_RX_MIX1)) {
|
||||
dev_err(wsa_dev,
|
||||
dev_err_ratelimited(wsa_dev,
|
||||
"%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
@@ -744,7 +744,7 @@ static int lpass_cdc_wsa_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
case SNDRV_PCM_STREAM_PLAYBACK:
|
||||
ret = lpass_cdc_wsa_macro_set_interpolator_rate(dai, params_rate(params));
|
||||
if (ret) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: cannot set sample rate: %u\n",
|
||||
__func__, params_rate(params));
|
||||
return ret;
|
||||
@@ -760,7 +760,7 @@ static int lpass_cdc_wsa_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
wsa_priv->bit_width[dai->id] = 32;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: Invalid format 0x%x\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid format 0x%x\n",
|
||||
__func__, params_width(params));
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -776,7 +776,7 @@ static int lpass_cdc_wsa_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
wsa_priv->bit_width[dai->id] = 24;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: Invalid format 0x%x\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid format 0x%x\n",
|
||||
__func__, params_width(params));
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -835,7 +835,7 @@ static int lpass_cdc_wsa_macro_get_channel_map(struct snd_soc_dai *dai,
|
||||
*tx_num = cnt;
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa_dev, "%s: Invalid AIF\n", __func__);
|
||||
dev_err_ratelimited(wsa_dev, "%s: Invalid AIF\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -901,7 +901,7 @@ static int lpass_cdc_wsa_macro_mclk_enable(
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(wsa_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(wsa_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -940,7 +940,7 @@ static int lpass_cdc_wsa_macro_mclk_enable(
|
||||
wsa_priv->wsa_mclk_users++;
|
||||
} else {
|
||||
if (wsa_priv->wsa_mclk_users <= 0) {
|
||||
dev_err(wsa_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(wsa_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
wsa_priv->wsa_mclk_users = 0;
|
||||
goto exit;
|
||||
@@ -995,7 +995,7 @@ static int lpass_cdc_wsa_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa_priv->dev,
|
||||
dev_err_ratelimited(wsa_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -1272,7 +1272,7 @@ static int lpass_cdc_wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
|
||||
} else if (!(strcmp(w->name, "WSA_RX1 MIX INP"))) {
|
||||
gain_reg = LPASS_CDC_WSA_RX1_RX_VOL_MIX_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: No gain register avail for %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: No gain register avail for %s\n",
|
||||
__func__, w->name);
|
||||
return 0;
|
||||
}
|
||||
@@ -1740,7 +1740,7 @@ static int lpass_cdc_wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w
|
||||
} else if (!(strcmp(w->name, "WSA_RX INT1 INTERP"))) {
|
||||
reg = LPASS_CDC_WSA_RX1_RX_PATH_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: Interpolator reg not found\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Interpolator reg not found\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1826,7 +1826,7 @@ static int lpass_cdc_wsa_macro_spk_boost_event(struct snd_soc_dapm_widget *w,
|
||||
reg = LPASS_CDC_WSA_RX1_RX_PATH_CTL;
|
||||
reg_mix = LPASS_CDC_WSA_RX1_RX_PATH_MIX_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: unknown widget: %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: unknown widget: %s\n",
|
||||
__func__, w->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1991,7 +1991,7 @@ static int lpass_cdc_wsa_macro_enable_vbat(struct snd_soc_dapm_widget *w,
|
||||
LPASS_CDC_WSA_VBAT_BCL_VBAT_PATH_CTL, 0x10, 0x00);
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
dev_err_ratelimited(wsa_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -2020,7 +2020,7 @@ static int lpass_cdc_wsa_macro_enable_echo(struct snd_soc_dapm_widget *w,
|
||||
ec_tx = ((val & 0x38) >> 0x3) - 1;
|
||||
|
||||
if (ec_tx < 0 || ec_tx >= (LPASS_CDC_WSA_MACRO_RX1 + 1)) {
|
||||
dev_err(wsa_dev, "%s: EC mix control not set correctly\n",
|
||||
dev_err_ratelimited(wsa_dev, "%s: EC mix control not set correctly\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2136,7 +2136,7 @@ static int lpass_cdc_wsa_macro_set_rx_mute_status(struct snd_kcontrol *kcontrol,
|
||||
0x10, value << 4);
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: invalid argument rx_shift = %d\n", __func__,
|
||||
pr_err_ratelimited("%s: invalid argument rx_shift = %d\n", __func__,
|
||||
wsa_rx_shift);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -2166,7 +2166,7 @@ static int lpass_cdc_wsa_macro_set_digital_volume(struct snd_kcontrol *kcontrol,
|
||||
return -EINVAL;
|
||||
|
||||
if (!wsa_priv) {
|
||||
pr_err("%s: priv is null for macro!\n",
|
||||
pr_err_ratelimited("%s: priv is null for macro!\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2186,7 +2186,7 @@ static int lpass_cdc_wsa_macro_set_digital_volume(struct snd_kcontrol *kcontrol,
|
||||
gain = (u8)(wsa_priv->rx1_origin_gain -
|
||||
wsa_priv->thermal_cur_state);
|
||||
} else {
|
||||
dev_err(wsa_priv->dev,
|
||||
dev_err_ratelimited(wsa_priv->dev,
|
||||
"%s: Incorrect RX Path selected\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2400,11 +2400,11 @@ static int lpass_cdc_wsa_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
|
||||
aif_rst = wsa_priv->rx_port_value[widget->shift];
|
||||
if (!rx_port_value) {
|
||||
if (aif_rst == 0) {
|
||||
dev_err(wsa_dev, "%s: AIF reset already\n", __func__);
|
||||
dev_err_ratelimited(wsa_dev, "%s: AIF reset already\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
if (aif_rst >= LPASS_CDC_WSA_MACRO_RX_MAX) {
|
||||
dev_err(wsa_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
dev_err_ratelimited(wsa_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2431,7 +2431,7 @@ static int lpass_cdc_wsa_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
|
||||
wsa_priv->active_ch_cnt[rx_port_value]++;
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa_dev,
|
||||
dev_err_ratelimited(wsa_dev,
|
||||
"%s: Invalid AIF_ID for WSA RX MUX %d\n",
|
||||
__func__, rx_port_value);
|
||||
return -EINVAL;
|
||||
@@ -3178,7 +3178,7 @@ static int lpass_cdc_wsa_macro_core_vote(void *handle, bool enable)
|
||||
struct lpass_cdc_wsa_macro_priv *wsa_priv = (struct lpass_cdc_wsa_macro_priv *) handle;
|
||||
|
||||
if (wsa_priv == NULL) {
|
||||
pr_err("%s: wsa priv data is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: wsa priv data is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (enable) {
|
||||
@@ -3202,7 +3202,7 @@ static int wsa_swrm_clock(void *handle, bool enable)
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(wsa_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(wsa_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3258,7 +3258,7 @@ static int wsa_swrm_clock(void *handle, bool enable)
|
||||
pm_runtime_put_autosuspend(wsa_priv->dev);
|
||||
} else {
|
||||
if (wsa_priv->swr_clk_users <= 0) {
|
||||
dev_err(wsa_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(wsa_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
wsa_priv->swr_clk_users = 0;
|
||||
goto exit;
|
||||
@@ -3296,7 +3296,7 @@ static int lpass_cdc_wsa_macro_get_max_state(
|
||||
{
|
||||
struct lpass_cdc_wsa_macro_priv *wsa_priv = cdev->devdata;
|
||||
if (!wsa_priv) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
*state = wsa_priv->thermal_max_state;
|
||||
@@ -3311,7 +3311,7 @@ static int lpass_cdc_wsa_macro_get_cur_state(
|
||||
struct lpass_cdc_wsa_macro_priv *wsa_priv = cdev->devdata;
|
||||
|
||||
if (!wsa_priv) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
*state = wsa_priv->thermal_cur_state;
|
||||
@@ -3327,14 +3327,14 @@ static int lpass_cdc_wsa_macro_set_cur_state(
|
||||
struct lpass_cdc_wsa_macro_priv *wsa_priv = cdev->devdata;
|
||||
|
||||
if (!wsa_priv || !wsa_priv->dev) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (state <= wsa_priv->thermal_max_state) {
|
||||
wsa_priv->thermal_cur_state = state;
|
||||
} else {
|
||||
dev_err(wsa_priv->dev,
|
||||
dev_err_ratelimited(wsa_priv->dev,
|
||||
"%s: incorrect requested state:%d\n",
|
||||
__func__, state);
|
||||
return -EINVAL;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -496,13 +497,13 @@ static bool lpass_cdc_wsa2_macro_get_data(struct snd_soc_component *component,
|
||||
*wsa2_dev = lpass_cdc_get_device_ptr(component->dev,
|
||||
WSA2_MACRO);
|
||||
if (!(*wsa2_dev)) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: null device for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
*wsa2_priv = dev_get_drvdata((*wsa2_dev));
|
||||
if (!(*wsa2_priv) || !(*wsa2_priv)->component) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: priv is null for macro!\n", func_name);
|
||||
return false;
|
||||
}
|
||||
@@ -555,7 +556,7 @@ static int lpass_cdc_wsa2_macro_set_prim_interpolator_rate(struct snd_soc_dai *d
|
||||
int_1_mix1_inp = port;
|
||||
if ((int_1_mix1_inp < LPASS_CDC_WSA2_MACRO_RX0) ||
|
||||
(int_1_mix1_inp > LPASS_CDC_WSA2_MACRO_RX_MIX1)) {
|
||||
dev_err(wsa2_dev,
|
||||
dev_err_ratelimited(wsa2_dev,
|
||||
"%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
@@ -627,7 +628,7 @@ static int lpass_cdc_wsa2_macro_set_mix_interpolator_rate(struct snd_soc_dai *da
|
||||
int_2_inp = port;
|
||||
if ((int_2_inp < LPASS_CDC_WSA2_MACRO_RX0) ||
|
||||
(int_2_inp > LPASS_CDC_WSA2_MACRO_RX_MIX1)) {
|
||||
dev_err(wsa2_dev,
|
||||
dev_err_ratelimited(wsa2_dev,
|
||||
"%s: Invalid RX port, Dai ID is %d\n",
|
||||
__func__, dai->id);
|
||||
return -EINVAL;
|
||||
@@ -724,7 +725,7 @@ static int lpass_cdc_wsa2_macro_hw_params(struct snd_pcm_substream *substream,
|
||||
case SNDRV_PCM_STREAM_PLAYBACK:
|
||||
ret = lpass_cdc_wsa2_macro_set_interpolator_rate(dai, params_rate(params));
|
||||
if (ret) {
|
||||
dev_err(component->dev,
|
||||
dev_err_ratelimited(component->dev,
|
||||
"%s: cannot set sample rate: %u\n",
|
||||
__func__, params_rate(params));
|
||||
return ret;
|
||||
@@ -790,7 +791,7 @@ static int lpass_cdc_wsa2_macro_get_channel_map(struct snd_soc_dai *dai,
|
||||
*tx_num = cnt;
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa2_dev, "%s: Invalid AIF\n", __func__);
|
||||
dev_err_ratelimited(wsa2_dev, "%s: Invalid AIF\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -856,7 +857,7 @@ static int lpass_cdc_wsa2_macro_mclk_enable(
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(wsa2_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(wsa2_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -895,7 +896,7 @@ static int lpass_cdc_wsa2_macro_mclk_enable(
|
||||
wsa2_priv->wsa2_mclk_users++;
|
||||
} else {
|
||||
if (wsa2_priv->wsa2_mclk_users <= 0) {
|
||||
dev_err(wsa2_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(wsa2_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
wsa2_priv->wsa2_mclk_users = 0;
|
||||
goto exit;
|
||||
@@ -950,7 +951,7 @@ static int lpass_cdc_wsa2_macro_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa2_priv->dev,
|
||||
dev_err_ratelimited(wsa2_priv->dev,
|
||||
"%s: invalid DAPM event %d\n", __func__, event);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -1227,7 +1228,7 @@ static int lpass_cdc_wsa2_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
|
||||
} else if (!(strcmp(w->name, "WSA2_RX1 MIX INP"))) {
|
||||
gain_reg = LPASS_CDC_WSA2_RX1_RX_VOL_MIX_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: No gain register avail for %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: No gain register avail for %s\n",
|
||||
__func__, w->name);
|
||||
return 0;
|
||||
}
|
||||
@@ -1547,7 +1548,7 @@ static int lpass_cdc_wsa2_macro_enable_interpolator(struct snd_soc_dapm_widget *
|
||||
} else if (!(strcmp(w->name, "WSA2_RX INT1 INTERP"))) {
|
||||
reg = LPASS_CDC_WSA2_RX1_RX_PATH_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: Interpolator reg not found\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Interpolator reg not found\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1627,7 +1628,7 @@ static int lpass_cdc_wsa2_macro_spk_boost_event(struct snd_soc_dapm_widget *w,
|
||||
reg = LPASS_CDC_WSA2_RX1_RX_PATH_CTL;
|
||||
reg_mix = LPASS_CDC_WSA2_RX1_RX_PATH_MIX_CTL;
|
||||
} else {
|
||||
dev_err(component->dev, "%s: unknown widget: %s\n",
|
||||
dev_err_ratelimited(component->dev, "%s: unknown widget: %s\n",
|
||||
__func__, w->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1792,7 +1793,7 @@ static int lpass_cdc_wsa2_macro_enable_vbat(struct snd_soc_dapm_widget *w,
|
||||
LPASS_CDC_WSA2_VBAT_BCL_VBAT_PATH_CTL, 0x10, 0x00);
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa2_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
dev_err_ratelimited(wsa2_dev, "%s: Invalid event %d\n", __func__, event);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1821,7 +1822,7 @@ static int lpass_cdc_wsa2_macro_enable_echo(struct snd_soc_dapm_widget *w,
|
||||
ec_tx = ((val & 0x38) >> 0x3) - 1;
|
||||
|
||||
if (ec_tx < 0 || ec_tx >= (LPASS_CDC_WSA2_MACRO_RX1 + 1)) {
|
||||
dev_err(wsa2_dev, "%s: EC mix control not set correctly\n",
|
||||
dev_err_ratelimited(wsa2_dev, "%s: EC mix control not set correctly\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1937,7 +1938,7 @@ static int lpass_cdc_wsa2_macro_set_rx_mute_status(struct snd_kcontrol *kcontrol
|
||||
0x10, value << 4);
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: invalid argument rx_shift = %d\n", __func__,
|
||||
pr_err_ratelimited("%s: invalid argument rx_shift = %d\n", __func__,
|
||||
wsa2_rx_shift);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
@@ -1967,7 +1968,7 @@ static int lpass_cdc_wsa2_macro_set_digital_volume(struct snd_kcontrol *kcontrol
|
||||
return -EINVAL;
|
||||
|
||||
if (!wsa2_priv) {
|
||||
pr_err("%s: priv is null for macro!\n",
|
||||
pr_err_ratelimited("%s: priv is null for macro!\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1987,7 +1988,7 @@ static int lpass_cdc_wsa2_macro_set_digital_volume(struct snd_kcontrol *kcontrol
|
||||
gain = (u8)(wsa2_priv->rx1_origin_gain -
|
||||
wsa2_priv->thermal_cur_state);
|
||||
} else {
|
||||
dev_err(wsa2_priv->dev,
|
||||
dev_err_ratelimited(wsa2_priv->dev,
|
||||
"%s: Incorrect RX Path selected\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2168,11 +2169,11 @@ static int lpass_cdc_wsa2_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
|
||||
aif_rst = wsa2_priv->rx_port_value[widget->shift];
|
||||
if (!rx_port_value) {
|
||||
if (aif_rst == 0) {
|
||||
dev_err(wsa2_dev, "%s: AIF reset already\n", __func__);
|
||||
dev_err_ratelimited(wsa2_dev, "%s: AIF reset already\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
if (aif_rst >= LPASS_CDC_WSA2_MACRO_RX_MAX) {
|
||||
dev_err(wsa2_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
dev_err_ratelimited(wsa2_dev, "%s: Invalid AIF reset\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2199,7 +2200,7 @@ static int lpass_cdc_wsa2_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
|
||||
wsa2_priv->active_ch_cnt[rx_port_value]++;
|
||||
break;
|
||||
default:
|
||||
dev_err(wsa2_dev,
|
||||
dev_err_ratelimited(wsa2_dev,
|
||||
"%s: Invalid AIF_ID for WSA2 RX MUX %d\n",
|
||||
__func__, rx_port_value);
|
||||
return -EINVAL;
|
||||
@@ -2754,7 +2755,7 @@ static int lpass_cdc_wsa2_macro_core_vote(void *handle, bool enable)
|
||||
struct lpass_cdc_wsa2_macro_priv *wsa2_priv = (struct lpass_cdc_wsa2_macro_priv *) handle;
|
||||
|
||||
if (wsa2_priv == NULL) {
|
||||
pr_err("%s: wsa2 priv data is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: wsa2 priv data is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (enable) {
|
||||
@@ -2777,7 +2778,7 @@ static int wsa2_swrm_clock(void *handle, bool enable)
|
||||
int ret = 0;
|
||||
|
||||
if (regmap == NULL) {
|
||||
dev_err(wsa2_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
dev_err_ratelimited(wsa2_priv->dev, "%s: regmap is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -2833,7 +2834,7 @@ static int wsa2_swrm_clock(void *handle, bool enable)
|
||||
pm_runtime_put_autosuspend(wsa2_priv->dev);
|
||||
} else {
|
||||
if (wsa2_priv->swr_clk_users <= 0) {
|
||||
dev_err(wsa2_priv->dev, "%s: clock already disabled\n",
|
||||
dev_err_ratelimited(wsa2_priv->dev, "%s: clock already disabled\n",
|
||||
__func__);
|
||||
wsa2_priv->swr_clk_users = 0;
|
||||
goto exit;
|
||||
@@ -2871,7 +2872,7 @@ static int lpass_cdc_wsa2_macro_get_max_state(
|
||||
{
|
||||
struct lpass_cdc_wsa2_macro_priv *wsa2_priv = cdev->devdata;
|
||||
if (!wsa2_priv) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
*state = wsa2_priv->thermal_max_state;
|
||||
@@ -2886,7 +2887,7 @@ static int lpass_cdc_wsa2_macro_get_cur_state(
|
||||
struct lpass_cdc_wsa2_macro_priv *wsa2_priv = cdev->devdata;
|
||||
|
||||
if (!wsa2_priv) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
*state = wsa2_priv->thermal_cur_state;
|
||||
@@ -2902,14 +2903,14 @@ static int lpass_cdc_wsa2_macro_set_cur_state(
|
||||
struct lpass_cdc_wsa2_macro_priv *wsa2_priv = cdev->devdata;
|
||||
|
||||
if (!wsa2_priv || !wsa2_priv->dev) {
|
||||
pr_err("%s: cdev->devdata is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: cdev->devdata is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (state <= wsa2_priv->thermal_max_state) {
|
||||
wsa2_priv->thermal_cur_state = state;
|
||||
} else {
|
||||
dev_err(wsa2_priv->dev,
|
||||
dev_err_ratelimited(wsa2_priv->dev,
|
||||
"%s: incorrect requested state:%d\n",
|
||||
__func__, state);
|
||||
return -EINVAL;
|
||||
@@ -3119,12 +3120,12 @@ static void lpass_cdc_wsa2_macro_cooling_adjust_gain(struct work_struct *work)
|
||||
wsa2_priv = container_of(work, struct lpass_cdc_wsa2_macro_priv,
|
||||
lpass_cdc_wsa2_macro_cooling_work);
|
||||
if (!wsa2_priv) {
|
||||
pr_err("%s: priv is null for macro!\n",
|
||||
pr_err_ratelimited("%s: priv is null for macro!\n",
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
if (!wsa2_priv->dev || !wsa2_priv->dev->of_node) {
|
||||
dev_err(wsa2_priv->dev,
|
||||
dev_err_ratelimited(wsa2_priv->dev,
|
||||
"%s: DT node for wsa2_priv does not exist\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/of_platform.h>
|
||||
@@ -55,7 +56,7 @@ int lpass_cdc_set_port_map(struct snd_soc_component *component,
|
||||
return -EINVAL;
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(priv->dev)) {
|
||||
dev_err(priv->dev, "%s: invalid codec\n", __func__);
|
||||
dev_err_ratelimited(priv->dev, "%s: invalid codec\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
map = (struct swr_mstr_port_map *)data;
|
||||
@@ -164,7 +165,7 @@ static int lpass_cdc_update_wcd_event(void *handle, u16 event, u32 data)
|
||||
struct lpass_cdc_priv *priv = (struct lpass_cdc_priv *)handle;
|
||||
|
||||
if (!priv) {
|
||||
pr_err("%s:Invalid lpass_cdc priv handle\n", __func__);
|
||||
pr_err_ratelimited("%s:Invalid lpass_cdc priv handle\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -219,7 +220,7 @@ static int lpass_cdc_update_wcd_event(void *handle, u16 event, u32 data)
|
||||
LPASS_CDC_MACRO_EVT_HPHR_HD2_ENABLE, data);
|
||||
break;
|
||||
default:
|
||||
dev_err(priv->dev, "%s: Invalid event %d trigger from wcd\n",
|
||||
dev_err_ratelimited(priv->dev, "%s: Invalid event %d trigger from wcd\n",
|
||||
__func__, event);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -233,7 +234,7 @@ static int lpass_cdc_register_notifier(void *handle,
|
||||
struct lpass_cdc_priv *priv = (struct lpass_cdc_priv *)handle;
|
||||
|
||||
if (!priv) {
|
||||
pr_err("%s: lpass_cdc priv is null\n", __func__);
|
||||
pr_err_ratelimited("%s: lpass_cdc priv is null\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (enable)
|
||||
@@ -323,17 +324,17 @@ struct device *lpass_cdc_get_device_ptr(struct device *dev, u16 macro_id)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is null\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(dev)) {
|
||||
pr_err("%s: invalid codec\n", __func__);
|
||||
pr_err_ratelimited("%s: invalid codec\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
priv = dev_get_drvdata(dev);
|
||||
if (!priv || (macro_id >= MAX_MACRO)) {
|
||||
dev_err(dev, "%s: priv is null or invalid macro\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null or invalid macro\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -353,17 +354,17 @@ struct device *lpass_cdc_get_rsc_clk_device_ptr(struct device *dev)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is null\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(dev)) {
|
||||
pr_err("%s: invalid codec\n", __func__);
|
||||
pr_err_ratelimited("%s: invalid codec\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
priv = dev_get_drvdata(dev);
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is null\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -413,17 +414,17 @@ int lpass_cdc_register_res_clk(struct device *dev, rsc_clk_cb_t rsc_clk_cb)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev || !rsc_clk_cb) {
|
||||
pr_err("%s: dev or rsc_clk_cb is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev or rsc_clk_cb is null\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!lpass_cdc_is_valid_child_dev(dev)) {
|
||||
dev_err(dev, "%s: child device :%pK not added yet\n",
|
||||
dev_err_ratelimited(dev, "%s: child device :%pK not added yet\n",
|
||||
__func__, dev);
|
||||
return -EINVAL;
|
||||
}
|
||||
priv = dev_get_drvdata(dev->parent);
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is null\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -444,17 +445,17 @@ void lpass_cdc_unregister_res_clk(struct device *dev)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (!lpass_cdc_is_valid_child_dev(dev)) {
|
||||
dev_err(dev, "%s: child device :%pK not added\n",
|
||||
dev_err_ratelimited(dev, "%s: child device :%pK not added\n",
|
||||
__func__, dev);
|
||||
return;
|
||||
}
|
||||
priv = dev_get_drvdata(dev->parent);
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is null\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -523,7 +524,7 @@ int lpass_cdc_dmic_clk_enable(struct snd_soc_component *component,
|
||||
freq_change_mask = 0x08;
|
||||
break;
|
||||
default:
|
||||
dev_err(component->dev, "%s: Invalid DMIC Selection\n",
|
||||
dev_err_ratelimited(component->dev, "%s: Invalid DMIC Selection\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -591,17 +592,17 @@ bool lpass_cdc_is_va_macro_registered(struct device *dev)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is null\n", __func__);
|
||||
return false;
|
||||
}
|
||||
if (!lpass_cdc_is_valid_child_dev(dev)) {
|
||||
dev_err(dev, "%s: child device calling is not added yet\n",
|
||||
dev_err_ratelimited(dev, "%s: child device calling is not added yet\n",
|
||||
__func__);
|
||||
return false;
|
||||
}
|
||||
priv = dev_get_drvdata(dev->parent);
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is null\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null\n", __func__);
|
||||
return false;
|
||||
}
|
||||
return priv->macros_supported[VA_MACRO];
|
||||
@@ -703,17 +704,17 @@ void lpass_cdc_unregister_macro(struct device *dev, u16 macro_id)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (!lpass_cdc_is_valid_child_dev(dev)) {
|
||||
dev_err(dev, "%s: macro:%d not in valid registered macro-list\n",
|
||||
dev_err_ratelimited(dev, "%s: macro:%d not in valid registered macro-list\n",
|
||||
__func__, macro_id);
|
||||
return;
|
||||
}
|
||||
priv = dev_get_drvdata(dev->parent);
|
||||
if (!priv || (macro_id >= MAX_MACRO)) {
|
||||
dev_err(dev, "%s: priv is null or invalid macro\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null or invalid macro\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -744,17 +745,17 @@ void lpass_cdc_wsa_pa_on(struct device *dev, bool adie_lb)
|
||||
struct lpass_cdc_priv *priv;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null\n", __func__);
|
||||
pr_err_ratelimited("%s: dev is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (!lpass_cdc_is_valid_child_dev(dev)) {
|
||||
dev_err(dev, "%s: not a valid child dev\n",
|
||||
dev_err_ratelimited(dev, "%s: not a valid child dev\n",
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
priv = dev_get_drvdata(dev->parent);
|
||||
if (!priv) {
|
||||
dev_err(dev, "%s: priv is null\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: priv is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (adie_lb)
|
||||
@@ -800,7 +801,7 @@ static ssize_t lpass_cdc_version_read(struct snd_info_entry *entry,
|
||||
|
||||
priv = (struct lpass_cdc_priv *) entry->private_data;
|
||||
if (!priv) {
|
||||
pr_err("%s: lpass_cdc priv is null\n", __func__);
|
||||
pr_err_ratelimited("%s: lpass_cdc priv is null\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -974,7 +975,7 @@ int lpass_cdc_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
"version",
|
||||
priv->entry);
|
||||
if (!version_entry) {
|
||||
dev_err(component->dev, "%s: failed to create lpass_cdc version entry\n",
|
||||
dev_err_ratelimited(component->dev, "%s: failed to create lpass_cdc version entry\n",
|
||||
__func__);
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
@@ -1017,7 +1018,7 @@ int lpass_cdc_register_wake_irq(struct snd_soc_component *component,
|
||||
return -EINVAL;
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(priv->dev)) {
|
||||
dev_err(component->dev, "%s: invalid codec\n", __func__);
|
||||
dev_err_ratelimited(component->dev, "%s: invalid codec\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1051,7 +1052,7 @@ int lpass_cdc_tx_mclk_enable(struct snd_soc_component *component,
|
||||
return -EINVAL;
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(priv->dev)) {
|
||||
dev_err(component->dev, "%s: invalid codec\n", __func__);
|
||||
dev_err_ratelimited(component->dev, "%s: invalid codec\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1086,7 +1087,7 @@ int lpass_cdc_register_event_listener(struct snd_soc_component *component,
|
||||
return -EINVAL;
|
||||
|
||||
if (!lpass_cdc_is_valid_codec_dev(priv->dev)) {
|
||||
dev_err(component->dev, "%s: invalid codec\n", __func__);
|
||||
dev_err_ratelimited(component->dev, "%s: invalid codec\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1384,7 +1385,7 @@ int lpass_cdc_runtime_resume(struct device *dev)
|
||||
if (priv->core_hw_vote_count == 0) {
|
||||
ret = digital_cdc_rsc_mgr_hw_vote_enable(priv->lpass_core_hw_vote);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "%s:lpass core hw enable failed\n",
|
||||
dev_err_ratelimited(dev, "%s:lpass core hw enable failed\n",
|
||||
__func__);
|
||||
goto audio_vote;
|
||||
}
|
||||
@@ -1402,7 +1403,7 @@ audio_vote:
|
||||
if (priv->core_audio_vote_count == 0) {
|
||||
ret = digital_cdc_rsc_mgr_hw_vote_enable(priv->lpass_audio_hw_vote);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
||||
dev_err_ratelimited(dev, "%s:lpass audio hw enable failed\n",
|
||||
__func__);
|
||||
goto done;
|
||||
}
|
||||
|
Referencia en una nueva incidencia
Block a user