aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8960.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/wm8960.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/wm8960.c')
-rw-r--r--sound/soc/codecs/wm8960.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index c529ffcfe5d8..f59703be61c8 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -747,7 +747,8 @@ struct snd_soc_codec_device soc_codec_dev_wm8960 = {
747}; 747};
748EXPORT_SYMBOL_GPL(soc_codec_dev_wm8960); 748EXPORT_SYMBOL_GPL(soc_codec_dev_wm8960);
749 749
750static int wm8960_register(struct wm8960_priv *wm8960) 750static int wm8960_register(struct wm8960_priv *wm8960,
751 enum snd_soc_control_type control)
751{ 752{
752 struct wm8960_data *pdata = wm8960->codec.dev->platform_data; 753 struct wm8960_data *pdata = wm8960->codec.dev->platform_data;
753 struct snd_soc_codec *codec = &wm8960->codec; 754 struct snd_soc_codec *codec = &wm8960->codec;
@@ -785,7 +786,7 @@ static int wm8960_register(struct wm8960_priv *wm8960)
785 786
786 memcpy(codec->reg_cache, wm8960_reg, sizeof(wm8960_reg)); 787 memcpy(codec->reg_cache, wm8960_reg, sizeof(wm8960_reg));
787 788
788 ret = snd_soc_codec_set_cache_io(codec, 7, 9); 789 ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
789 if (ret < 0) { 790 if (ret < 0) {
790 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 791 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
791 goto err; 792 goto err;
@@ -866,14 +867,13 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
866 return -ENOMEM; 867 return -ENOMEM;
867 868
868 codec = &wm8960->codec; 869 codec = &wm8960->codec;
869 codec->hw_write = (hw_write_t)i2c_master_send;
870 870
871 i2c_set_clientdata(i2c, wm8960); 871 i2c_set_clientdata(i2c, wm8960);
872 codec->control_data = i2c; 872 codec->control_data = i2c;
873 873
874 codec->dev = &i2c->dev; 874 codec->dev = &i2c->dev;
875 875
876 return wm8960_register(wm8960); 876 return wm8960_register(wm8960, SND_SOC_I2C);
877} 877}
878 878
879static __devexit int wm8960_i2c_remove(struct i2c_client *client) 879static __devexit int wm8960_i2c_remove(struct i2c_client *client)