diff mbox

[2/3] ASoC: rt5677: Add the MICBIAS VDD setting in the platform data

Message ID 1420684267-19211-2-git-send-email-oder_chiou@realtek.com (mailing list archive)
State Accepted
Commit 277880a356c10adcb43604f6ab9ec9b2d64db8b2
Headers show

Commit Message

Oder Chiou Jan. 8, 2015, 2:31 a.m. UTC
The patch adds the MICBIAS VDD setting in the platform data. It can be set to
1V8 or 3V3 in the MICBIAS VDD.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
 include/sound/rt5677.h    | 3 +++
 sound/soc/codecs/rt5677.c | 5 +++++
 2 files changed, 8 insertions(+)

Comments

Mark Brown Jan. 8, 2015, 6:36 p.m. UTC | #1
On Thu, Jan 08, 2015 at 10:31:06AM +0800, Oder Chiou wrote:
> The patch adds the MICBIAS VDD setting in the platform data. It can be set to
> 1V8 or 3V3 in the MICBIAS VDD.

Applied, thanks.
diff mbox

Patch

diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h
index d9eb7d8..a620704 100644
--- a/include/sound/rt5677.h
+++ b/include/sound/rt5677.h
@@ -37,6 +37,9 @@  struct rt5677_platform_data {
 		OFF, GPIO4, GPIO5 and GPIO6 respectively */
 	unsigned int jd2_gpio;
 	unsigned int jd3_gpio;
+
+	/* Set MICBIAS1 VDD 1v8 or 3v3 */
+	bool micbias1_vdd_3v3;
 };
 
 #endif
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index d27630a..32c368c 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4923,6 +4923,11 @@  static int rt5677_i2c_probe(struct i2c_client *i2c,
 					RT5677_GPIO5_DIR_OUT);
 	}
 
+	if (rt5677->pdata.micbias1_vdd_3v3)
+		regmap_update_bits(rt5677->regmap, RT5677_MICBIAS,
+			RT5677_MICBIAS1_CTRL_VDD_MASK,
+			RT5677_MICBIAS1_CTRL_VDD_3_3V);
+
 	rt5677_init_gpio(i2c);
 	rt5677_init_irq(i2c);