aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8988.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/wm8988.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/wm8988.c')
-rw-r--r--sound/soc/codecs/wm8988.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 7d5b807bdb48..7486d3ec787e 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -825,7 +825,8 @@ struct snd_soc_codec_device soc_codec_dev_wm8988 = {
825}; 825};
826EXPORT_SYMBOL_GPL(soc_codec_dev_wm8988); 826EXPORT_SYMBOL_GPL(soc_codec_dev_wm8988);
827 827
828static int wm8988_register(struct wm8988_priv *wm8988) 828static int wm8988_register(struct wm8988_priv *wm8988,
829 enum snd_soc_control_type control)
829{ 830{
830 struct snd_soc_codec *codec = &wm8988->codec; 831 struct snd_soc_codec *codec = &wm8988->codec;
831 int ret; 832 int ret;
@@ -854,7 +855,7 @@ static int wm8988_register(struct wm8988_priv *wm8988)
854 memcpy(codec->reg_cache, wm8988_reg, 855 memcpy(codec->reg_cache, wm8988_reg,
855 sizeof(wm8988_reg)); 856 sizeof(wm8988_reg));
856 857
857 ret = snd_soc_codec_set_cache_io(codec, 7, 9); 858 ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
858 if (ret < 0) { 859 if (ret < 0) {
859 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 860 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
860 goto err; 861 goto err;
@@ -927,14 +928,13 @@ static int wm8988_i2c_probe(struct i2c_client *i2c,
927 return -ENOMEM; 928 return -ENOMEM;
928 929
929 codec = &wm8988->codec; 930 codec = &wm8988->codec;
930 codec->hw_write = (hw_write_t)i2c_master_send;
931 931
932 i2c_set_clientdata(i2c, wm8988); 932 i2c_set_clientdata(i2c, wm8988);
933 codec->control_data = i2c; 933 codec->control_data = i2c;
934 934
935 codec->dev = &i2c->dev; 935 codec->dev = &i2c->dev;
936 936
937 return wm8988_register(wm8988); 937 return wm8988_register(wm8988, SND_SOC_I2C);
938} 938}
939 939
940static int wm8988_i2c_remove(struct i2c_client *client) 940static int wm8988_i2c_remove(struct i2c_client *client)
@@ -1019,7 +1019,7 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
1019 1019
1020 spi->dev.driver_data = wm8988; 1020 spi->dev.driver_data = wm8988;
1021 1021
1022 return wm8988_register(wm8988); 1022 return wm8988_register(wm8988, SND_SOC_SPI);
1023} 1023}
1024 1024
1025static int __devexit wm8988_spi_remove(struct spi_device *spi) 1025static int __devexit wm8988_spi_remove(struct spi_device *spi)