--- zzzz-none-000/linux-3.10.107/sound/soc/samsung/bells.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/soc/samsung/bells.c 2021-02-04 17:41:59.000000000 +0000 @@ -350,8 +350,17 @@ }, }; +static struct snd_soc_dapm_widget bells_widgets[] = { + SND_SOC_DAPM_MIC("DMIC", NULL), +}; + static struct snd_soc_dapm_route bells_routes[] = { { "Sub CLK_SYS", NULL, "OPCLK" }, + { "CLKIN", NULL, "OPCLK" }, + + { "DMIC", NULL, "MICBIAS2" }, + { "IN2L", NULL, "DMIC" }, + { "IN2R", NULL, "DMIC" }, }; static struct snd_soc_card bells_cards[] = { @@ -365,6 +374,8 @@ .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), @@ -383,6 +394,8 @@ .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), @@ -401,6 +414,8 @@ .late_probe = bells_late_probe, + .dapm_widgets = bells_widgets, + .num_dapm_widgets = ARRAY_SIZE(bells_widgets), .dapm_routes = bells_routes, .num_dapm_routes = ARRAY_SIZE(bells_routes), @@ -418,32 +433,21 @@ bells_cards[pdev->id].dev = &pdev->dev; - ret = snd_soc_register_card(&bells_cards[pdev->id]); - if (ret) { + ret = devm_snd_soc_register_card(&pdev->dev, &bells_cards[pdev->id]); + if (ret) dev_err(&pdev->dev, "snd_soc_register_card(%s) failed: %d\n", bells_cards[pdev->id].name, ret); - return ret; - } - - return 0; -} - -static int bells_remove(struct platform_device *pdev) -{ - snd_soc_unregister_card(&bells_cards[pdev->id]); - return 0; + return ret; } static struct platform_driver bells_driver = { .driver = { .name = "bells", - .owner = THIS_MODULE, .pm = &snd_soc_pm_ops, }, .probe = bells_probe, - .remove = bells_remove, }; module_platform_driver(bells_driver);