diff options
author | Inha Song <ideal.song@samsung.com> | 2015-02-26 19:32:43 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:42:44 +0900 |
commit | 5ebdf0ee49d1f7cc4755032fdb9e3ef1673268b7 (patch) | |
tree | b0754883b067a38b6239c766f8e93e47423708c1 /sound | |
parent | 0943ccf86491beea5667b050ab869846a1ed9d4b (diff) |
LOCAL / ASoC: samsung: Enable mclk2 for jack detect
This patch enable mclk2 for jack detect in TM2 board.
The internal 32kHz clock must be present and enabed when
using the jack insertion or accessory detection.
Signed-off-by: Inha Song <ideal.song@samsung.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/samsung/tm2_wm5110.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index 13177b6e5443..f6fcee25b2fe 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -25,6 +25,7 @@ struct tm2_machine_priv { struct snd_soc_codec *codec; struct clk *codec_mclk1; + struct clk *codec_mclk2; int mic_bias; }; @@ -189,6 +190,9 @@ static int tm2_late_probe(struct snd_soc_card *card) return ret; } + /* 32khz must be enabled for jack detect */ + if (!IS_ERR(priv->codec_mclk2)) + clk_prepare_enable(priv->codec_mclk2); gpio_direction_output(priv->mic_bias, 0); return 0; @@ -279,6 +283,11 @@ static int tm2_wm5110_probe(struct platform_device *pdev) return PTR_ERR(priv->codec_mclk1); } + /* mclk2 is optional */ + priv->codec_mclk2 = devm_clk_get(&pdev->dev, "mclk2"); + if (IS_ERR(priv->codec_mclk2)) + dev_err(&pdev->dev, "Failed to get mclk2 clock\n"); + priv->mic_bias = of_get_named_gpio(np, "mic_bias_gpio", 0); if (!gpio_is_valid(priv->mic_bias)) { dev_err(&pdev->dev, "Failed to get mic_bias_gpio\n"); |