diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 08:21:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:41:39 -0400 |
commit | b8cc4151f8af97e1b573ca399a77f439f401a57e (patch) | |
tree | 66b9b6afc707e406a4bb9ac88e80238aabb06ffc | |
parent | 37c83edf9afd3d7b39ace9113a166c03b7a2820f (diff) |
ASoC: wm8400: Use regmap for I/O
Since we no longer have a fake register to simulate we can use the
framework for I/O.
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/wm8400.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c index 95c33d169952..48dc7d2fee36 100644 --- a/sound/soc/codecs/wm8400.c +++ b/sound/soc/codecs/wm8400.c | |||
@@ -67,25 +67,6 @@ struct wm8400_priv { | |||
67 | int fll_in, fll_out; | 67 | int fll_in, fll_out; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static inline unsigned int wm8400_read(struct snd_soc_codec *codec, | ||
71 | unsigned int reg) | ||
72 | { | ||
73 | struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec); | ||
74 | |||
75 | return wm8400_reg_read(wm8400->wm8400, reg); | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * write to the wm8400 register space | ||
80 | */ | ||
81 | static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg, | ||
82 | unsigned int value) | ||
83 | { | ||
84 | struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec); | ||
85 | |||
86 | return wm8400_set_bits(wm8400->wm8400, reg, 0xffff, value); | ||
87 | } | ||
88 | |||
89 | static void wm8400_codec_reset(struct snd_soc_codec *codec) | 70 | static void wm8400_codec_reset(struct snd_soc_codec *codec) |
90 | { | 71 | { |
91 | struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec); | 72 | struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec); |
@@ -1328,9 +1309,12 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec) | |||
1328 | return -ENOMEM; | 1309 | return -ENOMEM; |
1329 | 1310 | ||
1330 | snd_soc_codec_set_drvdata(codec, priv); | 1311 | snd_soc_codec_set_drvdata(codec, priv); |
1331 | codec->control_data = priv->wm8400 = wm8400; | 1312 | priv->wm8400 = wm8400; |
1313 | codec->control_data = wm8400->regmap; | ||
1332 | priv->codec = codec; | 1314 | priv->codec = codec; |
1333 | 1315 | ||
1316 | snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP); | ||
1317 | |||
1334 | ret = devm_regulator_bulk_get(wm8400->dev, | 1318 | ret = devm_regulator_bulk_get(wm8400->dev, |
1335 | ARRAY_SIZE(power), &power[0]); | 1319 | ARRAY_SIZE(power), &power[0]); |
1336 | if (ret != 0) { | 1320 | if (ret != 0) { |
@@ -1377,8 +1361,6 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8400 = { | |||
1377 | .remove = wm8400_codec_remove, | 1361 | .remove = wm8400_codec_remove, |
1378 | .suspend = wm8400_suspend, | 1362 | .suspend = wm8400_suspend, |
1379 | .resume = wm8400_resume, | 1363 | .resume = wm8400_resume, |
1380 | .read = snd_soc_read, | ||
1381 | .write = wm8400_write, | ||
1382 | .set_bias_level = wm8400_set_bias_level, | 1364 | .set_bias_level = wm8400_set_bias_level, |
1383 | 1365 | ||
1384 | .controls = wm8400_snd_controls, | 1366 | .controls = wm8400_snd_controls, |