Merge branches 'topic/rt5640', 'topic/rt5645' and 'topic/rt5651' of git://git.kernel...
[deliverable/linux.git] / sound / soc / codecs / rt5640.c
index 6674372be12c0aca3c5874cae91308cc065c02c2..ddefd5a476d04700d0b1f5f74d8c49608a7c83c9 100644 (file)
@@ -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));
@@ -2017,6 +2018,10 @@ static int rt5640_probe(struct snd_soc_codec *codec)
                        rt5639_specific_dapm_routes,
                        ARRAY_SIZE(rt5639_specific_dapm_routes));
                break;
+       default:
+               dev_err(codec->dev,
+                       "The driver is for RT5639 RT5640 or RT5642 only\n");
+               return -ENODEV;
        }
 
        return 0;
@@ -2149,12 +2154,14 @@ 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);
 
 #if defined(CONFIG_OF)
 static const struct of_device_id rt5640_of_match[] = {
+       { .compatible = "realtek,rt5639", },
        { .compatible = "realtek,rt5640", },
        {},
 };
This page took 0.026085 seconds and 5 git commands to generate.