Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270581
b: refs/heads/master
c: 62e4f7d
h: refs/heads/master
i:
  270579: e1054fc
v: v3
  • Loading branch information
Mika Westerberg authored and Mark Brown committed Sep 16, 2011
1 parent e883b76 commit ade6705
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1dc698a54259cb454284456483b45f67c865cf8
refs/heads/master: 62e4f7d1386f3e9c126fc7febc719d504b3e344b
53 changes: 36 additions & 17 deletions trunk/sound/soc/ep93xx/snappercl15.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,37 +104,56 @@ static struct snd_soc_card snd_soc_snappercl15 = {
.num_links = 1,
};

static struct platform_device *snappercl15_snd_device;

static int __init snappercl15_init(void)
static int __devinit snappercl15_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &snd_soc_snappercl15;
int ret;

if (!machine_is_snapper_cl15())
return -ENODEV;

ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
EP93XX_SYSCON_I2SCLKDIV_ORIDE |
EP93XX_SYSCON_I2SCLKDIV_SPOL);
if (ret)
return ret;

snappercl15_snd_device = platform_device_alloc("soc-audio", -1);
if (!snappercl15_snd_device)
return -ENOMEM;

platform_set_drvdata(snappercl15_snd_device, &snd_soc_snappercl15);
ret = platform_device_add(snappercl15_snd_device);
if (ret)
platform_device_put(snappercl15_snd_device);
card->dev = &pdev->dev;

ret = snd_soc_register_card(card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
ep93xx_i2s_release();
}

return ret;
}

static void __exit snappercl15_exit(void)
static int __devexit snappercl15_remove(struct platform_device *pdev)
{
platform_device_unregister(snappercl15_snd_device);
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);
ep93xx_i2s_release();

return 0;
}

static struct platform_driver snappercl15_driver = {
.driver = {
.name = "snappercl15-audio",
.owner = THIS_MODULE,
},
.probe = snappercl15_probe,
.remove = __devexit_p(snappercl15_remove),
};

static int __init snappercl15_init(void)
{
return platform_driver_register(&snappercl15_driver);
}

static void __exit snappercl15_exit(void)
{
platform_driver_unregister(&snappercl15_driver);
}

module_init(snappercl15_init);
Expand All @@ -143,4 +162,4 @@ module_exit(snappercl15_exit);
MODULE_AUTHOR("Ryan Mallon");
MODULE_DESCRIPTION("ALSA SoC Snapper CL15");
MODULE_LICENSE("GPL");

MODULE_ALIAS("platform:snappercl15-audio");

0 comments on commit ade6705

Please sign in to comment.