diff options
| author | Mark Brown <broonie@linaro.org> | 2013-08-31 08:52:41 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-09-24 14:40:12 -0400 |
| commit | d33c33352b3228ca3a422e55981f80fc12dc30f8 (patch) | |
| tree | 95902c29b14e77aaa972e0eba9b4bd9d6590c6f3 | |
| parent | 1201939a6f981cb656872784e39ef443540078cd (diff) | |
ASoC: cq93vc: Use regmap for I/O
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>
| -rw-r--r-- | sound/soc/codecs/cq93vc.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 2cbb584b33de..43737a27d79c 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c | |||
| @@ -38,24 +38,6 @@ | |||
| 38 | #include <sound/soc.h> | 38 | #include <sound/soc.h> |
| 39 | #include <sound/initval.h> | 39 | #include <sound/initval.h> |
| 40 | 40 | ||
| 41 | static inline unsigned int cq93vc_read(struct snd_soc_codec *codec, | ||
| 42 | unsigned int reg) | ||
| 43 | { | ||
| 44 | struct davinci_vc *davinci_vc = codec->control_data; | ||
| 45 | |||
| 46 | return readl(davinci_vc->base + reg); | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline int cq93vc_write(struct snd_soc_codec *codec, unsigned int reg, | ||
| 50 | unsigned int value) | ||
| 51 | { | ||
| 52 | struct davinci_vc *davinci_vc = codec->control_data; | ||
| 53 | |||
| 54 | writel(value, davinci_vc->base + reg); | ||
| 55 | |||
| 56 | return 0; | ||
| 57 | } | ||
| 58 | |||
| 59 | static const struct snd_kcontrol_new cq93vc_snd_controls[] = { | 41 | static const struct snd_kcontrol_new cq93vc_snd_controls[] = { |
| 60 | SOC_SINGLE("PGA Capture Volume", DAVINCI_VC_REG05, 0, 0x03, 0), | 42 | SOC_SINGLE("PGA Capture Volume", DAVINCI_VC_REG05, 0, 0x03, 0), |
| 61 | SOC_SINGLE("Mono DAC Playback Volume", DAVINCI_VC_REG09, 0, 0x3f, 0), | 43 | SOC_SINGLE("Mono DAC Playback Volume", DAVINCI_VC_REG09, 0, 0x3f, 0), |
| @@ -156,7 +138,9 @@ static int cq93vc_probe(struct snd_soc_codec *codec) | |||
| 156 | struct davinci_vc *davinci_vc = codec->dev->platform_data; | 138 | struct davinci_vc *davinci_vc = codec->dev->platform_data; |
| 157 | 139 | ||
| 158 | davinci_vc->cq93vc.codec = codec; | 140 | davinci_vc->cq93vc.codec = codec; |
| 159 | codec->control_data = davinci_vc; | 141 | codec->control_data = davinci_vc->regmap; |
| 142 | |||
| 143 | snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP); | ||
| 160 | 144 | ||
| 161 | /* Off, with power on */ | 145 | /* Off, with power on */ |
| 162 | cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 146 | cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
| @@ -172,8 +156,6 @@ static int cq93vc_remove(struct snd_soc_codec *codec) | |||
| 172 | } | 156 | } |
| 173 | 157 | ||
| 174 | static struct snd_soc_codec_driver soc_codec_dev_cq93vc = { | 158 | static struct snd_soc_codec_driver soc_codec_dev_cq93vc = { |
| 175 | .read = cq93vc_read, | ||
| 176 | .write = cq93vc_write, | ||
| 177 | .set_bias_level = cq93vc_set_bias_level, | 159 | .set_bias_level = cq93vc_set_bias_level, |
| 178 | .probe = cq93vc_probe, | 160 | .probe = cq93vc_probe, |
| 179 | .remove = cq93vc_remove, | 161 | .remove = cq93vc_remove, |
