Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132923
b: refs/heads/master
c: 77dd7e1
h: refs/heads/master
i:
  132921: 0a1cf14
  132919: 3c738ea
v: v3
  • Loading branch information
Lopez Cruz, Misael authored and Mark Brown committed Mar 13, 2009
1 parent 270f420 commit 83eb0bf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 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: eb5f6d753e337834c7ceb07824ee472e43d9a7a2
refs/heads/master: 77dd7e17b86bd81b3638e01d784a72652071508b
74 changes: 39 additions & 35 deletions trunk/sound/soc/omap/sdp3430.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "omap-pcm.h"
#include "../codecs/twl4030.h"

static struct snd_soc_card snd_soc_sdp3430;

static int sdp3430_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
Expand Down Expand Up @@ -82,6 +84,27 @@ static struct snd_soc_ops sdp3430_ops = {
.hw_params = sdp3430_hw_params,
};

/* Headset jack */
static struct snd_soc_jack hs_jack;

/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin hs_jack_pins[] = {
{
.pin = "Headset Jack",
.mask = SND_JACK_HEADSET,
},
};

/* Headset jack detection gpios */
static struct snd_soc_jack_gpio hs_jack_gpios[] = {
{
.gpio = (OMAP_MAX_GPIO_LINES + 2),
.name = "hsdet-gpio",
.report = SND_JACK_HEADSET,
.debounce_time = 200,
},
};

/* SDP3430 machine DAPM */
static const struct snd_soc_dapm_widget sdp3430_twl4030_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Ext Mic", NULL),
Expand Down Expand Up @@ -141,30 +164,25 @@ static int sdp3430_twl4030_init(struct snd_soc_codec *codec)
snd_soc_dapm_nc_pin(codec, "CARKITR");

ret = snd_soc_dapm_sync(codec);
if (ret)
return ret;

return ret;
}
/* Headset jack detection */
ret = snd_soc_jack_new(&snd_soc_sdp3430, "Headset Jack",
SND_JACK_HEADSET, &hs_jack);
if (ret)
return ret;

/* Headset jack */
static struct snd_soc_jack hs_jack;
ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
hs_jack_pins);
if (ret)
return ret;

/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin hs_jack_pins[] = {
{
.pin = "Headset Jack",
.mask = SND_JACK_HEADSET,
},
};
ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
hs_jack_gpios);

/* Headset jack detection gpios */
static struct snd_soc_jack_gpio hs_jack_gpios[] = {
{
.gpio = (OMAP_MAX_GPIO_LINES + 2),
.name = "hsdet-gpio",
.report = SND_JACK_HEADSET,
.debounce_time = 200,
},
};
return ret;
}

/* Digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link sdp3430_dai = {
Expand Down Expand Up @@ -216,21 +234,7 @@ static int __init sdp3430_soc_init(void)
if (ret)
goto err1;

/* Headset jack detection */
ret = snd_soc_jack_new(&snd_soc_sdp3430, "SDP3430 headset jack",
SND_JACK_HEADSET, &hs_jack);
if (ret)
return ret;

ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
hs_jack_pins);
if (ret)
return ret;

ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
hs_jack_gpios);

return ret;
return 0;

err1:
printk(KERN_ERR "Unable to add platform device\n");
Expand Down

0 comments on commit 83eb0bf

Please sign in to comment.