diff options
author | Bard Liao <bardliao@realtek.com> | 2014-04-17 10:24:06 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-22 12:52:08 +0100 |
commit | 8bfc6d2d1b6266e8da2a7cf89e8d05e2ea8b09e5 (patch) | |
tree | 5b75b1a2fe6bfa37a32b7d3d0405b34c0a32e2f8 /sound/soc/codecs/rt5640.c | |
parent | 908b7032a8b5cb7110beac213f7d3058097fa5aa (diff) | |
download | blackbird-op-linux-8bfc6d2d1b6266e8da2a7cf89e8d05e2ea8b09e5.tar.gz blackbird-op-linux-8bfc6d2d1b6266e8da2a7cf89e8d05e2ea8b09e5.zip |
ASoC: rt5640: Add minimal support for RT5642
We have been using rt5640.c codec driver with RT5642 codec chip before commit
022d21f004c1 ("ASoC: rt5640: add rt5639 support"). That commits starts using
device ID reading in reset register for adding device specific controls and
routes runtime.
Now since device ID appears to be different between RT5640 and RT5642 the
driver doesn't add those controls and routes that are valid also on RT5642.
Fix this by adding a device ID found by debugging and minimal code for
supporting RT5642.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/rt5640.c')
-rw-r--r-- | sound/soc/codecs/rt5640.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 6674372be12c..79635ee42a61 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -1997,8 +1997,9 @@ static int rt5640_probe(struct snd_soc_codec *codec) snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030); snd_soc_update_bits(codec, RT5640_DSP_PATH2, 0xfc00, 0x0c00); - switch (snd_soc_read(codec, RT5640_RESET)) { - case RT5640_RESET_ID: + switch (snd_soc_read(codec, RT5640_RESET) & RT5640_ID_MASK) { + case RT5640_ID_5640: + case RT5640_ID_5642: snd_soc_add_codec_controls(codec, rt5640_specific_snd_controls, ARRAY_SIZE(rt5640_specific_snd_controls)); @@ -2009,7 +2010,7 @@ static int rt5640_probe(struct snd_soc_codec *codec) rt5640_specific_dapm_routes, ARRAY_SIZE(rt5640_specific_dapm_routes)); break; - case RT5639_RESET_ID: + case RT5640_ID_5639: snd_soc_dapm_new_controls(&codec->dapm, rt5639_specific_dapm_widgets, ARRAY_SIZE(rt5639_specific_dapm_widgets)); @@ -2149,6 +2150,7 @@ static const struct regmap_config rt5640_regmap = { static const struct i2c_device_id rt5640_i2c_id[] = { { "rt5640", 0 }, { "rt5639", 0 }, + { "rt5642", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); |