コード例 #1
0
static int __devexit hi3620_digital_platform_remove(struct platform_device *pdev)
{
    snd_soc_unregister_platform(&pdev->dev);
    snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(hi3620_digital_dai));
    hi3620_digital_platform_close_clocks();
    return 0;
}
コード例 #2
0
static int __devinit archos_omap4_soc_probe(struct platform_device *pdev)
{
    int ret, no_twl6040;

    pr_info("%s: Archos Device SoC init\n", __func__);

    no_twl6040 = 0;

    if (!no_twl6040) {
        /* Master clock has to be enable to feed the TWL6040 */
        pt_audio_device_io = archos_audio_twl6040_get_io();
    }

    archos_omap4_snd_device = platform_device_alloc("soc-audio", -1);
    if (!archos_omap4_snd_device) {
        printk(KERN_ERR "Platform device allocation failed\n");
        return -ENOMEM;
    }

    ret = snd_soc_register_dais(&archos_omap4_snd_device->dev, dai, ARRAY_SIZE(dai));
    if (ret < 0)
        goto err;

    if (no_twl6040)
        platform_set_drvdata(archos_omap4_snd_device, &snd_soc_archos_omap4_no_twl6040);
    else
        platform_set_drvdata(archos_omap4_snd_device, &snd_soc_archos_omap4);

    ret = platform_device_add(archos_omap4_snd_device);
    if (ret)
        goto err_dev;

    /* regulators */
    dmic_1v8 = regulator_get(&archos_omap4_snd_device->dev, "DMIC_1V8");
    if (IS_ERR(dmic_1v8))
        dev_dbg(&archos_omap4_snd_device->dev, "no DMIC_1V8\n");

    if (!no_twl6040) {
        twl6040_codec = snd_soc_card_get_codec(&snd_soc_archos_omap4,
                                               "twl6040-codec");
        if(twl6040_codec <= 0) {
            printk(KERN_ERR "archos_omap4: could not find `twl6040-codec`\n");
            ret = -ENODEV;
            goto err_dev;
        }
    }

    return ret;

err_dev:
    snd_soc_unregister_dais(&archos_omap4_snd_device->dev, ARRAY_SIZE(dai));
err:
    platform_device_put(archos_omap4_snd_device);
    if (!IS_ERR(dmic_1v8)) {
        regulator_disable(dmic_1v8);
        regulator_put(dmic_1v8);
    }
    return ret;
}
コード例 #3
0
static void __exit sdp4430_soc_exit(void)
{
	regulator_put(av_switch_reg);
	platform_device_unregister(sdp4430_snd_device);
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
	i2c_unregister_device(tps6130x_client);
	i2c_put_adapter(adapter);
}
コード例 #4
0
static void __exit sdp4430_soc_exit(void)
{
	/*regulator_put(av_switch_reg);*/
	cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0);
	cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT);
	platform_device_unregister(sdp4430_snd_device);
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
}
コード例 #5
0
ファイル: sst_platform.c プロジェクト: 33d/linux-2.6.21-hh20
static int sst_platform_remove(struct platform_device *pdev)
{

	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sst_platform_dai));
	snd_soc_unregister_platform(&pdev->dev);
	pr_debug("sst_platform_remove success\n");
	return 0;
}
コード例 #6
0
static int __init sdp4430_soc_init(void)
{
	int ret;

	if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda() &&
		!machine_is_omap_tabletblaze()) {
		pr_debug("Not SDP4430, BlazeTablet or PandaBoard!\n");
		return -ENODEV;
	}
	printk(KERN_INFO "SDP4430 SoC init\n");
	if (machine_is_omap_4430sdp())
		snd_soc_sdp4430.name = "SDP4430";
	else if (machine_is_omap4_panda())
		snd_soc_sdp4430.name = "Panda";
	else if (machine_is_omap_tabletblaze())
		snd_soc_sdp4430.name = "Tablet44xx";

	sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
	if (!sdp4430_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai));
	if (ret < 0)
		goto err;
	platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);

	ret = platform_device_add(sdp4430_snd_device);
	if (ret)
		goto err_dev;

	twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430,
					"twl6040-codec");
	if(twl6040_codec <= 0) {
		printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n");
		ret = -ENODEV;
		goto err_dev;
	}

	av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch");
	if (IS_ERR(av_switch_reg)) {
		ret = PTR_ERR(av_switch_reg);
		printk(KERN_ERR "couldn't get AV Switch regulator %d\n",
			ret);
		goto err_dev;
	}

	return ret;

err_dev:
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
err:
	platform_device_put(sdp4430_snd_device);
	return ret;
}
コード例 #7
0
static int __devexit archos_omap4_soc_remove(struct platform_device *pdev)
{
    platform_device_unregister(archos_omap4_snd_device);
    snd_soc_unregister_dais(&archos_omap4_snd_device->dev, ARRAY_SIZE(dai));
    if (!IS_ERR(dmic_1v8)) {
        regulator_disable(dmic_1v8);
        regulator_put(dmic_1v8);
    }
    return 0;
}
コード例 #8
0
/*
 * Initialization routine.
 */
static int __init acclaim_soc_init (void)
{
	int ret;
	struct device *dev;
	unsigned char board_ver = 3;
	void __iomem *phymux_base = NULL;
	u32 val;

	printk(KERN_INFO "Audio SoC init\n");
	acclaim_snd_device = platform_device_alloc("soc-audio", -1);
	if (!acclaim_snd_device) {
		printk(KERN_INFO "Platform device allocation failed\n");
		return -ENOMEM;
	}
#ifdef CONFIG_ABE_44100
#warning "Configuring the ABE at 44.1 Khz."
#endif
	if(board_ver == 3) {
		printk(KERN_INFO "Found Board EVT 2.1-ABE support Enabled\n");
		platform_set_drvdata(acclaim_snd_device, &snd_soc_card_acclaim_abe);
	} else {
		printk(KERN_INFO "Not found Board EVT 2.1 - ABE support ommitted.\n");
		platform_set_drvdata(acclaim_snd_device, &snd_soc_card_acclaim);
	}
	ret = platform_device_add(acclaim_snd_device);
	if (ret){
		printk(KERN_INFO "%s: platform device allocation failed\n", __func__);
		goto err_dev;
	}
	ret=snd_soc_register_dais(&acclaim_snd_device->dev, mach_dai, ARRAY_SIZE(mach_dai));
       if (ret < 0)
               goto err;
	dev = &acclaim_snd_device->dev;

	/*
	 * Enable the GPIO related code-base on the ACCLAIM Board for
	 * Headphone/MIC Detection
	 */
	phymux_base = ioremap (0x4a100000, 0x1000);
	val = __raw_readl(phymux_base + 0x90);
	val =  ((val & 0xFEFCFFFE) | 0x01030003);
	/*__raw_writel (0x01030003, phymux_base + 0x90); */
	__raw_writel (val, phymux_base + 0x90);
	iounmap(phymux_base);
	return 0;
err_dev:
       snd_soc_unregister_dais(&acclaim_snd_device->dev, ARRAY_SIZE(mach_dai));

err:
	platform_device_put(acclaim_snd_device);

	return ret;
}
コード例 #9
0
ファイル: ux500_msp_dai.c プロジェクト: hackeran/linux-netmap
static int __devexit ux500_msp_drv_remove(struct platform_device *pdev)
{
    struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev);

    snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));

    devm_regulator_put(drvdata->reg_vape);
    prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");

    clk_put(drvdata->clk);

    ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp);

    return 0;
}
コード例 #10
0
static int ssp_dai_remove(struct platform_device *pdev)
{
	struct workqueue_struct *ssp_dai_wq = platform_get_drvdata(pdev);

	pr_debug("SSP DAI: FCT %s enters\n",
			__func__);

	flush_workqueue(ssp_dai_wq);

	destroy_workqueue(ssp_dai_wq);

	platform_set_drvdata(pdev, NULL);

	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(intel_ssp_platform_dai));

	snd_soc_unregister_platform(&pdev->dev);

	pr_debug("SSP DAI: FCT %s leaves\n",
			__func__);

	return 0;
}
コード例 #11
0
static void __exit atmel_ssc_modexit(void)
{
	snd_soc_unregister_dais(atmel_ssc_dai, ARRAY_SIZE(atmel_ssc_dai));
}
コード例 #12
0
static void __exit snd_omap_mcbsp_exit(void)
{
	snd_soc_unregister_dais(omap_mcbsp_dai, ARRAY_SIZE(omap_mcbsp_dai));
}
コード例 #13
0
ファイル: s3c64xx-i2s.c プロジェクト: Adjustxx/Savaged-Zen
static __devexit int s3c64xx_iis_dev_remove(struct platform_device *pdev)
{
	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c64xx_i2s_dai));
	return 0;
}
コード例 #14
0
static void __exit msm_cpu_dai_exit(void)
{
	snd_soc_unregister_dais(msm_cpu_dai, ARRAY_SIZE(msm_cpu_dai));
}
コード例 #15
0
static void __exit aml_dai_modexit(void)
{
	snd_soc_unregister_dais(aml_dai, ARRAY_SIZE(aml_dai));
}
コード例 #16
0
static void __exit smdkc110_exit(void)
{
	snd_soc_unregister_dais(spdif_dai,ARRAY_SIZE(spdif_dai));  //Modified as per 2.6.29
	platform_device_unregister(smdkc110_snd_device);
}
コード例 #17
0
ファイル: tcc-i2s.c プロジェクト: AmesianX/telechips-linux
static int __devexit soc_tcc_i2s_remove(struct platform_device *pdev)
{
    alsa_dbg(" %s \n", __func__);
	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(tcc_i2s_dai));
	return 0;
}
コード例 #18
0
ファイル: pxa2xx-ac97.c プロジェクト: AdiPat/i9003_Kernel
static int __devexit pxa2xx_ac97_dev_remove(struct platform_device *pdev)
{
	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(pxa_ac97_dai));
	return 0;
}
コード例 #19
0
static void __exit sdp4430_soc_exit(void)
{
	regulator_put(av_switch_reg);
	platform_device_unregister(sdp4430_snd_device);
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
}
コード例 #20
0
ファイル: ipq-cpu-dai.c プロジェクト: darcyg/ap_project_v2
static __devexit int ipq_lpass_dai_remove(struct platform_device *pdev)
{
	snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ipq_cpu_dais));
	return 0;
}
コード例 #21
0
static int __init sdp4430_soc_init(void)
{
	u8 gpoctl;
	int ret;

//  Need Fix
//	if (!machine_is_p2() && !machine_is_lghdk() && !machine_is_iff() && !machine_is_u2) {
//		printk("Not Supported Sound Device\n");
//		return -ENODEV;
//	}
	printk(KERN_INFO "LG SoC init\n");
	if (machine_is_lghdk())
                snd_soc_sdp4430.name = "lghdk";
        else if(machine_is_p2())
                snd_soc_sdp4430.name = "p2";
        else if(machine_is_iff())
                snd_soc_sdp4430.name = "iff";
// Need Fix
	else
		snd_soc_sdp4430.name = "u2";

	sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
	if (!sdp4430_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai));
	if (ret < 0)
		goto err;
	platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);

	ret = platform_device_add(sdp4430_snd_device);
	if (ret)
		goto err_dev;

	twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430,
					"twl6040-codec");
	if(twl6040_codec <= 0) {
		printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n");
		ret = -ENODEV;
		goto err_dev;
	}

#if 0 //Ti patch
	av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch");
	if (IS_ERR(av_switch_reg)) {
		ret = PTR_ERR(av_switch_reg);
		printk(KERN_ERR "couldn't get AV Switch regulator %d\n",
			ret);
		goto err_dev;
	}

	/* Default mode is low-power, MCLK not required */
	twl6040_power_mode = 0;
	cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0);

	/*
	 * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to
	 * have full control of MCLK gating
	 */
	cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT);

	return ret;
#else //                                              

	/* Default mode is low-power, MCLK not required */
	twl6040_power_mode = 0;	//  Set Default mode is High-Performace power

	//                                                                                        
	//cdc_tcxo_set_req_int(CDC_TCXO_CLK3, 0);
	cdc_tcxo_set_req_int(CDC_TCXO_CLK3, 1);
	//                                                                                      

	/*
	 * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to
	 * have full control of MCLK gating
	 */
	cdc_tcxo_set_req_prio(CDC_TCXO_CLK3, CDC_TCXO_PRIO_REQINT);

	return 0;
#endif

err_dev:
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
err:
	platform_device_put(sdp4430_snd_device);
	return ret;
}
コード例 #22
0
static int __devexit psc_i2s_of_remove(struct platform_device *op)
{
	snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai));
	return 0;
}
コード例 #23
0
static int __init sdp4430_soc_init(void)
{
	int ret;

	if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda() &&
		!machine_is_omap_tabletblaze()) {
		pr_debug("Not SDP4430, BlazeTablet or PandaBoard!\n");
		return -ENODEV;
	}
	printk(KERN_INFO "SDP4430 SoC init\n");
	if (machine_is_omap_4430sdp())
		snd_soc_sdp4430.name = "SDP4430";
	else if (machine_is_omap4_panda())
		snd_soc_sdp4430.name = "Panda";
	else if (machine_is_omap_tabletblaze())
		snd_soc_sdp4430.name = "Tablet44xx";

	sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
	if (!sdp4430_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai));
	if (ret < 0)
		goto err;
	platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);

	ret = platform_device_add(sdp4430_snd_device);
	if (ret)
		goto err_dev;

	twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430,
					"twl6040-codec");
	if(twl6040_codec <= 0) {
		printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n");
		ret = -ENODEV;
		goto err_dev;
	}

	/*av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch");
	if (IS_ERR(av_switch_reg)) {
		ret = PTR_ERR(av_switch_reg);
		printk(KERN_ERR "couldn't get AV Switch regulator %d\n",
			ret);
		goto err_dev;
	}*/

	/* Default mode is low-power, MCLK not required */
	twl6040_power_mode = 0;
	cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0);

	/*
	 * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to
	 * have full control of MCLK gating
	 */
	cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT);

	return ret;

err_dev:
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
err:
	platform_device_put(sdp4430_snd_device);
	return ret;
}
コード例 #24
0
static void __exit pxa3xx_ssp_exit(void)
{
	snd_soc_unregister_dais(ARRAY_AND_SIZE(pxa3xx_ssp_dai));
}
コード例 #25
0
static int __init sdp4430_soc_init(void)
{
	struct i2c_adapter *adapter;
	u8 gpoctl;
	int ret;

	if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda() &&
		!machine_is_omap_tabletblaze()) {
		pr_debug("Not SDP4430, BlazeTablet or PandaBoard!\n");
		return -ENODEV;
	}
	printk(KERN_INFO "SDP4430 SoC init\n");
	if (machine_is_omap_4430sdp())
		snd_soc_sdp4430.name = "SDP4430";
	else if (machine_is_omap4_panda())
		snd_soc_sdp4430.name = "Panda";
	else if (machine_is_omap_tabletblaze())
		snd_soc_sdp4430.name = "Tablet44xx";

	sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
	if (!sdp4430_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai));
	if (ret < 0)
		goto err;
	platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);

	ret = platform_device_add(sdp4430_snd_device);
	if (ret)
		goto err_dev;

	twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430,
					"twl6040-codec");
	if(twl6040_codec <= 0) {
		printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n");
		ret = -ENODEV;
		goto err_dev;
	}

	av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch");
	if (IS_ERR(av_switch_reg)) {
		ret = PTR_ERR(av_switch_reg);
		printk(KERN_ERR "couldn't get AV Switch regulator %d\n",
			ret);
		goto err_dev;
	}

	/* enable tps6130x */
	ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &gpoctl,
		TWL6040_REG_GPOCTL);
	if (ret) {
		printk(KERN_ERR "i2c read error\n");
		goto i2c_err;
	}

	ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, gpoctl | TWL6040_GPO2,
		TWL6040_REG_GPOCTL);
	if (ret) {
		printk(KERN_ERR "i2c write error\n");
		goto i2c_err;
	}

	adapter = i2c_get_adapter(TPS6130X_I2C_ADAPTER);
	if (!adapter) {
		printk(KERN_ERR "can't get i2c adapter\n");
		ret = -ENODEV;
		goto adp_err;
	}

	tps6130x_client = i2c_new_device(adapter, &tps6130x_hwmon_info);
	if (!tps6130x_client) {
		printk(KERN_ERR "can't add i2c device\n");
		ret = -ENODEV;
		goto tps_err;
	}


	/* Only configure the TPS6130x on SDP4430 */
	if (machine_is_omap_4430sdp() || machine_is_omap_tabletblaze())
		sdp4430_tps6130x_configure();
	i2c_put_adapter(adapter);

	return ret;

tps_err:
	i2c_put_adapter(adapter);
adp_err:
	twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, gpoctl, TWL6040_REG_GPOCTL);
i2c_err:
	regulator_put(av_switch_reg);
err_dev:
	snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai));
err:
	platform_device_put(sdp4430_snd_device);
	return ret;
}