diff options
Diffstat (limited to 'sound/soc/codecs/wm8993.c')
-rw-r--r-- | sound/soc/codecs/wm8993.c | 49 |
1 files changed, 10 insertions, 39 deletions
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index d9987999e92c..5e32f2ed5fc2 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -422,7 +422,7 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, | |||
422 | return 0; | 422 | return 0; |
423 | } | 423 | } |
424 | 424 | ||
425 | static int wm8993_set_fll(struct snd_soc_dai *dai, int fll_id, | 425 | static int wm8993_set_fll(struct snd_soc_dai *dai, int fll_id, int source, |
426 | unsigned int Fref, unsigned int Fout) | 426 | unsigned int Fref, unsigned int Fout) |
427 | { | 427 | { |
428 | struct snd_soc_codec *codec = dai->codec; | 428 | struct snd_soc_codec *codec = dai->codec; |
@@ -1464,19 +1464,8 @@ static int wm8993_probe(struct platform_device *pdev) | |||
1464 | wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff, | 1464 | wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff, |
1465 | wm8993->pdata.lineout2_diff); | 1465 | wm8993->pdata.lineout2_diff); |
1466 | 1466 | ||
1467 | snd_soc_dapm_new_widgets(codec); | ||
1468 | |||
1469 | ret = snd_soc_init_card(socdev); | ||
1470 | if (ret < 0) { | ||
1471 | dev_err(codec->dev, "failed to register card\n"); | ||
1472 | goto card_err; | ||
1473 | } | ||
1474 | |||
1475 | return ret; | 1467 | return ret; |
1476 | 1468 | ||
1477 | card_err: | ||
1478 | snd_soc_free_pcms(socdev); | ||
1479 | snd_soc_dapm_free(socdev); | ||
1480 | err: | 1469 | err: |
1481 | return ret; | 1470 | return ret; |
1482 | } | 1471 | } |
@@ -1572,33 +1561,15 @@ static int wm8993_i2c_probe(struct i2c_client *i2c, | |||
1572 | /* Use automatic clock configuration */ | 1561 | /* Use automatic clock configuration */ |
1573 | snd_soc_update_bits(codec, WM8993_CLOCKING_4, WM8993_SR_MODE, 0); | 1562 | snd_soc_update_bits(codec, WM8993_CLOCKING_4, WM8993_SR_MODE, 0); |
1574 | 1563 | ||
1575 | if (!wm8993->pdata.lineout1_diff) | 1564 | wm_hubs_handle_analogue_pdata(codec, wm8993->pdata.lineout1_diff, |
1576 | snd_soc_update_bits(codec, WM8993_LINE_MIXER1, | 1565 | wm8993->pdata.lineout2_diff, |
1577 | WM8993_LINEOUT1_MODE, | 1566 | wm8993->pdata.lineout1fb, |
1578 | WM8993_LINEOUT1_MODE); | 1567 | wm8993->pdata.lineout2fb, |
1579 | if (!wm8993->pdata.lineout2_diff) | 1568 | wm8993->pdata.jd_scthr, |
1580 | snd_soc_update_bits(codec, WM8993_LINE_MIXER2, | 1569 | wm8993->pdata.jd_thr, |
1581 | WM8993_LINEOUT2_MODE, | 1570 | wm8993->pdata.micbias1_lvl, |
1582 | WM8993_LINEOUT2_MODE); | 1571 | wm8993->pdata.micbias2_lvl); |
1583 | 1572 | ||
1584 | if (wm8993->pdata.lineout1fb) | ||
1585 | snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, | ||
1586 | WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB); | ||
1587 | |||
1588 | if (wm8993->pdata.lineout2fb) | ||
1589 | snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, | ||
1590 | WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB); | ||
1591 | |||
1592 | /* Apply the microphone bias/detection configuration - the | ||
1593 | * platform data is directly applicable to the register. */ | ||
1594 | snd_soc_update_bits(codec, WM8993_MICBIAS, | ||
1595 | WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK | | ||
1596 | WM8993_MICB1_LVL | WM8993_MICB2_LVL, | ||
1597 | wm8993->pdata.jd_scthr << WM8993_JD_SCTHR_SHIFT | | ||
1598 | wm8993->pdata.jd_thr << WM8993_JD_THR_SHIFT | | ||
1599 | wm8993->pdata.micbias1_lvl | | ||
1600 | wm8993->pdata.micbias1_lvl << 1); | ||
1601 | |||
1602 | ret = wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1573 | ret = wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1603 | if (ret != 0) | 1574 | if (ret != 0) |
1604 | goto err; | 1575 | goto err; |