Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284039
b: refs/heads/master
c: 2445ecc
h: refs/heads/master
i:
  284037: 9c605cc
  284035: 1e8e5d8
  284031: cc028c4
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Dec 30, 2011
1 parent 4151eed commit b688c40
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 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: 1b39bf3468e03016ffdcadef3dac1fd75d2db6fa
refs/heads/master: 2445ecc3c036ae5f1cc0c3dfed4731d9519a3811
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ static struct scoop_pcmcia_config poodle_pcmcia_config = {
EXPORT_SYMBOL(poodle_scoop_device);


static struct platform_device poodle_audio_device = {
.name = "poodle-audio",
.id = -1,
};

/* LoCoMo device */
static struct resource locomo_resources[] = {
[0] = {
Expand Down Expand Up @@ -407,6 +412,7 @@ static struct platform_device sharpsl_rom_device = {
static struct platform_device *devices[] __initdata = {
&poodle_locomo_device,
&poodle_scoop_device,
&poodle_audio_device,
&sharpsl_nand_device,
&sharpsl_rom_device,
};
Expand Down
42 changes: 23 additions & 19 deletions trunk/sound/soc/pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,18 @@ static struct snd_soc_dai_link poodle_dai = {
};

/* poodle audio machine driver */
static struct snd_soc_card snd_soc_poodle = {
static struct snd_soc_card poodle = {
.name = "Poodle",
.dai_link = &poodle_dai,
.num_links = 1,
.owner = THIS_MODULE,
};

static struct platform_device *poodle_snd_device;

static int __init poodle_init(void)
static int __devinit poodle_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &poodle;
int ret;

if (!machine_is_poodle())
return -ENODEV;

locomo_gpio_set_dir(&poodle_locomo_device.dev,
POODLE_LOCOMO_GPIO_AMP_ON, 0);
/* should we mute HP at startup - burning power ?*/
Expand All @@ -305,28 +301,36 @@ static int __init poodle_init(void)
locomo_gpio_set_dir(&poodle_locomo_device.dev,
POODLE_LOCOMO_GPIO_MUTE_R, 0);

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

platform_set_drvdata(poodle_snd_device, &snd_soc_poodle);
ret = platform_device_add(poodle_snd_device);
card->dev = &pdev->dev;

ret = snd_soc_register_card(card);
if (ret)
platform_device_put(poodle_snd_device);

dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
return ret;
}

static void __exit poodle_exit(void)
static int __devexit poodle_remove(struct platform_device *pdev)
{
platform_device_unregister(poodle_snd_device);
struct snd_soc_card *card = platform_get_drvdata(pdev);

snd_soc_unregister_card(card);
return 0;
}

module_init(poodle_init);
module_exit(poodle_exit);
static struct platform_driver poodle_driver = {
.driver = {
.name = "poodle-audio",
.owner = THIS_MODULE,
},
.probe = poodle_probe,
.remove = __devexit_p(poodle_remove),
};

module_platform_driver(poodle_driver);

/* Module information */
MODULE_AUTHOR("Richard Purdie");
MODULE_DESCRIPTION("ALSA SoC Poodle");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:poodle-audio");

0 comments on commit b688c40

Please sign in to comment.