]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: cq93vc: Use regmap for I/O
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 12:52:41 +0000 (13:52 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:38:36 +0000 (00:38 +0100)
Avoid use of the ASoC-specific register I/O functions by converting to
use the MMIO regmap provided the core MFD.

Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/cq93vc.c

index e2c4c0a896e2f9e22f9492cc9a720ee322427089..f7c27d5ba1fc2fc784372fa0e86bb155bc140df2 100644 (file)
 #include <sound/soc.h>
 #include <sound/initval.h>
 
-static inline unsigned int cq93vc_read(struct snd_soc_codec *codec,
-                                               unsigned int reg)
-{
-       struct davinci_vc *davinci_vc = codec->control_data;
-
-       return readl(davinci_vc->base + reg);
-}
-
-static inline int cq93vc_write(struct snd_soc_codec *codec, unsigned int reg,
-                      unsigned int value)
-{
-       struct davinci_vc *davinci_vc = codec->control_data;
-
-       writel(value, davinci_vc->base + reg);
-
-       return 0;
-}
-
 static const struct snd_kcontrol_new cq93vc_snd_controls[] = {
        SOC_SINGLE("PGA Capture Volume", DAVINCI_VC_REG05, 0, 0x03, 0),
        SOC_SINGLE("Mono DAC Playback Volume", DAVINCI_VC_REG09, 0, 0x3f, 0),
@@ -154,7 +136,9 @@ static int cq93vc_probe(struct snd_soc_codec *codec)
        struct davinci_vc *davinci_vc = codec->dev->platform_data;
 
        davinci_vc->cq93vc.codec = codec;
-       codec->control_data = davinci_vc;
+       codec->control_data = davinci_vc->regmap;
+
+       snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP);
 
        /* Set controls */
        snd_soc_add_codec_controls(codec, cq93vc_snd_controls,
@@ -174,8 +158,6 @@ static int cq93vc_remove(struct snd_soc_codec *codec)
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_cq93vc = {
-       .read = cq93vc_read,
-       .write = cq93vc_write,
        .set_bias_level = cq93vc_set_bias_level,
        .probe = cq93vc_probe,
        .remove = cq93vc_remove,