aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8580.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-07-10 17:24:27 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-03 11:59:09 -0400
commit7084a42b965d972079201414d19a399e65b26099 (patch)
tree391a0ed913eb769013ca65e3c042ac043981dbfa /sound/soc/codecs/wm8580.c
parent030c819e79e8ad0320486e9ccbe76d2f0870369f (diff)
ASoC: Add I/O control bus information to factored out cache setup
While writes tend to be able to use a fairly bus independant format to do the writes reads are all bus specific. To allow us to factor out this code include the bus type as a parameter when setting up the cache. Initially just use this to factor out hw_write_t for I2C. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8580.c')
-rw-r--r--sound/soc/codecs/wm8580.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 2250adea749f..d5473473a1e3 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -832,7 +832,8 @@ struct snd_soc_codec_device soc_codec_dev_wm8580 = {
832}; 832};
833EXPORT_SYMBOL_GPL(soc_codec_dev_wm8580); 833EXPORT_SYMBOL_GPL(soc_codec_dev_wm8580);
834 834
835static int wm8580_register(struct wm8580_priv *wm8580) 835static int wm8580_register(struct wm8580_priv *wm8580,
836 enum snd_soc_control_type control)
836{ 837{
837 int ret, i; 838 int ret, i;
838 struct snd_soc_codec *codec = &wm8580->codec; 839 struct snd_soc_codec *codec = &wm8580->codec;
@@ -859,7 +860,7 @@ static int wm8580_register(struct wm8580_priv *wm8580)
859 860
860 memcpy(codec->reg_cache, wm8580_reg, sizeof(wm8580_reg)); 861 memcpy(codec->reg_cache, wm8580_reg, sizeof(wm8580_reg));
861 862
862 ret = snd_soc_codec_set_cache_io(codec, 7, 9); 863 ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
863 if (ret < 0) { 864 if (ret < 0) {
864 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 865 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
865 goto err; 866 goto err;
@@ -944,14 +945,13 @@ static int wm8580_i2c_probe(struct i2c_client *i2c,
944 return -ENOMEM; 945 return -ENOMEM;
945 946
946 codec = &wm8580->codec; 947 codec = &wm8580->codec;
947 codec->hw_write = (hw_write_t)i2c_master_send;
948 948
949 i2c_set_clientdata(i2c, wm8580); 949 i2c_set_clientdata(i2c, wm8580);
950 codec->control_data = i2c; 950 codec->control_data = i2c;
951 951
952 codec->dev = &i2c->dev; 952 codec->dev = &i2c->dev;
953 953
954 return wm8580_register(wm8580); 954 return wm8580_register(wm8580, SND_SOC_I2C);
955} 955}
956 956
957static int wm8580_i2c_remove(struct i2c_client *client) 957static int wm8580_i2c_remove(struct i2c_client *client)