static int aml_m6_audio_remove(struct platform_device *pdev) { int ret = 0; // struct device_node *np = pdev->dev.of_node; // struct device_node *npc; struct snd_soc_card *card; struct aml_audio_private_data *p_aml_audio; card = platform_get_drvdata(pdev); p_aml_audio = snd_soc_card_get_drvdata(card); #if HP_IRQ snd_soc_jack_free_gpios(&p_aml_audio->jack, 1,// &aml_audio_hp_jack_gpio);// #endif snd_soc_unregister_card(card); #if HP_DET /* stop timer */ mutex_lock(&p_aml_audio->lock); if (p_aml_audio->timer_en) { aml_audio_stop_timer(p_aml_audio); } mutex_unlock(&p_aml_audio->lock); #endif aml_m6_pinmux_deinit(card); kfree(p_aml_audio); return ret; }
static int aml_m8_audio_remove(struct platform_device *pdev) { int ret = 0; struct snd_soc_card *card = platform_get_drvdata(pdev); struct aml_audio_private_data *p_aml_audio; p_aml_audio = snd_soc_card_get_drvdata(card); snd_soc_unregister_card(card); #if HP_DET /* stop timer */ mutex_lock(&p_aml_audio->lock); if (p_aml_audio->timer_en) { aml_audio_stop_timer(p_aml_audio); } mutex_unlock(&p_aml_audio->lock); #endif aml_m8_pinmux_deinit(card); kfree(p_aml_audio); return ret; }