From patchwork Tue May 26 23:58:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yang.a.fang@intel.com X-Patchwork-Id: 6486351 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9DDF69F1C1 for ; Tue, 26 May 2015 23:59:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1687E206DF for ; Tue, 26 May 2015 23:59:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D43A8206D9 for ; Tue, 26 May 2015 23:59:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 88B4326580E; Wed, 27 May 2015 01:59:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C579F26577A; Wed, 27 May 2015 01:59:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D5B7F26577A; Wed, 27 May 2015 01:59:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 5F4922652E6 for ; Wed, 27 May 2015 01:58:58 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 26 May 2015 16:58:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,502,1427785200"; d="scan'208";a="700654070" Received: from mocha.sc.intel.com ([143.183.245.87]) by orsmga001.jf.intel.com with ESMTP; 26 May 2015 16:58:52 -0700 From: yang.a.fang@intel.com To: broonie@kernel.org, lgirdwood@gmail.com Date: Tue, 26 May 2015 16:58:04 -0700 Message-Id: <1432684686-14460-1-git-send-email-yang.a.fang@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: alsa-devel@alsa-project.org, srinivas.sripathi@intel.com, "Fang, Yang A" , praveen.k.jain@intel.com, denny.iriawan@intel.com, sathyanarayana.nujella@intel.com, kevin.strasser@linux.intel.com, dgreid@chromium.org Subject: [alsa-devel] [PATCH 1/3] ASoC: max98090: read micbias from device property X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Fang, Yang A" This patch reads max98090 micbias from acpi or dt Signed-off-by: Fang, Yang A --- sound/soc/codecs/max98090.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index c230626..27df17e 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2419,6 +2419,8 @@ static int max98090_probe(struct snd_soc_codec *codec) struct max98090_cdata *cdata; enum max98090_type devtype; int ret = 0; + int err; + unsigned int micbias; dev_dbg(codec->dev, "max98090_probe\n"); @@ -2503,8 +2505,13 @@ static int max98090_probe(struct snd_soc_codec *codec) snd_soc_write(codec, M98090_REG_BIAS_CONTROL, M98090_VCM_MODE_MASK); + err = device_property_read_u32(codec->dev, "max,micbias", &micbias); + + if (err) + micbias = M98090_MBVSEL_2V8; + snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE, - M98090_MBVSEL_MASK, M98090_MBVSEL_2V8); + M98090_MBVSEL_MASK, micbias); max98090_add_widgets(codec);