]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/wm8904.c
ASoC: wm8904: Fix GPIO and MICBIAS initialisation for regmap conversion
[karo-tx-linux.git] / sound / soc / codecs / wm8904.c
index 65d525d74c549ee9d83bbb1f1ca0a982a103a567..4e190b5950bae0d0dfd47a43dc4b57ea7815650a 100644 (file)
@@ -2084,7 +2084,6 @@ static int wm8904_probe(struct snd_soc_codec *codec)
 {
        struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
        struct wm8904_pdata *pdata = wm8904->pdata;
-       u16 *reg_cache = codec->reg_cache;
        int ret, i;
 
        codec->cache_sync = 1;
@@ -2180,14 +2179,18 @@ static int wm8904_probe(struct snd_soc_codec *codec)
                        if (!pdata->gpio_cfg[i])
                                continue;
 
-                       reg_cache[WM8904_GPIO_CONTROL_1 + i]
-                               = pdata->gpio_cfg[i] & 0xffff;
+                       regmap_update_bits(wm8904->regmap,
+                                          WM8904_GPIO_CONTROL_1 + i,
+                                          0xffff,
+                                          pdata->gpio_cfg[i]);
                }
 
                /* Zero is the default value for these anyway */
                for (i = 0; i < WM8904_MIC_REGS; i++)
-                       reg_cache[WM8904_MIC_BIAS_CONTROL_0 + i]
-                               = pdata->mic_cfg[i];
+                       regmap_update_bits(wm8904->regmap,
+                                          WM8904_MIC_BIAS_CONTROL_0 + i,
+                                          0xffff,
+                                          pdata->mic_cfg[i]);
        }
 
        /* Set Class W by default - this will be managed by the Class