Commit 9c4f7286 authored by Michael Zoran's avatar Michael Zoran Committed by Greg Kroah-Hartman

staging: bcm2835-audio: Remove code for non device tree init

The bcm2835-audio driver has a legacy code path for initializing
devices without a device tree.  Delete this code path and remove
the non device tree devices.
Signed-off-by: default avatarMichael Zoran <mzoran@crowfest.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c07499d
......@@ -21,12 +21,6 @@
#include "bcm2835.h"
/* module parameters (see "Module Parameters") */
/* SNDRV_CARDS: maximum number of cards supported by this module */
static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1};
static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL};
static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1};
/* HACKY global pointers needed for successive probes to work : ssp
* But compared against the changes we will have to do in VC audio_ipc code
* to export 8 audio_ipc devices as a single IPC device and then monitor all
......@@ -162,103 +156,6 @@ static int snd_bcm2835_alsa_probe_dt(struct platform_device *pdev)
return err;
}
static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
{
static int dev;
struct bcm2835_chip *chip;
struct snd_card *card;
int err;
if (pdev->dev.of_node)
return snd_bcm2835_alsa_probe_dt(pdev);
if (dev >= MAX_SUBSTREAMS)
return -ENODEV;
if (!enable[dev]) {
dev++;
return -ENOENT;
}
if (dev > 0)
goto add_register_map;
err = snd_card_new(&pdev->dev, index[dev], id[dev], THIS_MODULE, 0, &g_card);
if (err < 0)
goto out;
snd_card_set_dev(g_card, &pdev->dev);
strcpy(g_card->driver, "bcm2835");
strcpy(g_card->shortname, "bcm2835 ALSA");
sprintf(g_card->longname, "%s", g_card->shortname);
err = snd_bcm2835_create(g_card, pdev, &chip);
if (err < 0) {
dev_err(&pdev->dev, "Failed to create bcm2835 chip\n");
goto out_bcm2835_create;
}
g_chip = chip;
err = snd_bcm2835_new_pcm(chip);
if (err < 0) {
dev_err(&pdev->dev, "Failed to create new BCM2835 pcm device\n");
goto out_bcm2835_new_pcm;
}
err = snd_bcm2835_new_spdif_pcm(chip);
if (err < 0) {
dev_err(&pdev->dev, "Failed to create new BCM2835 spdif pcm device\n");
goto out_bcm2835_new_spdif;
}
err = snd_bcm2835_new_ctl(chip);
if (err < 0) {
dev_err(&pdev->dev, "Failed to create new BCM2835 ctl\n");
goto out_bcm2835_new_ctl;
}
add_register_map:
card = g_card;
chip = g_chip;
BUG_ON(!(card && chip));
chip->avail_substreams |= (1 << dev);
chip->pdev[dev] = pdev;
if (!dev) {
err = snd_card_register(card);
if (err < 0) {
dev_err(&pdev->dev,
"Failed to register bcm2835 ALSA card \n");
goto out_card_register;
}
platform_set_drvdata(pdev, card);
audio_info("bcm2835 ALSA card created!\n");
} else {
audio_info("bcm2835 ALSA chip created!\n");
platform_set_drvdata(pdev, (void*)(long)dev);
}
dev++;
return 0;
out_card_register:
out_bcm2835_new_ctl :
out_bcm2835_new_spdif :
out_bcm2835_new_pcm :
out_bcm2835_create :
BUG_ON(!g_card);
if (snd_card_free(g_card))
dev_err(&pdev->dev, "Failed to free Registered alsa card\n");
g_card = NULL;
out:
dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */
dev_err(&pdev->dev, "BCM2835 ALSA Probe failed !!\n");
return err;
}
static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
{
int idx;
......@@ -316,7 +213,7 @@ static const struct of_device_id snd_bcm2835_of_match_table[] = {
MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
static struct platform_driver bcm2835_alsa0_driver = {
.probe = snd_bcm2835_alsa_probe,
.probe = snd_bcm2835_alsa_probe_dt,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
......@@ -330,185 +227,21 @@ static struct platform_driver bcm2835_alsa0_driver = {
},
};
static struct platform_driver bcm2835_alsa1_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD1",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa2_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD2",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa3_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD3",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa4_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD4",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa5_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD5",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa6_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD6",
.owner = THIS_MODULE,
},
};
static struct platform_driver bcm2835_alsa7_driver = {
.probe = snd_bcm2835_alsa_probe,
.remove = snd_bcm2835_alsa_remove,
#ifdef CONFIG_PM
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
.driver =
{
.name = "bcm2835_AUD7",
.owner = THIS_MODULE,
},
};
static int bcm2835_alsa_device_init(void)
{
int err;
err = platform_driver_register(&bcm2835_alsa0_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto out;
}
err = platform_driver_register(&bcm2835_alsa1_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_0;
}
err = platform_driver_register(&bcm2835_alsa2_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_1;
}
err = platform_driver_register(&bcm2835_alsa3_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_2;
}
err = platform_driver_register(&bcm2835_alsa4_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_3;
}
err = platform_driver_register(&bcm2835_alsa5_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_4;
}
err = platform_driver_register(&bcm2835_alsa6_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_5;
}
err = platform_driver_register(&bcm2835_alsa7_driver);
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
goto unregister_6;
return err;
}
return 0;
unregister_6:
platform_driver_unregister(&bcm2835_alsa6_driver);
unregister_5:
platform_driver_unregister(&bcm2835_alsa5_driver);
unregister_4:
platform_driver_unregister(&bcm2835_alsa4_driver);
unregister_3:
platform_driver_unregister(&bcm2835_alsa3_driver);
unregister_2:
platform_driver_unregister(&bcm2835_alsa2_driver);
unregister_1:
platform_driver_unregister(&bcm2835_alsa1_driver);
unregister_0:
platform_driver_unregister(&bcm2835_alsa0_driver);
out:
return err;
}
static void bcm2835_alsa_device_exit(void)
{
platform_driver_unregister(&bcm2835_alsa0_driver);
platform_driver_unregister(&bcm2835_alsa1_driver);
platform_driver_unregister(&bcm2835_alsa2_driver);
platform_driver_unregister(&bcm2835_alsa3_driver);
platform_driver_unregister(&bcm2835_alsa4_driver);
platform_driver_unregister(&bcm2835_alsa5_driver);
platform_driver_unregister(&bcm2835_alsa6_driver);
platform_driver_unregister(&bcm2835_alsa7_driver);
}
late_initcall(bcm2835_alsa_device_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment