Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 919149c5 authored by Josh Kirsch's avatar Josh Kirsch Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: mdmcalifornium: Add fix for machine driver probe failure



Add a dummy device to ensure that a platform driver gets
registered once ADSP is up. This make sure that the deffered
codec driver gets probed. This is occurring due to a race
condition where all the devices are registered before ADSP is up.

CRs-fixed: 1032883
Change-Id: I72184f18142daf9584318e2e64d661b08742e036
Signed-off-by: default avatarJosh Kirsch <jkirsch@codeaurora.org>
parent 3b47bff2
Loading
Loading
Loading
Loading
+29 −2
Original line number Diff line number Diff line
@@ -2316,11 +2316,36 @@ static struct platform_driver mdm_asoc_machine_driver = {
	.remove = mdm_asoc_machine_remove,
};

static int dummy_machine_probe(struct platform_device *pdev)
{
	return 0;
}

static int dummy_machine_remove(struct platform_device *pdev)
{
	return 0;
}

static struct platform_device dummy_machine_device = {
		.name = "dummymachinedriver",
};

static struct platform_driver mdm_asoc_machine_dummy_driver = {
	.driver = {
		.name = "dummymachinedriver",
		.owner = THIS_MODULE,
	},
	.probe = dummy_machine_probe,
	.remove = dummy_machine_remove,
};

static int  mdm_adsp_state_callback(struct notifier_block *nb,
					unsigned long value, void *priv)
{
	if (SUBSYS_AFTER_POWERUP == value)
		platform_driver_register(&mdm_asoc_machine_driver);
	if (SUBSYS_AFTER_POWERUP == value) {
		platform_driver_register(&mdm_asoc_machine_dummy_driver);
		platform_device_register(&dummy_machine_device);
	}

		return NOTIFY_OK;
}
@@ -2339,6 +2364,8 @@ static int __init mdm_soc_platform_init(void)

module_init(mdm_soc_platform_init);

module_platform_driver(mdm_asoc_machine_driver);

MODULE_DESCRIPTION("ALSA SoC msm");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" MDM9650_MACHINE_DRV_NAME);