diff options
-rw-r--r-- | include/sound/wm8962.h | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h index cc32aff53222..9722aac5a138 100644 --- a/include/sound/wm8962.h +++ b/include/sound/wm8962.h | |||
@@ -17,6 +17,12 @@ | |||
17 | struct wm8962_pdata { | 17 | struct wm8962_pdata { |
18 | u32 gpio_init[WM8962_MAX_GPIO]; | 18 | u32 gpio_init[WM8962_MAX_GPIO]; |
19 | 19 | ||
20 | /* Setup for microphone detection, raw value to be written to | ||
21 | * R48(0x30) - only microphone related bits will be updated. | ||
22 | * Detection may be enabled here for use with signals brought | ||
23 | * out on the GPIOs. */ | ||
24 | u32 mic_cfg; | ||
25 | |||
20 | bool irq_active_low; | 26 | bool irq_active_low; |
21 | 27 | ||
22 | bool spk_mono; /* Speaker outputs tied together as mono */ | 28 | bool spk_mono; /* Speaker outputs tied together as mono */ |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 4fa5de873c8b..be34146a775b 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -630,6 +630,8 @@ SND_SOC_DAPM_INPUT("IN4L"), | |||
630 | SND_SOC_DAPM_INPUT("IN4R"), | 630 | SND_SOC_DAPM_INPUT("IN4R"), |
631 | SND_SOC_DAPM_INPUT("Beep"), | 631 | SND_SOC_DAPM_INPUT("Beep"), |
632 | 632 | ||
633 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8962_PWR_MGMT_1, 1, 0), | ||
634 | |||
633 | SND_SOC_DAPM_SUPPLY("Class G", WM8962_CHARGE_PUMP_B, 0, 1, NULL, 0), | 635 | SND_SOC_DAPM_SUPPLY("Class G", WM8962_CHARGE_PUMP_B, 0, 1, NULL, 0), |
634 | SND_SOC_DAPM_SUPPLY("SYSCLK", WM8962_CLOCKING2, 5, 0, sysclk_event, | 636 | SND_SOC_DAPM_SUPPLY("SYSCLK", WM8962_CLOCKING2, 5, 0, sysclk_event, |
635 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | 637 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
@@ -1755,6 +1757,16 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
1755 | if (pdata->spk_mono) | 1757 | if (pdata->spk_mono) |
1756 | wm8962->reg_cache[WM8962_CLASS_D_CONTROL_2] | 1758 | wm8962->reg_cache[WM8962_CLASS_D_CONTROL_2] |
1757 | |= WM8962_SPK_MONO; | 1759 | |= WM8962_SPK_MONO; |
1760 | |||
1761 | /* Micbias setup, detection enable and detection | ||
1762 | * threasholds. */ | ||
1763 | if (pdata->mic_cfg) | ||
1764 | snd_soc_update_bits(codec, WM8962_ADDITIONAL_CONTROL_4, | ||
1765 | WM8962_MICDET_ENA | | ||
1766 | WM8962_MICDET_THR_MASK | | ||
1767 | WM8962_MICSHORT_THR_MASK | | ||
1768 | WM8962_MICBIAS_LVL, | ||
1769 | pdata->mic_cfg); | ||
1758 | } | 1770 | } |
1759 | 1771 | ||
1760 | /* Latch volume update bits */ | 1772 | /* Latch volume update bits */ |