diff options
Diffstat (limited to 'sound/soc/codecs/ak4535.c')
-rw-r--r-- | sound/soc/codecs/ak4535.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index 352d1d08dbd9..d4253675b2d3 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -302,7 +302,7 @@ static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
302 | int clk_id, unsigned int freq, int dir) | 302 | int clk_id, unsigned int freq, int dir) |
303 | { | 303 | { |
304 | struct snd_soc_codec *codec = codec_dai->codec; | 304 | struct snd_soc_codec *codec = codec_dai->codec; |
305 | struct ak4535_priv *ak4535 = codec->private_data; | 305 | struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec); |
306 | 306 | ||
307 | ak4535->sysclk = freq; | 307 | ak4535->sysclk = freq; |
308 | return 0; | 308 | return 0; |
@@ -315,7 +315,7 @@ static int ak4535_hw_params(struct snd_pcm_substream *substream, | |||
315 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 315 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
316 | struct snd_soc_device *socdev = rtd->socdev; | 316 | struct snd_soc_device *socdev = rtd->socdev; |
317 | struct snd_soc_codec *codec = socdev->card->codec; | 317 | struct snd_soc_codec *codec = socdev->card->codec; |
318 | struct ak4535_priv *ak4535 = codec->private_data; | 318 | struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec); |
319 | u8 mode2 = ak4535_read_reg_cache(codec, AK4535_MODE2) & ~(0x3 << 5); | 319 | u8 mode2 = ak4535_read_reg_cache(codec, AK4535_MODE2) & ~(0x3 << 5); |
320 | int rate = params_rate(params), fs = 256; | 320 | int rate = params_rate(params), fs = 256; |
321 | 321 | ||
@@ -446,7 +446,6 @@ static int ak4535_resume(struct platform_device *pdev) | |||
446 | struct snd_soc_codec *codec = socdev->card->codec; | 446 | struct snd_soc_codec *codec = socdev->card->codec; |
447 | ak4535_sync(codec); | 447 | ak4535_sync(codec); |
448 | ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 448 | ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
449 | ak4535_set_bias_level(codec, codec->suspend_bias_level); | ||
450 | return 0; | 449 | return 0; |
451 | } | 450 | } |
452 | 451 | ||
@@ -600,7 +599,7 @@ static int ak4535_probe(struct platform_device *pdev) | |||
600 | return -ENOMEM; | 599 | return -ENOMEM; |
601 | } | 600 | } |
602 | 601 | ||
603 | codec->private_data = ak4535; | 602 | snd_soc_codec_set_drvdata(codec, ak4535); |
604 | socdev->card->codec = codec; | 603 | socdev->card->codec = codec; |
605 | mutex_init(&codec->mutex); | 604 | mutex_init(&codec->mutex); |
606 | INIT_LIST_HEAD(&codec->dapm_widgets); | 605 | INIT_LIST_HEAD(&codec->dapm_widgets); |
@@ -617,7 +616,7 @@ static int ak4535_probe(struct platform_device *pdev) | |||
617 | #endif | 616 | #endif |
618 | 617 | ||
619 | if (ret != 0) { | 618 | if (ret != 0) { |
620 | kfree(codec->private_data); | 619 | kfree(snd_soc_codec_get_drvdata(codec)); |
621 | kfree(codec); | 620 | kfree(codec); |
622 | } | 621 | } |
623 | return ret; | 622 | return ret; |
@@ -639,7 +638,7 @@ static int ak4535_remove(struct platform_device *pdev) | |||
639 | i2c_unregister_device(codec->control_data); | 638 | i2c_unregister_device(codec->control_data); |
640 | i2c_del_driver(&ak4535_i2c_driver); | 639 | i2c_del_driver(&ak4535_i2c_driver); |
641 | #endif | 640 | #endif |
642 | kfree(codec->private_data); | 641 | kfree(snd_soc_codec_get_drvdata(codec)); |
643 | kfree(codec); | 642 | kfree(codec); |
644 | 643 | ||
645 | return 0; | 644 | return 0; |