ASoC: rk817: Move dbg message into CONFIG_SND_DEBUG

$ ./scripts/bloat-o-meter rk817_codec.o.old rk817_codec.o
add/remove: 0/3 grow/shrink: 0/15 up/down: 0/-1680 (-1680)
Function                                     old     new   delta
dbg_enable                                     4       -      -4
__param_dbg_level                             20       -     -20
__param_str_dbg_level                         24       -     -24
rk817_probe                                  328     284     -44
rk817_remove                                 156     108     -48
rk817_set_dai_sysclk                          76      24     -52
rk817_platform_shutdown                       84      32     -52
rk817_playback_path_get                       84      28     -56
rk817_capture_path_put                       504     444     -60
rk817_hw_params                              464     396     -68
rk817_digital_mute                           384     308     -76
rk817_playback_path_put                      880     788     -92
rk817_codec_ctl_gpio                         188      96     -92
rk817_set_dai_fmt                            196      92    -104
rk817_codec_power_up                         416     292    -124
rk817_codec_power_down                       460     336    -124
__func__                                     310      94    -216
rk817_platform_probe                        1304     880    -424
Total: Before=8618, After=6938, chg -19.49%

Change-Id: I98471c52ea342672e10deb02c4fb38d9fb82f906
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
Sugar Zhang
2021-08-18 15:25:05 +08:00
committed by Tao Huang
parent 2a4f54dcf3
commit cb8e6654bb

View File

@@ -26,15 +26,11 @@
#include <sound/soc.h>
#include "rk817_codec.h"
static int dbg_enable;
module_param_named(dbg_level, dbg_enable, int, 0644);
#define DBG(args...) \
do { \
if (dbg_enable) { \
pr_info(args); \
} \
} while (0)
#ifdef CONFIG_SND_DEBUG
#define DBG(args...) pr_info(args)
#else
#define DBG(args...)
#endif
/* For route */
#define RK817_CODEC_PLAYBACK 1
@@ -830,14 +826,12 @@ static int rk817_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component = rtd->codec_dai->component;
struct rk817_codec_priv *rk817 = snd_soc_component_get_drvdata(component);
unsigned int rate = params_rate(params);
unsigned char apll_cfg3_val;
unsigned char dtop_digen_sr_lmt0;
unsigned char dtop_digen_clke;
DBG("%s : MCLK = %dHz, sample rate = %dHz\n",
__func__, rk817->stereo_sysclk, rate);
DBG("%s : sample rate = %dHz\n", __func__, rate);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dtop_digen_clke = DAC_DIG_CLK_EN;