Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293311
b: refs/heads/master
c: 6d6761a
h: refs/heads/master
i:
  293309: e5cbfca
  293307: 973b8a9
  293303: d85275a
  293295: 76198d8
  293279: 5ac37ab
  293247: d140855
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Feb 7, 2012
1 parent cb3b38d commit 107d158
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 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: 49915a54f0dceeff15a5d008dc9ce7a1d25f2a98
refs/heads/master: 6d6761aa9b36e2da18669b9948ee6849064a84e9
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-kirkwood/openrd-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
},
};

static struct platform_device openrd_client_audio_device = {
.name = "openrd-client-audio",
.id = -1,
};

static int __initdata uart1;

static int __init sd_uart_selection(char *str)
Expand Down Expand Up @@ -172,6 +177,7 @@ static void __init openrd_init(void)
kirkwood_i2c_init();

if (machine_is_openrd_client() || machine_is_openrd_ultimate()) {
platform_device_register(&openrd_client_audio_device);
i2c_register_board_info(0, i2c_board_info,
ARRAY_SIZE(i2c_board_info));
kirkwood_audio_init();
Expand Down
46 changes: 23 additions & 23 deletions trunk/sound/soc/kirkwood/kirkwood-openrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,41 +71,41 @@ static struct snd_soc_card openrd_client = {
.num_links = ARRAY_SIZE(openrd_client_dai),
};

static struct platform_device *openrd_client_snd_device;

static int __init openrd_client_init(void)
static int __devinit openrd_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &openrd_client;
int ret;

if (!machine_is_openrd_client() && !machine_is_openrd_ultimate())
return 0;

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

platform_set_drvdata(openrd_client_snd_device,
&openrd_client);

ret = platform_device_add(openrd_client_snd_device);
if (ret) {
printk(KERN_ERR "%s: platform_device_add failed\n", __func__);
platform_device_put(openrd_client_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);
return ret;
}

static void __exit openrd_client_exit(void)
static int __devexit openrd_remove(struct platform_device *pdev)
{
platform_device_unregister(openrd_client_snd_device);
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);
return 0;
}

module_init(openrd_client_init);
module_exit(openrd_client_exit);
static struct platform_driver openrd_driver = {
.driver = {
.name = "openrd-client-audio",
.owner = THIS_MODULE,
},
.probe = openrd_probe,
.remove = __devexit_p(openrd_remove),
};

module_platform_driver(openrd_driver);

/* Module information */
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("ALSA SoC OpenRD Client");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:soc-audio");
MODULE_ALIAS("platform:openrd-client-audio");

0 comments on commit 107d158

Please sign in to comment.