diff options
author | Fang, Yang A <yang.a.fang@intel.com> | 2015-05-06 02:55:34 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-05-06 13:58:29 +0300 |
commit | 673c4f896a10a8df7d09525fe41f5663e0ca1bd4 (patch) | |
tree | 2c5411edc7825f81952d663678fc16693bf9f071 /sound/soc/intel/boards/cht_bsw_rt5645.c | |
parent | 292d2497cd8f551642a38f7a55b1b7965049c75d (diff) | |
download | linux-673c4f896a10a8df7d09525fe41f5663e0ca1bd4.tar.xz |
ASoC: Intel: Enabled button jack for BSW platform with rt5650 codec
rt5650 codec supports 4 buttons detections so enabled it
Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/cht_bsw_rt5645.c')
-rw-r--r-- | sound/soc/intel/boards/cht_bsw_rt5645.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 8f96c21fef4f..bdcaf467842a 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -41,8 +41,7 @@ struct cht_acpi_card { }; struct cht_mc_private { - struct snd_soc_jack hp_jack; - struct snd_soc_jack mic_jack; + struct snd_soc_jack jack; struct cht_acpi_card *acpi_card; }; @@ -179,6 +178,7 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream, static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) { int ret; + int jack_type; struct snd_soc_codec *codec = runtime->codec; struct snd_soc_dai *codec_dai = runtime->codec_dai; struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); @@ -198,23 +198,22 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) return ret; } - ret = snd_soc_card_jack_new(runtime->card, "Headphone Jack", - SND_JACK_HEADPHONE, &ctx->hp_jack, - NULL, 0); - if (ret) { - dev_err(runtime->dev, "HP jack creation failed %d\n", ret); - return ret; - } + if (ctx->acpi_card->codec_type == CODEC_TYPE_RT5650) + jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3; + else + jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE; - ret = snd_soc_card_jack_new(runtime->card, "Mic Jack", - SND_JACK_MICROPHONE, &ctx->mic_jack, + ret = snd_soc_card_jack_new(runtime->card, "Headset Jack", + jack_type, &ctx->jack, NULL, 0); if (ret) { - dev_err(runtime->dev, "Mic jack creation failed %d\n", ret); + dev_err(runtime->dev, "Headset jack creation failed %d\n", ret); return ret; } - rt5645_set_jack_detect(codec, &ctx->hp_jack, &ctx->mic_jack, NULL); + rt5645_set_jack_detect(codec, &ctx->jack, &ctx->jack, &ctx->jack); return ret; } |