aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ssm2602.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-23 17:55:23 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-27 05:30:54 -0500
commit6627a653bceb3a54e55e5cdc478ec5b8d5c9cc44 (patch)
tree9a6f157ad1123e4f047689bbf3c4ef88ec1259a4 /sound/soc/codecs/ssm2602.c
parent0db4d0705260dd4bddf1e5a5441c58bdf08bdc9f (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/ssm2602.c')
-rw-r--r--sound/soc/codecs/ssm2602.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index ec7fe3b7b0cb..58e225dadc7e 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -276,7 +276,7 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
276 u16 srate; 276 u16 srate;
277 struct snd_soc_pcm_runtime *rtd = substream->private_data; 277 struct snd_soc_pcm_runtime *rtd = substream->private_data;
278 struct snd_soc_device *socdev = rtd->socdev; 278 struct snd_soc_device *socdev = rtd->socdev;
279 struct snd_soc_codec *codec = socdev->codec; 279 struct snd_soc_codec *codec = socdev->card->codec;
280 struct ssm2602_priv *ssm2602 = codec->private_data; 280 struct ssm2602_priv *ssm2602 = codec->private_data;
281 struct i2c_client *i2c = codec->control_data; 281 struct i2c_client *i2c = codec->control_data;
282 u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3; 282 u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3;
@@ -321,7 +321,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
321{ 321{
322 struct snd_soc_pcm_runtime *rtd = substream->private_data; 322 struct snd_soc_pcm_runtime *rtd = substream->private_data;
323 struct snd_soc_device *socdev = rtd->socdev; 323 struct snd_soc_device *socdev = rtd->socdev;
324 struct snd_soc_codec *codec = socdev->codec; 324 struct snd_soc_codec *codec = socdev->card->codec;
325 struct ssm2602_priv *ssm2602 = codec->private_data; 325 struct ssm2602_priv *ssm2602 = codec->private_data;
326 struct i2c_client *i2c = codec->control_data; 326 struct i2c_client *i2c = codec->control_data;
327 struct snd_pcm_runtime *master_runtime; 327 struct snd_pcm_runtime *master_runtime;
@@ -358,7 +358,7 @@ static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream,
358{ 358{
359 struct snd_soc_pcm_runtime *rtd = substream->private_data; 359 struct snd_soc_pcm_runtime *rtd = substream->private_data;
360 struct snd_soc_device *socdev = rtd->socdev; 360 struct snd_soc_device *socdev = rtd->socdev;
361 struct snd_soc_codec *codec = socdev->codec; 361 struct snd_soc_codec *codec = socdev->card->codec;
362 /* set active */ 362 /* set active */
363 ssm2602_write(codec, SSM2602_ACTIVE, ACTIVE_ACTIVATE_CODEC); 363 ssm2602_write(codec, SSM2602_ACTIVE, ACTIVE_ACTIVATE_CODEC);
364 364
@@ -370,7 +370,7 @@ static void ssm2602_shutdown(struct snd_pcm_substream *substream,
370{ 370{
371 struct snd_soc_pcm_runtime *rtd = substream->private_data; 371 struct snd_soc_pcm_runtime *rtd = substream->private_data;
372 struct snd_soc_device *socdev = rtd->socdev; 372 struct snd_soc_device *socdev = rtd->socdev;
373 struct snd_soc_codec *codec = socdev->codec; 373 struct snd_soc_codec *codec = socdev->card->codec;
374 struct ssm2602_priv *ssm2602 = codec->private_data; 374 struct ssm2602_priv *ssm2602 = codec->private_data;
375 /* deactivate */ 375 /* deactivate */
376 if (!codec->active) 376 if (!codec->active)
@@ -535,7 +535,7 @@ EXPORT_SYMBOL_GPL(ssm2602_dai);
535static int ssm2602_suspend(struct platform_device *pdev, pm_message_t state) 535static int ssm2602_suspend(struct platform_device *pdev, pm_message_t state)
536{ 536{
537 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 537 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
538 struct snd_soc_codec *codec = socdev->codec; 538 struct snd_soc_codec *codec = socdev->card->codec;
539 539
540 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF); 540 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
541 return 0; 541 return 0;
@@ -544,7 +544,7 @@ static int ssm2602_suspend(struct platform_device *pdev, pm_message_t state)
544static int ssm2602_resume(struct platform_device *pdev) 544static int ssm2602_resume(struct platform_device *pdev)
545{ 545{
546 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 546 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
547 struct snd_soc_codec *codec = socdev->codec; 547 struct snd_soc_codec *codec = socdev->card->codec;
548 int i; 548 int i;
549 u8 data[2]; 549 u8 data[2];
550 u16 *cache = codec->reg_cache; 550 u16 *cache = codec->reg_cache;
@@ -566,7 +566,7 @@ static int ssm2602_resume(struct platform_device *pdev)
566 */ 566 */
567static int ssm2602_init(struct snd_soc_device *socdev) 567static int ssm2602_init(struct snd_soc_device *socdev)
568{ 568{
569 struct snd_soc_codec *codec = socdev->codec; 569 struct snd_soc_codec *codec = socdev->card->codec;
570 int reg, ret = 0; 570 int reg, ret = 0;
571 571
572 codec->name = "SSM2602"; 572 codec->name = "SSM2602";
@@ -639,7 +639,7 @@ static int ssm2602_i2c_probe(struct i2c_client *i2c,
639 const struct i2c_device_id *id) 639 const struct i2c_device_id *id)
640{ 640{
641 struct snd_soc_device *socdev = ssm2602_socdev; 641 struct snd_soc_device *socdev = ssm2602_socdev;
642 struct snd_soc_codec *codec = socdev->codec; 642 struct snd_soc_codec *codec = socdev->card->codec;
643 int ret; 643 int ret;
644 644
645 i2c_set_clientdata(i2c, codec); 645 i2c_set_clientdata(i2c, codec);
@@ -733,7 +733,7 @@ static int ssm2602_probe(struct platform_device *pdev)
733 } 733 }
734 734
735 codec->private_data = ssm2602; 735 codec->private_data = ssm2602;
736 socdev->codec = codec; 736 socdev->card->codec = codec;
737 mutex_init(&codec->mutex); 737 mutex_init(&codec->mutex);
738 INIT_LIST_HEAD(&codec->dapm_widgets); 738 INIT_LIST_HEAD(&codec->dapm_widgets);
739 INIT_LIST_HEAD(&codec->dapm_paths); 739 INIT_LIST_HEAD(&codec->dapm_paths);
@@ -754,7 +754,7 @@ static int ssm2602_probe(struct platform_device *pdev)
754static int ssm2602_remove(struct platform_device *pdev) 754static int ssm2602_remove(struct platform_device *pdev)
755{ 755{
756 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 756 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
757 struct snd_soc_codec *codec = socdev->codec; 757 struct snd_soc_codec *codec = socdev->card->codec;
758 758
759 if (codec->control_data) 759 if (codec->control_data)
760 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF); 760 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);