Commit 99081589 authored by Caesar Wang's avatar Caesar Wang Committed by Mark Brown

ASoC: rt5616: trivial: fix the typo

This patch try to fix the trivial typo.

Run "scripts/checkpatch.pl -f --subjective xxx"
The enable more subjective tests.
Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent dcaee813
...@@ -53,6 +53,7 @@ static const struct reg_sequence init_list[] = { ...@@ -53,6 +53,7 @@ static const struct reg_sequence init_list[] = {
{RT5616_PR_BASE + 0x21, 0x4040}, {RT5616_PR_BASE + 0x21, 0x4040},
{RT5616_PR_BASE + 0x23, 0x0004}, {RT5616_PR_BASE + 0x23, 0x0004},
}; };
#define RT5616_INIT_REG_LEN ARRAY_SIZE(init_list) #define RT5616_INIT_REG_LEN ARRAY_SIZE(init_list)
static const struct reg_default rt5616_reg[] = { static const struct reg_default rt5616_reg[] = {
...@@ -162,10 +163,9 @@ static bool rt5616_volatile_register(struct device *dev, unsigned int reg) ...@@ -162,10 +163,9 @@ static bool rt5616_volatile_register(struct device *dev, unsigned int reg)
for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) { for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) {
if (reg >= rt5616_ranges[i].range_min && if (reg >= rt5616_ranges[i].range_min &&
reg <= rt5616_ranges[i].range_max) { reg <= rt5616_ranges[i].range_max)
return true; return true;
} }
}
switch (reg) { switch (reg) {
case RT5616_RESET: case RT5616_RESET:
...@@ -190,10 +190,9 @@ static bool rt5616_readable_register(struct device *dev, unsigned int reg) ...@@ -190,10 +190,9 @@ static bool rt5616_readable_register(struct device *dev, unsigned int reg)
for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) { for (i = 0; i < ARRAY_SIZE(rt5616_ranges); i++) {
if (reg >= rt5616_ranges[i].range_min && if (reg >= rt5616_ranges[i].range_min &&
reg <= rt5616_ranges[i].range_max) { reg <= rt5616_ranges[i].range_max)
return true; return true;
} }
}
switch (reg) { switch (reg) {
case RT5616_RESET: case RT5616_RESET:
...@@ -533,9 +532,10 @@ static int rt5616_charge_pump_event(struct snd_soc_dapm_widget *w, ...@@ -533,9 +532,10 @@ static int rt5616_charge_pump_event(struct snd_soc_dapm_widget *w,
RT5616_HP_L_SMT_DIS | RT5616_HP_R_SMT_DIS); RT5616_HP_L_SMT_DIS | RT5616_HP_R_SMT_DIS);
/* headphone amp power down */ /* headphone amp power down */
snd_soc_update_bits(codec, RT5616_DEPOP_M1, snd_soc_update_bits(codec, RT5616_DEPOP_M1,
RT5616_SMT_TRIG_MASK | RT5616_HP_CD_PD_MASK | RT5616_SMT_TRIG_MASK |
RT5616_HP_CO_MASK | RT5616_HP_CP_MASK | RT5616_HP_CD_PD_MASK | RT5616_HP_CO_MASK |
RT5616_HP_SG_MASK | RT5616_HP_CB_MASK, RT5616_HP_CP_MASK | RT5616_HP_SG_MASK |
RT5616_HP_CB_MASK,
RT5616_SMT_TRIG_DIS | RT5616_HP_CD_PD_EN | RT5616_SMT_TRIG_DIS | RT5616_HP_CD_PD_EN |
RT5616_HP_CO_DIS | RT5616_HP_CP_PD | RT5616_HP_CO_DIS | RT5616_HP_CP_PD |
RT5616_HP_SG_EN | RT5616_HP_CB_PD); RT5616_HP_SG_EN | RT5616_HP_CB_PD);
...@@ -561,9 +561,9 @@ static int rt5616_hp_event(struct snd_soc_dapm_widget *w, ...@@ -561,9 +561,9 @@ static int rt5616_hp_event(struct snd_soc_dapm_widget *w,
snd_soc_update_bits(codec, RT5616_DEPOP_M3, snd_soc_update_bits(codec, RT5616_DEPOP_M3,
RT5616_CP_FQ1_MASK | RT5616_CP_FQ2_MASK | RT5616_CP_FQ1_MASK | RT5616_CP_FQ2_MASK |
RT5616_CP_FQ3_MASK, RT5616_CP_FQ3_MASK,
(RT5616_CP_FQ_192_KHZ << RT5616_CP_FQ1_SFT) | RT5616_CP_FQ_192_KHZ << RT5616_CP_FQ1_SFT |
(RT5616_CP_FQ_12_KHZ << RT5616_CP_FQ2_SFT) | RT5616_CP_FQ_12_KHZ << RT5616_CP_FQ2_SFT |
(RT5616_CP_FQ_192_KHZ << RT5616_CP_FQ3_SFT)); RT5616_CP_FQ_192_KHZ << RT5616_CP_FQ3_SFT);
snd_soc_write(codec, RT5616_PR_BASE + snd_soc_write(codec, RT5616_PR_BASE +
RT5616_MAMP_INT_REG2, 0xfc00); RT5616_MAMP_INT_REG2, 0xfc00);
snd_soc_update_bits(codec, RT5616_DEPOP_M1, snd_soc_update_bits(codec, RT5616_DEPOP_M1,
...@@ -591,9 +591,9 @@ static int rt5616_hp_event(struct snd_soc_dapm_widget *w, ...@@ -591,9 +591,9 @@ static int rt5616_hp_event(struct snd_soc_dapm_widget *w,
snd_soc_update_bits(codec, RT5616_DEPOP_M3, snd_soc_update_bits(codec, RT5616_DEPOP_M3,
RT5616_CP_FQ1_MASK | RT5616_CP_FQ2_MASK | RT5616_CP_FQ1_MASK | RT5616_CP_FQ2_MASK |
RT5616_CP_FQ3_MASK, RT5616_CP_FQ3_MASK,
(RT5616_CP_FQ_96_KHZ << RT5616_CP_FQ1_SFT) | RT5616_CP_FQ_96_KHZ << RT5616_CP_FQ1_SFT |
(RT5616_CP_FQ_12_KHZ << RT5616_CP_FQ2_SFT) | RT5616_CP_FQ_12_KHZ << RT5616_CP_FQ2_SFT |
(RT5616_CP_FQ_96_KHZ << RT5616_CP_FQ3_SFT)); RT5616_CP_FQ_96_KHZ << RT5616_CP_FQ3_SFT);
snd_soc_write(codec, RT5616_PR_BASE + snd_soc_write(codec, RT5616_PR_BASE +
RT5616_MAMP_INT_REG2, 0xfc00); RT5616_MAMP_INT_REG2, 0xfc00);
snd_soc_update_bits(codec, RT5616_DEPOP_M1, snd_soc_update_bits(codec, RT5616_DEPOP_M1,
...@@ -746,9 +746,11 @@ static const struct snd_soc_dapm_widget rt5616_dapm_widgets[] = { ...@@ -746,9 +746,11 @@ static const struct snd_soc_dapm_widget rt5616_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("stereo1 filter", RT5616_PWR_DIG2, SND_SOC_DAPM_SUPPLY("stereo1 filter", RT5616_PWR_DIG2,
RT5616_PWR_ADC_STO1_F_BIT, 0, NULL, 0), RT5616_PWR_ADC_STO1_F_BIT, 0, NULL, 0),
SND_SOC_DAPM_MIXER("Stereo1 ADC MIXL", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Stereo1 ADC MIXL", SND_SOC_NOPM, 0, 0,
rt5616_sto1_adc_l_mix, ARRAY_SIZE(rt5616_sto1_adc_l_mix)), rt5616_sto1_adc_l_mix,
ARRAY_SIZE(rt5616_sto1_adc_l_mix)),
SND_SOC_DAPM_MIXER("Stereo1 ADC MIXR", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Stereo1 ADC MIXR", SND_SOC_NOPM, 0, 0,
rt5616_sto1_adc_r_mix, ARRAY_SIZE(rt5616_sto1_adc_r_mix)), rt5616_sto1_adc_r_mix,
ARRAY_SIZE(rt5616_sto1_adc_r_mix)),
/* Digital Interface */ /* Digital Interface */
SND_SOC_DAPM_SUPPLY("I2S1", RT5616_PWR_DIG1, SND_SOC_DAPM_SUPPLY("I2S1", RT5616_PWR_DIG1,
...@@ -779,9 +781,11 @@ static const struct snd_soc_dapm_widget rt5616_dapm_widgets[] = { ...@@ -779,9 +781,11 @@ static const struct snd_soc_dapm_widget rt5616_dapm_widgets[] = {
/* DAC Mixer */ /* DAC Mixer */
SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
rt5616_sto_dac_l_mix, ARRAY_SIZE(rt5616_sto_dac_l_mix)), rt5616_sto_dac_l_mix,
ARRAY_SIZE(rt5616_sto_dac_l_mix)),
SND_SOC_DAPM_MIXER("Stereo DAC MIXR", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Stereo DAC MIXR", SND_SOC_NOPM, 0, 0,
rt5616_sto_dac_r_mix, ARRAY_SIZE(rt5616_sto_dac_r_mix)), rt5616_sto_dac_r_mix,
ARRAY_SIZE(rt5616_sto_dac_r_mix)),
/* DACs */ /* DACs */
SND_SOC_DAPM_DAC("DAC L1", NULL, RT5616_PWR_DIG1, SND_SOC_DAPM_DAC("DAC L1", NULL, RT5616_PWR_DIG1,
...@@ -950,7 +954,8 @@ static const struct snd_soc_dapm_route rt5616_dapm_routes[] = { ...@@ -950,7 +954,8 @@ static const struct snd_soc_dapm_route rt5616_dapm_routes[] = {
}; };
static int rt5616_hw_params(struct snd_pcm_substream *substream, static int rt5616_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_codec *codec = rtd->codec;
...@@ -1001,7 +1006,6 @@ static int rt5616_hw_params(struct snd_pcm_substream *substream, ...@@ -1001,7 +1006,6 @@ static int rt5616_hw_params(struct snd_pcm_substream *substream,
RT5616_I2S_DL_MASK, val_len); RT5616_I2S_DL_MASK, val_len);
snd_soc_update_bits(codec, RT5616_ADDA_CLK1, mask_clk, val_clk); snd_soc_update_bits(codec, RT5616_ADDA_CLK1, mask_clk, val_clk);
return 0; return 0;
} }
...@@ -1053,7 +1057,6 @@ static int rt5616_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -1053,7 +1057,6 @@ static int rt5616_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
RT5616_I2S_MS_MASK | RT5616_I2S_BP_MASK | RT5616_I2S_MS_MASK | RT5616_I2S_BP_MASK |
RT5616_I2S_DF_MASK, reg_val); RT5616_I2S_DF_MASK, reg_val);
return 0; return 0;
} }
...@@ -1078,6 +1081,7 @@ static int rt5616_set_dai_sysclk(struct snd_soc_dai *dai, ...@@ -1078,6 +1081,7 @@ static int rt5616_set_dai_sysclk(struct snd_soc_dai *dai,
dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id); dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id);
return -EINVAL; return -EINVAL;
} }
snd_soc_update_bits(codec, RT5616_GLB_CLK, snd_soc_update_bits(codec, RT5616_GLB_CLK,
RT5616_SCLK_SRC_MASK, reg_val); RT5616_SCLK_SRC_MASK, reg_val);
rt5616->sysclk = freq; rt5616->sysclk = freq;
...@@ -1106,19 +1110,22 @@ static int rt5616_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source, ...@@ -1106,19 +1110,22 @@ static int rt5616_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
rt5616->pll_in = 0; rt5616->pll_in = 0;
rt5616->pll_out = 0; rt5616->pll_out = 0;
snd_soc_update_bits(codec, RT5616_GLB_CLK, snd_soc_update_bits(codec, RT5616_GLB_CLK,
RT5616_SCLK_SRC_MASK, RT5616_SCLK_SRC_MCLK); RT5616_SCLK_SRC_MASK,
RT5616_SCLK_SRC_MCLK);
return 0; return 0;
} }
switch (source) { switch (source) {
case RT5616_PLL1_S_MCLK: case RT5616_PLL1_S_MCLK:
snd_soc_update_bits(codec, RT5616_GLB_CLK, snd_soc_update_bits(codec, RT5616_GLB_CLK,
RT5616_PLL1_SRC_MASK, RT5616_PLL1_SRC_MCLK); RT5616_PLL1_SRC_MASK,
RT5616_PLL1_SRC_MCLK);
break; break;
case RT5616_PLL1_S_BCLK1: case RT5616_PLL1_S_BCLK1:
case RT5616_PLL1_S_BCLK2: case RT5616_PLL1_S_BCLK2:
snd_soc_update_bits(codec, RT5616_GLB_CLK, snd_soc_update_bits(codec, RT5616_GLB_CLK,
RT5616_PLL1_SRC_MASK, RT5616_PLL1_SRC_BCLK1); RT5616_PLL1_SRC_MASK,
RT5616_PLL1_SRC_BCLK1);
break; break;
default: default:
dev_err(codec->dev, "Unknown PLL source %d\n", source); dev_err(codec->dev, "Unknown PLL source %d\n", source);
...@@ -1138,7 +1145,8 @@ static int rt5616_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source, ...@@ -1138,7 +1145,8 @@ static int rt5616_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
snd_soc_write(codec, RT5616_PLL_CTRL1, snd_soc_write(codec, RT5616_PLL_CTRL1,
pll_code.n_code << RT5616_PLL_N_SFT | pll_code.k_code); pll_code.n_code << RT5616_PLL_N_SFT | pll_code.k_code);
snd_soc_write(codec, RT5616_PLL_CTRL2, snd_soc_write(codec, RT5616_PLL_CTRL2,
(pll_code.m_bp ? 0 : pll_code.m_code) << RT5616_PLL_M_SFT | (pll_code.m_bp ? 0 : pll_code.m_code) <<
RT5616_PLL_M_SFT |
pll_code.m_bp << RT5616_PLL_M_BP_SFT); pll_code.m_bp << RT5616_PLL_M_BP_SFT);
rt5616->pll_in = freq_in; rt5616->pll_in = freq_in;
...@@ -1164,7 +1172,8 @@ static int rt5616_set_bias_level(struct snd_soc_codec *codec, ...@@ -1164,7 +1172,8 @@ static int rt5616_set_bias_level(struct snd_soc_codec *codec,
RT5616_PWR_FV1 | RT5616_PWR_FV2, RT5616_PWR_FV1 | RT5616_PWR_FV2,
RT5616_PWR_FV1 | RT5616_PWR_FV2); RT5616_PWR_FV1 | RT5616_PWR_FV2);
snd_soc_update_bits(codec, RT5616_D_MISC, snd_soc_update_bits(codec, RT5616_D_MISC,
RT5616_D_GATE_EN, RT5616_D_GATE_EN); RT5616_D_GATE_EN,
RT5616_D_GATE_EN);
} }
break; break;
...@@ -1222,7 +1231,6 @@ static int rt5616_resume(struct snd_soc_codec *codec) ...@@ -1222,7 +1231,6 @@ static int rt5616_resume(struct snd_soc_codec *codec)
#define RT5616_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ #define RT5616_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
struct snd_soc_dai_ops rt5616_aif_dai_ops = { struct snd_soc_dai_ops rt5616_aif_dai_ops = {
.hw_params = rt5616_hw_params, .hw_params = rt5616_hw_params,
.set_fmt = rt5616_set_dai_fmt, .set_fmt = rt5616_set_dai_fmt,
...@@ -1304,7 +1312,7 @@ static int rt5616_i2c_probe(struct i2c_client *i2c, ...@@ -1304,7 +1312,7 @@ static int rt5616_i2c_probe(struct i2c_client *i2c,
rt5616 = devm_kzalloc(&i2c->dev, sizeof(struct rt5616_priv), rt5616 = devm_kzalloc(&i2c->dev, sizeof(struct rt5616_priv),
GFP_KERNEL); GFP_KERNEL);
if (rt5616 == NULL) if (!rt5616)
return -ENOMEM; return -ENOMEM;
i2c_set_clientdata(i2c, rt5616); i2c_set_clientdata(i2c, rt5616);
...@@ -1345,7 +1353,6 @@ static int rt5616_i2c_probe(struct i2c_client *i2c, ...@@ -1345,7 +1353,6 @@ static int rt5616_i2c_probe(struct i2c_client *i2c,
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5616, return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5616,
rt5616_dai, ARRAY_SIZE(rt5616_dai)); rt5616_dai, ARRAY_SIZE(rt5616_dai));
} }
static int rt5616_i2c_remove(struct i2c_client *i2c) static int rt5616_i2c_remove(struct i2c_client *i2c)
...@@ -1361,7 +1368,6 @@ static void rt5616_i2c_shutdown(struct i2c_client *client) ...@@ -1361,7 +1368,6 @@ static void rt5616_i2c_shutdown(struct i2c_client *client)
regmap_write(rt5616->regmap, RT5616_HP_VOL, 0xc8c8); regmap_write(rt5616->regmap, RT5616_HP_VOL, 0xc8c8);
regmap_write(rt5616->regmap, RT5616_LOUT_CTRL1, 0xc8c8); regmap_write(rt5616->regmap, RT5616_LOUT_CTRL1, 0xc8c8);
} }
static struct i2c_driver rt5616_i2c_driver = { static struct i2c_driver rt5616_i2c_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment