Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332141
b: refs/heads/master
c: b5d5a03
h: refs/heads/master
i:
  332139: 14a9372
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Sep 22, 2012
1 parent af54f7a commit fcd8820
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 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: bade699c67d40b785e00738b0593c7ed1dad78fc
refs/heads/master: b5d5a034dec62c456a48d6977d926236ec605015
34 changes: 16 additions & 18 deletions trunk/drivers/mfd/twl4030-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,30 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev)
return -EINVAL;
}

audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio),
GFP_KERNEL);
if (!audio)
return -ENOMEM;

mutex_init(&audio->mutex);
audio->audio_mclk = pdata->audio_mclk;

/* Configure APLL_INFREQ and disable APLL if enabled */
val = 0;
switch (pdata->audio_mclk) {
switch (audio->audio_mclk) {
case 19200000:
val |= TWL4030_APLL_INFREQ_19200KHZ;
val = TWL4030_APLL_INFREQ_19200KHZ;
break;
case 26000000:
val |= TWL4030_APLL_INFREQ_26000KHZ;
val = TWL4030_APLL_INFREQ_26000KHZ;
break;
case 38400000:
val |= TWL4030_APLL_INFREQ_38400KHZ;
val = TWL4030_APLL_INFREQ_38400KHZ;
break;
default:
dev_err(&pdev->dev, "Invalid audio_mclk\n");
return -EINVAL;
}
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
val, TWL4030_REG_APLL_CTL);

audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio),
GFP_KERNEL);
if (!audio)
return -ENOMEM;

platform_set_drvdata(pdev, audio);

twl4030_audio_dev = pdev;
mutex_init(&audio->mutex);
audio->audio_mclk = pdata->audio_mclk;
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, val, TWL4030_REG_APLL_CTL);

/* Codec power */
audio->resource[TWL4030_AUDIO_RES_POWER].reg = TWL4030_REG_CODEC_MODE;
Expand All @@ -222,6 +217,9 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev)
childs++;
}

platform_set_drvdata(pdev, audio);
twl4030_audio_dev = pdev;

if (childs)
ret = mfd_add_devices(&pdev->dev, pdev->id, audio->cells,
childs, NULL, 0);
Expand Down

0 comments on commit fcd8820

Please sign in to comment.