Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284085
b: refs/heads/master
c: e48b46b
h: refs/heads/master
i:
  284083: adabc89
v: v3
  • Loading branch information
Liam Girdwood committed Jan 11, 2012
1 parent 18ae2e5 commit 2aa1a22
Show file tree
Hide file tree
Showing 3 changed files with 25 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: f75a8ff67d161b5166a2c2360bb2ffaefd5eb853
refs/heads/master: e48b46ba169181dc88ea48e31dcb4afcf8778397
23 changes: 23 additions & 0 deletions trunk/sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>

Expand Down Expand Up @@ -1012,6 +1013,28 @@ static int twl6040_pll_put_enum(struct snd_kcontrol *kcontrol,
return 0;
}

int twl6040_get_dl1_gain(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;

if (snd_soc_dapm_get_pin_status(dapm, "EP"))
return -1; /* -1dB */

if (snd_soc_dapm_get_pin_status(dapm, "HSOR") ||
snd_soc_dapm_get_pin_status(dapm, "HSOL")) {

u8 val = snd_soc_read(codec, TWL6040_REG_HSLCTL);
if (val & TWL6040_HSDACMODE)
/* HSDACL in LP mode */
return -8; /* -8dB */
else
/* HSDACL in HP mode */
return -1; /* -1dB */
}
return 0; /* 0dB */
}
EXPORT_SYMBOL_GPL(twl6040_get_dl1_gain);

int twl6040_get_clk_id(struct snd_soc_codec *codec)
{
struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/soc/codecs/twl6040.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum twl6040_trim {
#define TWL6040_HSF_TRIM_LEFT(x) (x & 0x0f)
#define TWL6040_HSF_TRIM_RIGHT(x) ((x >> 4) & 0x0f)

int twl6040_get_dl1_gain(struct snd_soc_codec *codec);
void twl6040_hs_jack_detect(struct snd_soc_codec *codec,
struct snd_soc_jack *jack, int report);
int twl6040_get_clk_id(struct snd_soc_codec *codec);
Expand Down

0 comments on commit 2aa1a22

Please sign in to comment.