Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230405
b: refs/heads/master
c: 96dc227
h: refs/heads/master
i:
  230403: dffc21d
v: v3
  • Loading branch information
Jorge Eduardo Candelaria authored and Liam Girdwood committed Dec 14, 2010
1 parent 4896bc1 commit 90837ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2d2362edf9f068bdee7d0411e0603b322f8415d
refs/heads/master: 96dc227c9086bc84ca23af70741b2a76e3dd08eb
32 changes: 32 additions & 0 deletions trunk/sound/soc/omap/sdp4430.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/jack.h>

#include <asm/mach-types.h>
#include <plat/hardware.h>
Expand Down Expand Up @@ -65,6 +66,21 @@ static struct snd_soc_ops sdp4430_ops = {
.hw_params = sdp4430_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 Mic",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headset Stereophone",
.mask = SND_JACK_HEADPHONE,
},
};

static int sdp4430_get_power_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
Expand Down Expand Up @@ -160,6 +176,22 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");

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

/* Headset jack detection */
ret = snd_soc_jack_new(codec, "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 (machine_is_omap_4430sdp())
twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
else
snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET);

return ret;
}
Expand Down

0 comments on commit 90837ce

Please sign in to comment.