diff options
Diffstat (limited to 'sound/soc/msm/msm8974.c')
| -rw-r--r-- | sound/soc/msm/msm8974.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/sound/soc/msm/msm8974.c b/sound/soc/msm/msm8974.c index 2279d4fc817..75bcda270ce 100644 --- a/sound/soc/msm/msm8974.c +++ b/sound/soc/msm/msm8974.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -20,6 +20,7 @@ #include <linux/qpnp/clkdiv.h> #include <linux/regulator/consumer.h> #include <linux/io.h> +#include <soc/qcom/subsystem_notif.h> #include <sound/core.h> #include <sound/soc.h> #include <sound/soc-dapm.h> @@ -27,7 +28,6 @@ #include <sound/jack.h> #include <sound/q6afe-v2.h> #include <sound/pcm_params.h> -#include <mach/subsystem_notif.h> #include "qdsp6v2/msm-pcm-routing-v2.h" #include "qdsp6v2/q6core.h" #include "../codecs/wcd9xxx-common.h" @@ -128,10 +128,12 @@ static struct wcd9xxx_mbhc_config mbhc_cfg = { .swap_gnd_mic = NULL, .cs_enable_flags = (1 << MBHC_CS_ENABLE_POLLING | 1 << MBHC_CS_ENABLE_INSERTION | - 1 << MBHC_CS_ENABLE_REMOVAL), + 1 << MBHC_CS_ENABLE_REMOVAL | + 1 << MBHC_CS_ENABLE_DET_ANC), .do_recalibration = true, .use_vddio_meas = true, .enable_anc_mic_detect = false, + .hw_jack_type = SIX_POLE_JACK, }; struct msm_auxpcm_gpio { @@ -2711,6 +2713,7 @@ static int msm8974_asoc_machine_probe(struct platform_device *pdev) int ret; const char *auxpcm_pri_gpio_set = NULL; const char *prop_name_ult_lo_gpio = "qcom,ext-ult-lo-amp-gpio"; + const char *mbhc_audio_jack_type = NULL; struct resource *pri_muxsel; struct resource *sec_muxsel; @@ -2770,6 +2773,34 @@ static int msm8974_asoc_machine_probe(struct platform_device *pdev) if (ret) goto err; + ret = of_property_read_string(pdev->dev.of_node, + "qcom,mbhc-audio-jack-type", &mbhc_audio_jack_type); + if (ret) { + dev_dbg(&pdev->dev, "Looking up %s property in node %s failed", + "qcom,mbhc-audio-jack-type", + pdev->dev.of_node->full_name); + mbhc_cfg.hw_jack_type = FOUR_POLE_JACK; + mbhc_cfg.enable_anc_mic_detect = false; + dev_dbg(&pdev->dev, "Jack type properties set to default"); + } else { + if (!strcmp(mbhc_audio_jack_type, "4-pole-jack")) { + mbhc_cfg.hw_jack_type = FOUR_POLE_JACK; + mbhc_cfg.enable_anc_mic_detect = false; + dev_dbg(&pdev->dev, "This hardware has 4 pole jack"); + } else if (!strcmp(mbhc_audio_jack_type, "5-pole-jack")) { + mbhc_cfg.hw_jack_type = FIVE_POLE_JACK; + mbhc_cfg.enable_anc_mic_detect = true; + dev_dbg(&pdev->dev, "This hardware has 5 pole jack"); + } else if (!strcmp(mbhc_audio_jack_type, "6-pole-jack")) { + mbhc_cfg.hw_jack_type = SIX_POLE_JACK; + mbhc_cfg.enable_anc_mic_detect = true; + dev_dbg(&pdev->dev, "This hardware has 6 pole jack"); + } else { + mbhc_cfg.hw_jack_type = FOUR_POLE_JACK; + mbhc_cfg.enable_anc_mic_detect = false; + dev_dbg(&pdev->dev, "Unknown value, hence setting to default"); + } + } if (of_property_read_bool(pdev->dev.of_node, "qcom,hdmi-audio-rx")) { dev_info(&pdev->dev, "%s(): hdmi audio support present\n", __func__); |
