예제 #1
0
static int smartq_wm8987_card_remove(struct snd_soc_card *card)
{
	snd_soc_jack_free_gpios(&smartq_jack, ARRAY_SIZE(smartq_jack_gpios),
				smartq_jack_gpios);

	return 0;
}
static int __devexit tegra_aic326x_driver_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_aic326x *machine = snd_soc_card_get_drvdata(card);
	struct tegra_asoc_platform_data *pdata = machine->pdata;

	if (machine->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&tegra_aic326x_hp_jack,
					1,
					&tegra_aic326x_hp_jack_gpio);

	snd_soc_unregister_card(card);

#ifdef CONFIG_SWITCH
	tegra_asoc_switch_unregister(&aic326x_wired_switch_dev);
#endif

	tegra_asoc_utils_fini(&machine->util_data);

	if (machine->gpio_requested & GPIO_EXT_MIC_EN)
		gpio_free(pdata->gpio_ext_mic_en);
	if (machine->gpio_requested & GPIO_INT_MIC_EN)
		gpio_free(pdata->gpio_int_mic_en);
	if (machine->gpio_requested & GPIO_HP_MUTE)
		gpio_free(pdata->gpio_hp_mute);
	if (machine->gpio_requested & GPIO_SPKR_EN)
		gpio_free(pdata->gpio_spkr_en);

	kfree(machine);

	return 0;
}
예제 #3
0
static void __exit ams_delta_module_exit(void)
{
	struct snd_soc_codec *codec;
	struct tty_struct *tty;

	if (ams_delta_audio_card.codec) {
		codec = ams_delta_audio_card.codec;

		if (codec->control_data) {
			tty = codec->control_data;

			tty_hangup(tty);
		}
	}

	if (tty_unregister_ldisc(N_V253) != 0)
		dev_warn(&ams_delta_audio_platform_device->dev,
			"failed to unregister V253 line discipline\n");

	snd_soc_jack_free_gpios(&ams_delta_hook_switch,
			ARRAY_SIZE(ams_delta_hook_switch_gpios),
			ams_delta_hook_switch_gpios);

	/* Keep modem power on */
	ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY);

	platform_device_unregister(cx20442_platform_device);
	platform_device_unregister(ams_delta_audio_platform_device);
}
예제 #4
0
static int tegra_rt5677_card_remove(struct snd_soc_card *card)
{
	struct tegra_rt5677 *machine = snd_soc_card_get_drvdata(card);

	if (gpio_is_valid(machine->gpio_hp_det)) {
		snd_soc_jack_free_gpios(&tegra_rt5677_hp_jack, 1,
				&tegra_rt5677_hp_jack_gpio);
	}

	if (gpio_is_valid(machine->gpio_mic_present)) {
		snd_soc_jack_free_gpios(&tegra_rt5677_mic_jack, 1,
				&tegra_rt5677_mic_jack_gpio);
	}

	return 0;
}
예제 #5
0
파일: rx51.c 프로젝트: DenisLug/mptcp
static int rx51_card_remove(struct snd_soc_card *card)
{
	snd_soc_jack_free_gpios(&rx51_av_jack, ARRAY_SIZE(rx51_av_jack_gpios),
				rx51_av_jack_gpios);

	return 0;
}
static int __devexit tegra_wm8903_driver_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
	struct tegra_wm8903_platform_data *pdata = &machine->pdata;

	if (machine->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack,
					1,
					&tegra_wm8903_hp_jack_gpio);
	if (machine->gpio_requested & GPIO_EXT_MIC_EN)
		gpio_free(pdata->gpio_ext_mic_en);
	if (machine->gpio_requested & GPIO_INT_MIC_EN)
		gpio_free(pdata->gpio_int_mic_en);
	if (machine->gpio_requested & GPIO_HP_MUTE)
		gpio_free(pdata->gpio_hp_mute);
	if (machine->gpio_requested & GPIO_SPKR_EN)
		gpio_free(pdata->gpio_spkr_en);
	machine->gpio_requested = 0;

	snd_soc_unregister_card(card);

	tegra_asoc_utils_fini(&machine->util_data);
	if (!IS_ERR(machine->pcm_dev))
		platform_device_unregister(machine->pcm_dev);

	return 0;
}
예제 #7
0
static int rx1950_uda1380_card_remove(struct snd_soc_card *card)
{
	snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
		hp_jack_gpios);

	return 0;
}
예제 #8
0
static void __exit smartq_exit(void)
{
	snd_soc_jack_free_gpios(&smartq_jack, ARRAY_SIZE(smartq_jack_gpios),
				smartq_jack_gpios);

	platform_device_unregister(smartq_snd_device);
}
예제 #9
0
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;
}
예제 #10
0
static void __exit sdp3430_soc_exit(void)
{
	snd_soc_jack_free_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
				hs_jack_gpios);

	platform_device_unregister(sdp3430_snd_device);
}
예제 #11
0
static int __devexit tegra_snd_tegra_alc5632_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_alc5632 *alc5632 = snd_soc_card_get_drvdata(card);

	if (alc5632->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&tegra_alc5632_hp_jack, 1,
			&tegra_alc5632_hp_jack_gpio);

	snd_soc_unregister_card(card);

	snd_soc_card_set_drvdata(card, NULL);
	platform_set_drvdata(pdev, NULL);
	card->dev = NULL;

	tegra_asoc_utils_fini(&alc5632->util_data);

/*	if (alc5632->gpio_requested & GPIO_EXT_MIC_EN)
		gpio_free(pdata->gpio_ext_mic_en);
	if (alc5632->gpio_requested & GPIO_INT_MIC_EN)
		gpio_free(pdata->gpio_int_mic_en);
	if (alc5632->gpio_requested & GPIO_SPKR_EN)
		gpio_free(pdata->gpio_spkr_en);
*/
	kfree(alc5632);

	return 0;
}
static void __exit rx1950_exit(void)
{
	platform_device_unregister(s3c24xx_snd_device);
	snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
		hp_jack_gpios);
	gpio_free(S3C2410_GPA(1));
}
예제 #13
0
static void __exit h1940_exit(void)
{
	platform_device_unregister(s3c24xx_snd_device);
	snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
		hp_jack_gpios);
	gpio_free(H1940_LATCH_AUDIO_POWER);
}
/* platform driver */
static int tegra_wired_jack_probe(struct platform_device *pdev)
{
	int ret;
	int hp_det_n;
	struct tegra_wired_jack_conf *pdata;

	pdata = (struct tegra_wired_jack_conf *)pdev->dev.platform_data;
	if (!pdata || !pdata->hp_det_n) {
		pr_err("Please set up gpio pins for jack.\n");
		return -EBUSY;
	}

	hp_det_n = pdata->hp_det_n;
	hs_jack_gpios[HEAD_DET_GPIO].gpio = hp_det_n;

	ret = snd_soc_jack_add_gpios(tegra_wired_jack,
				     ARRAY_SIZE(hs_jack_gpios),
				     hs_jack_gpios);
	if (ret) {
		pr_err("Could NOT set up gpio pins for jack.\n");
		snd_soc_jack_free_gpios(tegra_wired_jack,
					ARRAY_SIZE(hs_jack_gpios),
					hs_jack_gpios);
		return ret;
	}

	return 0;
}
예제 #15
0
static int __devexit tegra_alc5623_driver_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_alc5623 *machine = snd_soc_card_get_drvdata(card);
	struct tegra_alc5623_platform_data *pdata = machine->pdata;

	if (machine->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&machine->tegra_jack,
					1,
					&tegra_alc5623_hp_jack_gpio);
	if (machine->gpio_requested & GPIO_SPKR_EN)
		gpio_free(pdata->gpio_spkr_en);
        if (machine->gpio_requested & GPIO_INT_MIC_EN)
                gpio_free(pdata->gpio_int_mic_en);
	machine->gpio_requested = 0;

	if (machine->spk_reg)
		regulator_put(machine->spk_reg);
/*
	if (machine->dmic_reg)
		regulator_put(machine->dmic_reg);
*/
	snd_soc_unregister_card(card);

	tegra_asoc_utils_fini(&machine->util_data);

#ifdef CONFIG_SWITCH
	switch_dev_unregister(&tegra_alc5623_headset_switch);
#endif
	kfree(machine);

	return 0;
}
/*
 * omap4_soc_exit
 * This function is used to exit the machine Driver.
 */
static void __exit omap4_soc_exit(void)
{
	snd_soc_jack_free_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
				hs_jack_gpios);

	platform_device_unregister(omap4_snd_device);
	i2c_unregister_device(tlv320aic31xx_client);
}
static int tegra_wired_jack_remove(struct platform_device *pdev)
{
	snd_soc_jack_free_gpios(tegra_wired_jack,
				ARRAY_SIZE(hs_jack_gpios),
				hs_jack_gpios);

	return 0;
}
예제 #18
0
파일: ams-delta.c 프로젝트: 383530895/linux
static int ams_delta_card_remove(struct snd_soc_card *card)
{
	snd_soc_jack_free_gpios(&ams_delta_hook_switch,
			ARRAY_SIZE(ams_delta_hook_switch_gpios),
			ams_delta_hook_switch_gpios);

	return 0;
}
예제 #19
0
파일: rx51.c 프로젝트: 303750856/linux-3.1
static void __exit rx51_soc_exit(void)
{
	snd_soc_jack_free_gpios(&rx51_av_jack, ARRAY_SIZE(rx51_av_jack_gpios),
				rx51_av_jack_gpios);

	platform_device_unregister(rx51_snd_device);
	gpio_free(RX51_ECI_SW_GPIO);
	gpio_free(RX51_TVOUT_SEL_GPIO);
}
static void snd_ctp_unregister_jack(struct ctp_mc_private *ctx,
				struct platform_device *pdev)
{
	if (!ctx->ops->jack_support)
		return;
	cancel_delayed_work_sync(&ctx->jack_work_insert);
	cancel_delayed_work_sync(&ctx->jack_work_remove);
	free_jack_wake_lock(ctx);
	snd_soc_jack_free_gpios(&ctx->ctp_jack, 2, ctx->hs_gpio_ops);
}
예제 #21
0
static int __devexit hx4700_audio_remove(struct platform_device *pdev)
{
	snd_soc_jack_free_gpios(&hs_jack, 1, &hs_jack_gpio);
	snd_soc_unregister_card(&snd_soc_card_hx4700);

	gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
	gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);

	gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
	return 0;
}
예제 #22
0
static int tegra_alc5632_card_remove(struct snd_soc_card *card)
{
	struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(card);

	if (gpio_is_valid(machine->gpio_hp_det)) {
		snd_soc_jack_free_gpios(&tegra_alc5632_hs_jack, 1,
					&tegra_alc5632_hp_jack_gpio);
	}

	return 0;
}
예제 #23
0
static int omap_twl4030_card_remove(struct snd_soc_card *card)
{
    struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card);

    if (priv->jack_detect > 0)
        snd_soc_jack_free_gpios(&priv->hs_jack,
                                ARRAY_SIZE(hs_jack_gpios),
                                hs_jack_gpios);

    return 0;
}
예제 #24
0
static void __exit ams_delta_module_exit(void)
{
	if (tty_unregister_ldisc(N_V253) != 0)
		dev_warn(&ams_delta_audio_platform_device->dev,
			"failed to unregister V253 line discipline\n");

	snd_soc_jack_free_gpios(&ams_delta_hook_switch,
			ARRAY_SIZE(ams_delta_hook_switch_gpios),
			ams_delta_hook_switch_gpios);

	platform_device_unregister(cx20442_platform_device);
	platform_device_unregister(ams_delta_audio_platform_device);
}
예제 #25
0
static int omap_twl4030_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card);

	if (priv->jack_detect > 0)
		snd_soc_jack_free_gpios(&priv->hs_jack,
					ARRAY_SIZE(hs_jack_gpios),
					hs_jack_gpios);
	snd_soc_unregister_card(card);

	return 0;
}
예제 #26
0
static int tegra_wm8903_driver_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);

	snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack, 1,
				&tegra_wm8903_hp_jack_gpio);

	snd_soc_unregister_card(card);

	tegra_asoc_utils_fini(&machine->util_data);

	return 0;
}
예제 #27
0
static void __exit ams_delta_module_exit(void)
{
	if (tty_unregister_ldisc(N_V253) != 0)
		dev_warn(&ams_delta_audio_platform_device->dev,
			"failed to unregister V253 line discipline\n");

	snd_soc_jack_free_gpios(&ams_delta_hook_switch,
			ARRAY_SIZE(ams_delta_hook_switch_gpios),
			ams_delta_hook_switch_gpios);

	/* Keep modem power on */
	ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY);

	platform_device_unregister(cx20442_platform_device);
	platform_device_unregister(ams_delta_audio_platform_device);
}
예제 #28
0
static int __devexit tegra_wm8903_driver_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
	struct tegra_wm8903_platform_data *pdata = machine->pdata;

	device_remove_file(card->dev, &dev_attr_jack_status);
	device_remove_file(card->dev, &dev_attr_input_source);
	device_remove_file(card->dev, &dev_attr_voice_call);
	device_remove_file(card->dev, &dev_attr_audio_mode);

	if (machine->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack,
					1,
					&tegra_wm8903_hp_jack_gpio);
	if (machine->gpio_requested & GPIO_EXT_MIC_EN)
		gpio_free(pdata->gpio_ext_mic_en);
	if (machine->gpio_requested & GPIO_INT_MIC_EN)
		gpio_free(pdata->gpio_int_mic_en);
	if (machine->gpio_requested & GPIO_HP_MUTE)
		gpio_free(pdata->gpio_hp_mute);
	if (machine->gpio_requested & GPIO_SPKR_EN)
		gpio_free(pdata->gpio_spkr_en);
	gpio_free(pdata->gpio_ext_mic_det);
	machine->gpio_requested = 0;

	if (machine->spk_reg)
		regulator_put(machine->spk_reg);
	if (machine->dmic_reg)
		regulator_put(machine->dmic_reg);
	if (machine->amic_reg)
		regulator_put(machine->amic_reg);
    if (machine->codec_reg)
        regulator_put(machine->codec_reg);

	snd_soc_unregister_card(card);

	tegra_asoc_utils_fini(&machine->util_data);

#ifdef CONFIG_SWITCH
	switch_dev_unregister(&tegra_wm8903_headset_switch);
#endif
	nvtec_ac_notifier_unregister(&machine->ac_notifier);
	kfree(machine);

	return 0;
}
예제 #29
0
파일: tegra_wm8903.c 프로젝트: 020gzh/linux
static int tegra_wm8903_remove(struct snd_soc_card *card)
{
	struct snd_soc_pcm_runtime *rtd =
		snd_soc_get_pcm_runtime(card, card->dai_link[0].name);
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	struct snd_soc_codec *codec = codec_dai->codec;
	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);

	if (gpio_is_valid(machine->gpio_hp_det)) {
		snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack, 1,
					&tegra_wm8903_hp_jack_gpio);
	}

	wm8903_mic_detect(codec, NULL, 0, 0);

	return 0;
}
예제 #30
0
static int __devexit tegra_alc5632_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(card);

	if (machine->gpio_requested & GPIO_HP_DET)
		snd_soc_jack_free_gpios(&tegra_alc5632_hs_jack,
					1,
					&tegra_alc5632_hp_jack_gpio);
	machine->gpio_requested = 0;

	snd_soc_unregister_card(card);

	tegra_asoc_utils_fini(&machine->util_data);

	return 0;
}