Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120254
b: refs/heads/master
c: 5c0d7bb
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Baryshkov authored and Mark Brown committed Nov 25, 2008
1 parent 83fee13 commit fa4f7d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 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: 4451582f7e9fc2860b289aca60a6065286439bb8
refs/heads/master: 5c0d7bb797a975691ca8bbc38e53da03c6e151bb
30 changes: 22 additions & 8 deletions trunk/sound/soc/pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,32 @@ static struct snd_soc_dai_link tosa_dai[] = {
},
};

static int tosa_probe(struct platform_device *dev)
{
int ret;

ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
if (ret)
return ret;
ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
if (ret)
gpio_free(TOSA_GPIO_L_MUTE);

return ret;
}

static int tosa_remove(struct platform_device *dev)
{
gpio_free(TOSA_GPIO_L_MUTE);
return 0;
}

static struct snd_soc_card tosa = {
.name = "Tosa",
.dai_link = tosa_dai,
.num_links = ARRAY_SIZE(tosa_dai),
.probe = tosa_probe,
.remove = tosa_remove,
};

static struct snd_soc_device tosa_snd_devdata = {
Expand All @@ -251,11 +273,6 @@ static int __init tosa_init(void)
if (!machine_is_tosa())
return -ENODEV;

ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
if (ret)
return ret;
gpio_direction_output(TOSA_GPIO_L_MUTE, 0);

tosa_snd_device = platform_device_alloc("soc-audio", -1);
if (!tosa_snd_device) {
ret = -ENOMEM;
Expand All @@ -272,15 +289,12 @@ static int __init tosa_init(void)
platform_device_put(tosa_snd_device);

err_alloc:
gpio_free(TOSA_GPIO_L_MUTE);

return ret;
}

static void __exit tosa_exit(void)
{
platform_device_unregister(tosa_snd_device);
gpio_free(TOSA_GPIO_L_MUTE);
}

module_init(tosa_init);
Expand Down

0 comments on commit fa4f7d9

Please sign in to comment.