static int wm8350_codec_io_remove(struct snd_soc_codec *codec, struct snd_soc_machine *machine) { struct wm8350* wm8350 = codec->control_data; snd_assert(wm8350 != NULL, return -EINVAL); run_delayed_work(&codec->delayed_work); wm8350_dapm_event(codec, SNDRV_CTL_POWER_D3cold); return 0; }
/* power down chip */ static int es8328_remove(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->card->codec; if (codec->control_data) es8328_set_bias_level(codec, SND_SOC_BIAS_OFF); run_delayed_work(&codec->delayed_work); snd_soc_free_pcms(socdev); snd_soc_dapm_free(socdev); #if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) i2c_del_driver(&es8328_i2c_driver); #endif #ifndef CONFIG_HHTECH_MINIPMP kfree(codec->private_data); #endif//CONFIG_HHTECH_MINIPMP kfree(codec); return 0; }