aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8750.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/wm8750.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/wm8750.c')
-rw-r--r--sound/soc/codecs/wm8750.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index ed09043181e1..e6422b161678 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -711,7 +711,8 @@ static int wm8750_resume(struct platform_device *pdev)
711 * initialise the WM8750 driver 711 * initialise the WM8750 driver
712 * register the mixer and dsp interfaces with the kernel 712 * register the mixer and dsp interfaces with the kernel
713 */ 713 */
714static int wm8750_init(struct snd_soc_device *socdev) 714static int wm8750_init(struct snd_soc_device *socdev,
715 enum snd_soc_control_type control)
715{ 716{
716 struct snd_soc_codec *codec = socdev->card->codec; 717 struct snd_soc_codec *codec = socdev->card->codec;
717 int reg, ret = 0; 718 int reg, ret = 0;
@@ -726,7 +727,7 @@ static int wm8750_init(struct snd_soc_device *socdev)
726 if (codec->reg_cache == NULL) 727 if (codec->reg_cache == NULL)
727 return -ENOMEM; 728 return -ENOMEM;
728 729
729 ret = snd_soc_codec_set_cache_io(codec, 7, 9); 730 ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
730 if (ret < 0) { 731 if (ret < 0) {
731 printk(KERN_ERR "wm8750: failed to set cache I/O: %d\n", ret); 732 printk(KERN_ERR "wm8750: failed to set cache I/O: %d\n", ret);
732 goto err; 733 goto err;
@@ -809,7 +810,7 @@ static int wm8750_i2c_probe(struct i2c_client *i2c,
809 i2c_set_clientdata(i2c, codec); 810 i2c_set_clientdata(i2c, codec);
810 codec->control_data = i2c; 811 codec->control_data = i2c;
811 812
812 ret = wm8750_init(socdev); 813 ret = wm8750_init(socdev, SND_SOC_I2C);
813 if (ret < 0) 814 if (ret < 0)
814 pr_err("failed to initialise WM8750\n"); 815 pr_err("failed to initialise WM8750\n");
815 816
@@ -889,7 +890,7 @@ static int __devinit wm8750_spi_probe(struct spi_device *spi)
889 890
890 codec->control_data = spi; 891 codec->control_data = spi;
891 892
892 ret = wm8750_init(socdev); 893 ret = wm8750_init(socdev, SND_SOC_SPI);
893 if (ret < 0) 894 if (ret < 0)
894 dev_err(&spi->dev, "failed to initialise WM8750\n"); 895 dev_err(&spi->dev, "failed to initialise WM8750\n");
895 896
@@ -967,7 +968,6 @@ static int wm8750_probe(struct platform_device *pdev)
967 968
968#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 969#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
969 if (setup->i2c_address) { 970 if (setup->i2c_address) {
970 codec->hw_write = (hw_write_t)i2c_master_send;
971 ret = wm8750_add_i2c_device(pdev, setup); 971 ret = wm8750_add_i2c_device(pdev, setup);
972 } 972 }
973#endif 973#endif