Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148295
b: refs/heads/master
c: 9da28c7
h: refs/heads/master
i:
  148293: fdbcd07
  148291: e62fcc6
  148287: 08a258e
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed May 22, 2009
1 parent 69f5c94 commit 8e7bffe
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 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: 5c82f56736e4c3a9eaf53c94366b056c8622d79e
refs/heads/master: 9da28c7b38170882b1c43d7d133ddce34e25f161
22 changes: 19 additions & 3 deletions trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,8 @@ static int twl4030_resume(struct platform_device *pdev)
static int twl4030_init(struct snd_soc_device *socdev)
{
struct snd_soc_codec *codec = socdev->card->codec;
struct twl4030_setup_data *setup = socdev->codec_data;
struct twl4030_priv *twl4030 = codec->private_data;
int ret = 0;

printk(KERN_INFO "TWL4030 Audio Codec init \n");
Expand All @@ -2014,6 +2016,23 @@ static int twl4030_init(struct snd_soc_device *socdev)
if (codec->reg_cache == NULL)
return -ENOMEM;

/* Configuration for headset ramp delay from setup data */
if (setup) {
unsigned char hs_pop;

if (setup->sysclk)
twl4030->sysclk = setup->sysclk;
else
twl4030->sysclk = 26000;

hs_pop = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
hs_pop &= ~TWL4030_RAMP_DELAY;
hs_pop |= (setup->ramp_delay_value << 2);
twl4030_write_reg_cache(codec, TWL4030_REG_HS_POPN_SET, hs_pop);
} else {
twl4030->sysclk = 26000;
}

/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0) {
Expand Down Expand Up @@ -2063,9 +2082,6 @@ static int twl4030_probe(struct platform_device *pdev)
kfree(codec);
return -ENOMEM;
}
/* Set default sysclk (used by the headsetl/rpga_event callback for
* pop-attenuation) */
twl4030->sysclk = 26000;

codec->private_data = twl4030;
socdev->card->codec = codec;
Expand Down
5 changes: 5 additions & 0 deletions trunk/sound/soc/codecs/twl4030.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,9 @@
extern struct snd_soc_dai twl4030_dai[2];
extern struct snd_soc_codec_device soc_codec_dev_twl4030;

struct twl4030_setup_data {
unsigned int ramp_delay_value;
unsigned int sysclk;
};

#endif /* End of __TWL4030_AUDIO_H__ */

0 comments on commit 8e7bffe

Please sign in to comment.