Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206620
b: refs/heads/master
c: 01ea6ba
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Liam Girdwood committed Jul 21, 2010
1 parent d16d243 commit 3300329
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 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: 0fad4ed7b230f593539b2da9cadbb77cb3a3131a
refs/heads/master: 01ea6ba2bce64112623dbf8c45ce487062b65446
25 changes: 21 additions & 4 deletions trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ struct twl4030_priv {
u8 earpiece_enabled;
u8 predrivel_enabled, predriver_enabled;
u8 carkitl_enabled, carkitr_enabled;

/* Delay needed after enabling the digimic interface */
unsigned int digimic_delay;
};

/*
Expand Down Expand Up @@ -312,6 +315,8 @@ static void twl4030_init_chip(struct platform_device *pdev)
if (!setup)
return;

twl4030->digimic_delay = setup->digimic_delay;

/* Configuration for headset ramp delay from setup data */
if (setup->sysclk != twl4030->sysclk)
dev_warn(codec->dev,
Expand Down Expand Up @@ -855,6 +860,16 @@ static int headsetrpga_event(struct snd_soc_dapm_widget *w,
return 0;
}

static int digimic_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);

if (twl4030->digimic_delay)
mdelay(twl4030->digimic_delay);
return 0;
}

/*
* Some of the gain controls in TWL (mostly those which are associated with
* the outputs) are implemented in an interesting way:
Expand Down Expand Up @@ -1439,10 +1454,12 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
SND_SOC_DAPM_PGA("ADC Physical Right",
TWL4030_REG_AVADC_CTL, 1, 0, NULL, 0),

SND_SOC_DAPM_PGA("Digimic0 Enable",
TWL4030_REG_ADCMICSEL, 1, 0, NULL, 0),
SND_SOC_DAPM_PGA("Digimic1 Enable",
TWL4030_REG_ADCMICSEL, 3, 0, NULL, 0),
SND_SOC_DAPM_PGA_E("Digimic0 Enable",
TWL4030_REG_ADCMICSEL, 1, 0, NULL, 0,
digimic_event, SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_PGA_E("Digimic1 Enable",
TWL4030_REG_ADCMICSEL, 3, 0, NULL, 0,
digimic_event, SND_SOC_DAPM_POST_PMU),

SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0),
SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/soc/codecs/twl4030.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extern struct snd_soc_codec_device soc_codec_dev_twl4030;

struct twl4030_setup_data {
unsigned int ramp_delay_value;
unsigned int digimic_delay; /* in ms */
unsigned int sysclk;
unsigned int offset_cncl_path;
unsigned int check_defaults:1;
Expand Down

0 comments on commit 3300329

Please sign in to comment.