[PATCH 13/14] ASoC: amd: RN machine driver using dmic

Mukunda, Vijendar Vijendar.Mukunda at amd.com
Wed May 6 18:01:14 CEST 2020



> -----Original Message-----
> From: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> Sent: Wednesday, May 6, 2020 3:08 AM
> To: Alex Deucher <alexdeucher at gmail.com>; alsa-devel at alsa-project.org;
> broonie at kernel.org; Mukunda, Vijendar <Vijendar.Mukunda at amd.com>;
> tiwai at suse.de
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
> Subject: Re: [PATCH 13/14] ASoC: amd: RN machine driver using dmic
> 
> 
> 
> > +static int acp_probe(struct platform_device *pdev)
> > +{
> > +	int ret;
> > +	struct acp_pdm *machine = NULL;
> > +	struct snd_soc_card *card;
> > +
> > +	card = &acp_card;
> > +	acp_card.dev = &pdev->dev;
> > +
> > +	platform_set_drvdata(pdev, card);
> > +	snd_soc_card_set_drvdata(card, machine);
> > +	ret = devm_snd_soc_register_card(&pdev->dev, card);
> > +	if (ret) {
> > +		dev_err(&pdev->dev,
> > +			"snd_soc_register_card(%s) failed: %d\n",
> > +			acp_card.name, ret);
> > +		return ret;
> > +	}
> > +	if (ret) {
> > +		dev_err(&pdev->dev,
> > +			"snd_soc_register_card(%s) failed: %d\n",
> > +			acp_card.name, ret);
> > +		return ret;
> > +	}
> 
> copy-paste mistake here, the same block appears twice?

Will fix it and share updated patch.

-Vijendar
> 
> > +	return 0;
> > +}
> > +
> > +static struct platform_driver acp_mach_driver = {
> > +	.driver = {
> > +		.name = "acp_pdm_mach",
> > +		.pm = &snd_soc_pm_ops,
> > +	},
> > +	.probe = acp_probe,
> > +};
> > +
> > +static int __init acp_audio_init(void)
> > +{
> > +	platform_driver_register(&acp_mach_driver);
> > +	return 0;
> > +}
> > +
> > +static void __exit acp_audio_exit(void)
> > +{
> > +	platform_driver_unregister(&acp_mach_driver);
> > +}
> > +
> > +module_init(acp_audio_init);
> > +module_exit(acp_audio_exit);
> 
> module_platform_driver(acp_mach_driver) does all this __init and __exit
> for you.
> 
> > +
> > +MODULE_AUTHOR("Vijendar.Mukunda at amd.com");
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_ALIAS("platform:" DRV_NAME);
> >


More information about the Alsa-devel mailing list