diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-23 17:55:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-27 05:30:54 -0500 |
commit | 6627a653bceb3a54e55e5cdc478ec5b8d5c9cc44 (patch) | |
tree | 9a6f157ad1123e4f047689bbf3c4ef88ec1259a4 /sound/soc/codecs/wm8731.c | |
parent | 0db4d0705260dd4bddf1e5a5441c58bdf08bdc9f (diff) |
ASoC: Push the codec runtime storage into the card structure
This is a further stage on the road to refactoring away the ASoC
platform device.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8731.c')
-rw-r--r-- | sound/soc/codecs/wm8731.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 96d6e1aeaf43..0150fe53a65d 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -253,7 +253,7 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, | |||
253 | { | 253 | { |
254 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 254 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
255 | struct snd_soc_device *socdev = rtd->socdev; | 255 | struct snd_soc_device *socdev = rtd->socdev; |
256 | struct snd_soc_codec *codec = socdev->codec; | 256 | struct snd_soc_codec *codec = socdev->card->codec; |
257 | struct wm8731_priv *wm8731 = codec->private_data; | 257 | struct wm8731_priv *wm8731 = codec->private_data; |
258 | u16 iface = wm8731_read_reg_cache(codec, WM8731_IFACE) & 0xfff3; | 258 | u16 iface = wm8731_read_reg_cache(codec, WM8731_IFACE) & 0xfff3; |
259 | int i = get_coeff(wm8731->sysclk, params_rate(params)); | 259 | int i = get_coeff(wm8731->sysclk, params_rate(params)); |
@@ -283,7 +283,7 @@ static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, | |||
283 | { | 283 | { |
284 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 284 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
285 | struct snd_soc_device *socdev = rtd->socdev; | 285 | struct snd_soc_device *socdev = rtd->socdev; |
286 | struct snd_soc_codec *codec = socdev->codec; | 286 | struct snd_soc_codec *codec = socdev->card->codec; |
287 | 287 | ||
288 | /* set active */ | 288 | /* set active */ |
289 | wm8731_write(codec, WM8731_ACTIVE, 0x0001); | 289 | wm8731_write(codec, WM8731_ACTIVE, 0x0001); |
@@ -296,7 +296,7 @@ static void wm8731_shutdown(struct snd_pcm_substream *substream, | |||
296 | { | 296 | { |
297 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 297 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
298 | struct snd_soc_device *socdev = rtd->socdev; | 298 | struct snd_soc_device *socdev = rtd->socdev; |
299 | struct snd_soc_codec *codec = socdev->codec; | 299 | struct snd_soc_codec *codec = socdev->card->codec; |
300 | 300 | ||
301 | /* deactivate */ | 301 | /* deactivate */ |
302 | if (!codec->active) { | 302 | if (!codec->active) { |
@@ -458,7 +458,7 @@ EXPORT_SYMBOL_GPL(wm8731_dai); | |||
458 | static int wm8731_suspend(struct platform_device *pdev, pm_message_t state) | 458 | static int wm8731_suspend(struct platform_device *pdev, pm_message_t state) |
459 | { | 459 | { |
460 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 460 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
461 | struct snd_soc_codec *codec = socdev->codec; | 461 | struct snd_soc_codec *codec = socdev->card->codec; |
462 | 462 | ||
463 | wm8731_write(codec, WM8731_ACTIVE, 0x0); | 463 | wm8731_write(codec, WM8731_ACTIVE, 0x0); |
464 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); | 464 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); |
@@ -468,7 +468,7 @@ static int wm8731_suspend(struct platform_device *pdev, pm_message_t state) | |||
468 | static int wm8731_resume(struct platform_device *pdev) | 468 | static int wm8731_resume(struct platform_device *pdev) |
469 | { | 469 | { |
470 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 470 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
471 | struct snd_soc_codec *codec = socdev->codec; | 471 | struct snd_soc_codec *codec = socdev->card->codec; |
472 | int i; | 472 | int i; |
473 | u8 data[2]; | 473 | u8 data[2]; |
474 | u16 *cache = codec->reg_cache; | 474 | u16 *cache = codec->reg_cache; |
@@ -490,7 +490,7 @@ static int wm8731_resume(struct platform_device *pdev) | |||
490 | */ | 490 | */ |
491 | static int wm8731_init(struct snd_soc_device *socdev) | 491 | static int wm8731_init(struct snd_soc_device *socdev) |
492 | { | 492 | { |
493 | struct snd_soc_codec *codec = socdev->codec; | 493 | struct snd_soc_codec *codec = socdev->card->codec; |
494 | int reg, ret = 0; | 494 | int reg, ret = 0; |
495 | 495 | ||
496 | codec->name = "WM8731"; | 496 | codec->name = "WM8731"; |
@@ -561,7 +561,7 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, | |||
561 | const struct i2c_device_id *id) | 561 | const struct i2c_device_id *id) |
562 | { | 562 | { |
563 | struct snd_soc_device *socdev = wm8731_socdev; | 563 | struct snd_soc_device *socdev = wm8731_socdev; |
564 | struct snd_soc_codec *codec = socdev->codec; | 564 | struct snd_soc_codec *codec = socdev->card->codec; |
565 | int ret; | 565 | int ret; |
566 | 566 | ||
567 | i2c_set_clientdata(i2c, codec); | 567 | i2c_set_clientdata(i2c, codec); |
@@ -642,7 +642,7 @@ err_driver: | |||
642 | static int __devinit wm8731_spi_probe(struct spi_device *spi) | 642 | static int __devinit wm8731_spi_probe(struct spi_device *spi) |
643 | { | 643 | { |
644 | struct snd_soc_device *socdev = wm8731_socdev; | 644 | struct snd_soc_device *socdev = wm8731_socdev; |
645 | struct snd_soc_codec *codec = socdev->codec; | 645 | struct snd_soc_codec *codec = socdev->card->codec; |
646 | int ret; | 646 | int ret; |
647 | 647 | ||
648 | codec->control_data = spi; | 648 | codec->control_data = spi; |
@@ -716,7 +716,7 @@ static int wm8731_probe(struct platform_device *pdev) | |||
716 | } | 716 | } |
717 | 717 | ||
718 | codec->private_data = wm8731; | 718 | codec->private_data = wm8731; |
719 | socdev->codec = codec; | 719 | socdev->card->codec = codec; |
720 | mutex_init(&codec->mutex); | 720 | mutex_init(&codec->mutex); |
721 | INIT_LIST_HEAD(&codec->dapm_widgets); | 721 | INIT_LIST_HEAD(&codec->dapm_widgets); |
722 | INIT_LIST_HEAD(&codec->dapm_paths); | 722 | INIT_LIST_HEAD(&codec->dapm_paths); |
@@ -750,7 +750,7 @@ static int wm8731_probe(struct platform_device *pdev) | |||
750 | static int wm8731_remove(struct platform_device *pdev) | 750 | static int wm8731_remove(struct platform_device *pdev) |
751 | { | 751 | { |
752 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 752 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
753 | struct snd_soc_codec *codec = socdev->codec; | 753 | struct snd_soc_codec *codec = socdev->card->codec; |
754 | 754 | ||
755 | if (codec->control_data) | 755 | if (codec->control_data) |
756 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); | 756 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); |