diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-07-10 17:24:27 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-08-03 11:59:09 -0400 |
commit | 7084a42b965d972079201414d19a399e65b26099 (patch) | |
tree | 391a0ed913eb769013ca65e3c042ac043981dbfa /sound/soc/codecs/wm8728.c | |
parent | 030c819e79e8ad0320486e9ccbe76d2f0870369f (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/wm8728.c')
-rw-r--r-- | sound/soc/codecs/wm8728.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index 66da44b08d35..a28630de9c91 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c | |||
@@ -248,7 +248,8 @@ static int wm8728_resume(struct platform_device *pdev) | |||
248 | * initialise the WM8728 driver | 248 | * initialise the WM8728 driver |
249 | * register the mixer and dsp interfaces with the kernel | 249 | * register the mixer and dsp interfaces with the kernel |
250 | */ | 250 | */ |
251 | static int wm8728_init(struct snd_soc_device *socdev) | 251 | static int wm8728_init(struct snd_soc_device *socdev, |
252 | enum snd_soc_control_type control) | ||
252 | { | 253 | { |
253 | struct snd_soc_codec *codec = socdev->card->codec; | 254 | struct snd_soc_codec *codec = socdev->card->codec; |
254 | int ret = 0; | 255 | int ret = 0; |
@@ -266,7 +267,7 @@ static int wm8728_init(struct snd_soc_device *socdev) | |||
266 | if (codec->reg_cache == NULL) | 267 | if (codec->reg_cache == NULL) |
267 | return -ENOMEM; | 268 | return -ENOMEM; |
268 | 269 | ||
269 | ret = snd_soc_codec_set_cache_io(codec, 7, 9); | 270 | ret = snd_soc_codec_set_cache_io(codec, 7, 9, control); |
270 | if (ret < 0) { | 271 | if (ret < 0) { |
271 | printk(KERN_ERR "wm8728: failed to configure cache I/O: %d\n", | 272 | printk(KERN_ERR "wm8728: failed to configure cache I/O: %d\n", |
272 | ret); | 273 | ret); |
@@ -323,7 +324,7 @@ static int wm8728_i2c_probe(struct i2c_client *i2c, | |||
323 | i2c_set_clientdata(i2c, codec); | 324 | i2c_set_clientdata(i2c, codec); |
324 | codec->control_data = i2c; | 325 | codec->control_data = i2c; |
325 | 326 | ||
326 | ret = wm8728_init(socdev); | 327 | ret = wm8728_init(socdev, SND_SOC_I2C); |
327 | if (ret < 0) | 328 | if (ret < 0) |
328 | pr_err("failed to initialise WM8728\n"); | 329 | pr_err("failed to initialise WM8728\n"); |
329 | 330 | ||
@@ -403,7 +404,7 @@ static int __devinit wm8728_spi_probe(struct spi_device *spi) | |||
403 | 404 | ||
404 | codec->control_data = spi; | 405 | codec->control_data = spi; |
405 | 406 | ||
406 | ret = wm8728_init(socdev); | 407 | ret = wm8728_init(socdev, SND_SOC_SPI); |
407 | if (ret < 0) | 408 | if (ret < 0) |
408 | dev_err(&spi->dev, "failed to initialise WM8728\n"); | 409 | dev_err(&spi->dev, "failed to initialise WM8728\n"); |
409 | 410 | ||
@@ -472,7 +473,6 @@ static int wm8728_probe(struct platform_device *pdev) | |||
472 | 473 | ||
473 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 474 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
474 | if (setup->i2c_address) { | 475 | if (setup->i2c_address) { |
475 | codec->hw_write = (hw_write_t)i2c_master_send; | ||
476 | ret = wm8728_add_i2c_device(pdev, setup); | 476 | ret = wm8728_add_i2c_device(pdev, setup); |
477 | } | 477 | } |
478 | #endif | 478 | #endif |