diff options
author | Bard Liao <bardliao@realtek.com> | 2017-10-30 03:26:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-10-31 07:01:53 -0400 |
commit | 50f510a33c7c906f8f75b02e3d1104984ebf6f78 (patch) | |
tree | bfd8dd080f741eeb9d72c99621dcc770ab24425f | |
parent | 72d7a16bb07582f8416bbcdc65fe2a1e63f11294 (diff) |
ASoC: rt5645: remove unexisting route on new rt5645
"SPOL MIX DAC R1 Switch" and "SPOL MIX SPKVOL R Switch" are only
exist in the early version of rt5645.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rt5645.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 4b2dbf0c3409..23cc2cb8393f 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c | |||
@@ -432,6 +432,7 @@ struct rt5645_priv { | |||
432 | int jack_type; | 432 | int jack_type; |
433 | bool en_button_func; | 433 | bool en_button_func; |
434 | bool hp_on; | 434 | bool hp_on; |
435 | int v_id; | ||
435 | }; | 436 | }; |
436 | 437 | ||
437 | static int rt5645_reset(struct snd_soc_codec *codec) | 438 | static int rt5645_reset(struct snd_soc_codec *codec) |
@@ -2516,9 +2517,7 @@ static const struct snd_soc_dapm_route rt5645_dapm_routes[] = { | |||
2516 | { "SPKVOL L", "Switch", "SPK MIXL" }, | 2517 | { "SPKVOL L", "Switch", "SPK MIXL" }, |
2517 | { "SPKVOL R", "Switch", "SPK MIXR" }, | 2518 | { "SPKVOL R", "Switch", "SPK MIXR" }, |
2518 | 2519 | ||
2519 | { "SPOL MIX", "DAC R1 Switch", "DAC R1" }, | ||
2520 | { "SPOL MIX", "DAC L1 Switch", "DAC L1" }, | 2520 | { "SPOL MIX", "DAC L1 Switch", "DAC L1" }, |
2521 | { "SPOL MIX", "SPKVOL R Switch", "SPKVOL R" }, | ||
2522 | { "SPOL MIX", "SPKVOL L Switch", "SPKVOL L" }, | 2521 | { "SPOL MIX", "SPKVOL L Switch", "SPKVOL L" }, |
2523 | { "SPOR MIX", "DAC R1 Switch", "DAC R1" }, | 2522 | { "SPOR MIX", "DAC R1 Switch", "DAC R1" }, |
2524 | { "SPOR MIX", "SPKVOL R Switch", "SPKVOL R" }, | 2523 | { "SPOR MIX", "SPKVOL R Switch", "SPKVOL R" }, |
@@ -2707,6 +2706,11 @@ static const struct snd_soc_dapm_route rt5645_specific_dapm_routes[] = { | |||
2707 | { "DAC R2 Mux", "IF1 DAC", "RT5645 IF1 DAC2 R Mux" }, | 2706 | { "DAC R2 Mux", "IF1 DAC", "RT5645 IF1 DAC2 R Mux" }, |
2708 | }; | 2707 | }; |
2709 | 2708 | ||
2709 | static const struct snd_soc_dapm_route rt5645_old_dapm_routes[] = { | ||
2710 | { "SPOL MIX", "DAC R1 Switch", "DAC R1" }, | ||
2711 | { "SPOL MIX", "SPKVOL R Switch", "SPKVOL R" }, | ||
2712 | }; | ||
2713 | |||
2710 | static int rt5645_hw_params(struct snd_pcm_substream *substream, | 2714 | static int rt5645_hw_params(struct snd_pcm_substream *substream, |
2711 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) | 2715 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) |
2712 | { | 2716 | { |
@@ -3363,6 +3367,11 @@ static int rt5645_probe(struct snd_soc_codec *codec) | |||
3363 | snd_soc_dapm_add_routes(dapm, | 3367 | snd_soc_dapm_add_routes(dapm, |
3364 | rt5645_specific_dapm_routes, | 3368 | rt5645_specific_dapm_routes, |
3365 | ARRAY_SIZE(rt5645_specific_dapm_routes)); | 3369 | ARRAY_SIZE(rt5645_specific_dapm_routes)); |
3370 | if (rt5645->v_id < 3) { | ||
3371 | snd_soc_dapm_add_routes(dapm, | ||
3372 | rt5645_old_dapm_routes, | ||
3373 | ARRAY_SIZE(rt5645_old_dapm_routes)); | ||
3374 | } | ||
3366 | break; | 3375 | break; |
3367 | case CODEC_TYPE_RT5650: | 3376 | case CODEC_TYPE_RT5650: |
3368 | snd_soc_dapm_new_controls(dapm, | 3377 | snd_soc_dapm_new_controls(dapm, |
@@ -3803,6 +3812,9 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, | |||
3803 | 3812 | ||
3804 | regmap_write(rt5645->regmap, RT5645_RESET, 0); | 3813 | regmap_write(rt5645->regmap, RT5645_RESET, 0); |
3805 | 3814 | ||
3815 | regmap_read(regmap, RT5645_VENDOR_ID, &val); | ||
3816 | rt5645->v_id = val & 0xff; | ||
3817 | |||
3806 | ret = regmap_register_patch(rt5645->regmap, init_list, | 3818 | ret = regmap_register_patch(rt5645->regmap, init_list, |
3807 | ARRAY_SIZE(init_list)); | 3819 | ARRAY_SIZE(init_list)); |
3808 | if (ret != 0) | 3820 | if (ret != 0) |