aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8731.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/wm8731.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/wm8731.c')
-rw-r--r--sound/soc/codecs/wm8731.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 4eb84ff691b3..27fc942a5ced 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -504,7 +504,8 @@ struct snd_soc_codec_device soc_codec_dev_wm8731 = {
504}; 504};
505EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731); 505EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731);
506 506
507static int wm8731_register(struct wm8731_priv *wm8731) 507static int wm8731_register(struct wm8731_priv *wm8731,
508 enum snd_soc_control_type control)
508{ 509{
509 int ret; 510 int ret;
510 struct snd_soc_codec *codec = &wm8731->codec; 511 struct snd_soc_codec *codec = &wm8731->codec;
@@ -531,7 +532,7 @@ static int wm8731_register(struct wm8731_priv *wm8731)
531 532
532 memcpy(codec->reg_cache, wm8731_reg, sizeof(wm8731_reg)); 533 memcpy(codec->reg_cache, wm8731_reg, sizeof(wm8731_reg));
533 534
534 ret = snd_soc_codec_set_cache_io(codec, 7, 9); 535 ret = snd_soc_codec_set_cache_io(codec, 7, 9, control);
535 if (ret < 0) { 536 if (ret < 0) {
536 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 537 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
537 goto err; 538 goto err;
@@ -630,7 +631,7 @@ static int __devinit wm8731_spi_probe(struct spi_device *spi)
630 631
631 dev_set_drvdata(&spi->dev, wm8731); 632 dev_set_drvdata(&spi->dev, wm8731);
632 633
633 return wm8731_register(wm8731); 634 return wm8731_register(wm8731, SND_SOC_SPI);
634} 635}
635 636
636static int __devexit wm8731_spi_remove(struct spi_device *spi) 637static int __devexit wm8731_spi_remove(struct spi_device *spi)
@@ -682,14 +683,13 @@ static __devinit int wm8731_i2c_probe(struct i2c_client *i2c,
682 return -ENOMEM; 683 return -ENOMEM;
683 684
684 codec = &wm8731->codec; 685 codec = &wm8731->codec;
685 codec->hw_write = (hw_write_t)i2c_master_send;
686 686
687 i2c_set_clientdata(i2c, wm8731); 687 i2c_set_clientdata(i2c, wm8731);
688 codec->control_data = i2c; 688 codec->control_data = i2c;
689 689
690 codec->dev = &i2c->dev; 690 codec->dev = &i2c->dev;
691 691
692 return wm8731_register(wm8731); 692 return wm8731_register(wm8731, SND_SOC_I2C);
693} 693}
694 694
695static __devexit int wm8731_i2c_remove(struct i2c_client *client) 695static __devexit int wm8731_i2c_remove(struct i2c_client *client)